diff --git a/DEPS b/DEPS index d96a7ab..56bd609a 100644 --- a/DEPS +++ b/DEPS
@@ -90,11 +90,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'a886544a7bf727a8f0d75597df99474dcba97273', + 'skia_revision': '5cb5c74efdac46a1f9af37ff9707bc9d2c900083', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': 'bdb814e9c797b7f9e6f1d7c706fe9dfe3ac9390c', + 'v8_revision': 'df1d991fdfece4c82b8c1635f69470f5a50903f7', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -114,7 +114,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': '575f238334d13ab7bc7920eee23c108ef3b0bbed', + 'pdfium_revision': '3241bb3e98c0b327bbd5b0dc02621e6105cf37a9', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling openmax_dl # and whatever else without interference from each other. @@ -122,7 +122,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. - 'boringssl_revision': '9f0e7cb314ae64234b928fd379381ae9760a9a5f', + 'boringssl_revision': 'cece32610b89549386b42b2032dd5d8a423af6c8', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling google-toolbox-for-mac # and whatever else without interference from each other. @@ -150,7 +150,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '82069c8b6ea20d2f3d073928872927550f779150', + 'catapult_revision': '6761f26bd9da8e703b355ce1c81f8e37b77a9467', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -166,7 +166,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'feed_revision': 'a8ecfb5b2201743e69e4e2961571308975212ce2', + 'feed_revision': '1160f3e7bcb05b8bda84edbb2c0f31395b230c3c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_build-tools_version # and whatever else without interference from each other. @@ -489,7 +489,7 @@ # Build tools for Chrome OS. Note: This depends on third_party/pyelftools. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'bec9b446c412520020e1f9f94f134a3c0abdeaf5', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '6b3c651c4ed28f73c4a730041c52995510f84e8d', 'condition': 'checkout_linux', }, @@ -959,7 +959,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '7c0541da63f571512c49758cbc0767117997a270', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '95141d91d8abf32df95d938d9e4e44e6a09cb003', # commit position 21742 + Var('webrtc_git') + '/src.git' + '@' + '169c7fd521da7530ea55f9c4d4d045ccfd952e18', # commit position 21742 'src/third_party/xdg-utils': { 'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d',
diff --git a/android_webview/browser/aw_web_contents_delegate.cc b/android_webview/browser/aw_web_contents_delegate.cc index 3ce5a0f..3431d263 100644 --- a/android_webview/browser/aw_web_contents_delegate.cc +++ b/android_webview/browser/aw_web_contents_delegate.cc
@@ -121,12 +121,13 @@ params.capture); } -void AwWebContentsDelegate::AddNewContents(WebContents* source, - WebContents* new_contents, - WindowOpenDisposition disposition, - const gfx::Rect& initial_rect, - bool user_gesture, - bool* was_blocked) { +void AwWebContentsDelegate::AddNewContents( + WebContents* source, + std::unique_ptr<WebContents> new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_rect, + bool user_gesture, + bool* was_blocked) { JNIEnv* env = AttachCurrentThread(); bool is_dialog = disposition == WindowOpenDisposition::NEW_POPUP; @@ -144,17 +145,22 @@ // it. The source AwContents takes ownership of the new WebContents // until then, and when the callback is made we will swap the WebContents // out into the new AwContents. + WebContents* raw_new_contents = new_contents.get(); AwContents::FromWebContents(source)->SetPendingWebContentsForPopup( - base::WrapUnique(new_contents)); + std::move(new_contents)); + // It's possible that SetPendingWebContentsForPopup deletes |new_contents|, + // but it only does so asynchronously, so it's safe to use a raw pointer + // here. // Hide the WebContents for the pop up now, we will show it again // when the user calls us back with an AwContents to use to show it. - new_contents->WasHidden(); + raw_new_contents->WasHidden(); } else { // The embedder has forgone their chance to display this popup // window, so we're done with the WebContents now. We use // DeleteSoon as WebContentsImpl may call methods on |new_contents| // after this method returns. - base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, new_contents); + base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, + std::move(new_contents)); } if (was_blocked) {
diff --git a/android_webview/browser/aw_web_contents_delegate.h b/android_webview/browser/aw_web_contents_delegate.h index 86be13e..b6b66384 100644 --- a/android_webview/browser/aw_web_contents_delegate.h +++ b/android_webview/browser/aw_web_contents_delegate.h
@@ -31,7 +31,7 @@ void RunFileChooser(content::RenderFrameHost* render_frame_host, const content::FileChooserParams& params) override; void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 281f6bb..0eaaeef 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -1177,7 +1177,6 @@ "//ash/strings", "//ash/wayland", "//mash/public/mojom", - "//mojo/common:values_struct_traits", "//mojo/public/cpp/system", "//services/ui/common:mus_common", "//services/ui/public/cpp", @@ -1785,6 +1784,7 @@ "//chromeos:power_manager_proto", "//chromeos:test_support", "//chromeos:test_support_without_gmock", + "//chromeos/services/multidevice_setup/public/mojom", "//components/password_manager/core/browser:hash_password_manager", "//components/prefs:test_support", "//components/quirks",
diff --git a/ash/DEPS b/ash/DEPS index 7aa9403..094cff31 100644 --- a/ash/DEPS +++ b/ash/DEPS
@@ -22,7 +22,6 @@ "+media", "+mash/public/mojom", "+mash/shelf/public", - "+mojo/common", "+mojo/public", "+services/catalog/public", "+services/preferences/public", @@ -57,6 +56,7 @@ "-chromeos", "+chromeos/accelerometer", "+chromeos/audio", + "+chromeos/chromeos_features.h", "+chromeos/chromeos_switches.h", "+chromeos/chromeos_paths.h", "+chromeos/components/proximity_auth/logging/logging.h",
diff --git a/ash/components/autoclick/BUILD.gn b/ash/components/autoclick/BUILD.gn index 491e99d..ef73514 100644 --- a/ash/components/autoclick/BUILD.gn +++ b/ash/components/autoclick/BUILD.gn
@@ -19,7 +19,6 @@ "//ash/public/cpp", "//base", "//mash/public/mojom", - "//mojo/common", "//mojo/public/cpp/bindings", "//services/service_manager/public/cpp", "//services/ui/public/cpp",
diff --git a/ash/components/touch_hud/BUILD.gn b/ash/components/touch_hud/BUILD.gn index a329ef2d..2a23ebd 100644 --- a/ash/components/touch_hud/BUILD.gn +++ b/ash/components/touch_hud/BUILD.gn
@@ -18,7 +18,6 @@ "//ash/touch_hud", "//base", "//mash/public/mojom", - "//mojo/common", "//mojo/public/cpp/bindings", "//services/service_manager/public/cpp", "//services/ui/public/cpp",
diff --git a/ash/login/login_screen_controller.cc b/ash/login/login_screen_controller.cc index ac2162ca..016c0d2 100644 --- a/ash/login/login_screen_controller.cc +++ b/ash/login/login_screen_controller.cc
@@ -221,6 +221,14 @@ login_screen_client_->LaunchPublicSession(account_id, locale, input_method); } +void LoginScreenController::RequestPublicSessionKeyboardLayouts( + const AccountId& account_id, + const std::string& locale) { + if (!login_screen_client_) + return; + login_screen_client_->RequestPublicSessionKeyboardLayouts(account_id, locale); +} + void LoginScreenController::AddObserver( LoginScreenControllerObserver* observer) { observers_.AddObserver(observer); @@ -361,6 +369,16 @@ } } +void LoginScreenController::SetPublicSessionKeyboardLayouts( + const AccountId& account_id, + const std::string& locale, + std::vector<mojom::InputMethodItemPtr> keyboard_layouts) { + if (DataDispatcher()) { + DataDispatcher()->SetPublicSessionKeyboardLayouts(account_id, locale, + keyboard_layouts); + } +} + void LoginScreenController::DoAuthenticateUser(const AccountId& account_id, const std::string& password, bool authenticated_by_pin,
diff --git a/ash/login/login_screen_controller.h b/ash/login/login_screen_controller.h index b428a0b..0f25625 100644 --- a/ash/login/login_screen_controller.h +++ b/ash/login/login_screen_controller.h
@@ -74,6 +74,8 @@ void LaunchPublicSession(const AccountId& account_id, const std::string& locale, const std::string& input_method); + void RequestPublicSessionKeyboardLayouts(const AccountId& account_id, + const std::string& locale); // Add or remove an observer. void AddObserver(LoginScreenControllerObserver* observer); @@ -117,6 +119,10 @@ base::Value locales, const std::string& default_locale, bool show_advanced_view) override; + void SetPublicSessionKeyboardLayouts( + const AccountId& account_id, + const std::string& locale, + std::vector<mojom::InputMethodItemPtr> keyboard_layouts) override; // Flushes the mojo pipes - to be used in tests. void FlushForTesting();
diff --git a/ash/login/mock_login_screen_client.h b/ash/login/mock_login_screen_client.h index bc500c3..5262be340 100644 --- a/ash/login/mock_login_screen_client.h +++ b/ash/login/mock_login_screen_client.h
@@ -65,6 +65,8 @@ void(const AccountId& account_id, const std::string& locale, const std::string& input_method)); + MOCK_METHOD2(RequestPublicSessionKeyboardLayouts, + void(const AccountId& account_id, const std::string& locale)); private: bool authenticate_user_callback_result_ = true;
diff --git a/ash/login/ui/lock_contents_view.cc b/ash/login/ui/lock_contents_view.cc index 4f1799d..70b1c1e 100644 --- a/ash/login/ui/lock_contents_view.cc +++ b/ash/login/ui/lock_contents_view.cc
@@ -36,7 +36,6 @@ #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "components/user_manager/user_type.h" -#include "mojo/common/values_struct_traits.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" #include "ui/display/display.h" @@ -556,6 +555,11 @@ user_view->UpdateForUser(user_info, false /*animate*/); } +void LockContentsView::OnPublicSessionKeyboardLayoutsChanged( + const AccountId& account_id, + const std::string& locale, + const std::vector<mojom::InputMethodItemPtr>& keyboard_layouts) {} + void LockContentsView::OnDetachableBasePairingStatusChanged( DetachableBasePairingStatus pairing_status) { const mojom::UserInfoPtr& user_info =
diff --git a/ash/login/ui/lock_contents_view.h b/ash/login/ui/lock_contents_view.h index 4153c3e6..09083df4 100644 --- a/ash/login/ui/lock_contents_view.h +++ b/ash/login/ui/lock_contents_view.h
@@ -133,6 +133,10 @@ const base::ListValue& locales, const std::string& default_locale, bool show_advanced_view) override; + void OnPublicSessionKeyboardLayoutsChanged( + const AccountId& account_id, + const std::string& locale, + const std::vector<mojom::InputMethodItemPtr>& keyboard_layouts) override; void OnDetachableBasePairingStatusChanged( DetachableBasePairingStatus pairing_status) override;
diff --git a/ash/login/ui/lock_debug_view.cc b/ash/login/ui/lock_debug_view.cc index 103c5015..e52c6df 100644 --- a/ash/login/ui/lock_debug_view.cc +++ b/ash/login/ui/lock_debug_view.cc
@@ -21,7 +21,6 @@ #include "ash/shell.h" #include "base/optional.h" #include "base/strings/utf_string_conversions.h" -#include "mojo/common/values_struct_traits.h" #include "ui/base/ime/chromeos/ime_keyboard.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/layout/box_layout.h" @@ -264,6 +263,14 @@ debug_dispatcher_.SetDetachableBasePairingStatus(pairing_status); } + void OnPublicSessionKeyboardLayoutsChanged( + const AccountId& account_id, + const std::string& locale, + const std::vector<mojom::InputMethodItemPtr>& keyboard_layouts) override { + debug_dispatcher_.SetPublicSessionKeyboardLayouts(account_id, locale, + keyboard_layouts); + } + private: // The debug overlay UI takes ground-truth data from |root_dispatcher_|, // applies a series of transformations to it, and exposes it to the UI via
diff --git a/ash/login/ui/login_data_dispatcher.cc b/ash/login/ui/login_data_dispatcher.cc index c1177fe..7eb189b 100644 --- a/ash/login/ui/login_data_dispatcher.cc +++ b/ash/login/ui/login_data_dispatcher.cc
@@ -41,6 +41,11 @@ const std::string& default_locale, bool show_advanced_view) {} +void LoginDataDispatcher::Observer::OnPublicSessionKeyboardLayoutsChanged( + const AccountId& account_id, + const std::string& locale, + const std::vector<mojom::InputMethodItemPtr>& keyboard_layouts) {} + void LoginDataDispatcher::Observer::OnDetachableBasePairingStatusChanged( DetachableBasePairingStatus pairing_status) {} @@ -114,6 +119,16 @@ } } +void LoginDataDispatcher::SetPublicSessionKeyboardLayouts( + const AccountId& account_id, + const std::string& locale, + const std::vector<mojom::InputMethodItemPtr>& keyboard_layouts) { + for (auto& observer : observers_) { + observer.OnPublicSessionKeyboardLayoutsChanged(account_id, locale, + keyboard_layouts); + } +} + void LoginDataDispatcher::SetDetachableBasePairingStatus( DetachableBasePairingStatus pairing_status) { for (auto& observer : observers_)
diff --git a/ash/login/ui/login_data_dispatcher.h b/ash/login/ui/login_data_dispatcher.h index 4155560..4db7cbc0 100644 --- a/ash/login/ui/login_data_dispatcher.h +++ b/ash/login/ui/login_data_dispatcher.h
@@ -81,6 +81,13 @@ const std::string& default_locale, bool show_advanced_view); + // Called when public session keyboard layouts are changed for user with + // |account_id|. + virtual void OnPublicSessionKeyboardLayoutsChanged( + const AccountId& account_id, + const std::string& locale, + const std::vector<mojom::InputMethodItemPtr>& keyboard_layouts); + // Called when the pairing status of detachable base changes - e.g. when the // base is attached or detached. virtual void OnDetachableBasePairingStatusChanged( @@ -108,6 +115,10 @@ std::unique_ptr<base::ListValue> locales, const std::string& default_locale, bool show_advanced_view); + void SetPublicSessionKeyboardLayouts( + const AccountId& account_id, + const std::string& locale, + const std::vector<mojom::InputMethodItemPtr>& keyboard_layouts); void SetDetachableBasePairingStatus( DetachableBasePairingStatus pairing_status);
diff --git a/ash/login/ui/login_expanded_public_account_view.cc b/ash/login/ui/login_expanded_public_account_view.cc index 547ad1f..eabf3e7 100644 --- a/ash/login/ui/login_expanded_public_account_view.cc +++ b/ash/login/ui/login_expanded_public_account_view.cc
@@ -11,7 +11,6 @@ #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" #include "base/strings/utf_string_conversions.h" -#include "mojo/common/values_struct_traits.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/canvas.h" #include "ui/gfx/paint_vector_icon.h"
diff --git a/ash/login/ui/login_user_view.cc b/ash/login/ui/login_user_view.cc index 07da8380..59aa0c5 100644 --- a/ash/login/ui/login_user_view.cc +++ b/ash/login/ui/login_user_view.cc
@@ -23,7 +23,6 @@ #include "base/memory/weak_ptr.h" #include "base/strings/utf_string_conversions.h" #include "components/user_manager/user_type.h" -#include "mojo/common/values_struct_traits.h" #include "ui/base/l10n/l10n_util.h" #include "ui/compositor/layer_animation_sequence.h" #include "ui/compositor/layer_animator.h"
diff --git a/ash/manifest.json b/ash/manifest.json index 94bfd70..b43a0b8 100644 --- a/ash/manifest.json +++ b/ash/manifest.json
@@ -61,6 +61,7 @@ "ash_pref_connector": [ "pref_connector" ], "catalog": [ "directory" ], "local_state": [ "pref_client" ], + "multidevice_setup": [ "multidevice_setup" ], "quick_launch_app": [ "mash:launchable" ], "service_manager": [ "service_manager:singleton" ], "ui": [ "display_dev", "window_manager", "video_detector" ],
diff --git a/ash/multi_device_setup/multi_device_notification_presenter.cc b/ash/multi_device_setup/multi_device_notification_presenter.cc index cceb5fe..add67bc 100644 --- a/ash/multi_device_setup/multi_device_notification_presenter.cc +++ b/ash/multi_device_setup/multi_device_notification_presenter.cc
@@ -8,12 +8,18 @@ #include <utility> #include "ash/public/cpp/vector_icons/vector_icons.h" +#include "ash/public/interfaces/session_controller.mojom.h" +#include "ash/session/session_controller.h" +#include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/tray/system_tray_controller.h" +#include "base/bind_helpers.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/strings/utf_string_conversions.h" #include "chromeos/components/proximity_auth/logging/logging.h" +#include "chromeos/services/multidevice_setup/public/mojom/constants.mojom.h" +#include "services/service_manager/public/cpp/connector.h" #include "ui/base/l10n/l10n_util.h" #include "ui/message_center/message_center.h" #include "ui/message_center/public/cpp/notification_types.h" @@ -52,8 +58,7 @@ void MultiDeviceNotificationPresenter::OpenUiDelegate:: OpenMultiDeviceSetupUi() { - // TODO(jordynass): Open WebUI once it is refactored to avoid circular - // dependcy + Shell::Get()->system_tray_controller()->ShowMultiDeviceSetup(); } void MultiDeviceNotificationPresenter::OpenUiDelegate:: @@ -86,12 +91,27 @@ } MultiDeviceNotificationPresenter::MultiDeviceNotificationPresenter( - message_center::MessageCenter* message_center) + message_center::MessageCenter* message_center, + service_manager::Connector* connector) : message_center_(message_center), + connector_(connector), + binding_(this), open_ui_delegate_(std::make_unique<OpenUiDelegate>()), - weak_ptr_factory_(this) {} + weak_ptr_factory_(this) { + DCHECK(message_center_); + DCHECK(connector_); -MultiDeviceNotificationPresenter::~MultiDeviceNotificationPresenter() = default; + Shell::Get()->session_controller()->AddObserver(this); + + // If the constructor is called after the session state has already been set + // (e.g., if recovering from a crash), handle that now. If the user has not + // yet logged in, this will be a no-op. + ObserveMultiDeviceSetupIfPossible(); +} + +MultiDeviceNotificationPresenter::~MultiDeviceNotificationPresenter() { + Shell::Get()->session_controller()->RemoveObserver(this); +} void MultiDeviceNotificationPresenter::OnPotentialHostExistsForNewUser() { base::string16 title = l10n_util::GetStringUTF16( @@ -126,6 +146,52 @@ /* by_user */ false); } +void MultiDeviceNotificationPresenter::OnUserSessionAdded( + const AccountId& account_id) { + ObserveMultiDeviceSetupIfPossible(); +} + +void MultiDeviceNotificationPresenter::OnSessionStateChanged( + session_manager::SessionState state) { + ObserveMultiDeviceSetupIfPossible(); +} + +void MultiDeviceNotificationPresenter::ObserveMultiDeviceSetupIfPossible() { + // If already observing, there is nothing else to do. + if (multidevice_setup_ptr_) + return; + + const SessionController* session_controller = + Shell::Get()->session_controller(); + + // If no active user is logged in, there is nothing to do. + if (session_controller->GetSessionState() != + session_manager::SessionState::ACTIVE) { + return; + } + + const mojom::UserSession* user_session = + session_controller->GetPrimaryUserSession(); + + // The primary user session may be unavailable (e.g., for test/guest users). + if (!user_session) + return; + + std::string service_user_id = user_session->user_info->service_user_id; + DCHECK(!service_user_id.empty()); + + connector_->BindInterface( + service_manager::Identity( + chromeos::multidevice_setup::mojom::kServiceName, service_user_id), + &multidevice_setup_ptr_); + + // Start observing the MultiDeviceSetup Service. + chromeos::multidevice_setup::mojom::MultiDeviceSetupObserverPtr observer_ptr; + binding_.Bind(mojo::MakeRequest(&observer_ptr)); + multidevice_setup_ptr_->SetObserver(std::move(observer_ptr), + base::DoNothing()); +} + void MultiDeviceNotificationPresenter::OnNotificationClicked() { DCHECK(notification_status_ != Status::kNoNotificationVisible); PA_LOG(INFO) << "User clicked " @@ -188,4 +254,9 @@ message_center::SystemNotificationWarningLevel::NORMAL); } +void MultiDeviceNotificationPresenter::FlushForTesting() { + if (multidevice_setup_ptr_) + multidevice_setup_ptr_.FlushForTesting(); +} + } // namespace ash
diff --git a/ash/multi_device_setup/multi_device_notification_presenter.h b/ash/multi_device_setup/multi_device_notification_presenter.h index f93ab3f..1cdb774f 100644 --- a/ash/multi_device_setup/multi_device_notification_presenter.h +++ b/ash/multi_device_setup/multi_device_notification_presenter.h
@@ -9,16 +9,22 @@ #include <string> #include "ash/ash_export.h" +#include "ash/session/session_observer.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/strings/string16.h" #include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h" +#include "mojo/public/cpp/bindings/binding.h" namespace message_center { class MessageCenter; class Notification; } // namespace message_center +namespace service_manager { +class Connector; +} // namespace service_manager + namespace ash { // Presents notifications necessary for MultiDevice setup flow. It observes the @@ -27,32 +33,39 @@ // flow before, // (2) the host has switched for someone who has, or // (3) a new Chromebook has been added to an account for someone who has. - +// // The behavior caused by clicking a notification depends its content as // described above: // (1) triggers the setup UI to appear to prompt setup flow, // (2) opens Settings/Connected Devices/Change Device, and // (3) opens Setting/Connected Devices. - +// // Note that if one notification is showing and another one is triggered, the // old text is replaced (if it's different) and the notification pops up again. class ASH_EXPORT MultiDeviceNotificationPresenter - : public chromeos::multidevice_setup::mojom::MultiDeviceSetupObserver { + : public chromeos::multidevice_setup::mojom::MultiDeviceSetupObserver, + public SessionObserver { public: - explicit MultiDeviceNotificationPresenter( - message_center::MessageCenter* message_center); + MultiDeviceNotificationPresenter( + message_center::MessageCenter* message_center, + service_manager::Connector* connector); ~MultiDeviceNotificationPresenter() override; - // multidevice_setup::mojom::MultiDeviceSetupObserver: - void OnPotentialHostExistsForNewUser() override; - void OnConnectedHostSwitchedForExistingUser() override; - void OnNewChromebookAddedForExistingUser() override; - // Removes the notification created by NotifyPotentialHostExists() or does // nothing if that notification is not currently displayed. // TODO(khorimoto): Change this to Mojo function. void RemoveMultiDeviceSetupNotification(); + protected: + // multidevice_setup::mojom::MultiDeviceSetupObserver: + void OnPotentialHostExistsForNewUser() override; + void OnConnectedHostSwitchedForExistingUser() override; + void OnNewChromebookAddedForExistingUser() override; + + // SessionObserver: + void OnUserSessionAdded(const AccountId& account_id) override; + void OnSessionStateChanged(session_manager::SessionState state) override; + private: friend class MultiDeviceNotificationPresenterTest; @@ -95,6 +108,7 @@ static std::string GetNotificationDescriptionForLogging( Status notification_status); + void ObserveMultiDeviceSetupIfPossible(); void OnNotificationClicked(); void ShowNotification(const Status notification_status, const base::string16& title, @@ -103,12 +117,20 @@ const base::string16& title, const base::string16& message); + void FlushForTesting(); + message_center::MessageCenter* message_center_; + service_manager::Connector* connector_; // Notification currently showing or // Status::kNoNotificationVisible if there isn't one. Status notification_status_ = Status::kNoNotificationVisible; + chromeos::multidevice_setup::mojom::MultiDeviceSetupPtr + multidevice_setup_ptr_; + mojo::Binding<chromeos::multidevice_setup::mojom::MultiDeviceSetupObserver> + binding_; + std::unique_ptr<OpenUiDelegate> open_ui_delegate_; base::WeakPtrFactory<MultiDeviceNotificationPresenter> weak_ptr_factory_;
diff --git a/ash/multi_device_setup/multi_device_notification_presenter_unittest.cc b/ash/multi_device_setup/multi_device_notification_presenter_unittest.cc index e73b7cc..8373e5c 100644 --- a/ash/multi_device_setup/multi_device_notification_presenter_unittest.cc +++ b/ash/multi_device_setup/multi_device_notification_presenter_unittest.cc
@@ -8,10 +8,17 @@ #include <memory> #include <utility> +#include "ash/session/test_session_controller_client.h" #include "ash/strings/grit/ash_strings.h" +#include "ash/test/ash_test_base.h" +#include "ash/test/ash_test_helper.h" +#include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/test/histogram_tester.h" -#include "testing/gtest/include/gtest/gtest.h" +#include "chromeos/services/multidevice_setup/public/mojom/constants.mojom.h" +#include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h" +#include "services/service_manager/public/cpp/connector.h" +#include "services/service_manager/public/mojom/connector.mojom.h" #include "ui/base/l10n/l10n_util.h" #include "ui/message_center/fake_message_center.h" #include "ui/message_center/message_center.h" @@ -20,6 +27,10 @@ namespace { +const char kTestUserEmail[] = "test@example.com"; +// Note: Must be formatted as a GUID. +const char kTestServiceUserId[] = "01234567-89ab-cdef-0123-456789abcdef"; + class TestMessageCenter : public message_center::FakeMessageCenter { public: TestMessageCenter() = default; @@ -68,9 +79,46 @@ DISALLOW_COPY_AND_ASSIGN(TestMessageCenter); }; +// Fake for the MultiDeviceSetup service. This class only implements the +// SetObserver() interface function since it's the only one that is used by +// MultiDeviceNotificationPresenter. +class FakeMultiDeviceSetup + : public chromeos::multidevice_setup::mojom::MultiDeviceSetup { + public: + FakeMultiDeviceSetup() : binding_(this) {} + ~FakeMultiDeviceSetup() override = default; + + chromeos::multidevice_setup::mojom::MultiDeviceSetupObserverPtr& observer() { + return observer_; + } + + void Bind(mojo::ScopedMessagePipeHandle handle) { + binding_.Bind(chromeos::multidevice_setup::mojom::MultiDeviceSetupRequest( + std::move(handle))); + } + + // mojom::MultiDeviceSetup: + void SetObserver( + chromeos::multidevice_setup::mojom::MultiDeviceSetupObserverPtr observer, + SetObserverCallback callback) override { + observer_ = std::move(observer); + std::move(callback).Run(); + } + + void TriggerEventForDebugging( + chromeos::multidevice_setup::mojom::EventTypeForDebugging type, + TriggerEventForDebuggingCallback callback) override { + NOTIMPLEMENTED(); + } + + private: + chromeos::multidevice_setup::mojom::MultiDeviceSetupObserverPtr observer_; + mojo::Binding<chromeos::multidevice_setup::mojom::MultiDeviceSetup> binding_; +}; + } // namespace -class MultiDeviceNotificationPresenterTest : public testing::Test { +class MultiDeviceNotificationPresenterTest : public NoSessionAshTestBase { public: class TestOpenUiDelegate : public MultiDeviceNotificationPresenter::OpenUiDelegate { @@ -113,18 +161,73 @@ MultiDeviceNotificationPresenterTest() = default; void SetUp() override { + NoSessionAshTestBase::SetUp(); + std::unique_ptr<TestOpenUiDelegate> test_open_ui_delegate = std::make_unique<TestOpenUiDelegate>(); - test_open_ui_delegate_ = test_open_ui_delegate.get(); + service_manager::mojom::ConnectorRequest request; + connector_ = service_manager::Connector::Create(&request); + + fake_multidevice_setup_ = std::make_unique<FakeMultiDeviceSetup>(); + service_manager::Connector::TestApi test_api(connector_.get()); + test_api.OverrideBinderForTesting( + service_manager::Identity( + chromeos::multidevice_setup::mojom::kServiceName, + kTestServiceUserId), + chromeos::multidevice_setup::mojom::MultiDeviceSetup::Name_, + base::BindRepeating(&FakeMultiDeviceSetup::Bind, + base::Unretained(fake_multidevice_setup_.get()))); + notification_presenter_ = std::make_unique<MultiDeviceNotificationPresenter>( - &test_message_center_); + &test_message_center_, connector_.get()); notification_presenter_->open_ui_delegate_ = std::move(test_open_ui_delegate); } + void TearDown() override { + notification_presenter_.reset(); + NoSessionAshTestBase::TearDown(); + } + + void InvokePendingMojoCalls() { notification_presenter_->FlushForTesting(); } + + void SignIntoAccount() { + TestSessionControllerClient* test_session_client = + GetSessionControllerClient(); + test_session_client->AddUserSession( + kTestUserEmail, user_manager::USER_TYPE_REGULAR, + true /* enable_settings */, true /* provide_pref_service */, + false /* is_new_profile */, kTestServiceUserId); + test_session_client->SetSessionState(session_manager::SessionState::ACTIVE); + test_session_client->SwitchActiveUser( + AccountId::FromUserEmail(kTestUserEmail)); + + InvokePendingMojoCalls(); + EXPECT_TRUE(fake_multidevice_setup_->observer().is_bound()); + } + + void ShowNewUserNotification() { + EXPECT_TRUE(fake_multidevice_setup_->observer().is_bound()); + fake_multidevice_setup_->observer()->OnPotentialHostExistsForNewUser(); + InvokePendingMojoCalls(); + } + + void ShowExistingUserHostSwitchedNotification() { + EXPECT_TRUE(fake_multidevice_setup_->observer().is_bound()); + fake_multidevice_setup_->observer() + ->OnConnectedHostSwitchedForExistingUser(); + InvokePendingMojoCalls(); + } + + void ShowExistingUserNewChromebookNotification() { + EXPECT_TRUE(fake_multidevice_setup_->observer().is_bound()); + fake_multidevice_setup_->observer()->OnNewChromebookAddedForExistingUser(); + InvokePendingMojoCalls(); + } + void ClickNotification() { test_message_center_.ClickOnNotification( MultiDeviceNotificationPresenter::kNotificationId); @@ -191,6 +294,8 @@ base::HistogramTester histogram_tester_; TestOpenUiDelegate* test_open_ui_delegate_; TestMessageCenter test_message_center_; + std::unique_ptr<service_manager::Connector> connector_; + std::unique_ptr<FakeMultiDeviceSetup> fake_multidevice_setup_; std::unique_ptr<MultiDeviceNotificationPresenter> notification_presenter_; private: @@ -233,9 +338,32 @@ DISALLOW_COPY_AND_ASSIGN(MultiDeviceNotificationPresenterTest); }; +TEST_F(MultiDeviceNotificationPresenterTest, NotSignedIntoAccount) { + static const session_manager::SessionState kNonActiveStates[] = { + session_manager::SessionState::UNKNOWN, + session_manager::SessionState::OOBE, + session_manager::SessionState::LOGIN_PRIMARY, + session_manager::SessionState::LOGGED_IN_NOT_ACTIVE, + session_manager::SessionState::LOCKED, + session_manager::SessionState::LOGIN_SECONDARY}; + + // For each of the states which is not ACTIVE, set the session state. None of + // these should trigger a SetObserver() call. + for (const auto state : kNonActiveStates) { + GetSessionControllerClient()->SetSessionState(state); + InvokePendingMojoCalls(); + EXPECT_FALSE(fake_multidevice_setup_->observer().is_bound()); + } + + SignIntoAccount(); + EXPECT_TRUE(fake_multidevice_setup_->observer().is_bound()); +} + TEST_F(MultiDeviceNotificationPresenterTest, TestHostNewUserPotentialHostExistsNotification_RemoveProgrammatically) { - notification_presenter_->OnPotentialHostExistsForNewUser(); + SignIntoAccount(); + + ShowNewUserNotification(); VerifyNewUserPotentialHostExistsNotificationIsVisible(); notification_presenter_->RemoveMultiDeviceSetupNotification(); @@ -248,7 +376,9 @@ TEST_F(MultiDeviceNotificationPresenterTest, TestHostNewUserPotentialHostExistsNotification_TapNotification) { - notification_presenter_->OnPotentialHostExistsForNewUser(); + SignIntoAccount(); + + ShowNewUserNotification(); VerifyNewUserPotentialHostExistsNotificationIsVisible(); ClickNotification(); @@ -261,7 +391,9 @@ TEST_F(MultiDeviceNotificationPresenterTest, TestHostExistingUserHostSwitchedNotification_RemoveProgrammatically) { - notification_presenter_->OnConnectedHostSwitchedForExistingUser(); + SignIntoAccount(); + + ShowExistingUserHostSwitchedNotification(); VerifyExistingUserHostSwitchedNotificationIsVisible(); notification_presenter_->RemoveMultiDeviceSetupNotification(); @@ -275,7 +407,9 @@ TEST_F(MultiDeviceNotificationPresenterTest, TestHostExistingUserHostSwitchedNotification_TapNotification) { - notification_presenter_->OnConnectedHostSwitchedForExistingUser(); + SignIntoAccount(); + + ShowExistingUserHostSwitchedNotification(); VerifyExistingUserHostSwitchedNotificationIsVisible(); ClickNotification(); @@ -290,7 +424,9 @@ TEST_F( MultiDeviceNotificationPresenterTest, TestHostExistingUserNewChromebookAddedNotification_RemoveProgrammatically) { - notification_presenter_->OnNewChromebookAddedForExistingUser(); + SignIntoAccount(); + + ShowExistingUserNewChromebookNotification(); VerifyExistingUserNewChromebookAddedNotificationIsVisible(); notification_presenter_->RemoveMultiDeviceSetupNotification(); @@ -303,7 +439,9 @@ TEST_F(MultiDeviceNotificationPresenterTest, TestHostExistingUserNewChromebookAddedNotification_TapNotification) { - notification_presenter_->OnNewChromebookAddedForExistingUser(); + SignIntoAccount(); + + ShowExistingUserNewChromebookNotification(); VerifyExistingUserNewChromebookAddedNotificationIsVisible(); ClickNotification(); @@ -315,13 +453,15 @@ } TEST_F(MultiDeviceNotificationPresenterTest, NotificationsReplaceOneAnother) { - notification_presenter_->OnPotentialHostExistsForNewUser(); + SignIntoAccount(); + + ShowNewUserNotification(); VerifyNewUserPotentialHostExistsNotificationIsVisible(); - notification_presenter_->OnConnectedHostSwitchedForExistingUser(); + ShowExistingUserHostSwitchedNotification(); VerifyExistingUserHostSwitchedNotificationIsVisible(); - notification_presenter_->OnNewChromebookAddedForExistingUser(); + ShowExistingUserNewChromebookNotification(); VerifyExistingUserNewChromebookAddedNotificationIsVisible(); ClickNotification(); @@ -333,21 +473,23 @@ } TEST_F(MultiDeviceNotificationPresenterTest, NotificationsReplaceThemselves) { - notification_presenter_->OnPotentialHostExistsForNewUser(); + SignIntoAccount(); + + ShowNewUserNotification(); VerifyNewUserPotentialHostExistsNotificationIsVisible(); - notification_presenter_->OnPotentialHostExistsForNewUser(); + ShowNewUserNotification(); VerifyNewUserPotentialHostExistsNotificationIsVisible(); notification_presenter_->RemoveMultiDeviceSetupNotification(); - notification_presenter_->OnConnectedHostSwitchedForExistingUser(); + ShowExistingUserHostSwitchedNotification(); VerifyExistingUserHostSwitchedNotificationIsVisible(); - notification_presenter_->OnConnectedHostSwitchedForExistingUser(); + ShowExistingUserHostSwitchedNotification(); VerifyExistingUserHostSwitchedNotificationIsVisible(); notification_presenter_->RemoveMultiDeviceSetupNotification(); - notification_presenter_->OnNewChromebookAddedForExistingUser(); + ShowExistingUserNewChromebookNotification(); VerifyExistingUserNewChromebookAddedNotificationIsVisible(); - notification_presenter_->OnNewChromebookAddedForExistingUser(); + ShowExistingUserNewChromebookNotification(); VerifyExistingUserNewChromebookAddedNotificationIsVisible(); notification_presenter_->RemoveMultiDeviceSetupNotification();
diff --git a/ash/public/cpp/DEPS b/ash/public/cpp/DEPS index aa4234d5..dab1430 100644 --- a/ash/public/cpp/DEPS +++ b/ash/public/cpp/DEPS
@@ -1,6 +1,5 @@ include_rules = [ "+components/prefs", - "+mojo/common", "+skia/public/interfaces", "+ui/display", ]
diff --git a/ash/public/interfaces/login_screen.mojom b/ash/public/interfaces/login_screen.mojom index 8afe97d..8d88653 100644 --- a/ash/public/interfaces/login_screen.mojom +++ b/ash/public/interfaces/login_screen.mojom
@@ -106,6 +106,12 @@ mojo_base.mojom.ListValue locales, string default_locale, bool show_advanced_view); + + // Set the public session keyboard layouts for user with |account_id|. + // |locale|: The locale that |keyboard_layouts| can be used for. + SetPublicSessionKeyboardLayouts(signin.mojom.AccountId account_id, + string locale, + array<InputMethodItem> keyboard_layouts); }; // Allows ash lock screen to control a client (e.g. Chrome browser). Requests @@ -187,4 +193,12 @@ LaunchPublicSession(signin.mojom.AccountId account_id, string locale, string input_method); + + // Request public session keyboard layouts for user with |account_id|. + // This function send a request to chrome and the result will be returned by + // SetPublicSessionKeyboardLayouts. + // |locale|: Request a list of keyboard layouts that can be used by this + // locale. + RequestPublicSessionKeyboardLayouts(signin.mojom.AccountId account_id, + string locale); };
diff --git a/ash/public/interfaces/login_user_info.mojom b/ash/public/interfaces/login_user_info.mojom index 0c1e7aa..150897e9 100644 --- a/ash/public/interfaces/login_user_info.mojom +++ b/ash/public/interfaces/login_user_info.mojom
@@ -67,6 +67,20 @@ bool is_trial_run; }; +// Infomation of each input method. This is used to populate keyboard layouts +// for public account user. +struct InputMethodItem { + // An id that identifies an input method engine (e.g., "t:latn-post", + // "pinyin", "hangul"). + string ime_id; + + // Title of the imput method. + string title; + + // Whether this input method is been selected. + bool selected; +}; + // Infomation about a public account user. struct PublicAccountInfo { // Optional, the domain name displayed in the login screen UI. @@ -82,6 +96,9 @@ // locales. This will be the case in multilingual environments where users // are likely to want to choose among locales. bool show_advanced_view; + + // A list of available keyboard layouts. + array<InputMethodItem> keyboard_layouts; }; // Info about a user in login/lock screen.
diff --git a/ash/shell.cc b/ash/shell.cc index c5cf3e5..104fa202 100644 --- a/ash/shell.cc +++ b/ash/shell.cc
@@ -62,6 +62,7 @@ #include "ash/media_controller.h" #include "ash/message_center/message_center_controller.h" #include "ash/metrics/time_to_first_present_recorder.h" +#include "ash/multi_device_setup/multi_device_notification_presenter.h" #include "ash/new_window_controller.h" #include "ash/note_taking_controller.h" #include "ash/public/cpp/ash_features.h" @@ -155,6 +156,7 @@ #include "base/memory/ptr_util.h" #include "base/sys_info.h" #include "base/trace_event/trace_event.h" +#include "chromeos/chromeos_features.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power_policy_controller.h" #include "chromeos/system/devicemode.h" @@ -844,6 +846,7 @@ screen_pinning_controller_.reset(); + multidevice_notification_presenter_.reset(); resolution_notification_controller_.reset(); screenshot_controller_.reset(); mouse_cursor_filter_.reset(); @@ -955,6 +958,15 @@ detachable_base_notification_controller_ = std::make_unique<DetachableBaseNotificationController>( detachable_base_handler_.get()); + // Connector can be null in tests. + if (shell_delegate_->GetShellConnector() && + base::FeatureList::IsEnabled( + chromeos::features::kEnableUnifiedMultiDeviceSetup)) { + multidevice_notification_presenter_ = + std::make_unique<MultiDeviceNotificationPresenter>( + message_center::MessageCenter::Get(), + shell_delegate_->GetShellConnector()); + } // Connector can be null in tests. if (shell_delegate_->GetShellConnector()) {
diff --git a/ash/shell.h b/ash/shell.h index b79178c..207c687 100644 --- a/ash/shell.h +++ b/ash/shell.h
@@ -129,6 +129,7 @@ class MessageCenterController; class MouseCursorEventFilter; class MruWindowTracker; +class MultiDeviceNotificationPresenter; class NewWindowController; class NightLightController; class NoteTakingController; @@ -725,6 +726,8 @@ std::unique_ptr<TabletModeController> tablet_mode_controller_; std::unique_ptr<MediaController> media_controller_; std::unique_ptr<MruWindowTracker> mru_window_tracker_; + std::unique_ptr<MultiDeviceNotificationPresenter> + multidevice_notification_presenter_; std::unique_ptr<NewWindowController> new_window_controller_; std::unique_ptr<ResizeShadowController> resize_shadow_controller_; std::unique_ptr<SessionController> session_controller_;
diff --git a/ash/wm/splitview/split_view_controller.cc b/ash/wm/splitview/split_view_controller.cc index 3bf7ffcc..3b07c70 100644 --- a/ash/wm/splitview/split_view_controller.cc +++ b/ash/wm/splitview/split_view_controller.cc
@@ -793,6 +793,7 @@ opacity -= kBlackScrimOpacity * (distance - work_area_bounds.width() * ratio) / (work_area_bounds.width() * kBlackScrimFadeInRatio); + opacity = std::max(opacity, 0.f); } black_scrim_layer_->SetOpacity(opacity); }
diff --git a/base/android/junit/src/org/chromium/base/metrics/test/ShadowRecordHistogram.java b/base/android/junit/src/org/chromium/base/metrics/test/ShadowRecordHistogram.java index 02745482..18fe6ce 100644 --- a/base/android/junit/src/org/chromium/base/metrics/test/ShadowRecordHistogram.java +++ b/base/android/junit/src/org/chromium/base/metrics/test/ShadowRecordHistogram.java
@@ -13,6 +13,7 @@ import org.chromium.base.metrics.RecordHistogram; import java.util.HashMap; +import java.util.concurrent.TimeUnit; /** * Implementation of RecordHistogram which does not rely on native and still enables testing of @@ -31,11 +32,13 @@ @Implementation public static void recordCountHistogram(String name, int sample) { Pair<String, Integer> key = Pair.create(name, sample); - Integer i = sSamples.get(key); - if (i == null) { - i = 0; - } - sSamples.put(key, i + 1); + incrementSampleCount(key); + } + + @Implementation + public static void recordLongTimesHistogram100(String name, long duration, TimeUnit timeUnit) { + Pair<String, Integer> key = Pair.create(name, (int) timeUnit.toMillis(duration)); + incrementSampleCount(key); } @Implementation @@ -43,4 +46,12 @@ Integer i = sSamples.get(Pair.create(name, sample)); return (i != null) ? i : 0; } + + private static void incrementSampleCount(Pair<String, Integer> key) { + Integer i = sSamples.get(key); + if (i == null) { + i = 0; + } + sSamples.put(key, i + 1); + } }
diff --git a/base/memory/weak_ptr.cc b/base/memory/weak_ptr.cc index f7c8af6..d6a5eca 100644 --- a/base/memory/weak_ptr.cc +++ b/base/memory/weak_ptr.cc
@@ -11,19 +11,21 @@ // Flags only become bound when checked for validity, or invalidated, // so that we can check that later validity/invalidation operations on // the same Flag take place on the same sequenced thread. - sequence_checker_.DetachFromSequence(); + DETACH_FROM_SEQUENCE(sequence_checker_); } void WeakReference::Flag::Invalidate() { // The flag being invalidated with a single ref implies that there are no // weak pointers in existence. Allow deletion on other thread in this case. +#if DCHECK_IS_ON() DCHECK(sequence_checker_.CalledOnValidSequence() || HasOneRef()) << "WeakPtrs must be invalidated on the same sequenced thread."; +#endif is_valid_ = false; } bool WeakReference::Flag::IsValid() const { - DCHECK(sequence_checker_.CalledOnValidSequence()) + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_) << "WeakPtrs must be checked on the same sequenced thread."; return is_valid_; } @@ -65,7 +67,7 @@ } } -WeakPtrBase::WeakPtrBase() : ptr_(0) {} +WeakPtrBase::WeakPtrBase() = default; WeakPtrBase::~WeakPtrBase() = default;
diff --git a/base/memory/weak_ptr.h b/base/memory/weak_ptr.h index a7be14af..028f6fa 100644 --- a/base/memory/weak_ptr.h +++ b/base/memory/weak_ptr.h
@@ -104,7 +104,7 @@ ~Flag(); - SequenceChecker sequence_checker_; + SEQUENCE_CHECKER(sequence_checker_); bool is_valid_; }; @@ -153,8 +153,13 @@ WeakPtrBase& operator=(WeakPtrBase&& other) = default; void reset() { - ref_ = internal::WeakReference(); - ptr_ = 0; + // Resetting is only ever necessary on a valid pointer + // Checking validity has the side effect of verifying + // we are on the right sequence. + if (ref_.is_valid()) { + ref_ = internal::WeakReference(); + ptr_ = 0; + } } protected: @@ -163,8 +168,9 @@ WeakReference ref_; // This pointer is only valid when ref_.is_valid() is true. Otherwise, its - // value is undefined (as opposed to nullptr). - uintptr_t ptr_; + // value is undefined (as opposed to nullptr). On the flipside, if the pointer + // is nullptr, this WeakPtr is guaranteed to be invalid." + uintptr_t ptr_ = 0; }; // This class provides a common implementation of common functions that would @@ -253,7 +259,10 @@ } // Allow conditionals to test validity, e.g. if (weak_ptr) {...}; - explicit operator bool() const { return get() != nullptr; } + // We test for a null pointer value first (which can be invalidated + // by reset()). Direct access of ptr_ is favored to facilitate + // detection of improper access by TSAN + explicit operator bool() const { return ptr_ != 0 && ref_.is_valid(); } private: friend class internal::SupportsWeakPtrBase;
diff --git a/base/memory/weak_ptr_unittest.cc b/base/memory/weak_ptr_unittest.cc index f8dfb7c0..67117c89 100644 --- a/base/memory/weak_ptr_unittest.cc +++ b/base/memory/weak_ptr_unittest.cc
@@ -99,6 +99,15 @@ completion.Wait(); } + void ResetArrow(Arrow* arrow) { + WaitableEvent completion(WaitableEvent::ResetPolicy::MANUAL, + WaitableEvent::InitialState::NOT_SIGNALED); + task_runner()->PostTask( + FROM_HERE, + base::BindOnce(&BackgroundThread::DoResetArrow, arrow, &completion)); + completion.Wait(); + } + void CreateArrowFromArrow(Arrow** arrow, const Arrow* other) { WaitableEvent completion(WaitableEvent::ResetPolicy::MANUAL, WaitableEvent::InitialState::NOT_SIGNALED); @@ -164,6 +173,11 @@ completion->Signal(); } + static void DoResetArrow(Arrow* arrow, WaitableEvent* completion) { + arrow->target.reset(); + completion->Signal(); + } + static void DoCreateArrowFromTarget(Arrow** arrow, Target* target, WaitableEvent* completion) { @@ -468,7 +482,7 @@ EXPECT_EQ(&target, background.DeRef(arrow)); // Release the only WeakPtr. - arrow->target.reset(); + background.ResetArrow(arrow); // Now we should be able to create a new reference from this thread. arrow->target = target.AsWeakPtr(); @@ -650,6 +664,26 @@ ASSERT_DCHECK_DEATH(background.DeRef(&arrow)); } +TEST(WeakPtrDeathTest, NonOwnerThreadResetsWeakPtrAfterReference) { + // The default style "fast" does not support multi-threaded tests + // (introduces deadlock on Linux). + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + + std::unique_ptr<Target> target(new Target()); + + // Main thread creates an arrow referencing the Target. + Arrow arrow; + arrow.target = target->AsWeakPtr(); + + // Background thread tries to deref target, binding it to the thread. + BackgroundThread background; + background.Start(); + background.DeRef(&arrow); + + // Main thread resets weak_ptr, violating thread binding. + ASSERT_DCHECK_DEATH(arrow.target.reset()); +} + TEST(WeakPtrDeathTest, NonOwnerThreadDeletesWeakPtrAfterReference) { // The default style "fast" does not support multi-threaded tests // (introduces deadlock on Linux).
diff --git a/base/message_loop/message_loop.h b/base/message_loop/message_loop.h index 852c0723..c780770 100644 --- a/base/message_loop/message_loop.h +++ b/base/message_loop/message_loop.h
@@ -82,11 +82,9 @@ public RunLoop::Delegate, public MessageLoopCurrent { public: - // TODO(gab): Migrate usage of these classes to MessageLoopCurrent and remove - // these forwarded declarations. + // TODO(gab): Migrate usage of this class to MessageLoopCurrent and remove + // this forwarded declaration. using DestructionObserver = MessageLoopCurrent::DestructionObserver; - using ScopedNestableTaskAllower = - MessageLoopCurrent::ScopedNestableTaskAllower; // A MessageLoop has a particular type, which indicates the set of // asynchronous events it may process in addition to tasks and timers.
diff --git a/base/message_loop/message_loop_current.cc b/base/message_loop/message_loop_current.cc index ca0a46c..502b424 100644 --- a/base/message_loop/message_loop_current.cc +++ b/base/message_loop/message_loop_current.cc
@@ -95,11 +95,8 @@ } MessageLoopCurrent::ScopedNestableTaskAllower::ScopedNestableTaskAllower() - : ScopedNestableTaskAllower(MessageLoopCurrent::Get()) {} - -MessageLoopCurrent::ScopedNestableTaskAllower::ScopedNestableTaskAllower( - MessageLoop* loop) - : loop_(loop), old_state_(loop_->NestableTasksAllowed()) { + : loop_(GetTLSMessageLoop()->Get()), + old_state_(loop_->NestableTasksAllowed()) { loop_->SetNestableTasksAllowed(true); }
diff --git a/base/message_loop/message_loop_current.h b/base/message_loop/message_loop_current.h index 72b0d8c..c36b9f6 100644 --- a/base/message_loop/message_loop_current.h +++ b/base/message_loop/message_loop_current.h
@@ -162,15 +162,10 @@ class BASE_EXPORT ScopedNestableTaskAllower { public: ScopedNestableTaskAllower(); - - // DEPRECATED(https://crbug.com/750779): Prefer the argument less - // constructor to obtaining and injecting MessageLoopCurrent manually. - explicit ScopedNestableTaskAllower(MessageLoop* loop); - ~ScopedNestableTaskAllower(); private: - MessageLoop* loop_; + MessageLoop* const loop_; const bool old_state_; };
diff --git a/base/metrics/persistent_histogram_storage_unittest.cc b/base/metrics/persistent_histogram_storage_unittest.cc index adbcdfc..0b9b1ce 100644 --- a/base/metrics/persistent_histogram_storage_unittest.cc +++ b/base/metrics/persistent_histogram_storage_unittest.cc
@@ -50,7 +50,10 @@ DISALLOW_COPY_AND_ASSIGN(PersistentHistogramStorageTest); }; -#if !defined(OS_NACL) +// TODO(chengx): Re-enable the test on OS_IOS after issue 836789 is fixed. +// PersistentHistogramStorage is only used on OS_WIN now, so disabling this +// test on OS_IOS is fine. +#if !defined(OS_NACL) && !defined(OS_IOS) TEST_F(PersistentHistogramStorageTest, HistogramWriteTest) { auto persistent_histogram_storage = std::make_unique<PersistentHistogramStorage>( @@ -70,6 +73,6 @@ EXPECT_TRUE(DirectoryExists(test_storage_dir())); EXPECT_FALSE(IsDirectoryEmpty(test_storage_dir())); } -#endif // !defined(OS_NACL) +#endif // !defined(OS_NACL) && !defined(OS_IOS) } // namespace base
diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h index a47a407..bd349f3 100644 --- a/base/observer_list_threadsafe.h +++ b/base/observer_list_threadsafe.h
@@ -186,7 +186,7 @@ Callback<void(ObserverType*)> method; }; - ~ObserverListThreadSafe() = default; + ~ObserverListThreadSafe() override = default; void NotifyWrapper(ObserverType* observer, const NotificationData& notification) {
diff --git a/base/sys_info_unittest.cc b/base/sys_info_unittest.cc index d9fc6a9..e97ab57 100644 --- a/base/sys_info_unittest.cc +++ b/base/sys_info_unittest.cc
@@ -34,7 +34,13 @@ } #if defined(OS_LINUX) || defined(OS_ANDROID) -TEST_F(SysInfoTest, AmountOfAvailablePhysicalMemory) { +#if defined(OS_LINUX) +#define MAYBE_AmountOfAvailablePhysicalMemory \ + DISABLED_AmountOfAvailablePhysicalMemory +#else +#define MAYBE_AmountOfAvailablePhysicalMemory AmountOfAvailablePhysicalMemory +#endif // defined(OS_LINUX) +TEST_F(SysInfoTest, MAYBE_AmountOfAvailablePhysicalMemory) { // Note: info is in _K_bytes. SystemMemoryInfoKB info; ASSERT_TRUE(GetSystemMemoryInfo(&info));
diff --git a/base/task_scheduler/scheduler_single_thread_task_runner_manager_unittest.cc b/base/task_scheduler/scheduler_single_thread_task_runner_manager_unittest.cc index ce999065..7c08620 100644 --- a/base/task_scheduler/scheduler_single_thread_task_runner_manager_unittest.cc +++ b/base/task_scheduler/scheduler_single_thread_task_runner_manager_unittest.cc
@@ -356,12 +356,20 @@ TEST_P(TaskSchedulerSingleThreadTaskRunnerManagerCommonTest, PostDelayedTask) { TimeTicks start_time = TimeTicks::Now(); - // Post a task with a short delay. - WaitableEvent task_ran(WaitableEvent::ResetPolicy::MANUAL, + WaitableEvent task_ran(WaitableEvent::ResetPolicy::AUTOMATIC, WaitableEvent::InitialState::NOT_SIGNALED); auto task_runner = single_thread_task_runner_manager_ ->CreateSingleThreadTaskRunnerWithTraits(TaskTraits(), GetParam()); + + // Wait until the task runner is up and running to make sure the test below is + // solely timing the delayed task, not bringing up a physical thread. + task_runner->PostTask( + FROM_HERE, BindOnce(&WaitableEvent::Signal, Unretained(&task_ran))); + task_ran.Wait(); + ASSERT_TRUE(!task_ran.IsSignaled()); + + // Post a task with a short delay. EXPECT_TRUE(task_runner->PostDelayedTask( FROM_HERE, BindOnce(&WaitableEvent::Signal, Unretained(&task_ran)), TestTimeouts::tiny_timeout())); @@ -369,7 +377,7 @@ // Wait until the task runs. task_ran.Wait(); - // Expect the task to run after its delay expires, but not more than 250 ms + // Expect the task to run after its delay expires, but no more than 250 ms // after that. const TimeDelta actual_delay = TimeTicks::Now() - start_time; EXPECT_GE(actual_delay, TestTimeouts::tiny_timeout());
diff --git a/base/task_scheduler/scheduler_worker_pool_unittest.cc b/base/task_scheduler/scheduler_worker_pool_unittest.cc index a2caf0d9..6e22eb0 100644 --- a/base/task_scheduler/scheduler_worker_pool_unittest.cc +++ b/base/task_scheduler/scheduler_worker_pool_unittest.cc
@@ -232,23 +232,31 @@ // Verify that a Task runs shortly after its delay expires. TEST_P(TaskSchedulerWorkerPoolTest, PostDelayedTask) { StartWorkerPool(); - TimeTicks start_time = TimeTicks::Now(); + + WaitableEvent task_ran(WaitableEvent::ResetPolicy::AUTOMATIC, + WaitableEvent::InitialState::NOT_SIGNALED); + + auto task_runner = test::CreateTaskRunnerWithExecutionMode( + worker_pool_.get(), GetParam().execution_mode); + + // Wait until the task runner is up and running to make sure the test below is + // solely timing the delayed task, not bringing up a physical thread. + task_runner->PostTask( + FROM_HERE, BindOnce(&WaitableEvent::Signal, Unretained(&task_ran))); + task_ran.Wait(); + ASSERT_TRUE(!task_ran.IsSignaled()); // Post a task with a short delay. - WaitableEvent task_ran(WaitableEvent::ResetPolicy::MANUAL, - WaitableEvent::InitialState::NOT_SIGNALED); - EXPECT_TRUE(test::CreateTaskRunnerWithExecutionMode(worker_pool_.get(), - GetParam().execution_mode) - ->PostDelayedTask( - FROM_HERE, - BindOnce(&WaitableEvent::Signal, Unretained(&task_ran)), - TestTimeouts::tiny_timeout())); + TimeTicks start_time = TimeTicks::Now(); + EXPECT_TRUE(task_runner->PostDelayedTask( + FROM_HERE, BindOnce(&WaitableEvent::Signal, Unretained(&task_ran)), + TestTimeouts::tiny_timeout())); // Wait until the task runs. task_ran.Wait(); - // Expect the task to run after its delay expires, but not more than 250 ms - // after that. + // Expect the task to run after its delay expires, but no more than 250 + // ms after that. const TimeDelta actual_delay = TimeTicks::Now() - start_time; EXPECT_GE(actual_delay, TestTimeouts::tiny_timeout()); EXPECT_LT(actual_delay,
diff --git a/build/android/lint/suppressions.xml b/build/android/lint/suppressions.xml index 3908242..e1ef41d9 100644 --- a/build/android/lint/suppressions.xml +++ b/build/android/lint/suppressions.xml
@@ -57,8 +57,6 @@ <ignore regexp="clank"/> <ignore regexp="com/android/tv"/> <ignore regexp="org/chromium/chrome/browser/payments/PaymentRequestMetricsTest.class"/> - <ignore regexp="org/chromium/chrome/browser/preferences/website/UsbChooserPreferences"/> - <ignore regexp="org/chromium/chrome/browser/preferences/website/UsbDevicePreferences"/> <ignore regexp="third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/contrib/AndroidListenerState.java"/> </issue> <!-- TODO(crbug.com/635567): Fix this properly. -->
diff --git a/build/android/play_services/config.json b/build/android/play_services/config.json index 33f79dd..656919d 100644 --- a/build/android/play_services/config.json +++ b/build/android/play_services/config.json
@@ -8,7 +8,6 @@ "play-services-gcm", "play-services-iid", "play-services-location", - "play-services-nearby", "play-services-tasks", "play-services-vision", "play-services-vision-common"
diff --git a/build/check_gn_headers_whitelist.txt b/build/check_gn_headers_whitelist.txt index 21b5f34d..be45dbe 100644 --- a/build/check_gn_headers_whitelist.txt +++ b/build/check_gn_headers_whitelist.txt
@@ -186,7 +186,6 @@ media/formats/mpeg/mpeg1_audio_stream_parser.h media/formats/mpeg/mpeg_audio_stream_parser_base.h media/gpu/media_gpu_export.h -mojo/common/mojo_common_export.h mojo/edk/system/broker_messages.h mojo/edk/system/system_impl_export.h mojo/public/cpp/bindings/strong_associated_binding_set.h
diff --git a/build/config/fuchsia/rules.gni b/build/config/fuchsia/rules.gni index 7c369be..d307195 100644 --- a/build/config/fuchsia/rules.gni +++ b/build/config/fuchsia/rules.gni
@@ -12,93 +12,11 @@ blobstore_qcow_path = "$root_out_dir/fvm.blk.qcow2" template("generate_runner_script") { - # This runtime_deps file is used at runtime and thus cannot go in - # target_gen_dir. - _runtime_deps_target = "${target_name}__deps" - _runtime_deps_file = - "$root_out_dir/gen.runtime/" + - get_label_info(invoker.root_target_name, "dir") + "/" + - get_label_info(invoker.root_target_name, "name") + ".runtime_deps" _pkg_dir = "$root_out_dir/gen/" + get_label_info(invoker.package_name, "dir") _manifest_path = "$_pkg_dir/${invoker.package_name}.archive_manifest" _package_path = "$_pkg_dir/${invoker.package_name}.far" - _runner_target = "${target_name}_script" - _legacy_runner_target = "${target_name}_legacy_script" - group(_runtime_deps_target) { - forward_variables_from(invoker, - [ - "deps", - "testonly", - ]) - data_deps = deps - write_runtime_deps = _runtime_deps_file - } - - # Build both types of runner scripts until the legacy scripts can be removed. - # TODO(crbug.com/805057): delete legacy runner scripts. - group(target_name) { - forward_variables_from(invoker, [ "testonly" ]) - data_deps = [ - ":${_legacy_runner_target}", - ] - data_deps += [ ":${_runner_target}" ] - } - - action(_legacy_runner_target) { - forward_variables_from(invoker, - [ - "deps", - "runner_script", - "target", - "testonly", - ]) - - script = "//build/fuchsia/create_runner_script.py" - depfile = "$target_gen_dir/$target_name.d" - - outputs = [ - invoker.generated_script, - ] - - data = [ - invoker.generated_script, - "//build/fuchsia/", - "//build/util/lib/", - "${fuchsia_sdk}/", - _runtime_deps_file, - ] - data_deps = [ - "//testing/buildbot/filters:fuchsia_filters", - ] - - # Arguments used at build time by the runner script generator. - args = [ - "--depfile", - rebase_path(depfile, root_build_dir), - "--script-output-path", - rebase_path(invoker.generated_script, root_build_dir), - "--exe-name", - rebase_path(invoker.exe_path, root_build_dir), - ] - - # Arguments used at runtime by the test runner. - if (defined(invoker.use_test_server) && invoker.use_test_server) { - args += [ "--enable-test-server" ] - } - args += [ - "--runner-script", - runner_script, - "--output-directory", - rebase_path(root_build_dir, root_build_dir), - "--target-cpu", - target_cpu, - "--runtime-deps-path", - rebase_path(_runtime_deps_file, root_build_dir), - ] - } - - action(_runner_target) { + action(target_name) { forward_variables_from(invoker, [ "runner_script", @@ -111,9 +29,9 @@ "//testing/buildbot/filters:fuchsia_filters", ] - _generated_script = "${invoker.generated_script}_v2" + _generated_script = "${invoker.generated_script}" - script = "//build/fuchsia/runner_v2/create_runner_script.py" + script = "//build/fuchsia/create_runner_script.py" outputs = [ _generated_script, @@ -122,7 +40,7 @@ data = [ _generated_script, _manifest_path, - "//build/fuchsia/runner_v2/", + "//build/fuchsia/", "//build/util/lib/", "${fuchsia_sdk}/", ] @@ -161,8 +79,6 @@ generate_runner_script(target_name) { testonly = true runner_script = "test_runner.py" - exe_path = invoker.exe_path - root_target_name = invoker.test_name generated_script = "$root_build_dir/bin/run_" + get_label_info(invoker.test_name, "name") forward_variables_from(invoker, "*") @@ -170,19 +86,8 @@ } # This template is used to generate a runner script for arbitrary executables -# into the build dir for Fuchsia. The template should reference an "executable" -# path using the "exe_path" attribute. -# -# Example usage: -# -# _exe_path = "$root_out_dir/foo_fuchsia" -# executable("foo") { -# sources = [ "foo_main.cc" ] -# output_name = _exe_path -# } -# fuchsia_executable_runner("foo_fuchsia") { -# exe_path = _exe_path -# } +# into the build dir for Fuchsia. The executable is specified as a target +# pass to the "exe_target" attribute. template("fuchsia_executable_runner") { forward_variables_from(invoker, [ "exe_target" ]) @@ -190,7 +95,6 @@ _gen_runner_target = "${target_name}_runner" _archive_target = "${target_name}_archive" _exe_name = get_label_info(exe_target, "name") - _exe_path = "${root_out_dir}/${_exe_name}" # Define the target dependencies as the union of the executable target # and the invoker's deps. @@ -212,9 +116,6 @@ forward_variables_from(invoker, [ "testonly" ]) runner_script = "exe_runner.py" generated_script = "$root_build_dir/bin/run_${_exe_name}" - deps = _combined_deps - exe_path = _exe_path - root_target_name = invoker.target_name package_name = _exe_name } @@ -237,9 +138,6 @@ runner_script = "archive_builder.py" generated_script = "$root_build_dir/bin/archive_" + get_label_info(exe_target, "name") - deps = _combined_deps - exe_path = _exe_path - root_target_name = invoker.target_name package_name = _exe_name } }
diff --git a/build/fuchsia/runner_v2/__init__.py b/build/fuchsia/__init__.py similarity index 100% rename from build/fuchsia/runner_v2/__init__.py rename to build/fuchsia/__init__.py
diff --git a/build/fuchsia/archive_builder.py b/build/fuchsia/archive_builder.py deleted file mode 100755 index 2592a4c..0000000 --- a/build/fuchsia/archive_builder.py +++ /dev/null
@@ -1,34 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2017 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. - -"""Packages a tar.gz archive of a binary along with its dependencies. This -contains the Chromium parts of what would normally be added to the bootfs -used to boot QEMU or a device.""" - -import argparse -import os -import sys - -from runner_common import AddCommonCommandLineArguments, BuildArchive, \ - ReadRuntimeDeps, ImageCreationData - - -def main(): - parser = argparse.ArgumentParser() - AddCommonCommandLineArguments(parser) - args, child_args = parser.parse_known_args() - - data = ImageCreationData(output_directory=args.output_directory, - exe_name=args.exe_name, - runtime_deps=ReadRuntimeDeps( - args.runtime_deps_path, args.output_directory), - target_cpu=args.target_cpu) - BuildArchive(data, '%s_archive_%s.tar.gz' % - (os.path.basename(args.exe_name), args.target_cpu)) - - -if __name__ == '__main__': - sys.exit(main())
diff --git a/build/fuchsia/runner_v2/boot_data.py b/build/fuchsia/boot_data.py similarity index 100% rename from build/fuchsia/runner_v2/boot_data.py rename to build/fuchsia/boot_data.py
diff --git a/build/fuchsia/runner_v2/common.py b/build/fuchsia/common.py similarity index 95% rename from build/fuchsia/runner_v2/common.py rename to build/fuchsia/common.py index e0e1af6e..337af3d 100644 --- a/build/fuchsia/runner_v2/common.py +++ b/build/fuchsia/common.py
@@ -5,6 +5,6 @@ import os DIR_SOURCE_ROOT = os.path.abspath( - os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir)) + os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'fuchsia-sdk', 'sdk')
diff --git a/build/fuchsia/runner_v2/common_args.py b/build/fuchsia/common_args.py similarity index 94% rename from build/fuchsia/runner_v2/common_args.py rename to build/fuchsia/common_args.py index fdd7101..e7a7305f 100644 --- a/build/fuchsia/runner_v2/common_args.py +++ b/build/fuchsia/common_args.py
@@ -26,8 +26,8 @@ help='Path to the Fuchsia package manifest file.') common_args.add_argument('--output-directory', type=os.path.realpath, required=True, - help=('Path to the directory in which build files are' - ' located (must include build type).')) + help=('Path to the directory in which build files ' + 'are located (must include build type).')) common_args.add_argument('--target-cpu', required=True, help='GN target_cpu setting for the build.') common_args.add_argument('--device', '-d', action='store_true', default=False, @@ -40,7 +40,8 @@ common_args.add_argument('--ssh-config', '-F', help='The path to the SSH configuration used for ' 'connecting to the target device.') - common_args.add_argument('--verbose', '-v', default=False, action='store_true', + common_args.add_argument('--verbose', '-v', default=False, + action='store_true', help='Show more logging information.') common_args.add_argument('--really-verbose', '-vv', default=False, action='store_true',
diff --git a/build/fuchsia/create_runner_script.py b/build/fuchsia/create_runner_script.py index a1f9f9c..d96c2cb 100755 --- a/build/fuchsia/create_runner_script.py +++ b/build/fuchsia/create_runner_script.py
@@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2017 The Chromium Authors. All rights reserved. +# Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -19,64 +19,43 @@ # # This file was generated by build/fuchsia/create_runner_script.py -import argparse import os import sys def main(): - # Redirect execution to the new scripts. - # Suppress -h/-help behavior so that we don't interfere with the help text - # output of the runner scripts. - parser = argparse.ArgumentParser(add_help=False) - parser.add_argument('--use-new-test-runner', action='store_true', - default=False, - help='Transitional flag. To be removed.') - args, unknown_args = parser.parse_known_args() + script_directory = os.path.dirname(__file__) - v2_test_path = sys.argv[0] + '_v2' - os.execv(v2_test_path, - [v2_test_path, '-vv'] + unknown_args) - return 1 + def ResolvePath(path): + \"\"\"Returns an absolute filepath given a path relative to this script. + \"\"\" + return os.path.abspath(os.path.join(script_directory, path)) + + runner_path = ResolvePath('{runner_path}') + runner_args = {runner_args} + runner_path_args = {runner_path_args} + for arg, path in runner_path_args: + runner_args.extend([arg, ResolvePath(path)]) + + os.execv(runner_path, + [runner_path] + runner_args + sys.argv[1:]) if __name__ == '__main__': sys.exit(main()) """ -def MakeDirectory(dir_path): - try: - os.makedirs(dir_path) - except OSError: - pass - - -def WriteDepfile(depfile_path, first_gn_output, inputs=None): - assert depfile_path != first_gn_output - inputs = inputs or [] - MakeDirectory(os.path.dirname(depfile_path)) - # Ninja does not support multiple outputs in depfiles. - with open(depfile_path, 'w') as depfile: - depfile.write(first_gn_output.replace(' ', '\\ ')) - depfile.write(': ') - depfile.write(' '.join(i.replace(' ', '\\ ') for i in inputs)) - depfile.write('\n') - - def main(args): parser = argparse.ArgumentParser() parser.add_argument('--runner-script', help='Name of the runner script to use.') parser.add_argument('--script-output-path', help='Output path for executable script.') - parser.add_argument('--depfile', - help='Path to the depfile. This must be specified as ' - 'the action\'s first output.') parser.add_argument('--test-runner-path', help='Path to test_runner.py (optional).') group = parser.add_argument_group('Test runner path arguments.') group.add_argument('--output-directory') - group.add_argument('--runtime-deps-path') - group.add_argument('--exe-name') + group.add_argument('--package') + group.add_argument('--package-manifest') args, runner_args = parser.parse_known_args(args) def RelativizePathToScript(path): @@ -91,22 +70,20 @@ runner_path_args.append( ('--output-directory', RelativizePathToScript(args.output_directory))) runner_path_args.append( - ('--runtime-deps-path', RelativizePathToScript(args.runtime_deps_path))) + ('--package', RelativizePathToScript(args.package))) runner_path_args.append( - ('--exe-name', RelativizePathToScript(args.exe_name))) + ('--package-manifest', RelativizePathToScript(args.package_manifest))) with open(args.script_output_path, 'w') as script: script.write(SCRIPT_TEMPLATE.format( runner_path=str(runner_path), - runner_args=str(runner_args), - runner_path_args=str(runner_path_args))) + runner_args=repr(runner_args), + runner_path_args=repr(runner_path_args))) + # Sets the mode of the generated script so that it is executable by the + # current user. os.chmod(args.script_output_path, 0750) - if args.depfile: - WriteDepfile(args.depfile, args.script_output_path, - [__file__]) - if __name__ == '__main__': sys.exit(main(sys.argv[1:]))
diff --git a/build/fuchsia/runner_v2/device_target.py b/build/fuchsia/device_target.py similarity index 100% rename from build/fuchsia/runner_v2/device_target.py rename to build/fuchsia/device_target.py
diff --git a/build/fuchsia/exe_runner.py b/build/fuchsia/exe_runner.py index 25ee738..5fa910d 100755 --- a/build/fuchsia/exe_runner.py +++ b/build/fuchsia/exe_runner.py
@@ -1,60 +1,34 @@ #!/usr/bin/env python # -# Copyright 2017 The Chromium Authors. All rights reserved. +# Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Packages a user.bootfs for a Fuchsia boot image, pulling in the runtime -dependencies of a binary, and then uses either QEMU from the Fuchsia SDK +dependencies of a test binary, and then uses either QEMU from the Fuchsia SDK to run, or starts the bootserver to allow running on a hardware device.""" import argparse -import os +import logging import sys -from runner_common import AddRunnerCommandLineArguments, BuildBootfs, \ - ImageCreationData, ReadRuntimeDeps, RunFuchsia +from common_args import AddCommonArgs, ConfigureLogging, \ + GetDeploymentTargetForArgs +from run_package import RunPackage def main(): parser = argparse.ArgumentParser() - AddRunnerCommandLineArguments(parser) - parser.add_argument('--extra-file', action='append', default=[], - help='Extra file to add to bootfs, ' - '<bootfs_path>=<local_path>') - parser.add_argument('--no-autorun', action='store_true', - help='Disable generating an autorun file') - parser.add_argument('--forward-ssh-port', action='store', - help='Forward specified host port to SSH.') - args, child_args = parser.parse_known_args() + AddCommonArgs(parser) + parser.add_argument('child_args', nargs='*', + help='Arguments for the test process.') + args = parser.parse_args() + ConfigureLogging(args) - runtime_deps = ReadRuntimeDeps(args.runtime_deps_path, args.output_directory) - for extra_file in args.extra_file: - parts = extra_file.split("=", 1) - if len(parts) < 2: - print 'Invalid --extra-file: ', extra_file - print 'Expected format: --extra-file <bootfs_path>=<local_path>' - return 2 - runtime_deps.append(tuple(parts)) - - image_creation_data = ImageCreationData( - output_directory=args.output_directory, - exe_name=args.exe_name, - runtime_deps=runtime_deps, - target_cpu=args.target_cpu, - dry_run=args.dry_run, - child_args=child_args, - use_device=args.device, - bootdata=args.bootdata, - wait_for_network=True, - use_autorun=not args.no_autorun) - bootfs = BuildBootfs(image_creation_data) - if not bootfs: - return 2 - - return RunFuchsia(bootfs, args.device, args.kernel, args.dry_run, - forward_ssh_port=args.forward_ssh_port, - vm_cpu_cores=args.vm_cpu_cores) + with GetDeploymentTargetForArgs(args) as target: + target.Start() + return RunPackage(args.output_directory, target, args.package, + args.package_name, args.child_args, args.package_manifest) if __name__ == '__main__':
diff --git a/build/fuchsia/runner_v2/net_test_server.py b/build/fuchsia/net_test_server.py similarity index 99% rename from build/fuchsia/runner_v2/net_test_server.py rename to build/fuchsia/net_test_server.py index 2db4978..2849c44 100644 --- a/build/fuchsia/runner_v2/net_test_server.py +++ b/build/fuchsia/net_test_server.py
@@ -14,7 +14,7 @@ import time DIR_SOURCE_ROOT = os.path.abspath( - os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir)) + os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) sys.path.append(os.path.join(DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common')) import chrome_test_server_spawner
diff --git a/build/fuchsia/runner_v2/qemu_target.py b/build/fuchsia/qemu_target.py similarity index 100% rename from build/fuchsia/runner_v2/qemu_target.py rename to build/fuchsia/qemu_target.py
diff --git a/build/fuchsia/runner_v2/qemu_target_test.py b/build/fuchsia/qemu_target_test.py similarity index 100% rename from build/fuchsia/runner_v2/qemu_target_test.py rename to build/fuchsia/qemu_target_test.py
diff --git a/build/fuchsia/runner_v2/remote_cmd.py b/build/fuchsia/remote_cmd.py similarity index 100% rename from build/fuchsia/runner_v2/remote_cmd.py rename to build/fuchsia/remote_cmd.py
diff --git a/build/fuchsia/runner_v2/run_package.py b/build/fuchsia/run_package.py similarity index 100% rename from build/fuchsia/runner_v2/run_package.py rename to build/fuchsia/run_package.py
diff --git a/build/fuchsia/runner_common.py b/build/fuchsia/runner_common.py deleted file mode 100755 index 3188d3b10..0000000 --- a/build/fuchsia/runner_common.py +++ /dev/null
@@ -1,757 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2017 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. - -"""Packages a user.bootfs for a Fuchsia boot image, pulling in the runtime -dependencies of a binary, and then uses either QEMU from the Fuchsia SDK -to run, or starts the bootserver to allow running on a hardware device.""" - -import argparse -import os -import platform -import re -import shutil -import signal -import subprocess -import sys -import tarfile -import time -import uuid - - -DIR_SOURCE_ROOT = os.path.abspath( - os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) -SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'fuchsia-sdk', 'sdk') - -# The guest will get 192.168.3.9 from DHCP, while the host will be -# accessible as 192.168.3.2 . -GUEST_NET = '192.168.3.0/24' -GUEST_IP_ADDRESS = '192.168.3.9' -HOST_IP_ADDRESS = '192.168.3.2' -GUEST_MAC_ADDRESS = '52:54:00:63:5e:7b' - -# A string used to uniquely identify this invocation of Fuchsia. -INSTANCE_ID = str(uuid.uuid1()) - -# Signals to the host that the the remote binary has finished executing. -# The UUID reduces the likelihood of the remote end generating the signal -# by coincidence. -ALL_DONE_MESSAGE = '*** RUN FINISHED: %s' % INSTANCE_ID - - -def _RunAndCheck(dry_run, args): - if dry_run: - print 'Run:', ' '.join(args) - return 0 - - try: - subprocess.check_call(args) - return 0 - except subprocess.CalledProcessError as e: - return e.returncode - finally: - sys.stdout.flush() - sys.stderr.flush() - - -def _IsRunningOnBot(): - return int(os.environ.get('CHROME_HEADLESS', 0)) != 0 - - -def _DumpFile(dry_run, name, description): - """Prints out the contents of |name| if |dry_run|.""" - if not dry_run: - return - print - print 'Contents of %s (for %s)' % (name, description) - print '-' * 80 - with open(name) as f: - sys.stdout.write(f.read()) - print '-' * 80 - - -def _MakeTargetImageName(common_prefix, output_directory, location): - """Generates the relative path name to be used in the file system image. - common_prefix: a prefix of both output_directory and location that - be removed. - output_directory: an optional prefix on location that will also be removed. - location: the file path to relativize. - - .so files will be stored into the lib subdirectory to be able to be found by - default by the loader. - - Examples: - - >>> _MakeTargetImageName(common_prefix='/work/cr/src', - ... output_directory='/work/cr/src/out/fuch', - ... location='/work/cr/src/base/test/data/xyz.json') - 'base/test/data/xyz.json' - - >>> _MakeTargetImageName(common_prefix='/work/cr/src', - ... output_directory='/work/cr/src/out/fuch', - ... location='/work/cr/src/out/fuch/icudtl.dat') - 'icudtl.dat' - - >>> _MakeTargetImageName(common_prefix='/work/cr/src', - ... output_directory='/work/cr/src/out/fuch', - ... location='/work/cr/src/out/fuch/libbase.so') - 'lib/libbase.so' - """ - if not common_prefix.endswith(os.sep): - common_prefix += os.sep - assert output_directory.startswith(common_prefix) - output_dir_no_common_prefix = output_directory[len(common_prefix):] - assert location.startswith(common_prefix) - loc = location[len(common_prefix):] - if loc.startswith(output_dir_no_common_prefix): - loc = loc[len(output_dir_no_common_prefix)+1:] - - if loc.startswith('lib.unstripped'): - # TODO(fuchsia): The requirements for finding/loading .so are in flux, so this - # ought to be reconsidered at some point. See https://crbug.com/732897. - loc = 'lib/' + loc[len('lib.unstripped') + 1:] - - if loc.startswith('exe.unstripped'): - # TODO(fuchsia): The requirements for finding/loading .so are in flux, so this - # ought to be reconsidered at some point. See https://crbug.com/732897. - loc = loc[len('lib.unstripped') + 1:] - - return loc - - -def _ExpandDirectories(file_mapping, mapper): - """Walks directories listed in |file_mapping| and adds their contents to - |file_mapping|, using |mapper| to determine the target filename. - """ - expanded = {} - for target, source in file_mapping.items(): - if os.path.isdir(source): - files = [os.path.join(dir_path, filename) - for dir_path, dir_names, file_names in os.walk(source) - for filename in file_names] - for f in files: - expanded[mapper(f)] = f - elif os.path.exists(source): - expanded[target] = source - else: - raise Exception('%s does not exist' % source) - return expanded - - -def _GetSymbolsMapping(dry_run, file_mapping): - """Generates symbols mapping from |file_mapping| by filtering out all files - that are not ELF binaries.""" - symbols_mapping = {} - for target, source in file_mapping.iteritems(): - with open(source, 'rb') as f: - file_tag = f.read(4) - if file_tag != '\x7fELF': - continue - - symbols_mapping[os.path.basename(target)] = source - symbols_mapping[target] = source - - if dry_run: - for target, path in symbols_mapping.iteritems(): - print 'Symbols:', target, '->', path - - return symbols_mapping - - -def _WriteManifest(manifest_file, file_mapping): - """Writes |file_mapping| to the given |manifest_file| (a file object) in a - form suitable for consumption by mkbootfs.""" - for target, source in file_mapping.viewitems(): - manifest_file.write('%s=%s\n' % (target, source)) - - -def ReadRuntimeDeps(deps_path, output_directory): - result = [] - for f in open(deps_path): - abs_path = os.path.abspath(os.path.join(output_directory, f.strip())); - target_path = \ - _MakeTargetImageName(DIR_SOURCE_ROOT, output_directory, abs_path) - result.append((target_path, abs_path)) - return result - - -def _TargetCpuToArch(target_cpu): - """Returns the Fuchsia SDK architecture name for the |target_cpu|.""" - if target_cpu == 'arm64': - return 'aarch64' - elif target_cpu == 'x64': - return 'x86_64' - raise Exception('Unknown target_cpu:' + target_cpu) - - -def _TargetCpuToSdkBinPath(target_cpu): - """Returns the path to the kernel & bootfs .bin files for |target_cpu|.""" - return os.path.join(SDK_ROOT, 'target', _TargetCpuToArch(target_cpu)) - - -def AddCommonCommandLineArguments(parser): - """Adds command line arguments used by all the helper scripts to an - argparse.ArgumentParser object.""" - parser.add_argument('--exe-name', - type=os.path.realpath, - help='Name of the the binary executable.') - parser.add_argument('--output-directory', - type=os.path.realpath, - help=('Path to the directory in which build files are' - ' located (must include build type).')) - parser.add_argument('--runtime-deps-path', - type=os.path.realpath, - help='Runtime data dependency file from GN.') - parser.add_argument('--target-cpu', - help='GN target_cpu setting for the build.') - - -def AddRunnerCommandLineArguments(parser): - """Adds command line arguments used by the runner scripts to an - argparse.ArgumentParser object. Includes all the arguments added by - AddCommonCommandLineArguments().""" - AddCommonCommandLineArguments(parser) - parser.add_argument('--bootdata', type=os.path.realpath, - help='Path to a bootdata to use instead of the default ' - 'one from the SDK') - parser.add_argument('--device', '-d', action='store_true', default=False, - help='Run on hardware device instead of QEMU.') - parser.add_argument('--vm-cpu-cores', type=int, default=4, - help='Sets the number of CPU cores to provide if ' - 'launching in a VM with QEMU.') - parser.add_argument('--dry-run', '-n', action='store_true', default=False, - help='Just print commands, don\'t execute them.') - parser.add_argument('--kernel', type=os.path.realpath, - help='Path to a kernel to use instead of the default ' - 'one from the SDK') - parser.add_argument('--wait-for-network', action='store_true', default=False, - help='Wait for network connectivity before executing ' - 'the test binary.') - - -class ImageCreationData(object): - """Grabbag of data needed to build bootfs or archive of binary's dependencies. - - output_directory: Path to the directory in which the build files are located. - exe_name: The name of the binary executable. - runtime_deps: A list of file paths on which the given binary depends. This is - generated by GN, and that file can be read by ReadRuntimeDeps(). - target_cpu: 'arm64' or 'x64'. - dry_run: Print the commands that would be run, but don't execute them. - child_args: Arguments to pass to the child process when run on the target by - the autorun script. - use_device: Run on device if true, otherwise on QEMU. Also affects timeouts. - bootdata: Path to a custom bootdata to use, rather than the default one from - the SDK. - summary_output: Use --test-launcher-summary-output when running to extra - test results to this file. - shutdown_machine: Reboot or shutdown the machine on completion when using - autorun. - wait_for_network: Block at startup until a successful ping to google.com - before running the target binary. - use_autorun: Create and set up an autorun script that runs the target binary. - """ - def __init__(self, output_directory, exe_name, runtime_deps, target_cpu, - dry_run=False, child_args=[], use_device=False, bootdata=None, - summary_output=None, shutdown_machine=False, - wait_for_network=False, use_autorun=False): - self.output_directory = output_directory - self.exe_name = exe_name - self.runtime_deps = runtime_deps - self.target_cpu = target_cpu - self.dry_run = dry_run - self.child_args = child_args - self.use_device = use_device - self.bootdata = bootdata - self.summary_output = summary_output - self.shutdown_machine = shutdown_machine - self.wait_for_network = wait_for_network - self.use_autorun = use_autorun - - -class BootfsData(object): - """Results from BuildBootfs(). - - bootfs: Local path to .bootfs image file. - symbols_mapping: A dict mapping executables to their unstripped originals. - target_cpu: GN's target_cpu setting for the image. - has_autorun: Whether an autorun file was written for /system/cr_autorun. - """ - def __init__(self, bootfs_name, symbols_mapping, target_cpu, has_autorun): - self.bootfs = bootfs_name - self.symbols_mapping = symbols_mapping - self.target_cpu = target_cpu - self.has_autorun = has_autorun - - -def WriteAutorun(bin_name, child_args, summary_output, shutdown_machine, - wait_for_network, dry_run, use_device, file_mapping): - # Generate a script that runs the binaries and shuts down QEMU (if used). - autorun_file = open(bin_name + '.bootfs_autorun', 'w') - autorun_file.write('#!/boot/bin/sh\n') - - if _IsRunningOnBot(): - # TODO(scottmg): Passed through for https://crbug.com/755282. - autorun_file.write('export CHROME_HEADLESS=1\n') - - if wait_for_network: - # Quietly block until `ping -c 0 google.com` succeeds. With -c 0 ping - # resolves the domain name, but doesn't send any pings. - autorun_file.write("echo Waiting for network connectivity...\n" + - "until ping -c 0 google.com >/dev/null 2>&1\n" + - "do sleep 1; done\n") - - if summary_output: - # Unfortunately, devmgr races with this autorun script. This delays long - # enough so that the block device is discovered before we try to mount it. - # See https://crbug.com/789473. - autorun_file.write('msleep 5000\n') - autorun_file.write('mkdir /volume/results\n') - autorun_file.write('mount /dev/class/block/000 /volume/results\n') - child_args.append('--test-launcher-summary-output=' - '/volume/results/output.json') - - autorun_file.write('echo Executing ' + os.path.basename(bin_name) + ' ' + - ' '.join(child_args) + '\n') - - # Due to Fuchsia's object name length limit being small, we cd into /system - # and set PATH to "." to reduce the length of the main executable path. - autorun_file.write('cd /system\n') - autorun_file.write('PATH=. ' + os.path.basename(bin_name)) - for arg in child_args: - autorun_file.write(' "%s"' % arg); - autorun_file.write('\n') - - if shutdown_machine: - autorun_file.write('echo Shutting down...\n') - - # Sleep 1 second to let test outputs get flushed to the console. - autorun_file.write('msleep 1000\n') - - if use_device: - autorun_file.write('dm reboot\n') - else: - autorun_file.write('dm poweroff\n') - - autorun_file.write('echo \"%s\"\n' % ALL_DONE_MESSAGE) - - autorun_file.flush() - os.chmod(autorun_file.name, 0750) - _DumpFile(dry_run, autorun_file.name, 'cr_autorun') - - # Add the autorun file, logger file, and target binary to |file_mapping|. - file_mapping['cr_autorun'] = autorun_file.name - file_mapping[os.path.basename(bin_name)] = bin_name - -def _ConfigureSSH(output_dir): - """Gets the public/private keypair to use for connecting to Fuchsia's SSH - services. Generates a new keypair if one doesn't already exist. - - output_dir: The build directory which will contain the generated keys. - Returns: a tuple (private_key_path, public_key_path).""" - - if not os.path.exists(output_dir): - os.makedirs(output_dir) - - host_key_path = output_dir + '/ssh_key' - host_pubkey_path = host_key_path + '.pub' - id_key_path = output_dir + '/id_ed25519' - id_pubkey_path = id_key_path + '.pub' - - if not os.path.isfile(host_key_path): - subprocess.check_call(['ssh-keygen', '-t', 'ed25519', '-h', '-f', - host_key_path, '-P', '', '-N', ''], - stdout=open(os.devnull)) - if not os.path.isfile(id_key_path): - subprocess.check_call(['ssh-keygen', '-t', 'ed25519', '-f', id_key_path, - '-P', '', '-N', ''], stdout=open(os.devnull)) - - print 'SSH private key location: ' + id_key_path - return [ - ('data/ssh/ssh_host_ed25519_key', host_key_path), - ('data/ssh/ssh_host_ed25519_key.pub', host_pubkey_path), - ('data/ssh/authorized_keys', id_pubkey_path) - ] - - -def _BuildBootfsManifest(image_creation_data): - icd = image_creation_data - - icd.runtime_deps.extend(_ConfigureSSH(icd.output_directory + '/gen')) - - # |runtime_deps| already contains (target, source) pairs for the runtime deps, - # so we can initialize |file_mapping| from it directly. - file_mapping = dict(icd.runtime_deps) - - if icd.use_autorun: - WriteAutorun(icd.exe_name, icd.child_args, icd.summary_output, - icd.shutdown_machine, icd.wait_for_network, icd.dry_run, - icd.use_device, file_mapping) - - # Find the full list of files to add to the bootfs. - file_mapping = _ExpandDirectories( - file_mapping, - lambda x: _MakeTargetImageName(DIR_SOURCE_ROOT, icd.output_directory, x)) - - # Determine the locations of unstripped versions of each binary, if any. - symbols_mapping = _GetSymbolsMapping(icd.dry_run, file_mapping) - - return file_mapping, symbols_mapping - - -def BuildBootfs(image_creation_data): - file_mapping, symbols_mapping = _BuildBootfsManifest(image_creation_data) - - # Write the target, source mappings to a file suitable for bootfs. - manifest_file = open(image_creation_data.exe_name + '.bootfs_manifest', 'w') - _WriteManifest(manifest_file, file_mapping) - manifest_file.flush() - _DumpFile(image_creation_data.dry_run, manifest_file.name, 'manifest') - - # Run mkbootfs with the manifest to copy the necessary files into the bootfs. - mkbootfs_path = os.path.join(SDK_ROOT, 'tools', 'mkbootfs') - bootfs_name = image_creation_data.exe_name + '.bootfs' - bootdata = image_creation_data.bootdata - if not bootdata: - bootdata = os.path.join( - _TargetCpuToSdkBinPath(image_creation_data.target_cpu), 'bootdata.bin') - args = [mkbootfs_path, '-o', bootfs_name, - '--target=boot', bootdata, - '--target=system', manifest_file.name] - if _RunAndCheck(image_creation_data.dry_run, args) != 0: - return None - - return BootfsData(bootfs_name, symbols_mapping, - image_creation_data.target_cpu, - image_creation_data.use_autorun) - - -def BuildArchive(image_creation_data, output_name): - """Creates an archive (.tar.gz) of the given binary and its dependencies, - storing them into output_name.""" - file_mapping, symbols_mapping = _BuildBootfsManifest(image_creation_data) - - print 'Archiving to', output_name - tar = tarfile.open(output_name, 'w:gz') - for archive_name, source_name in file_mapping.iteritems(): - tar.add(source_name, '/system/' + archive_name, recursive=False) - - -def _SymbolizeEntries(entries): - filename_re = re.compile(r'at ([-._a-zA-Z0-9/+]+):(\d+)') - - # Use addr2line to symbolize all the |pc_offset|s in |entries| in one go. - # Entries with no |debug_binary| are also processed here, so that we get - # consistent output in that case, with the cannot-symbolize case. - addr2line_output = None - if entries[0].has_key('debug_binary'): - addr2line_args = (['addr2line', '-Cipf', '-p', - '--exe=' + entries[0]['debug_binary']] + - map(lambda entry: entry['pc_offset'], entries)) - addr2line_output = subprocess.check_output(addr2line_args).splitlines() - assert addr2line_output - - # Collate a set of |(frame_id, result)| pairs from the output lines. - results = {} - for entry in entries: - raw, frame_id = entry['raw'], entry['frame_id'] - prefix = '#%s: ' % frame_id - - if not addr2line_output: - # Either there was no addr2line output, or too little of it. - filtered_line = raw - else: - output_line = addr2line_output.pop(0) - - # Relativize path to DIR_SOURCE_ROOT if we see a filename. - def RelativizePath(m): - relpath = os.path.relpath(os.path.normpath(m.group(1)), DIR_SOURCE_ROOT) - return 'at ' + relpath + ':' + m.group(2) - filtered_line = filename_re.sub(RelativizePath, output_line) - - if '??' in filtered_line.split(): - # If symbolization fails just output the raw backtrace. - filtered_line = raw - else: - # Release builds may inline things, resulting in "(inlined by)" lines. - inlined_by_prefix = " (inlined by)" - while (addr2line_output and - addr2line_output[0].startswith(inlined_by_prefix)): - inlined_by_line = '\n' + (' ' * len(prefix)) + addr2line_output.pop(0) - filtered_line += filename_re.sub(RelativizePath, inlined_by_line) - - results[entry['frame_id']] = prefix + filtered_line - - return results - - -def _LookupDebugBinary(entry, symbols_mapping): - """Looks up the binary listed in |entry| in the |symbols_mapping|, and returns - the corresponding host-side binary's filename, or None.""" - binary = entry['binary'] - if not binary: - return None - - app_prefix = 'app:' - if binary.startswith(app_prefix): - binary = binary[len(app_prefix):] - - # We change directory into /system/ before running the target executable, so - # all paths are relative to "/system/", and will typically start with "./". - # Some crashes still uses the full filesystem path, so cope with that as well. - system_prefix = '/system/' - cwd_prefix = './' - if binary.startswith(cwd_prefix): - binary = binary[len(cwd_prefix):] - elif binary.startswith(system_prefix): - binary = binary[len(system_prefix):] - # Allow any other paths to pass-through; sometimes neither prefix is present. - - if binary in symbols_mapping: - return symbols_mapping[binary] - - # |binary| may be truncated by the crashlogger, so if there is a unique - # match for the truncated name in |symbols_mapping|, use that instead. - matches = filter(lambda x: x.startswith(binary), symbols_mapping.keys()) - if len(matches) == 1: - return symbols_mapping[matches[0]] - - return None - - -def _SymbolizeBacktrace(backtrace, symbols_mapping): - # Group |backtrace| entries according to the associated binary, and locate - # the path to the debug symbols for that binary, if any. - batches = {} - - for entry in backtrace: - debug_binary = _LookupDebugBinary(entry, symbols_mapping) - if debug_binary: - entry['debug_binary'] = debug_binary - batches.setdefault(debug_binary, []).append(entry) - - # Run _SymbolizeEntries on each batch and collate the results. - symbolized = {} - for batch in batches.itervalues(): - symbolized.update(_SymbolizeEntries(batch)) - - # Map each backtrace to its symbolized form, by frame-id, and return the list. - return map(lambda entry: symbolized[entry['frame_id']], backtrace) - - -def _GetResultsFromImg(dry_run, test_launcher_summary_output): - """Extract the results .json out of the .minfs image.""" - if os.path.exists(test_launcher_summary_output): - os.unlink(test_launcher_summary_output) - img_filename = test_launcher_summary_output + '.minfs' - _RunAndCheck(dry_run, [os.path.join(SDK_ROOT, 'tools', 'minfs'), img_filename, - 'cp', '::/output.json', test_launcher_summary_output]) - - -def _HandleOutputFromProcess(process, symbols_mapping): - # Set up backtrace-parsing regexps. - fuch_prefix = re.compile(r'^.*> ') - backtrace_prefix = re.compile(r'bt#(?P<frame_id>\d+): ') - - # Back-trace line matcher/parser assumes that 'pc' is always present, and - # expects that 'sp' and ('binary','pc_offset') may also be provided. - backtrace_entry = re.compile( - r'pc 0(?:x[0-9a-f]+)?' + - r'(?: sp 0x[0-9a-f]+)?' + - r'(?: \((?P<binary>\S+),(?P<pc_offset>0x[0-9a-f]+)\))?$') - - # A buffer of backtrace entries awaiting symbolization, stored as dicts: - # raw: The original back-trace line that followed the prefix. - # frame_id: backtrace frame number (starting at 0). - # binary: path to executable code corresponding to the current frame. - # pc_offset: memory offset within the executable. - backtrace_entries = [] - - # Continue processing until we receive the ALL_DONE_MESSAGE or we read EOF, - # whichever happens first. - success = False - while True: - line = process.stdout.readline().strip() - if not line: - break - - if 'SUCCESS: all tests passed.' in line: - success = True - elif ALL_DONE_MESSAGE in line: - break - - # If the line is not from Fuchsia then don't try to process it. - matched = fuch_prefix.match(line) - if not matched: - print line - continue - guest_line = line[matched.end():] - - # Look for the back-trace prefix, otherwise just print the line. - matched = backtrace_prefix.match(guest_line) - if not matched: - print line - continue - backtrace_line = guest_line[matched.end():] - - # If this was the end of a back-trace then symbolize and print it. - frame_id = matched.group('frame_id') - if backtrace_line == 'end': - if backtrace_entries: - for processed in _SymbolizeBacktrace(backtrace_entries, - symbols_mapping): - print processed - backtrace_entries = [] - continue - - # Otherwise, parse the program-counter offset, etc into |backtrace_entries|. - matched = backtrace_entry.match(backtrace_line) - if matched: - # |binary| and |pc_offset| will be None if not present. - backtrace_entries.append( - {'raw': backtrace_line, 'frame_id': frame_id, - 'binary': matched.group('binary'), - 'pc_offset': matched.group('pc_offset')}) - else: - backtrace_entries.append( - {'raw': backtrace_line, 'frame_id': frame_id, - 'binary': None, 'pc_offset': None}) - - return success - - -def RunFuchsia(bootfs_data, use_device, kernel_path, dry_run, - test_launcher_summary_output=None, forward_ssh_port=None, - vm_cpu_cores=4): - if not kernel_path: - # TODO(wez): Parameterize this on the |target_cpu| from GN. - kernel_path = os.path.join(_TargetCpuToSdkBinPath(bootfs_data.target_cpu), - 'zircon.bin') - - kernel_args = [ - 'devmgr.epoch=%d' % time.time(), - 'zircon.nodename=' + INSTANCE_ID, - - # TERM=dumb tells the guest OS to not emit ANSI commands that trigger - # noisy ANSI spew from the user's terminal emulator. - 'TERM=dumb', - - # Enable logging to the serial port. - 'kernel.serial=legacy' - ] - - if bootfs_data.has_autorun: - # See https://fuchsia.googlesource.com/zircon/+/master/docs/kernel_cmdline.md#zircon_autorun_system_command. - kernel_args.append('zircon.autorun.system=/boot/bin/sh+/system/cr_autorun') - - if use_device: - if test_launcher_summary_output: - sys.stderr.write("--test-launcher-summary-output when running " + - "on a device.\n") - return 1 - - if forward_ssh_port: - sys.stderr.write("--forward-ssh-port is not supported when running " + - "on a device.\n") - return 1 - - # Deploy the boot image to the device. - bootserver_path = os.path.join(SDK_ROOT, 'tools', 'bootserver') - bootserver_command = [bootserver_path, '-1', kernel_path, - bootfs_data.bootfs, '--'] + kernel_args - _RunAndCheck(dry_run, bootserver_command) - - # Start listening for logging lines. - process = subprocess.Popen( - [os.path.join(SDK_ROOT, 'tools', 'loglistener'), INSTANCE_ID], - stdout=subprocess.PIPE, stdin=open(os.devnull)) - else: - qemu_path = os.path.join( - SDK_ROOT, 'qemu', 'bin', - 'qemu-system-' + _TargetCpuToArch(bootfs_data.target_cpu)) - qemu_command = [qemu_path, - '-m', '2048', - '-nographic', - '-kernel', kernel_path, - '-initrd', bootfs_data.bootfs, - '-smp', str(vm_cpu_cores), - - # Use stdio for the guest OS only; don't attach the QEMU interactive - # monitor. - '-serial', 'stdio', - '-monitor', 'none', - - '-append', ' '.join(kernel_args) - ] - - # Configure the machine & CPU to emulate, based on the target architecture. - # Enable lightweight virtualization (KVM) if the host and guest OS run on - # the same architecture. - if bootfs_data.target_cpu == 'arm64': - qemu_command.extend([ - '-machine','virt', - '-cpu', 'cortex-a53', - ]) - netdev_type = 'virtio-net-pci' - if platform.machine() == 'aarch64': - qemu_command.append('-enable-kvm') - else: - qemu_command.extend([ - '-machine', 'q35', - '-cpu', 'host,migratable=no', - ]) - netdev_type = 'e1000' - if platform.machine() == 'x86_64': - qemu_command.append('-enable-kvm') - - # Configure virtual network. It is used in the tests to connect to - # testserver running on the host. - netdev_config = 'user,id=net0,net=%s,dhcpstart=%s,host=%s' % \ - (GUEST_NET, GUEST_IP_ADDRESS, HOST_IP_ADDRESS) - if forward_ssh_port: - netdev_config += ",hostfwd=tcp::%s-:22" % forward_ssh_port - qemu_command.extend([ - '-netdev', netdev_config, - '-device', '%s,netdev=net0,mac=%s' % (netdev_type, GUEST_MAC_ADDRESS), - ]) - - if test_launcher_summary_output: - # Make and mount a 100M minfs formatted image that is used to copy the - # results json to, for extraction from the target. - img_filename = test_launcher_summary_output + '.minfs' - _RunAndCheck(dry_run, ['truncate', '-s100M', img_filename,]) - _RunAndCheck(dry_run, [os.path.join(SDK_ROOT, 'tools', 'minfs'), - img_filename, 'mkfs']) - # Specifically set an AHCI drive, otherwise the drive won't be mountable - # on ARM64. - qemu_command.extend(['-drive', 'file=' + img_filename + - ',if=none,format=raw,id=resultsdisk', - '-device', 'ahci,id=ahci', - '-device', 'ide-drive,drive=resultsdisk,bus=ahci.0']) - - if dry_run: - print 'Run:', ' '.join(qemu_command) - return 0 - - # We pass a separate stdin stream to qemu. Sharing stdin across processes - # leads to flakiness due to the OS prematurely killing the stream and the - # Python script panicking and aborting. - # The precise root cause is still nebulous, but this fix works. - # See crbug.com/741194. - process = subprocess.Popen( - qemu_command, stdout=subprocess.PIPE) - - success = _HandleOutputFromProcess(process, - bootfs_data.symbols_mapping) - - if not use_device: - process.wait() - - sys.stdout.flush() - - if test_launcher_summary_output: - _GetResultsFromImg(dry_run, test_launcher_summary_output) - - return 0 if success else 1
diff --git a/build/fuchsia/runner_v2/create_runner_script.py b/build/fuchsia/runner_v2/create_runner_script.py deleted file mode 100755 index 80fd16d..0000000 --- a/build/fuchsia/runner_v2/create_runner_script.py +++ /dev/null
@@ -1,89 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2018 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Creates a script to run a Fushsia executable by delegating to -build/fuchsia/(exe|test)_runner.py. -""" - -import argparse -import os -import re -import sys - - -SCRIPT_TEMPLATE = """\ -#!/usr/bin/env python -# -# This file was generated by build/fuchsia/runner_v2/create_runner_script.py - -import os -import sys - -def main(): - script_directory = os.path.dirname(__file__) - - def ResolvePath(path): - \"\"\"Returns an absolute filepath given a path relative to this script. - \"\"\" - return os.path.abspath(os.path.join(script_directory, path)) - - runner_path = ResolvePath('{runner_path}') - runner_args = {runner_args} - runner_path_args = {runner_path_args} - for arg, path in runner_path_args: - runner_args.extend([arg, ResolvePath(path)]) - - os.execv(runner_path, - [runner_path] + runner_args + sys.argv[1:]) - -if __name__ == '__main__': - sys.exit(main()) -""" - - -def main(args): - parser = argparse.ArgumentParser() - parser.add_argument('--runner-script', - help='Name of the runner script to use.') - parser.add_argument('--script-output-path', - help='Output path for executable script.') - parser.add_argument('--test-runner-path', - help='Path to test_runner.py (optional).') - group = parser.add_argument_group('Test runner path arguments.') - group.add_argument('--output-directory') - group.add_argument('--package') - group.add_argument('--package-manifest') - args, runner_args = parser.parse_known_args(args) - - def RelativizePathToScript(path): - """Returns the path relative to the output script directory.""" - return os.path.relpath(path, os.path.dirname(args.script_output_path)) - - runner_path = args.test_runner_path or os.path.join( - os.path.dirname(__file__), args.runner_script) - runner_path = RelativizePathToScript(runner_path) - - runner_path_args = [] - runner_path_args.append( - ('--output-directory', RelativizePathToScript(args.output_directory))) - runner_path_args.append( - ('--package', RelativizePathToScript(args.package))) - runner_path_args.append( - ('--package-manifest', RelativizePathToScript(args.package_manifest))) - - with open(args.script_output_path, 'w') as script: - script.write(SCRIPT_TEMPLATE.format( - runner_path=str(runner_path), - runner_args=repr(runner_args), - runner_path_args=repr(runner_path_args))) - - # Sets the mode of the generated script so that it is executable by the - # current user. - os.chmod(args.script_output_path, 0750) - - -if __name__ == '__main__': - sys.exit(main(sys.argv[1:]))
diff --git a/build/fuchsia/runner_v2/exe_runner.py b/build/fuchsia/runner_v2/exe_runner.py deleted file mode 100755 index 5fa910d..0000000 --- a/build/fuchsia/runner_v2/exe_runner.py +++ /dev/null
@@ -1,35 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2018 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Packages a user.bootfs for a Fuchsia boot image, pulling in the runtime -dependencies of a test binary, and then uses either QEMU from the Fuchsia SDK -to run, or starts the bootserver to allow running on a hardware device.""" - -import argparse -import logging -import sys - -from common_args import AddCommonArgs, ConfigureLogging, \ - GetDeploymentTargetForArgs -from run_package import RunPackage - - -def main(): - parser = argparse.ArgumentParser() - AddCommonArgs(parser) - parser.add_argument('child_args', nargs='*', - help='Arguments for the test process.') - args = parser.parse_args() - ConfigureLogging(args) - - with GetDeploymentTargetForArgs(args) as target: - target.Start() - return RunPackage(args.output_directory, target, args.package, - args.package_name, args.child_args, args.package_manifest) - - -if __name__ == '__main__': - sys.exit(main())
diff --git a/build/fuchsia/runner_v2/test_runner.py b/build/fuchsia/runner_v2/test_runner.py deleted file mode 100755 index 8ab88d6..0000000 --- a/build/fuchsia/runner_v2/test_runner.py +++ /dev/null
@@ -1,118 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2018 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Packages a user.bootfs for a Fuchsia boot image, pulling in the runtime -dependencies of a test binary, and then uses either QEMU from the Fuchsia SDK -to run, or starts the bootserver to allow running on a hardware device.""" - -import argparse -import json -import logging -import os -import socket -import subprocess -import sys -import tempfile -import time - -from common_args import AddCommonArgs, ConfigureLogging, GetDeploymentTargetForArgs -from net_test_server import SetupTestServer -from run_package import RunPackage - -DEFAULT_TEST_CONCURRENCY = 4 -TEST_RESULT_PATH = '/data/test_summary.json' -TEST_FILTER_PATH = '/data/test_filter.txt' - -def main(): - parser = argparse.ArgumentParser() - AddCommonArgs(parser) - parser.add_argument('--gtest_filter', - help='GTest filter to use in place of any default.') - parser.add_argument('--gtest_repeat', - help='GTest repeat value to use. This also disables the ' - 'test launcher timeout.') - parser.add_argument('--gtest_break_on_failure', action='store_true', - default=False, - help='Should GTest break on failure; useful with ' - '--gtest_repeat.') - parser.add_argument('--single-process-tests', action='store_true', - default=False, - help='Runs the tests and the launcher in the same ' - 'process. Useful for debugging.') - parser.add_argument('--test-launcher-batch-limit', - type=int, - help='Sets the limit of test batch to run in a single ' - 'process.') - # --test-launcher-filter-file is specified relative to --output-directory, - # so specifying type=os.path.* will break it. - parser.add_argument('--test-launcher-filter-file', - default=None, - help='Override default filter file passed to target test ' - 'process. Set an empty path to disable filtering.') - parser.add_argument('--test-launcher-jobs', - type=int, - help='Sets the number of parallel test jobs.') - parser.add_argument('--test-launcher-summary-output', - help='Where the test launcher will output its json.') - parser.add_argument('--enable-test-server', action='store_true', - default=False, - help='Enable Chrome test server spawner.') - parser.add_argument('child_args', nargs='*', - help='Arguments for the test process.') - args = parser.parse_args() - ConfigureLogging(args) - - child_args = ['--test-launcher-retry-limit=0'] - if args.single_process_tests: - child_args.append('--single-process-tests') - if args.test_launcher_batch_limit: - child_args.append('--test-launcher-batch-limit=%d' % - args.test_launcher_batch_limit) - - test_concurrency = args.test_launcher_jobs \ - if args.test_launcher_jobs else DEFAULT_TEST_CONCURRENCY - child_args.append('--test-launcher-jobs=%d' % test_concurrency) - - if args.gtest_filter: - child_args.append('--gtest_filter=' + args.gtest_filter) - if args.gtest_repeat: - child_args.append('--gtest_repeat=' + args.gtest_repeat) - child_args.append('--test-launcher-timeout=-1') - if args.gtest_break_on_failure: - child_args.append('--gtest_break_on_failure') - if args.child_args: - child_args.extend(args.child_args) - - if args.test_launcher_summary_output: - child_args.append('--test-launcher-summary-output=' + TEST_RESULT_PATH) - - with GetDeploymentTargetForArgs(args) as target: - target.Start() - - if args.test_launcher_filter_file: - target.PutFile(args.test_launcher_filter_file, TEST_FILTER_PATH) - child_args.append('--test-launcher-filter-file=' + TEST_FILTER_PATH) - - forwarder = None - if args.enable_test_server: - test_server = SetupTestServer(target, test_concurrency) - - returncode = RunPackage(args.output_directory, target, args.package, - args.package_name, child_args, - args.package_manifest) - - if forwarder: - forwarder.terminate() - forwarder.wait() - - if args.test_launcher_summary_output: - target.GetFile(TEST_RESULT_PATH, args.test_launcher_summary_output) - - return returncode - - -if __name__ == '__main__': - sys.exit(main())
diff --git a/build/fuchsia/runner_v2/symbolizer.py b/build/fuchsia/symbolizer.py similarity index 98% rename from build/fuchsia/runner_v2/symbolizer.py rename to build/fuchsia/symbolizer.py index 4764c26..55043cd 100644 --- a/build/fuchsia/runner_v2/symbolizer.py +++ b/build/fuchsia/symbolizer.py
@@ -67,7 +67,8 @@ # Compute remote/local path mappings using the manifest data. for next_line in open(manifest_path): target, source = next_line.strip().split('=') - stripped_binary_path = _GetUnstrippedPath(os.path.join(output_dir, source)) + stripped_binary_path = _GetUnstrippedPath(os.path.join(output_dir, + source)) if not stripped_binary_path: continue
diff --git a/build/fuchsia/runner_v2/target.py b/build/fuchsia/target.py similarity index 99% rename from build/fuchsia/runner_v2/target.py rename to build/fuchsia/target.py index 0bd2034..8eb5fcf 100644 --- a/build/fuchsia/runner_v2/target.py +++ b/build/fuchsia/target.py
@@ -59,7 +59,8 @@ command: A list of strings representing the command and arguments. kwargs: A dictionary of parameters to be passed to subprocess.Popen(). - The parameters can be used to override stdin and stdout, for example. + The parameters can be used to override stdin and stdout, for + example. Returns: a Popen object.
diff --git a/build/fuchsia/test_runner.py b/build/fuchsia/test_runner.py index 42506be..8ab88d6 100755 --- a/build/fuchsia/test_runner.py +++ b/build/fuchsia/test_runner.py
@@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2017 The Chromium Authors. All rights reserved. +# Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -10,82 +10,25 @@ import argparse import json +import logging import os import socket +import subprocess import sys import tempfile import time -from runner_common import AddRunnerCommandLineArguments, BuildBootfs, \ - ImageCreationData, ReadRuntimeDeps, RunFuchsia, HOST_IP_ADDRESS +from common_args import AddCommonArgs, ConfigureLogging, GetDeploymentTargetForArgs +from net_test_server import SetupTestServer +from run_package import RunPackage -DIR_SOURCE_ROOT = os.path.abspath( - os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) -sys.path.append(os.path.join(DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common')) -import chrome_test_server_spawner - - -def IsLocalPortAvailable(port): - s = socket.socket() - try: - s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - s.bind(('127.0.0.1', port)) - return True - except socket.error: - return False - finally: - s.close() - - -def WaitUntil(predicate, timeout_seconds=1): - """Blocks until the provided predicate (function) is true. - - Returns: - Whether the provided predicate was satisfied once (before the timeout). - """ - start_time = time.clock() - sleep_time_sec = 0.025 - while True: - if predicate(): - return True - - if time.clock() - start_time > timeout_seconds: - return False - - time.sleep(sleep_time_sec) - sleep_time_sec = min(1, sleep_time_sec * 2) # Don't wait more than 1 sec. - - -# Implementation of chrome_test_server_spawner.PortForwarder that doesn't -# forward ports. Instead the tests are expected to connect to the host IP -# address inside the virtual network provided by qemu. qemu will forward -# these connections to the corresponding localhost ports. -class PortForwarderNoop(chrome_test_server_spawner.PortForwarder): - def Map(self, port_pairs): - pass - - def GetDevicePortForHostPort(self, host_port): - return host_port - - def WaitHostPortAvailable(self, port): - return WaitUntil(lambda: IsLocalPortAvailable(port)) - - def WaitPortNotAvailable(self, port): - return WaitUntil(lambda: not IsLocalPortAvailable(port)) - - def WaitDevicePortReady(self, port): - return self.WaitPortNotAvailable(port) - - def Unmap(self, device_port): - pass - +DEFAULT_TEST_CONCURRENCY = 4 +TEST_RESULT_PATH = '/data/test_summary.json' +TEST_FILTER_PATH = '/data/test_filter.txt' def main(): parser = argparse.ArgumentParser() - AddRunnerCommandLineArguments(parser) - parser.add_argument('--enable-test-server', action='store_true', - default=False, - help='Enable testserver spawner.') + AddCommonArgs(parser) parser.add_argument('--gtest_filter', help='GTest filter to use in place of any default.') parser.add_argument('--gtest_repeat', @@ -98,7 +41,7 @@ parser.add_argument('--single-process-tests', action='store_true', default=False, help='Runs the tests and the launcher in the same ' - 'process. Useful for debugging.') + 'process. Useful for debugging.') parser.add_argument('--test-launcher-batch-limit', type=int, help='Sets the limit of test batch to run in a single ' @@ -113,26 +56,24 @@ type=int, help='Sets the number of parallel test jobs.') parser.add_argument('--test-launcher-summary-output', - '--test_launcher_summary_output', help='Where the test launcher will output its json.') + parser.add_argument('--enable-test-server', action='store_true', + default=False, + help='Enable Chrome test server spawner.') parser.add_argument('child_args', nargs='*', help='Arguments for the test process.') args = parser.parse_args() + ConfigureLogging(args) child_args = ['--test-launcher-retry-limit=0'] - if args.single_process_tests: child_args.append('--single-process-tests') - if args.test_launcher_batch_limit: child_args.append('--test-launcher-batch-limit=%d' % args.test_launcher_batch_limit) - # By default run the same number of test jobs as there are CPU cores. - # If running tests on a device then the caller should provide the - # test-launcher-jobs limit explicitly, since we can't count the CPU cores. test_concurrency = args.test_launcher_jobs \ - if args.test_launcher_jobs else args.vm_cpu_cores + if args.test_launcher_jobs else DEFAULT_TEST_CONCURRENCY child_args.append('--test-launcher-jobs=%d' % test_concurrency) if args.gtest_filter: @@ -145,77 +86,32 @@ if args.child_args: child_args.extend(args.child_args) - runtime_deps = ReadRuntimeDeps(args.runtime_deps_path, args.output_directory) + if args.test_launcher_summary_output: + child_args.append('--test-launcher-summary-output=' + TEST_RESULT_PATH) - spawning_server = None + with GetDeploymentTargetForArgs(args) as target: + target.Start() - # Start test server spawner for tests that need it. - if args.enable_test_server: - spawning_server = chrome_test_server_spawner.SpawningServer( - 0, PortForwarderNoop(), test_concurrency) - spawning_server.Start() + if args.test_launcher_filter_file: + target.PutFile(args.test_launcher_filter_file, TEST_FILTER_PATH) + child_args.append('--test-launcher-filter-file=' + TEST_FILTER_PATH) - # Generate test server config. - config_file = tempfile.NamedTemporaryFile() - config_file.write(json.dumps({ - 'name': 'testserver', - 'address': HOST_IP_ADDRESS, - 'spawner_url_base': 'http://%s:%d' % - (HOST_IP_ADDRESS, spawning_server.server_port) - })) - config_file.flush() - runtime_deps.append(('net-test-server-config', config_file.name)) + forwarder = None + if args.enable_test_server: + test_server = SetupTestServer(target, test_concurrency) - # If no --test-launcher-filter-file is specified, use the default filter path. - if args.test_launcher_filter_file == None: - exe_base_name = os.path.basename(args.exe_name) - test_launcher_filter_file = os.path.normpath(os.path.join( - args.output_directory, - '../../testing/buildbot/filters/fuchsia.%s.filter' % exe_base_name)) - if os.path.exists(test_launcher_filter_file): - args.test_launcher_filter_file = test_launcher_filter_file + returncode = RunPackage(args.output_directory, target, args.package, + args.package_name, child_args, + args.package_manifest) - # Copy the test-launcher-filter-file to the bootfs, if set. - if args.test_launcher_filter_file: - # Bundle the filter file in the runtime deps and compose the command-line - # flag which references it. - test_launcher_filter_file = os.path.normpath( - os.path.join(args.output_directory, args.test_launcher_filter_file)) - runtime_deps.append(('test_filter_file', test_launcher_filter_file)) - child_args.append('--test-launcher-filter-file=/system/test_filter_file') + if forwarder: + forwarder.terminate() + forwarder.wait() - if args.dry_run: - print 'Filter file is %s' % (args.test_launcher_filter_file if - args.test_launcher_filter_file else - 'not applied.') + if args.test_launcher_summary_output: + target.GetFile(TEST_RESULT_PATH, args.test_launcher_summary_output) - try: - image_creation_data = ImageCreationData( - output_directory=args.output_directory, - exe_name=args.exe_name, - runtime_deps=runtime_deps, - target_cpu=args.target_cpu, - dry_run=args.dry_run, - child_args=child_args, - use_device=args.device, - bootdata=args.bootdata, - summary_output=args.test_launcher_summary_output, - shutdown_machine=True, - wait_for_network=args.wait_for_network, - use_autorun=True) - bootfs = BuildBootfs(image_creation_data) - if not bootfs: - return 2 - - return RunFuchsia(bootfs, args.device, args.kernel, args.dry_run, - test_launcher_summary_output= - args.test_launcher_summary_output, - vm_cpu_cores = args.vm_cpu_cores) - finally: - # Stop the spawner to make sure it doesn't leave testserver running, in - # case some tests failed. - if spawning_server: - spawning_server.Stop() + return returncode if __name__ == '__main__':
diff --git a/build/secondary/third_party/android_tools/BUILD.gn b/build/secondary/third_party/android_tools/BUILD.gn index 172aeb5..4a902b5 100644 --- a/build/secondary/third_party/android_tools/BUILD.gn +++ b/build/secondary/third_party/android_tools/BUILD.gn
@@ -217,18 +217,6 @@ [ "${target_gen_dir}/google_play_services_basement_java/proguard.txt" ] } - android_aar_prebuilt("google_play_services_nearby_java") { - deps = [ - ":google_play_services_base_java", - ":google_play_services_basement_java", - ] - _lib_name = "play-services-nearby" - aar_path = "$gms_path/$_lib_name/$gms_version/$_lib_name-$gms_version.aar" - info_path = "//build/secondary/third_party/android_tools/$target_name.info" - proguard_configs = - [ "${target_gen_dir}/google_play_services_basement_java/proguard.txt" ] - } - android_aar_prebuilt("google_play_services_vision_java") { deps = [ ":google_play_services_base_java",
diff --git a/build/secondary/third_party/android_tools/google_play_services_nearby_java.info b/build/secondary/third_party/android_tools/google_play_services_nearby_java.info deleted file mode 100644 index 2307336..0000000 --- a/build/secondary/third_party/android_tools/google_play_services_nearby_java.info +++ /dev/null
@@ -1,13 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = false -has_proguard_flags = false -has_r_text_file = false -is_manifest_empty = false -resources = [ ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/cc/raster/one_copy_raster_buffer_provider.cc b/cc/raster/one_copy_raster_buffer_provider.cc index 25ba880f..ab3e93d 100644 --- a/cc/raster/one_copy_raster_buffer_provider.cc +++ b/cc/raster/one_copy_raster_buffer_provider.cc
@@ -74,7 +74,7 @@ OneCopyRasterBufferProvider::RasterBufferImpl::RasterBufferImpl( OneCopyRasterBufferProvider* client, - LayerTreeResourceProvider* resource_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, const ResourcePool::InUsePoolResource& in_use_resource, OneCopyGpuBacking* backing, const gpu::SyncToken& before_raster_sync_token, @@ -128,7 +128,7 @@ scoped_refptr<base::SequencedTaskRunner> task_runner, viz::ContextProvider* compositor_context_provider, viz::RasterContextProvider* worker_context_provider, - LayerTreeResourceProvider* resource_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, int max_copy_texture_chromium_size, bool use_partial_raster, bool use_gpu_memory_buffer_resources, @@ -136,7 +136,7 @@ viz::ResourceFormat tile_format) : compositor_context_provider_(compositor_context_provider), worker_context_provider_(worker_context_provider), - resource_provider_(resource_provider), + gpu_memory_buffer_manager_(gpu_memory_buffer_manager), max_bytes_per_copy_operation_( max_copy_texture_chromium_size ? std::min(kMaxBytesPerCopyOperation, @@ -148,7 +148,6 @@ tile_format_(tile_format), staging_pool_(std::move(task_runner), worker_context_provider, - resource_provider, use_partial_raster, max_staging_buffer_usage_in_bytes) { DCHECK(compositor_context_provider); @@ -194,9 +193,9 @@ // TODO(danakj): If resource_content_id != 0, we only need to copy/upload // the dirty rect. - return std::make_unique<RasterBufferImpl>(this, resource_provider_, resource, - backing, before_raster_sync_token, - previous_content_id); + return std::make_unique<RasterBufferImpl>( + this, gpu_memory_buffer_manager_, resource, backing, + before_raster_sync_token, previous_content_id); } void OneCopyRasterBufferProvider::Flush() { @@ -321,7 +320,7 @@ // must allocate a buffer with BufferUsage CPU_READ_WRITE_PERSISTENT. if (!staging_buffer->gpu_memory_buffer) { staging_buffer->gpu_memory_buffer = - resource_provider_->gpu_memory_buffer_manager()->CreateGpuMemoryBuffer( + gpu_memory_buffer_manager_->CreateGpuMemoryBuffer( staging_buffer->size, BufferFormat(format), StagingBufferUsage(), gpu::kNullSurfaceHandle); } @@ -436,7 +435,7 @@ // TODO(vmiura): Need a way to ensure we don't hold onto bindings? // ri->BindTexture(image_target, 0); - if (resource_provider_->use_sync_query()) { + if (worker_context_provider_->ContextCapabilities().sync_query) { if (!staging_buffer->query_id) ri->GenQueriesEXT(1, &staging_buffer->query_id); @@ -483,7 +482,7 @@ } } - if (resource_provider_->use_sync_query()) { + if (worker_context_provider_->ContextCapabilities().sync_query) { #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) ri->EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM); #else
diff --git a/cc/raster/one_copy_raster_buffer_provider.h b/cc/raster/one_copy_raster_buffer_provider.h index 43971c4..97cb70cd 100644 --- a/cc/raster/one_copy_raster_buffer_provider.h +++ b/cc/raster/one_copy_raster_buffer_provider.h
@@ -13,6 +13,10 @@ #include "cc/resources/layer_tree_resource_provider.h" #include "gpu/command_buffer/common/sync_token.h" +namespace gpu { +class GpuMemoryBufferManager; +} + namespace viz { class ContextProvider; class RasterContextProvider; @@ -28,7 +32,7 @@ scoped_refptr<base::SequencedTaskRunner> task_runner, viz::ContextProvider* compositor_context_provider, viz::RasterContextProvider* worker_context_provider, - LayerTreeResourceProvider* resource_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, int max_copy_texture_chromium_size, bool use_partial_raster, bool use_gpu_memory_buffer_resources, @@ -78,7 +82,7 @@ class RasterBufferImpl : public RasterBuffer { public: RasterBufferImpl(OneCopyRasterBufferProvider* client, - LayerTreeResourceProvider* resource_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, const ResourcePool::InUsePoolResource& in_use_resource, OneCopyGpuBacking* backing, const gpu::SyncToken& before_raster_sync_token, @@ -143,7 +147,7 @@ viz::ContextProvider* const compositor_context_provider_; viz::RasterContextProvider* const worker_context_provider_; - LayerTreeResourceProvider* const resource_provider_; + gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; const int max_bytes_per_copy_operation_; const bool use_partial_raster_; const bool use_gpu_memory_buffer_resources_;
diff --git a/cc/raster/raster_buffer_provider_perftest.cc b/cc/raster/raster_buffer_provider_perftest.cc index 21f01f48..c313070 100644 --- a/cc/raster/raster_buffer_provider_perftest.cc +++ b/cc/raster/raster_buffer_provider_perftest.cc
@@ -361,7 +361,7 @@ Create3dResourceProvider(); raster_buffer_provider_ = std::make_unique<OneCopyRasterBufferProvider>( task_runner_.get(), compositor_context_provider_.get(), - worker_context_provider_.get(), resource_provider_.get(), + worker_context_provider_.get(), &gpu_memory_buffer_manager_, std::numeric_limits<int>::max(), false, false, std::numeric_limits<int>::max(), viz::RGBA_8888); resource_pool_ = std::make_unique<ResourcePool>( @@ -516,13 +516,13 @@ private: void Create3dResourceProvider() { resource_provider_ = FakeResourceProvider::CreateLayerTreeResourceProvider( - compositor_context_provider_.get(), &gpu_memory_buffer_manager_); + compositor_context_provider_.get()); } void CreateSoftwareResourceProvider() { layer_tree_frame_sink_ = FakeLayerTreeFrameSink::CreateSoftware(); resource_provider_ = - FakeResourceProvider::CreateLayerTreeResourceProvider(nullptr, nullptr); + FakeResourceProvider::CreateLayerTreeResourceProvider(nullptr); } std::string TestModifierString() const { @@ -586,7 +586,7 @@ // Overridden from testing::Test: void SetUp() override { resource_provider_ = FakeResourceProvider::CreateLayerTreeResourceProvider( - compositor_context_provider_.get(), nullptr); + compositor_context_provider_.get()); resource_pool_ = std::make_unique<ResourcePool>( resource_provider_.get(), task_runner_, ResourcePool::kDefaultExpirationDelay, ResourcePool::Mode::kGpu, false);
diff --git a/cc/raster/raster_buffer_provider_unittest.cc b/cc/raster/raster_buffer_provider_unittest.cc index 77926ce..d178d39 100644 --- a/cc/raster/raster_buffer_provider_unittest.cc +++ b/cc/raster/raster_buffer_provider_unittest.cc
@@ -167,7 +167,7 @@ Create3dResourceProvider(); raster_buffer_provider_ = std::make_unique<OneCopyRasterBufferProvider>( base::ThreadTaskRunnerHandle::Get().get(), context_provider_.get(), - worker_context_provider_.get(), resource_provider_.get(), + worker_context_provider_.get(), &gpu_memory_buffer_manager_, kMaxBytesPerCopyOperation, false, false, kMaxStagingBuffers, viz::RGBA_8888); pool_ = std::make_unique<ResourcePool>( @@ -301,13 +301,13 @@ context3d->set_support_sync_query(true); layer_tree_frame_sink_ = FakeLayerTreeFrameSink::Create3d(); resource_provider_ = FakeResourceProvider::CreateLayerTreeResourceProvider( - context_provider_.get(), &gpu_memory_buffer_manager_); + context_provider_.get()); } void CreateSoftwareResourceProvider() { layer_tree_frame_sink_ = FakeLayerTreeFrameSink::CreateSoftware(); - resource_provider_ = FakeResourceProvider::CreateLayerTreeResourceProvider( - nullptr, &gpu_memory_buffer_manager_); + resource_provider_ = + FakeResourceProvider::CreateLayerTreeResourceProvider(nullptr); } void OnTimeout() {
diff --git a/cc/raster/staging_buffer_pool.cc b/cc/raster/staging_buffer_pool.cc index b5cd9331..0ac04f7 100644 --- a/cc/raster/staging_buffer_pool.cc +++ b/cc/raster/staging_buffer_pool.cc
@@ -131,12 +131,10 @@ StagingBufferPool::StagingBufferPool( scoped_refptr<base::SequencedTaskRunner> task_runner, viz::RasterContextProvider* worker_context_provider, - LayerTreeResourceProvider* resource_provider, bool use_partial_raster, int max_staging_buffer_usage_in_bytes) : task_runner_(std::move(task_runner)), worker_context_provider_(worker_context_provider), - resource_provider_(resource_provider), use_partial_raster_(use_partial_raster), max_staging_buffer_usage_in_bytes_(max_staging_buffer_usage_in_bytes), staging_buffer_usage_in_bytes_(0), @@ -262,7 +260,7 @@ DCHECK(ri); // Check if any busy buffers have become available. - if (resource_provider_->use_sync_query()) { + if (worker_context_provider_->ContextCapabilities().sync_query) { while (!busy_buffers_.empty()) { if (!CheckForQueryResult(ri, busy_buffers_.front()->query_id)) break; @@ -280,7 +278,7 @@ if (busy_buffers_.empty()) break; - if (resource_provider_->use_sync_query()) { + if (worker_context_provider_->ContextCapabilities().sync_query) { WaitForQueryResult(ri, busy_buffers_.front()->query_id); MarkStagingBufferAsFree(busy_buffers_.front().get()); free_buffers_.push_back(PopFront(&busy_buffers_));
diff --git a/cc/raster/staging_buffer_pool.h b/cc/raster/staging_buffer_pool.h index 3a527d9e..c253c0d 100644 --- a/cc/raster/staging_buffer_pool.h +++ b/cc/raster/staging_buffer_pool.h
@@ -18,7 +18,10 @@ #include "base/time/time.h" #include "base/trace_event/memory_dump_provider.h" #include "base/trace_event/trace_event.h" -#include "cc/resources/layer_tree_resource_provider.h" +#include "cc/cc_export.h" +#include "components/viz/common/resources/resource_format.h" +#include "ui/gfx/geometry/size.h" +#include "ui/gfx/gpu_memory_buffer.h" namespace gfx { class GpuMemoryBuffer; @@ -62,7 +65,6 @@ StagingBufferPool(scoped_refptr<base::SequencedTaskRunner> task_runner, viz::RasterContextProvider* worker_context_provider, - LayerTreeResourceProvider* resource_provider, bool use_partial_raster, int max_staging_buffer_usage_in_bytes); void Shutdown(); @@ -99,7 +101,6 @@ scoped_refptr<base::SequencedTaskRunner> task_runner_; viz::RasterContextProvider* const worker_context_provider_; - LayerTreeResourceProvider* const resource_provider_; const bool use_partial_raster_; mutable base::Lock lock_;
diff --git a/cc/raster/staging_buffer_pool_unittest.cc b/cc/raster/staging_buffer_pool_unittest.cc index 51e3f7c..7c7c79a 100644 --- a/cc/raster/staging_buffer_pool_unittest.cc +++ b/cc/raster/staging_buffer_pool_unittest.cc
@@ -16,14 +16,13 @@ TEST(StagingBufferPoolTest, ShutdownImmediatelyAfterCreation) { auto context_provider = viz::TestContextProvider::CreateWorker(); - LayerTreeResourceProvider* resource_provider = nullptr; bool use_partial_raster = false; int max_staging_buffer_usage_in_bytes = 1024; auto task_runner = base::ThreadTaskRunnerHandle::Get(); // Create a StagingBufferPool and immediately shut it down. auto pool = std::make_unique<StagingBufferPool>( - task_runner.get(), context_provider.get(), resource_provider, - use_partial_raster, max_staging_buffer_usage_in_bytes); + task_runner.get(), context_provider.get(), use_partial_raster, + max_staging_buffer_usage_in_bytes); pool->Shutdown(); // Flush the message loop. auto flush_message_loop = [] {
diff --git a/cc/resources/display_resource_provider_unittest.cc b/cc/resources/display_resource_provider_unittest.cc index 8c33021..246bdf78 100644 --- a/cc/resources/display_resource_provider_unittest.cc +++ b/cc/resources/display_resource_provider_unittest.cc
@@ -361,8 +361,6 @@ child_context_provider_->BindToCurrentThread(); gpu_memory_buffer_manager_ = std::make_unique<viz::TestGpuMemoryBufferManager>(); - child_gpu_memory_buffer_manager_ = - gpu_memory_buffer_manager_->CreateClientGpuMemoryBufferManager(); } else { shared_bitmap_manager_ = std::make_unique<viz::TestSharedBitmapManager>(); } @@ -379,8 +377,8 @@ void MakeChildResourceProvider() { child_resource_provider_ = std::make_unique<LayerTreeResourceProvider>( - child_context_provider_.get(), child_gpu_memory_buffer_manager_.get(), - child_needs_sync_token_, CreateResourceSettings()); + child_context_provider_.get(), child_needs_sync_token_, + CreateResourceSettings()); } static void CollectResources( @@ -473,8 +471,6 @@ scoped_refptr<viz::TestContextProvider> child_context_provider_; std::unique_ptr<viz::TestGpuMemoryBufferManager> gpu_memory_buffer_manager_; std::unique_ptr<DisplayResourceProvider> resource_provider_; - std::unique_ptr<viz::TestGpuMemoryBufferManager> - child_gpu_memory_buffer_manager_; std::unique_ptr<LayerTreeResourceProvider> child_resource_provider_; std::unique_ptr<viz::TestSharedBitmapManager> shared_bitmap_manager_; };
diff --git a/cc/resources/layer_tree_resource_provider.cc b/cc/resources/layer_tree_resource_provider.cc index bd022388..55941e0d 100644 --- a/cc/resources/layer_tree_resource_provider.cc +++ b/cc/resources/layer_tree_resource_provider.cc
@@ -14,10 +14,8 @@ #include "gpu/GLES2/gl2extchromium.h" #include "gpu/command_buffer/client/context_support.h" #include "gpu/command_buffer/client/gles2_interface.h" -#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" #include "gpu/command_buffer/client/raster_interface.h" #include "gpu/command_buffer/common/capabilities.h" -#include "gpu/command_buffer/common/gpu_memory_buffer_support.h" #include "third_party/skia/include/core/SkCanvas.h" using gpu::gles2::GLES2Interface; @@ -39,7 +37,6 @@ } const auto& caps = compositor_context_provider->ContextCapabilities(); - use_sync_query = caps.sync_query; if (caps.disable_one_component_textures) { yuv_resource_format = yuv_highbit_resource_format = viz::RGBA_8888; @@ -91,14 +88,12 @@ LayerTreeResourceProvider::LayerTreeResourceProvider( viz::ContextProvider* compositor_context_provider, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, bool delegated_sync_points_required, const viz::ResourceSettings& resource_settings) : settings_(compositor_context_provider, delegated_sync_points_required, resource_settings), compositor_context_provider_(compositor_context_provider), - gpu_memory_buffer_manager_(gpu_memory_buffer_manager), next_id_(kLayerTreeInitialResourceId) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); }
diff --git a/cc/resources/layer_tree_resource_provider.h b/cc/resources/layer_tree_resource_provider.h index e6539ed01..509ffd7 100644 --- a/cc/resources/layer_tree_resource_provider.h +++ b/cc/resources/layer_tree_resource_provider.h
@@ -21,7 +21,6 @@ #include "third_party/skia/include/gpu/GrContext.h" namespace gpu { -class GpuMemoryBufferManager; namespace gles2 { class GLES2Interface; } @@ -42,7 +41,6 @@ public: LayerTreeResourceProvider( viz::ContextProvider* compositor_context_provider, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, bool delegated_sync_points_required, const viz::ResourceSettings& resource_settings); ~LayerTreeResourceProvider(); @@ -94,16 +92,10 @@ bool IsSoftware() const { return !compositor_context_provider_; } - bool use_sync_query() const { return settings_.use_sync_query; } - int max_texture_size() const { return settings_.max_texture_size; } viz::ResourceFormat YuvResourceFormat(int bits) const; - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { - return gpu_memory_buffer_manager_; - } - class CC_EXPORT ScopedSkSurface { public: ScopedSkSurface(GrContext* gr_context, @@ -133,7 +125,6 @@ const viz::ResourceSettings& resource_settings); int max_texture_size = 0; - bool use_sync_query = false; viz::ResourceFormat yuv_resource_format = viz::LUMINANCE_8; viz::ResourceFormat yuv_highbit_resource_format = viz::LUMINANCE_8; bool delegated_sync_points_required = false; @@ -146,7 +137,6 @@ THREAD_CHECKER(thread_checker_); base::flat_map<viz::ResourceId, ImportedResource> imported_resources_; viz::ContextProvider* compositor_context_provider_; - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; viz::ResourceId next_id_; DISALLOW_COPY_AND_ASSIGN(LayerTreeResourceProvider);
diff --git a/cc/resources/layer_tree_resource_provider_unittest.cc b/cc/resources/layer_tree_resource_provider_unittest.cc index ca8a38d..18243f4 100644 --- a/cc/resources/layer_tree_resource_provider_unittest.cc +++ b/cc/resources/layer_tree_resource_provider_unittest.cc
@@ -11,7 +11,6 @@ #include "components/viz/common/resources/returned_resource.h" #include "components/viz/common/resources/single_release_callback.h" #include "components/viz/test/test_context_provider.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -28,7 +27,6 @@ bound_(context_provider_->BindToCurrentThread()), provider_(std::make_unique<LayerTreeResourceProvider>( use_gpu_ ? context_provider_.get() : nullptr, - &gpu_memory_buffer_manager_, delegated_sync_points_required_, resource_settings_)) { DCHECK_EQ(bound_, gpu::ContextResult::kSuccess); @@ -71,7 +69,6 @@ bool use_gpu_; scoped_refptr<viz::TestContextProvider> context_provider_; gpu::ContextResult bound_; - viz::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; bool delegated_sync_points_required_ = true; viz::ResourceSettings resource_settings_; std::unique_ptr<LayerTreeResourceProvider> provider_;
diff --git a/cc/resources/resource_pool_unittest.cc b/cc/resources/resource_pool_unittest.cc index 6941cd326..0de064a3 100644 --- a/cc/resources/resource_pool_unittest.cc +++ b/cc/resources/resource_pool_unittest.cc
@@ -23,7 +23,7 @@ context_provider_ = viz::TestContextProvider::Create(); context_provider_->BindToCurrentThread(); resource_provider_ = FakeResourceProvider::CreateLayerTreeResourceProvider( - context_provider_.get(), nullptr); + context_provider_.get()); task_runner_ = base::ThreadTaskRunnerHandle::Get(); resource_pool_ = std::make_unique<ResourcePool>( resource_provider_.get(), task_runner_,
diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc index 6d97863..57301ae 100644 --- a/cc/resources/resource_provider_unittest.cc +++ b/cc/resources/resource_provider_unittest.cc
@@ -385,7 +385,7 @@ void MakeChildResourceProvider() { child_resource_provider_ = std::make_unique<LayerTreeResourceProvider>( - child_context_provider_.get(), nullptr, child_needs_sync_token_, + child_context_provider_.get(), child_needs_sync_token_, CreateResourceSettings()); } @@ -611,7 +611,7 @@ bool need_sync_tokens = false; auto no_token_resource_provider = std::make_unique<LayerTreeResourceProvider>( - child_context_provider_.get(), nullptr, need_sync_tokens, + child_context_provider_.get(), need_sync_tokens, CreateResourceSettings()); GLuint external_texture_id = child_context_->createExternalTexture(); @@ -1249,8 +1249,7 @@ nullptr, shared_bitmap_manager_.get()); auto child_resource_provider(std::make_unique<LayerTreeResourceProvider>( - nullptr, nullptr, kDelegatedSyncPointsRequired, - CreateResourceSettings())); + nullptr, kDelegatedSyncPointsRequired, CreateResourceSettings())); gpu::SyncToken release_sync_token; bool lost_resource = false; @@ -1326,7 +1325,7 @@ child_context_provider->BindToCurrentThread(); auto child_resource_provider(std::make_unique<LayerTreeResourceProvider>( - child_context_provider.get(), nullptr, kDelegatedSyncPointsRequired, + child_context_provider.get(), kDelegatedSyncPointsRequired, CreateResourceSettings())); unsigned texture_id = 1; @@ -1486,7 +1485,7 @@ child_context_provider->BindToCurrentThread(); auto child_resource_provider(std::make_unique<LayerTreeResourceProvider>( - child_context_provider.get(), nullptr, kDelegatedSyncPointsRequired, + child_context_provider.get(), kDelegatedSyncPointsRequired, CreateResourceSettings())); gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, @@ -1723,7 +1722,7 @@ context_provider->BindToCurrentThread(); auto resource_provider(std::make_unique<LayerTreeResourceProvider>( - context_provider.get(), nullptr, kDelegatedSyncPointsRequired, + context_provider.get(), kDelegatedSyncPointsRequired, CreateResourceSettings())); EXPECT_CALL(*context, bindTexture(_, _)).Times(0);
diff --git a/cc/resources/video_resource_updater_unittest.cc b/cc/resources/video_resource_updater_unittest.cc index 2d21c7c..d1915980 100644 --- a/cc/resources/video_resource_updater_unittest.cc +++ b/cc/resources/video_resource_updater_unittest.cc
@@ -87,10 +87,10 @@ layer_tree_frame_sink_software_ = FakeLayerTreeFrameSink::CreateSoftware(); resource_provider3d_ = FakeResourceProvider::CreateLayerTreeResourceProvider( - context_provider_.get(), nullptr, high_bit_for_testing_); + context_provider_.get(), high_bit_for_testing_); resource_provider_software_ = FakeResourceProvider::CreateLayerTreeResourceProvider( - nullptr, nullptr, high_bit_for_testing_); + nullptr, high_bit_for_testing_); } std::unique_ptr<VideoResourceUpdater> CreateUpdaterForHardware(
diff --git a/cc/test/fake_resource_provider.h b/cc/test/fake_resource_provider.h index c57f1cd..aeba820 100644 --- a/cc/test/fake_resource_provider.h +++ b/cc/test/fake_resource_provider.h
@@ -15,12 +15,11 @@ static std::unique_ptr<LayerTreeResourceProvider> CreateLayerTreeResourceProvider( viz::ContextProvider* context_provider, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr, bool high_bit_for_testing = false) { viz::ResourceSettings resource_settings; resource_settings.high_bit_for_testing = high_bit_for_testing; - return std::make_unique<LayerTreeResourceProvider>( - context_provider, gpu_memory_buffer_manager, true, resource_settings); + return std::make_unique<LayerTreeResourceProvider>(context_provider, true, + resource_settings); } static std::unique_ptr<DisplayResourceProvider> CreateDisplayResourceProvider(
diff --git a/cc/test/layer_tree_pixel_resource_test.cc b/cc/test/layer_tree_pixel_resource_test.cc index c5ce5c2..b68e4cd 100644 --- a/cc/test/layer_tree_pixel_resource_test.cc +++ b/cc/test/layer_tree_pixel_resource_test.cc
@@ -49,7 +49,6 @@ layer_tree_frame_sink->context_provider(); viz::RasterContextProvider* worker_context_provider = layer_tree_frame_sink->worker_context_provider(); - LayerTreeResourceProvider* resource_provider = host_impl->resource_provider(); gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = layer_tree_frame_sink->gpu_memory_buffer_manager(); int max_bytes_per_copy_operation = 1024 * 1024; @@ -98,7 +97,7 @@ return std::make_unique<OneCopyRasterBufferProvider>( task_runner, compositor_context_provider, worker_context_provider, - resource_provider, max_bytes_per_copy_operation, false, false, + gpu_memory_buffer_manager, max_bytes_per_copy_operation, false, false, max_staging_buffer_usage_in_bytes, sw_raster_format); } return {};
diff --git a/cc/test/pixel_test.cc b/cc/test/pixel_test.cc index 67eb260..2d86b840 100644 --- a/cc/test/pixel_test.cc +++ b/cc/test/pixel_test.cc
@@ -30,7 +30,6 @@ #include "components/viz/service/display/software_output_device.h" #include "components/viz/service/display/software_renderer.h" #include "components/viz/test/paths.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "components/viz/test/test_shared_bitmap_manager.h" #include "gpu/command_buffer/client/gles2_interface.h" #include "testing/gtest/include/gtest/gtest.h" @@ -202,8 +201,6 @@ output_surface_->BindToClient(output_surface_client_.get()); shared_bitmap_manager_ = std::make_unique<viz::TestSharedBitmapManager>(); - gpu_memory_buffer_manager_ = - std::make_unique<viz::TestGpuMemoryBufferManager>(); resource_provider_ = std::make_unique<DisplayResourceProvider>( output_surface_->context_provider(), shared_bitmap_manager_.get()); @@ -212,8 +209,7 @@ /*support_gles2_interface=*/true); child_context_provider_->BindToCurrentThread(); child_resource_provider_ = std::make_unique<LayerTreeResourceProvider>( - child_context_provider_.get(), gpu_memory_buffer_manager_.get(), true, - settings_.resource_settings); + child_context_provider_.get(), true, settings_.resource_settings); } void PixelTest::SetUpGLRenderer(bool flipped_output_surface) { @@ -246,7 +242,7 @@ resource_provider_ = std::make_unique<DisplayResourceProvider>( nullptr, shared_bitmap_manager_.get()); child_resource_provider_ = std::make_unique<LayerTreeResourceProvider>( - nullptr, nullptr, true, settings_.resource_settings); + nullptr, true, settings_.resource_settings); auto renderer = std::make_unique<viz::SoftwareRenderer>( &renderer_settings_, output_surface_.get(), resource_provider_.get());
diff --git a/cc/test/pixel_test.h b/cc/test/pixel_test.h index 77c892f..a831591 100644 --- a/cc/test/pixel_test.h +++ b/cc/test/pixel_test.h
@@ -22,7 +22,6 @@ namespace viz { class CopyOutputResult; class DirectRenderer; -class TestGpuMemoryBufferManager; class TestSharedBitmapManager; } @@ -78,7 +77,6 @@ std::unique_ptr<FakeOutputSurfaceClient> output_surface_client_; std::unique_ptr<viz::OutputSurface> output_surface_; std::unique_ptr<viz::TestSharedBitmapManager> shared_bitmap_manager_; - std::unique_ptr<viz::TestGpuMemoryBufferManager> gpu_memory_buffer_manager_; std::unique_ptr<DisplayResourceProvider> resource_provider_; scoped_refptr<TestInProcessContextProvider> child_context_provider_; std::unique_ptr<LayerTreeResourceProvider> child_resource_provider_;
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 440fc5f6..9a8e41f 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -2713,8 +2713,8 @@ caps.max_copy_texture_chromium_size; return std::make_unique<OneCopyRasterBufferProvider>( GetTaskRunner(), compositor_context_provider, worker_context_provider, - resource_provider_.get(), max_copy_texture_chromium_size, - settings_.use_partial_raster, + layer_tree_frame_sink_->gpu_memory_buffer_manager(), + max_copy_texture_chromium_size, settings_.use_partial_raster, settings_.resource_settings.use_gpu_memory_buffer_resources, settings_.max_staging_buffer_usage_in_bytes, tile_format); } @@ -2850,7 +2850,6 @@ has_valid_layer_tree_frame_sink_ = true; resource_provider_ = std::make_unique<LayerTreeResourceProvider>( layer_tree_frame_sink_->context_provider(), - layer_tree_frame_sink_->gpu_memory_buffer_manager(), layer_tree_frame_sink_->capabilities().delegated_sync_points_required, settings_.resource_settings); if (!layer_tree_frame_sink_->context_provider()) {
diff --git a/chrome/DEPS b/chrome/DEPS index 44a9f94..bc128f4 100644 --- a/chrome/DEPS +++ b/chrome/DEPS
@@ -26,7 +26,6 @@ "+content/public/common", "+content/public/test", "+media/media_buildflags.h", - "+mojo/common", "+mojo/public", "+ppapi/buildflags",
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 5f7acc0f..976c5617 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -201,7 +201,6 @@ "$google_play_services_package:google_play_services_cast_java", "$google_play_services_package:google_play_services_gcm_java", "$google_play_services_package:google_play_services_iid_java", - "$google_play_services_package:google_play_services_nearby_java", "$google_play_services_package:google_play_services_tasks_java", "//base:base_java", "//chrome/android/third_party/compositor_animator:compositor_animator_java",
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml index 8dcaa7f..cc61f5a 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml
@@ -753,10 +753,6 @@ {{ self.supports_vr() }} </activity> - <!-- Service for handling Nearby Messages --> - <service android:name="org.chromium.chrome.browser.physicalweb.NearbyMessageIntentService" - android:exported="false" /> - <!-- Activities for Browser Actions --> <activity android:name="org.chromium.chrome.browser.browseractions.BrowserActionActivity" android:theme="@style/FullscreenTransparentActivityTheme"
diff --git a/chrome/android/java/res/layout/usb_permission.xml b/chrome/android/java/res/layout/object_permission.xml similarity index 100% rename from chrome/android/java/res/layout/usb_permission.xml rename to chrome/android/java/res/layout/object_permission.xml
diff --git a/chrome/android/java/res/xml/usb_device_preferences.xml b/chrome/android/java/res/xml/chosen_object_preferences.xml similarity index 88% rename from chrome/android/java/res/xml/usb_device_preferences.xml rename to chrome/android/java/res/xml/chosen_object_preferences.xml index ee2c409..9369f51 100644 --- a/chrome/android/java/res/xml/usb_device_preferences.xml +++ b/chrome/android/java/res/xml/chosen_object_preferences.xml
@@ -6,7 +6,7 @@ <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <Preference android:key="object_name" - android:widgetLayout="@layout/usb_permission" /> + android:widgetLayout="@layout/object_permission" /> <Preference android:key="divider" android:layout="@layout/divider_preference" />
diff --git a/chrome/android/java/res/xml/single_website_preferences.xml b/chrome/android/java/res/xml/single_website_preferences.xml index 8eef786..c2ab4dc 100644 --- a/chrome/android/java/res/xml/single_website_preferences.xml +++ b/chrome/android/java/res/xml/single_website_preferences.xml
@@ -66,6 +66,8 @@ android:key="midi_sysex_permission_list" /> <org.chromium.chrome.browser.preferences.ChromeBaseListPreference android:key="clipboard_permission_list" /> + <org.chromium.chrome.browser.preferences.ChromeBaseListPreference + android:key="usb_permission_list" /> <org.chromium.chrome.browser.preferences.ButtonPreference android:key="reset_site_button"
diff --git a/chrome/android/java/res/xml/site_settings_preferences.xml b/chrome/android/java/res/xml/site_settings_preferences.xml index afb425b..1159fd1 100644 --- a/chrome/android/java/res/xml/site_settings_preferences.xml +++ b/chrome/android/java/res/xml/site_settings_preferences.xml
@@ -80,10 +80,8 @@ android:icon="@drawable/settings_storage" /> <!-- USB --> <org.chromium.chrome.browser.preferences.website.SiteSettingsPreference - android:fragment="org.chromium.chrome.browser.preferences.website.UsbChooserPreferences" - android:key="usb" - android:title="@string/website_settings_usb" - android:icon="@drawable/settings_usb" /> + android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences" + android:key="usb" /> <!-- Clipboard API --> <org.chromium.chrome.browser.preferences.website.SiteSettingsPreference android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences"
diff --git a/chrome/android/java/res/xml/usb_chooser_preferences.xml b/chrome/android/java/res/xml/usb_chooser_preferences.xml deleted file mode 100644 index 4d2261f..0000000 --- a/chrome/android/java/res/xml/usb_chooser_preferences.xml +++ /dev/null
@@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2016 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. --> - -<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" />
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java index 59e76396..15a2a91 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java
@@ -37,7 +37,6 @@ import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmark; import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksProviderIterator; import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations; -import org.chromium.chrome.browser.physicalweb.PhysicalWebBleClient; import org.chromium.chrome.browser.policy.PolicyAuditor; import org.chromium.chrome.browser.preferences.LocationSettings; import org.chromium.chrome.browser.rlz.RevenueStats; @@ -226,13 +225,6 @@ } /** - * @return A new {@link PhysicalWebBleClient} instance. - */ - public PhysicalWebBleClient createPhysicalWebBleClient() { - return new PhysicalWebBleClient(); - } - - /** * @return a new {@link ProcessInitializationHandler} instance. */ public ProcessInitializationHandler createProcessInitializationHandler() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java index bdb9e62d..27631f29 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -68,6 +68,7 @@ import org.chromium.chrome.browser.compositor.layouts.content.ContentOffsetProvider; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; import org.chromium.chrome.browser.contextual_suggestions.ContextualSuggestionsCoordinator; +import org.chromium.chrome.browser.contextual_suggestions.PageViewTimer; import org.chromium.chrome.browser.contextualsearch.ContextualSearchFieldTrial; import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager; import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager.ContextualSearchTabPromotionDelegate; @@ -287,6 +288,9 @@ /** Whether or not a PolicyChangeListener was added. */ private boolean mDidAddPolicyChangeListener; + /** Adds TabObserver and TabModelObserver to measure page view times. */ + private PageViewTimer mPageViewTimer; + /** * @param factory The {@link AppMenuHandlerFactory} for creating {@link #mAppMenuHandler} */ @@ -388,6 +392,7 @@ ((BottomContainer) findViewById(R.id.bottom_container)).initialize(mFullscreenManager); mModalDialogManager = createModalDialogManager(); + mPageViewTimer = new PageViewTimer(mTabModelSelector); } @Override @@ -1134,6 +1139,11 @@ @SuppressLint("NewApi") @Override protected final void onDestroy() { + if (mPageViewTimer != null) { + mPageViewTimer.destroy(); + mPageViewTimer = null; + } + if (mReaderModeManager != null) { mReaderModeManager.destroy(); mReaderModeManager = null;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsMediator.java index 13b59bd0..073e697c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsMediator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsMediator.java
@@ -239,6 +239,7 @@ mModel.setClusterList(new ClusterList(Collections.emptyList())); mModel.setCloseButtonOnClickListener(null); mModel.setMenuButtonVisibility(false); + mModel.setMenuButtonAlpha(0f); mModel.setMenuButtonDelegate(null); mModel.setDefaultToolbarClickListener(null); mModel.setTitle(null); @@ -266,6 +267,7 @@ clearSuggestions(); }); mModel.setMenuButtonVisibility(false); + mModel.setMenuButtonAlpha(0f); mModel.setMenuButtonDelegate(this); mModel.setDefaultToolbarClickListener(view -> mCoordinator.expandBottomSheet()); mModel.setTitle(title); @@ -310,6 +312,11 @@ public void onSheetClosed(int reason) { mModel.setMenuButtonVisibility(false); } + + @Override + public void onTransitionPeekToHalf(float transitionFraction) { + mModel.setMenuButtonAlpha(transitionFraction); + } }; mCoordinator.addBottomSheetObserver(mSheetObserver);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsModel.java b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsModel.java index 6cd5f6e..cf3c8de 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsModel.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsModel.java
@@ -23,6 +23,7 @@ static class PropertyKey { static final PropertyKey CLOSE_BUTTON_ON_CLICK_LISTENER = new PropertyKey(); static final PropertyKey MENU_BUTTON_VISIBILITY = new PropertyKey(); + static final PropertyKey MENU_BUTTON_ALPHA = new PropertyKey(); static final PropertyKey MENU_BUTTON_DELEGATE = new PropertyKey(); static final PropertyKey TITLE = new PropertyKey(); static final PropertyKey TOOLBAR_SHADOW_VISIBILITY = new PropertyKey(); @@ -81,6 +82,7 @@ ClusterListObservable mClusterListObservable = new ClusterListObservable(); private OnClickListener mCloseButtonOnClickListener; private boolean mMenuButtonVisibility; + private float mMenuButtonAlpha; private ListMenuButton.Delegate mMenuButtonDelegate; private OnClickListener mDefaultToolbarOnClickListener; private String mTitle; @@ -118,6 +120,17 @@ return mMenuButtonVisibility; } + /** @param alpha The opacity of the menu button. */ + void setMenuButtonAlpha(float alpha) { + mMenuButtonAlpha = alpha; + notifyPropertyChanged(PropertyKey.MENU_BUTTON_ALPHA); + } + + /** @return The opacity of the menu button. */ + float getMenuButtonAlpha() { + return mMenuButtonAlpha; + } + /** @param delegate The delegate for handles actions for the menu. */ void setMenuButtonDelegate(ListMenuButton.Delegate delegate) { mMenuButtonDelegate = delegate;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/PageViewTimer.java b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/PageViewTimer.java new file mode 100644 index 0000000..02c11cd --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/PageViewTimer.java
@@ -0,0 +1,139 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.contextual_suggestions; + +import android.os.SystemClock; +import android.webkit.URLUtil; + +import org.chromium.base.metrics.RecordHistogram; +import org.chromium.chrome.browser.tab.EmptyTabObserver; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.tab.TabObserver; +import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType; +import org.chromium.chrome.browser.tabmodel.TabModelSelector; +import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabModelObserver; +import org.chromium.chrome.browser.util.UrlUtilities; + +import java.util.concurrent.TimeUnit; + +/** Class allowing to measure and report a page view time in UMA. */ +public class PageViewTimer { + private final TabModelSelectorTabModelObserver mTabModelObserver; + private final TabObserver mTabObserver; + + /** Currnetly observed tab. */ + private Tab mCurrentTab; + /** Last URL loaded in the observed tab. */ + private String mLastUrl; + /** Start time for the page that is observed. */ + private long mStartTimeMs; + /** Whether the page is showing anything. */ + private boolean mPageDidPaint; + + public PageViewTimer(TabModelSelector tabModelSelector) { + // TODO(fgorski): May need to change to TabObserver. + mTabObserver = new EmptyTabObserver() { + @Override + public void onUpdateUrl(Tab tab, String url) { + assert tab == mCurrentTab; + + // In the current implementation, when the user refreshes a page or navigates to a + // fragment on the page, it is still part of the same page view. + if (UrlUtilities.urlsMatchIgnoringFragments(url, mLastUrl)) return; + + maybeReportViewTime(); + maybeStartMeasuring(url, !tab.isLoading()); + } + + @Override + public void didFirstVisuallyNonEmptyPaint(Tab tab) { + assert tab == mCurrentTab; + mPageDidPaint = true; + } + + @Override + public void onPageLoadFinished(Tab tab) { + assert tab == mCurrentTab; + mPageDidPaint = true; + } + + @Override + public void onLoadStopped(Tab tab, boolean toDifferentDocument) { + assert tab == mCurrentTab; + mPageDidPaint = true; + } + }; + + mTabModelObserver = new TabModelSelectorTabModelObserver(tabModelSelector) { + @Override + public void didSelectTab(Tab tab, TabSelectionType type, int lastId) { + assert tab != null; + if (tab == mCurrentTab) return; + + maybeReportViewTime(); + switchObserverToTab(tab); + maybeStartMeasuring(tab.getUrl(), !tab.isLoading()); + } + + @Override + public void willCloseTab(Tab tab, boolean animate) { + assert tab != null; + if (tab != mCurrentTab) return; + + maybeReportViewTime(); + switchObserverToTab(null); + } + + @Override + public void tabRemoved(Tab tab) { + assert tab != null; + if (tab != mCurrentTab) return; + + maybeReportViewTime(); + switchObserverToTab(null); + } + }; + } + + /** Destroys the PageViewTimer. */ + public void destroy() { + maybeReportViewTime(); + switchObserverToTab(null); + mTabModelObserver.destroy(); + } + + private void maybeReportViewTime() { + if (mLastUrl != null && mStartTimeMs != 0 && mPageDidPaint) { + long durationMs = SystemClock.uptimeMillis() - mStartTimeMs; + RecordHistogram.recordLongTimesHistogram100( + "ContextualSuggestions.PageViewTime", durationMs, TimeUnit.MILLISECONDS); + } + + // Reporting triggers every time the user would see something new, therefore we clean up + // reporting state every time. + mLastUrl = null; + mStartTimeMs = 0; + mPageDidPaint = false; + } + + private void switchObserverToTab(Tab tab) { + if (mCurrentTab != tab && mCurrentTab != null) { + mCurrentTab.removeObserver(mTabObserver); + } + + mCurrentTab = tab; + if (mCurrentTab != null) { + mCurrentTab.addObserver(mTabObserver); + } + } + + private void maybeStartMeasuring(String url, boolean isLoaded) { + if (!URLUtil.isHttpUrl(url) && !URLUtil.isHttpsUrl(url)) return; + + mLastUrl = url; + mStartTimeMs = SystemClock.uptimeMillis(); + mPageDidPaint = isLoaded; + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ToolbarView.java b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ToolbarView.java index abb83e5..fefb4fd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ToolbarView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ToolbarView.java
@@ -46,6 +46,10 @@ mMenuButton.setVisibility(visible ? View.VISIBLE : View.GONE); } + void setMenuButtonAlpha(float alpha) { + mMenuButton.setAlpha(alpha); + } + void setTitle(String title) { mTitle.setText(title); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ToolbarViewBinder.java b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ToolbarViewBinder.java index 22ae678..0325129 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ToolbarViewBinder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ToolbarViewBinder.java
@@ -19,6 +19,8 @@ view.setCloseButtonOnClickListener(model.getCloseButtonOnClickListener()); } else if (propertyKey == PropertyKey.MENU_BUTTON_VISIBILITY) { view.setMenuButtonVisibility(model.getMenuButtonVisibility()); + } else if (propertyKey == PropertyKey.MENU_BUTTON_ALPHA) { + view.setMenuButtonAlpha(model.getMenuButtonAlpha()); } else if (propertyKey == PropertyKey.MENU_BUTTON_DELEGATE) { view.setMenuButtonDelegate(model.getMenuButtonDelegate()); } else if (propertyKey == PropertyKey.TITLE) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadBroadcastManager.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadBroadcastManager.java index a6fe4c5..0dcf820f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadBroadcastManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadBroadcastManager.java
@@ -48,7 +48,6 @@ */ public class DownloadBroadcastManager extends Service { private static final String TAG = "DLBroadcastManager"; - // TODO(jming): Check to see if this wait time is long enough to execute commands on native. private static final int WAIT_TIME_MS = 5000; private final DownloadSharedPreferenceHelper mDownloadSharedPreferenceHelper = @@ -264,7 +263,8 @@ /** * Retrieves DownloadSharedPreferenceEntry from a download action intent. - * TODO(jming): Instead of getting entire entry, pass only id/isOffTheRecord (crbug.com/749323). + * TODO(crbug.com/691805): Instead of getting entire entry, pass only id/isOffTheRecord, after + * consolidating all downloads-related objects. * @param intent Intent that contains the download action. */ private DownloadSharedPreferenceEntry getDownloadEntryFromIntent(Intent intent) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadForegroundServiceManager.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadForegroundServiceManager.java index 23e4277..5a7db284 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadForegroundServiceManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadForegroundServiceManager.java
@@ -33,15 +33,14 @@ * Manager to stop and start the foreground service associated with downloads. */ public class DownloadForegroundServiceManager { - public enum DownloadStatus { PAUSE, CANCEL, COMPLETE, IN_PROGRESS, FAIL } private static class DownloadUpdate { int mNotificationId; Notification mNotification; - DownloadStatus mDownloadStatus; + DownloadNotificationService2.DownloadStatus mDownloadStatus; Context mContext; - DownloadUpdate(int notificationId, Notification notification, DownloadStatus downloadStatus, - Context context) { + DownloadUpdate(int notificationId, Notification notification, + DownloadNotificationService2.DownloadStatus downloadStatus, Context context) { mNotificationId = notificationId; mNotification = notification; mDownloadStatus = downloadStatus; @@ -80,9 +79,10 @@ public DownloadForegroundServiceManager() {} - public void updateDownloadStatus(Context context, DownloadStatus downloadStatus, - int notificationId, Notification notification) { - if (downloadStatus != DownloadStatus.IN_PROGRESS) { + public void updateDownloadStatus(Context context, + DownloadNotificationService2.DownloadStatus downloadStatus, int notificationId, + Notification notification) { + if (downloadStatus != DownloadNotificationService2.DownloadStatus.IN_PROGRESS) { Log.w(TAG, "updateDownloadStatus status: " + downloadStatus + ", id: " + notificationId); } @@ -176,8 +176,8 @@ return null; } - private boolean isActive(DownloadStatus downloadStatus) { - return downloadStatus == DownloadStatus.IN_PROGRESS; + private boolean isActive(DownloadNotificationService2.DownloadStatus downloadStatus) { + return downloadStatus == DownloadNotificationService2.DownloadStatus.IN_PROGRESS; } private void cleanDownloadUpdateQueue() { @@ -256,16 +256,16 @@ /** Helper code to stop and unbind service. */ @VisibleForTesting - void stopAndUnbindService(DownloadStatus downloadStatus) { + void stopAndUnbindService(DownloadNotificationService2.DownloadStatus downloadStatus) { Log.w(TAG, "stopAndUnbindService status: " + downloadStatus); Preconditions.checkNotNull(mBoundService); mIsServiceBound = false; @DownloadForegroundService.StopForegroundNotification int stopForegroundNotification; - if (downloadStatus == DownloadStatus.CANCEL) { + if (downloadStatus == DownloadNotificationService2.DownloadStatus.CANCELLED) { stopForegroundNotification = DownloadForegroundService.StopForegroundNotification.KILL; - } else if (downloadStatus == DownloadStatus.PAUSE) { + } else if (downloadStatus == DownloadNotificationService2.DownloadStatus.PAUSED) { stopForegroundNotification = DownloadForegroundService.StopForegroundNotification.DETACH_OR_PERSIST; } else {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java index 4b1948a..2ffc67d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java
@@ -105,8 +105,6 @@ nativeOnComplete(mNativeDownloadLocationDialogBridge, filePath.getAbsolutePath()); } - // TODO(jming): Right now this doesn't stay checked if a second error is displayed. - // Figure out if this needs to be fixed (depending on if we want it pre-checked anyways). // Update preference to show prompt based on whether checkbox is checked. if (dontShowAgain) { PrefServiceBridge.getInstance().setPromptForDownloadAndroid(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java index 07edbf6..3aaba3c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
@@ -374,7 +374,6 @@ * will not be called. */ public void onActivityLaunched() { - // TODO(jming): Remove this after M-62. DownloadNotificationService.clearResumptionAttemptLeft(); DownloadManagerService.getDownloadManagerService().checkForExternallyRemovedDownloads(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationFactory.java index ccfc013c..7a4a5bbc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationFactory.java
@@ -47,16 +47,6 @@ // Limit file name to 25 characters. TODO(qinmin): use different limit for different devices? public static final int MAX_FILE_NAME_LENGTH = 25; - // TODO(jming): Eventually move this to DownloadNotificationStore. - enum DownloadStatus { - IN_PROGRESS, - PAUSED, - SUCCESSFUL, - FAILED, - DELETED, - SUMMARY // TODO(jming): Remove when summary notification is no longer in-use. - } - /** * Builds a downloads notification based on the status of the download and its information. * @param context of the download. @@ -64,8 +54,9 @@ * @param downloadUpdate information about the download (ie. contentId, fileName, icon, etc). * @return Notification that is built based on these parameters. */ - public static Notification buildNotification( - Context context, DownloadStatus downloadStatus, DownloadUpdate downloadUpdate) { + public static Notification buildNotification(Context context, + DownloadNotificationService2.DownloadStatus downloadStatus, + DownloadUpdate downloadUpdate) { ChromeNotificationBuilder builder = NotificationBuilderFactory .createChromeNotificationBuilder( @@ -193,7 +184,7 @@ break; - case SUCCESSFUL: + case COMPLETED: Preconditions.checkArgument(downloadUpdate.getNotificationId() != -1); contentText = @@ -241,18 +232,6 @@ contentText = DownloadUtils.getFailStatusString(downloadUpdate.getFailState()); break; - case SUMMARY: - Preconditions.checkArgument(downloadUpdate.getIconId() != -1); - - iconId = downloadUpdate.getIconId(); - contentText = ""; - builder.setContentTitle( - context.getString(R.string.download_notification_summary_title)) - .setSubText(context.getString(R.string.menu_downloads)) - .setSmallIcon(iconId) - .setGroupSummary(true); - break; - default: iconId = -1; contentText = ""; @@ -270,8 +249,8 @@ } if (downloadUpdate.getIcon() != null) builder.setLargeIcon(downloadUpdate.getIcon()); if (!downloadUpdate.getIsTransient() && downloadUpdate.getNotificationId() != -1 - && downloadStatus != DownloadStatus.SUCCESSFUL - && downloadStatus != DownloadStatus.FAILED) { + && downloadStatus != DownloadNotificationService2.DownloadStatus.COMPLETED + && downloadStatus != DownloadNotificationService2.DownloadStatus.FAILED) { Intent downloadHomeIntent = buildActionIntent( context, ACTION_NOTIFICATION_CLICKED, null, downloadUpdate.getIsOffTheRecord()); builder.setContentIntent(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService2.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService2.java index a2d21d9..a9d3577 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService2.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService2.java
@@ -48,6 +48,8 @@ * - Update DownloadForegroundServiceManager about downloads, allowing it to start/stop service. */ public class DownloadNotificationService2 { + public enum DownloadStatus { IN_PROGRESS, PAUSED, COMPLETED, CANCELLED, FAILED } + static final String EXTRA_DOWNLOAD_CONTENTID_ID = "org.chromium.chrome.browser.download.DownloadContentId_Id"; static final String EXTRA_DOWNLOAD_CONTENTID_NAMESPACE = @@ -60,17 +62,15 @@ static final String EXTRA_DOWNLOAD_STATE_AT_CANCEL = "org.chromium.chrome.browser.download.OfflineItemsStateAtCancel"; - public static final String ACTION_DOWNLOAD_CANCEL = + static final String ACTION_DOWNLOAD_CANCEL = "org.chromium.chrome.browser.download.DOWNLOAD_CANCEL"; - public static final String ACTION_DOWNLOAD_PAUSE = + static final String ACTION_DOWNLOAD_PAUSE = "org.chromium.chrome.browser.download.DOWNLOAD_PAUSE"; - public static final String ACTION_DOWNLOAD_RESUME = + static final String ACTION_DOWNLOAD_RESUME = "org.chromium.chrome.browser.download.DOWNLOAD_RESUME"; - public static final String ACTION_DOWNLOAD_OPEN = - "org.chromium.chrome.browser.download.DOWNLOAD_OPEN"; + static final String ACTION_DOWNLOAD_OPEN = "org.chromium.chrome.browser.download.DOWNLOAD_OPEN"; - public static final String EXTRA_NOTIFICATION_BUNDLE_ICON_ID = - "Chrome.NotificationBundleIconIdExtra"; + static final String EXTRA_NOTIFICATION_BUNDLE_ICON_ID = "Chrome.NotificationBundleIconIdExtra"; /** Notification Id starting value, to avoid conflicts from IDs used in prior versions. */ private static final int STARTING_NOTIFICATION_ID = 1000000; @@ -222,7 +222,7 @@ .setPendingState(pendingState) .build(); Notification notification = DownloadNotificationFactory.buildNotification( - context, DownloadNotificationFactory.DownloadStatus.IN_PROGRESS, downloadUpdate); + context, DownloadStatus.IN_PROGRESS, downloadUpdate); // If called from DownloadBroadcastManager, only update notification, not tracking. if (hasUserGesture) { @@ -234,9 +234,8 @@ new DownloadSharedPreferenceEntry(id, notificationId, isOffTheRecord, canDownloadWhileMetered, fileName, true, isTransient)); - mDownloadForegroundServiceManager.updateDownloadStatus(context, - DownloadForegroundServiceManager.DownloadStatus.IN_PROGRESS, notificationId, - notification); + mDownloadForegroundServiceManager.updateDownloadStatus( + context, DownloadStatus.IN_PROGRESS, notificationId, notification); startTrackingInProgressDownload(id); } @@ -280,7 +279,7 @@ cancelNotification(entry.notificationId, id); mDownloadForegroundServiceManager.updateDownloadStatus(ContextUtils.getApplicationContext(), - DownloadForegroundServiceManager.DownloadStatus.CANCEL, entry.notificationId, null); + DownloadStatus.CANCELLED, entry.notificationId, null); } /** @@ -329,7 +328,7 @@ .build(); Notification notification = DownloadNotificationFactory.buildNotification( - context, DownloadNotificationFactory.DownloadStatus.PAUSED, downloadUpdate); + context, DownloadStatus.PAUSED, downloadUpdate); // If called from DownloadBroadcastManager, only update notification, not tracking. if (hasUserGesture) { @@ -341,9 +340,8 @@ new DownloadSharedPreferenceEntry(id, notificationId, isOffTheRecord, canDownloadWhileMetered, fileName, isAutoResumable, isTransient)); - mDownloadForegroundServiceManager.updateDownloadStatus(context, - DownloadForegroundServiceManager.DownloadStatus.PAUSE, notificationId, - notification); + mDownloadForegroundServiceManager.updateDownloadStatus( + context, DownloadStatus.PAUSED, notificationId, notification); stopTrackingInProgressDownload(id); } @@ -389,12 +387,11 @@ .setReferrer(referrer) .build(); Notification notification = DownloadNotificationFactory.buildNotification( - context, DownloadNotificationFactory.DownloadStatus.SUCCESSFUL, downloadUpdate); + context, DownloadStatus.COMPLETED, downloadUpdate); updateNotification(notificationId, notification, id, null); - mDownloadForegroundServiceManager.updateDownloadStatus(context, - DownloadForegroundServiceManager.DownloadStatus.COMPLETE, notificationId, - notification); + mDownloadForegroundServiceManager.updateDownloadStatus( + context, DownloadStatus.COMPLETED, notificationId, notification); stopTrackingInProgressDownload(id); return notificationId; } @@ -427,11 +424,11 @@ .setFailState(failState) .build(); Notification notification = DownloadNotificationFactory.buildNotification( - context, DownloadNotificationFactory.DownloadStatus.FAILED, downloadUpdate); + context, DownloadStatus.FAILED, downloadUpdate); updateNotification(notificationId, notification, id, null); - mDownloadForegroundServiceManager.updateDownloadStatus(context, - DownloadForegroundServiceManager.DownloadStatus.FAIL, notificationId, notification); + mDownloadForegroundServiceManager.updateDownloadStatus( + context, DownloadStatus.FAILED, notificationId, notification); stopTrackingInProgressDownload(id); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUpdate.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUpdate.java index 258a999..7f99afc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUpdate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUpdate.java
@@ -13,7 +13,7 @@ /** * Class representing information relating to an update in download status. - * TODO(jming): Consolidate with other downloads-related objects (http://crbug.com/746692). + * TODO(crbug.com/691805): Consolidate with other downloads-related objects. */ public final class DownloadUpdate { private final ContentId mContentId;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java index 5f134bb..fc3f525 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java
@@ -553,11 +553,12 @@ @CallSuper @Override public boolean onActivityResultWithNative(int requestCode, int resultCode, Intent intent) { - if (mWindowAndroid != null) { - return mWindowAndroid.onActivityResult(requestCode, resultCode, intent); - } else { - return false; + if (mWindowAndroid != null + && mWindowAndroid.onActivityResult(requestCode, resultCode, intent)) { + return true; } + super.onActivityResult(requestCode, resultCode, intent); + return false; } @CallSuper
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java index c2c9768..608651be 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java
@@ -442,9 +442,10 @@ return false; } if (Build.VERSION.SDK_INT == Build.VERSION_CODES.M - && Build.MANUFACTURER.equalsIgnoreCase("samsung")) { + && (Build.MANUFACTURER.equalsIgnoreCase("samsung") + || Build.MANUFACTURER.equalsIgnoreCase("yulong"))) { // Updating a notification with a bitmap status bar icon leads to a crash on Samsung - // devices on Marshmallow, see https://crbug.com/829367. + // and Coolpad (Yulong) devices on Marshmallow, see https://crbug.com/829367. return false; } return true;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbyBackgroundSubscription.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbyBackgroundSubscription.java deleted file mode 100644 index a1452058..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbyBackgroundSubscription.java +++ /dev/null
@@ -1,72 +0,0 @@ -// Copyright 2016 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.physicalweb; - -import android.app.PendingIntent; -import android.content.Intent; - -import com.google.android.gms.common.api.PendingResult; -import com.google.android.gms.common.api.Status; -import com.google.android.gms.nearby.Nearby; - -import org.chromium.base.ContextUtils; - - -/** - * This class represents a connection to Google Play Services that does background - * subscription/unsubscription to Nearby Eddystone-URLs. - */ -class NearbyBackgroundSubscription extends NearbySubscription { - private static final String TAG = "PhysicalWeb"; - private final int mAction; - private final Runnable mCallback; - - NearbyBackgroundSubscription(int action, Runnable callback) { - super(ContextUtils.getApplicationContext()); - mAction = action; - mCallback = callback; - } - - NearbyBackgroundSubscription(int action) { - this(action, null); - } - - private PendingIntent createNearbySubscribeIntent() { - Intent intent = - new Intent(ContextUtils.getApplicationContext(), NearbyMessageIntentService.class); - PendingIntent pendingIntent = PendingIntent.getService( - ContextUtils.getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); - return pendingIntent; - } - - @Override - protected void onConnected() { - PendingResult<Status> pendingResult = null; - String actionStr = null; - if (mAction == SUBSCRIBE) { - pendingResult = Nearby.Messages.subscribe( - getGoogleApiClient(), createNearbySubscribeIntent(), createSubscribeOptions()); - actionStr = "background subscribe"; - } else { - pendingResult = Nearby.Messages.unsubscribe( - getGoogleApiClient(), createNearbySubscribeIntent()); - actionStr = "background unsubscribe"; - } - pendingResult.setResultCallback(new SimpleResultCallback(actionStr) { - @Override - public void onResult(final Status status) { - super.onResult(status); - disconnect(); - if (mCallback != null) { - mCallback.run(); - } - } - }); - } - - void run() { - connect(); - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbyForegroundSubscription.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbyForegroundSubscription.java deleted file mode 100644 index 99efb62..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbyForegroundSubscription.java +++ /dev/null
@@ -1,77 +0,0 @@ -// Copyright 2016 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.physicalweb; - -import android.app.Activity; - -import com.google.android.gms.nearby.Nearby; -import com.google.android.gms.nearby.messages.Distance; -import com.google.android.gms.nearby.messages.Message; -import com.google.android.gms.nearby.messages.MessageListener; - -import org.chromium.base.ThreadUtils; - -/** - * This class represents a connection to Google Play Services that does foreground - * subscription/unsubscription to Nearby Eddystone-URLs. - * To use this class, one should: - * 1. connect, - * 2. subscribe, - * 3. unsubscribe, - * 4. repeat steps 2-3 as desired, and - * 5. disconnect. - */ -class NearbyForegroundSubscription extends NearbySubscription { - private static final String TAG = "PhysicalWeb"; - private static final MessageListener MESSAGE_LISTENER = new MessageListener() { - @Override - public void onFound(Message message) {} - - @Override - public void onDistanceChanged(Message message, final Distance distance) { - final String url = PhysicalWebBleClient.getInstance().getUrlFromMessage(message); - if (url == null) return; - - ThreadUtils.postOnUiThread(new Runnable() { - @Override - public void run() { - UrlManager.getInstance().addUrl( - new UrlInfo(url).setDistance(distance.getMeters())); - } - }); - } - }; - private boolean mShouldSubscribe; - - NearbyForegroundSubscription(Activity activity) { - super(activity); - mShouldSubscribe = false; - } - - @Override - protected void onConnected() { - if (mShouldSubscribe) { - subscribe(); - } - } - - void subscribe() { - if (!getGoogleApiClient().isConnected()) { - mShouldSubscribe = true; - return; - } - Nearby.Messages.subscribe(getGoogleApiClient(), MESSAGE_LISTENER, createSubscribeOptions()) - .setResultCallback(new SimpleResultCallback("foreground subscribe")); - } - - void unsubscribe() { - if (!getGoogleApiClient().isConnected()) { - mShouldSubscribe = false; - return; - } - Nearby.Messages.unsubscribe(getGoogleApiClient(), MESSAGE_LISTENER) - .setResultCallback(new SimpleResultCallback("foreground unsubscribe")); - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbyMessageIntentService.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbyMessageIntentService.java deleted file mode 100644 index 23651ea..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbyMessageIntentService.java +++ /dev/null
@@ -1,30 +0,0 @@ -// Copyright 2015 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.physicalweb; - -import android.app.IntentService; -import android.content.Intent; - -import com.google.android.gms.nearby.Nearby; -import com.google.android.gms.nearby.messages.MessageListener; - -/** - * Service that handles intents from Nearby. - */ -public class NearbyMessageIntentService extends IntentService { - private static final MessageListener MESSAGE_LISTENER = - PhysicalWebBleClient.getInstance().createBackgroundMessageListener(); - - - public NearbyMessageIntentService() { - super(NearbyMessageIntentService.class.getSimpleName()); - setIntentRedelivery(true); - } - - @Override - protected void onHandleIntent(Intent intent) { - Nearby.Messages.handleIntent(intent, MESSAGE_LISTENER); - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbySubscription.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbySubscription.java deleted file mode 100644 index f4538f70..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbySubscription.java +++ /dev/null
@@ -1,102 +0,0 @@ -// Copyright 2016 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.physicalweb; - -import android.content.Context; -import android.os.Bundle; - -import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; -import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; -import com.google.android.gms.common.api.ResultCallback; -import com.google.android.gms.common.api.Status; -import com.google.android.gms.nearby.Nearby; -import com.google.android.gms.nearby.messages.MessageFilter; -import com.google.android.gms.nearby.messages.MessagesOptions; -import com.google.android.gms.nearby.messages.NearbyPermissions; -import com.google.android.gms.nearby.messages.Strategy; -import com.google.android.gms.nearby.messages.SubscribeOptions; - -import org.chromium.base.Log; - - -/** - * This class represents a connection to Google Play Services that performs subscriptions - * and unsubscriptions to Nearby. - */ -abstract class NearbySubscription implements ConnectionCallbacks, OnConnectionFailedListener { - public static final int UNSUBSCRIBE = 0; - public static final int SUBSCRIBE = 1; - private static final String TAG = "PhysicalWeb"; - private final GoogleApiClient mGoogleApiClient; - - protected static class SimpleResultCallback implements ResultCallback<Status> { - private String mAction; - - SimpleResultCallback(String action) { - mAction = action; - } - - @Override - public void onResult(final Status status) { - if (status.isSuccess()) { - Log.d(TAG, "Nearby " + mAction + " succeeded"); - } else { - Log.d(TAG, "Nearby " + mAction + " failed: " + status.getStatusMessage()); - } - } - } - - NearbySubscription(Context context) { - mGoogleApiClient = new GoogleApiClient.Builder(context) - .addApi(Nearby.MESSAGES_API, new MessagesOptions.Builder() - .setPermissions(NearbyPermissions.BLE) - .build()) - .addConnectionCallbacks(this) - .addOnConnectionFailedListener(this) - .build(); - } - - protected void connect() { - mGoogleApiClient.connect(); - } - - protected void disconnect() { - mGoogleApiClient.disconnect(); - } - - protected void onConnected() { - } - - @Override - public void onConnected(Bundle connectionHint) { - onConnected(); - } - - @Override - public void onConnectionSuspended(int cause) { - Log.i(TAG, "Nearby connection suspended: " + cause); - } - - @Override - public void onConnectionFailed(ConnectionResult result) { - Log.i(TAG, "Nearby connection failed: " + result); - } - - protected static SubscribeOptions createSubscribeOptions() { - MessageFilter messageFilter = PhysicalWebBleClient.getInstance().modifyMessageFilterBuilder( - new MessageFilter.Builder()) - .build(); - return new SubscribeOptions.Builder() - .setStrategy(Strategy.BLE_ONLY) - .setFilter(messageFilter) - .build(); - } - - protected GoogleApiClient getGoogleApiClient() { - return mGoogleApiClient; - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java index 866af15..8b61ebb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java
@@ -66,9 +66,6 @@ // In the case that the user has disabled our flag and restarted, this is a minimal code // path to disable our subscription to Nearby. if (!featureIsEnabled()) { - if (!SysUtils.isLowEndDevice()) { - new NearbyBackgroundSubscription(NearbySubscription.UNSUBSCRIBE).run(); - } return; } @@ -138,17 +135,5 @@ /** * Examines the environment in order to decide whether we should begin or end a scan. */ - public static void updateScans() { - if (SysUtils.isLowEndDevice()) return; - - LocationUtils locationUtils = LocationUtils.getInstance(); - if (!locationUtils.hasAndroidLocationPermission() - || !locationUtils.isSystemLocationSettingEnabled() - || !isPhysicalWebPreferenceEnabled()) { - new NearbyBackgroundSubscription(NearbySubscription.UNSUBSCRIBE).run(); - return; - } - - new NearbyBackgroundSubscription(NearbySubscription.SUBSCRIBE).run(); - } + public static void updateScans() {} }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java deleted file mode 100644 index 559bfdd..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java +++ /dev/null
@@ -1,90 +0,0 @@ -// Copyright 2015 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.physicalweb; - -import android.os.Handler; -import android.os.Looper; - -import com.google.android.gms.nearby.messages.Message; -import com.google.android.gms.nearby.messages.MessageFilter; -import com.google.android.gms.nearby.messages.MessageListener; - -import org.chromium.chrome.browser.AppHooks; - -/** - * The Client that harvests URLs from BLE signals. - * This class is designed to scan URLs from Bluetooth Low Energy beacons. - * This class is currently an empty implementation and must be extended by a - * subclass. - */ -public class PhysicalWebBleClient { - private static PhysicalWebBleClient sInstance; - private static final String TAG = "PhysicalWeb"; - - protected static class BackgroundMessageListener extends MessageListener { - @Override - public void onFound(Message message) { - final String url = PhysicalWebBleClient.getInstance().getUrlFromMessage(message); - if (url != null) { - new Handler(Looper.getMainLooper()).post(new Runnable() { - @Override - public void run() { - UrlManager.getInstance().addUrl(new UrlInfo(url)); - } - }); - } - } - - @Override - public void onLost(Message message) { - final String url = PhysicalWebBleClient.getInstance().getUrlFromMessage(message); - if (url != null) { - new Handler(Looper.getMainLooper()).post(new Runnable() { - @Override - public void run() { - UrlManager.getInstance().removeUrl(new UrlInfo(url)); - } - }); - } - } - }; - - /** - * Get a singleton instance of this class. - * @return an instance of this class (or subclass). - */ - public static PhysicalWebBleClient getInstance() { - if (sInstance == null) { - sInstance = AppHooks.get().createPhysicalWebBleClient(); - } - return sInstance; - } - - /** - * Create a MessageListener that listens during a background scan. - * @return the MessageListener. - */ - MessageListener createBackgroundMessageListener() { - return new BackgroundMessageListener(); - } - - /** - * Get the URLs from a device within a message. - * @param message The Nearby message. - * @return The URL contained in the message. - */ - String getUrlFromMessage(Message message) { - return null; - } - - /** - * Modify a MessageFilter.Builder as necessary for doing Physical Web scanning. - * @param builder The builder to be modified. - * @return The Builder. - */ - MessageFilter.Builder modifyMessageFilterBuilder(MessageFilter.Builder builder) { - return builder.includeAllMyTypes(); - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java index 3dec1b4..2166a86 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
@@ -387,6 +387,13 @@ } /** + * @return true if websites are allowed to request permission to access USB devices. + */ + public boolean isUsbEnabled() { + return isContentSettingEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_GUARD); + } + + /** * Sets the preference that controls protected media identifier. */ public void setProtectedMediaIdentifierEnabled(boolean enabled) { @@ -751,6 +758,10 @@ nativeSetSoundEnabled(allow); } + public void setUsbEnabled(boolean allow) { + setContentSettingEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_GUARD, allow); + } + /** * @return The setting if popups are enabled */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ChosenObjectInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ChosenObjectInfo.java new file mode 100644 index 0000000..f0bcebf --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ChosenObjectInfo.java
@@ -0,0 +1,73 @@ +// Copyright 2016 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.preferences.website; + +import org.chromium.chrome.browser.ContentSettingsType; + +import java.io.Serializable; + +/** + * Information about an object (such as a USB device) the user has granted permission for an origin + * to access. + */ +public class ChosenObjectInfo implements Serializable { + private final @ContentSettingsType int mContentSettingsType; + private final String mOrigin; + private final String mEmbedder; + private final String mName; + private final String mObject; + + ChosenObjectInfo(@ContentSettingsType int contentSettingsType, String origin, String embedder, + String name, String object) { + mContentSettingsType = contentSettingsType; + mOrigin = origin; + mEmbedder = embedder; + mName = name; + mObject = object; + } + + /** + * Returns the content settings type of the permission. + */ + public @ContentSettingsType int getContentSettingsType() { + return mContentSettingsType; + } + + /** + * Returns the origin that requested the permission. + */ + public String getOrigin() { + return mOrigin; + } + + /** + * Returns the origin that the requester was embedded in. + */ + public String getEmbedder() { + return mEmbedder; + } + + /** + * Returns the human readable name for the object to display in the UI. + */ + public String getName() { + return mName; + } + + /** + * Returns the opaque object string that represents the object. + */ + public String getObject() { + return mObject; + } + + /** + * Revokes permission for the origin to access the object. + */ + public void revoke() { + WebsitePreferenceBridge.nativeRevokeObjectPermission( + mContentSettingsType, mOrigin, mEmbedder, mObject); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbDevicePreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ChosenObjectPreferences.java similarity index 69% rename from chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbDevicePreferences.java rename to chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ChosenObjectPreferences.java index 822b968..2462018 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbDevicePreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ChosenObjectPreferences.java
@@ -16,6 +16,7 @@ import android.view.inputmethod.EditorInfo; import android.widget.ListView; +import org.chromium.base.annotations.RemovableInRelease; import org.chromium.chrome.R; import org.chromium.chrome.browser.help.HelpAndFeedback; import org.chromium.chrome.browser.preferences.PreferenceUtils; @@ -23,13 +24,15 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Locale; /** - * Shows the list of sites that the user has granted access to a particular USB device. + * Shows a particular chosen object (e.g. a USB device) and the list of sites that have been + * granted access to it by the user. */ -public class UsbDevicePreferences +public class ChosenObjectPreferences extends PreferenceFragment implements Preference.OnPreferenceClickListener { - public static final String EXTRA_USB_INFOS = "org.chromium.chrome.preferences.usb_infos"; + public static final String EXTRA_OBJECT_INFOS = "org.chromium.chrome.preferences.object_infos"; public static final String EXTRA_SITES = "org.chromium.chrome.preferences.site_set"; public static final String EXTRA_CATEGORY = "org.chromium.chrome.preferences.content_settings_type"; @@ -38,10 +41,8 @@ // The site settings category we are showing. private SiteSettingsCategory mCategory; - // Canonical example of the USB device being examined. - private UsbInfo mUsbInfo; - // All of the USB device permission entries matching the canonical device. - private ArrayList<UsbInfo> mUsbInfos; + // The set of object permissions being examined. + private ArrayList<ChosenObjectInfo> mObjectInfos; // The set of sites to display. private ArrayList<Website> mSites; // The view for searching the list of items. @@ -52,14 +53,15 @@ @Override @SuppressWarnings("unchecked") public void onActivityCreated(Bundle savedInstanceState) { - PreferenceUtils.addPreferencesFromResource(this, R.xml.usb_device_preferences); + PreferenceUtils.addPreferencesFromResource(this, R.xml.chosen_object_preferences); ListView listView = (ListView) getView().findViewById(android.R.id.list); listView.setDivider(null); int contentSettingsType = getArguments().getInt(EXTRA_CATEGORY); mCategory = SiteSettingsCategory.fromContentSettingsType(contentSettingsType); - mUsbInfos = (ArrayList<UsbInfo>) getArguments().getSerializable(EXTRA_USB_INFOS); - mUsbInfo = mUsbInfos.get(0); + mObjectInfos = + (ArrayList<ChosenObjectInfo>) getArguments().getSerializable(EXTRA_OBJECT_INFOS); + checkObjectConsistency(); mSites = (ArrayList<Website>) getArguments().getSerializable(EXTRA_SITES); String title = getArguments().getString(SingleCategoryPreferences.EXTRA_TITLE); if (title != null) getActivity().setTitle(title); @@ -69,6 +71,21 @@ super.onActivityCreated(savedInstanceState); } + /** + * Checks the consistency of |mObjectInfos|. + * + * This method asserts that for all the entries in |mObjectInfos| the getObject() method + * returns the same value. This must be true because this activity is displaying permissions + * for a single object. Each instance varies only in which site it represents. + */ + @RemovableInRelease + private void checkObjectConsistency() { + String exampleObject = mObjectInfos.get(0).getObject(); + for (ChosenObjectInfo info : mObjectInfos) { + assert info.getObject().equals(exampleObject); + } + } + @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { menu.clear(); @@ -86,7 +103,7 @@ @Override public boolean onQueryTextChange(String query) { // Make search case-insensitive. - query = query.toLowerCase(); + query = query.toLowerCase(Locale.getDefault()); if (query.equals(mSearch)) return true; @@ -127,7 +144,7 @@ @Override public boolean onPreferenceClick(Preference preference) { if (PREF_OBJECT_NAME.equals(preference.getKey())) { - for (int i = 0; i < mUsbInfos.size(); ++i) mUsbInfos.get(i).revoke(); + for (int i = 0; i < mObjectInfos.size(); ++i) mObjectInfos.get(i).revoke(); getActivity().finish(); return true; } @@ -142,25 +159,32 @@ // In that case, bail out. if (getActivity() == null) return; - mUsbInfos.clear(); + // Remember the object being examined in this view so that we can filter the results + // to only include sites with permission for this particular object. + String exampleObject = mObjectInfos.get(0).getObject(); + + mObjectInfos.clear(); mSites = new ArrayList<Website>(); for (Website site : sites) { - for (UsbInfo info : site.getUsbInfo()) { - if (info.getObject().equals(mUsbInfo.getObject())) { - mUsbInfos.add(info); - if (mSearch.isEmpty() || site.getTitle().toLowerCase().contains(mSearch)) { + for (ChosenObjectInfo info : site.getChosenObjectInfo()) { + if (info.getObject().equals(exampleObject)) { + mObjectInfos.add(info); + if (mSearch.isEmpty() + || site.getTitle() + .toLowerCase(Locale.getDefault()) + .contains(mSearch)) { mSites.add(site); } } } } - // After revoking a site's permission to access a device the user may end up back at + // After revoking a site's permission to access an object the user may end up back at // this activity. It is awkward to display this empty list because there's no action // that can be taken from it. In this case we dismiss this activity as well, taking - // them back to UsbChooserPreferences which will now no longer offer the option to - // examine the permissions for this device. - if (mUsbInfos.isEmpty()) { + // them back to SingleCategoryPreferences which will now no longer offer the option to + // examine the permissions for this object. + if (mObjectInfos.isEmpty()) { getActivity().finish(); } else { resetList(); @@ -180,11 +204,13 @@ private void resetList() { getPreferenceScreen().removeAll(); - PreferenceUtils.addPreferencesFromResource(this, R.xml.usb_device_preferences); + PreferenceUtils.addPreferencesFromResource(this, R.xml.chosen_object_preferences); PreferenceScreen preferenceScreen = getPreferenceScreen(); Preference header = preferenceScreen.findPreference(PREF_OBJECT_NAME); - header.setTitle(mUsbInfo.getName()); + // All the ChosenObjectInfo instances represent the same object so we may arbitrarily + // use the name of the first one. + header.setTitle(mObjectInfos.get(0).getName()); header.setOnPreferenceClickListener(this); for (int i = 0; i < mSites.size(); ++i) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ContentSettingsResources.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ContentSettingsResources.java index 716a594..6d22897 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ContentSettingsResources.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ContentSettingsResources.java
@@ -167,7 +167,12 @@ R.string.website_settings_category_sound_blocked)); localMap.put(ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA, new ResourceItem(R.drawable.settings_usb, 0, 0, ContentSetting.ASK, - ContentSetting.BLOCK, 0, 0)); + ContentSetting.BLOCK, 0, 0)); + localMap.put(ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_GUARD, + new ResourceItem(R.drawable.settings_usb, R.string.website_settings_usb, + R.string.website_settings_usb, ContentSetting.ASK, ContentSetting.BLOCK, + R.string.website_settings_category_usb_ask, + R.string.website_settings_category_usb_blocked)); sResourceInfo = localMap; } return sResourceInfo;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java index 539375b..1d9ff44 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
@@ -18,6 +18,7 @@ import android.support.v7.app.AlertDialog; import android.support.v7.widget.SearchView; import android.text.format.Formatter; +import android.util.Pair; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -52,7 +53,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * Shows a list of sites in a particular Site Settings category. For example, this could show all @@ -129,84 +132,16 @@ if (getActivity() == null) return; mWebsites = null; - // Find origins matching the current search. - List<WebsitePreference> websites = new ArrayList<>(); - for (Website site : sites) { - if (mSearch.isEmpty() || site.getTitle().contains(mSearch)) { - websites.add(new WebsitePreference(getActivity(), site, mCategory)); - } - } - resetList(); - Collections.sort(websites); - mAllowedSiteCount = 0; - int blocked = 0; - if (websites.size() > 0) { - if (!mGroupByAllowBlock) { - // We're not grouping sites into Allowed/Blocked lists, so show all in order - // (will be alphabetical). - for (WebsitePreference website : websites) { - getPreferenceScreen().addPreference(website); - } - } else { - // Group sites into Allowed/Blocked lists. - PreferenceGroup allowedGroup = - (PreferenceGroup) getPreferenceScreen().findPreference( - ALLOWED_GROUP); - PreferenceGroup blockedGroup = - (PreferenceGroup) getPreferenceScreen().findPreference( - BLOCKED_GROUP); - for (WebsitePreference website : websites) { - if (isOnBlockList(website)) { - blockedGroup.addPreference(website); - blocked += 1; - } else { - allowedGroup.addPreference(website); - mAllowedSiteCount += 1; - } - } - - // For the ads permission, the Allowed list should appear first. Default - // collapsed settings should not change. - if (mCategory.showAdsSites()) { - blockedGroup.setOrder(allowedGroup.getOrder() + 1); - } - - // The default, when the two lists are shown for the first time, is for the - // Blocked list to be collapsed and Allowed expanded -- because the data in - // the Allowed list is normally more useful than the data in the Blocked - // list. A collapsed initial Blocked list works well *except* when there's - // nothing in the Allowed list because then there's only Blocked items to - // show and it doesn't make sense for those items to be hidden. So, in that - // case (and only when the list is shown for the first time) do we ignore - // the collapsed directive. The user can still collapse and expand the - // Blocked list at will. - if (mIsInitialRun) { - if (allowedGroup.getPreferenceCount() == 0) mBlockListExpanded = true; - mIsInitialRun = false; - } - - if (!mBlockListExpanded) { - blockedGroup.removeAll(); - } - - if (!mAllowListExpanded) { - allowedGroup.removeAll(); - } - } - - mWebsites = websites; - updateBlockedHeader(blocked); - ChromeSwitchPreference globalToggle = (ChromeSwitchPreference) - getPreferenceScreen().findPreference(READ_WRITE_TOGGLE_KEY); - updateAllowedHeader(mAllowedSiteCount, - (globalToggle != null ? globalToggle.isChecked() : true)); + boolean hasEntries; + if (mCategory.showUsbDevices()) { + hasEntries = addChosenObjects(sites); } else { - displayEmptyScreenMessage(); - updateBlockedHeader(0); - updateAllowedHeader(0, true); + hasEntries = addWebsites(sites); } + + if (!hasEntries) displayEmptyScreenMessage(); } } @@ -528,6 +463,8 @@ (boolean) newValue); } else if (mCategory.showSoundSites()) { PrefServiceBridge.getInstance().setSoundEnabled((boolean) newValue); + } else if (mCategory.showUsbDevices()) { + PrefServiceBridge.getInstance().setUsbEnabled((boolean) newValue); } // Categories that support adding exceptions also manage the 'Add site' preference. @@ -648,6 +585,131 @@ } } + private boolean addWebsites(Collection<Website> sites) { + List<WebsitePreference> websites = new ArrayList<>(); + + // Find origins matching the current search. + for (Website site : sites) { + if (mSearch.isEmpty() || site.getTitle().contains(mSearch)) { + websites.add(new WebsitePreference(getActivity(), site, mCategory)); + } + } + + if (websites.size() == 0) { + updateBlockedHeader(0); + updateAllowedHeader(0, true); + return false; + } + + Collections.sort(websites); + mAllowedSiteCount = 0; + int blocked = 0; + + if (!mGroupByAllowBlock) { + // We're not grouping sites into Allowed/Blocked lists, so show all in order + // (will be alphabetical). + for (WebsitePreference website : websites) { + getPreferenceScreen().addPreference(website); + } + } else { + // Group sites into Allowed/Blocked lists. + PreferenceGroup allowedGroup = + (PreferenceGroup) getPreferenceScreen().findPreference(ALLOWED_GROUP); + PreferenceGroup blockedGroup = + (PreferenceGroup) getPreferenceScreen().findPreference(BLOCKED_GROUP); + + for (WebsitePreference website : websites) { + if (isOnBlockList(website)) { + blockedGroup.addPreference(website); + blocked += 1; + } else { + allowedGroup.addPreference(website); + mAllowedSiteCount += 1; + } + } + + // For the ads permission, the Allowed list should appear first. Default + // collapsed settings should not change. + if (mCategory.showAdsSites()) { + blockedGroup.setOrder(allowedGroup.getOrder() + 1); + } + + // The default, when the two lists are shown for the first time, is for the + // Blocked list to be collapsed and Allowed expanded -- because the data in + // the Allowed list is normally more useful than the data in the Blocked + // list. A collapsed initial Blocked list works well *except* when there's + // nothing in the Allowed list because then there's only Blocked items to + // show and it doesn't make sense for those items to be hidden. So, in that + // case (and only when the list is shown for the first time) do we ignore + // the collapsed directive. The user can still collapse and expand the + // Blocked list at will. + if (mIsInitialRun) { + if (allowedGroup.getPreferenceCount() == 0) mBlockListExpanded = true; + mIsInitialRun = false; + } + + if (!mBlockListExpanded) { + blockedGroup.removeAll(); + } + + if (!mAllowListExpanded) { + allowedGroup.removeAll(); + } + } + + mWebsites = websites; + updateBlockedHeader(blocked); + ChromeSwitchPreference globalToggle = + (ChromeSwitchPreference) getPreferenceScreen().findPreference( + READ_WRITE_TOGGLE_KEY); + updateAllowedHeader( + mAllowedSiteCount, (globalToggle != null ? globalToggle.isChecked() : true)); + + return websites.size() != 0; + } + + private boolean addChosenObjects(Collection<Website> sites) { + Map<String, Pair<ArrayList<ChosenObjectInfo>, ArrayList<Website>>> objects = + new HashMap<>(); + + // Find chosen objects matching the current search and collect the list of sites + // that have permission to access each. + for (Website site : sites) { + for (ChosenObjectInfo info : site.getChosenObjectInfo()) { + if (mSearch.isEmpty() || info.getName().toLowerCase().contains(mSearch)) { + Pair<ArrayList<ChosenObjectInfo>, ArrayList<Website>> entry = + objects.get(info.getObject()); + if (entry == null) { + entry = Pair.create( + new ArrayList<ChosenObjectInfo>(), new ArrayList<Website>()); + objects.put(info.getObject(), entry); + } + entry.first.add(info); + entry.second.add(site); + } + } + } + + updateBlockedHeader(0); + updateAllowedHeader(0, true); + + for (Pair<ArrayList<ChosenObjectInfo>, ArrayList<Website>> entry : objects.values()) { + Preference preference = new Preference(getActivity()); + Bundle extras = preference.getExtras(); + extras.putInt( + ChosenObjectPreferences.EXTRA_CATEGORY, mCategory.toContentSettingsType()); + extras.putString(EXTRA_TITLE, getActivity().getTitle().toString()); + extras.putSerializable(ChosenObjectPreferences.EXTRA_OBJECT_INFOS, entry.first); + extras.putSerializable(ChosenObjectPreferences.EXTRA_SITES, entry.second); + preference.setIcon(ContentSettingsResources.getIcon(mCategory.toContentSettingsType())); + preference.setTitle(entry.first.get(0).getName()); + preference.setFragment(ChosenObjectPreferences.class.getCanonicalName()); + getPreferenceScreen().addPreference(preference); + } + + return objects.size() != 0; + } + private void configureGlobalToggles() { // Only some have a global toggle at the top. ChromeSwitchPreference globalToggle = (ChromeSwitchPreference) @@ -779,6 +841,8 @@ PrefServiceBridge.getInstance().isProtectedMediaIdentifierEnabled()); } else if (mCategory.showSoundSites()) { globalToggle.setChecked(PrefServiceBridge.getInstance().isSoundEnabled()); + } else if (mCategory.showUsbDevices()) { + globalToggle.setChecked(PrefServiceBridge.getInstance().isUsbEnabled()); } } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java index e61cd5d..576ad56 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java
@@ -50,7 +50,7 @@ // permissions for that website address and display those. public static final String EXTRA_SITE = "org.chromium.chrome.preferences.site"; public static final String EXTRA_SITE_ADDRESS = "org.chromium.chrome.preferences.site_address"; - public static final String EXTRA_USB_INFO = "org.chromium.chrome.preferences.usb_info"; + public static final String EXTRA_OBJECT_INFO = "org.chromium.chrome.preferences.object_info"; // Preference keys, see single_website_preferences.xml // Headings: @@ -108,8 +108,8 @@ // The website this page is displaying details about. private Website mSite; - // The number of USB device permissions displayed. - private int mUsbPermissionCount; + // The number of chosen object permissions displayed. + private int mObjectPermissionCount; private class SingleWebsitePermissionsPopulator implements WebsitePermissionsFetcher.WebsitePermissionsCallback { @@ -240,10 +240,11 @@ merged.addStorageInfo(storageInfo); } } - for (UsbInfo usbInfo : other.getUsbInfo()) { - if (origin.equals(usbInfo.getOrigin()) - && (usbInfo.getEmbedder() == null || usbInfo.getEmbedder().equals("*"))) { - merged.addUsbInfo(usbInfo); + for (ChosenObjectInfo objectInfo : other.getChosenObjectInfo()) { + if (origin.equals(objectInfo.getOrigin()) + && (objectInfo.getEmbedder() == null + || objectInfo.getEmbedder().equals("*"))) { + merged.addChosenObjectInfo(objectInfo); } } if (host.equals(other.getAddress().getHost())) { @@ -301,7 +302,7 @@ maxPermissionOrder = Math.max(maxPermissionOrder, preference.getOrder()); } } - setUpUsbPreferences(maxPermissionOrder); + setUpChosenObjectPreferences(maxPermissionOrder); setUpOsWarningPreferences(); setUpAdsInformationalBanner(); @@ -465,17 +466,17 @@ } } - private void setUpUsbPreferences(int maxPermissionOrder) { - for (UsbInfo info : mSite.getUsbInfo()) { + private void setUpChosenObjectPreferences(int maxPermissionOrder) { + for (ChosenObjectInfo info : mSite.getChosenObjectInfo()) { Preference preference = new Preference(getActivity()); - preference.getExtras().putSerializable(EXTRA_USB_INFO, info); - preference.setIcon(R.drawable.settings_usb); + preference.getExtras().putSerializable(EXTRA_OBJECT_INFO, info); + preference.setIcon(ContentSettingsResources.getIcon(info.getContentSettingsType())); preference.setOnPreferenceClickListener(this); preference.setOrder(maxPermissionOrder); preference.setTitle(info.getName()); - preference.setWidgetLayoutResource(R.layout.usb_permission); + preference.setWidgetLayoutResource(R.layout.object_permission); getPreferenceScreen().addPreference(preference); - mUsbPermissionCount++; + mObjectPermissionCount++; } } @@ -570,7 +571,7 @@ } private boolean hasPermissionsPreferences() { - if (mUsbPermissionCount > 0) return true; + if (mObjectPermissionCount > 0) return true; PreferenceScreen screen = getPreferenceScreen(); for (String key : PERMISSION_PREFERENCE_KEYS) { if (screen.findPreference(key) != null) return true; @@ -824,13 +825,14 @@ public boolean onPreferenceClick(Preference preference) { Bundle extras = preference.peekExtras(); if (extras != null) { - UsbInfo usbInfo = (UsbInfo) extras.getSerializable(EXTRA_USB_INFO); - if (usbInfo != null) { - usbInfo.revoke(); + ChosenObjectInfo objectInfo = + (ChosenObjectInfo) extras.getSerializable(EXTRA_OBJECT_INFO); + if (objectInfo != null) { + objectInfo.revoke(); PreferenceScreen preferenceScreen = getPreferenceScreen(); preferenceScreen.removePreference(preference); - mUsbPermissionCount--; + mObjectPermissionCount--; if (!hasPermissionsPreferences()) { Preference heading = preferenceScreen.findPreference(PREF_PERMISSIONS); preferenceScreen.removePreference(heading); @@ -890,7 +892,8 @@ mSite.setProtectedMediaIdentifierPermission(ContentSetting.DEFAULT); mSite.setSoundPermission(ContentSetting.DEFAULT); - for (UsbInfo info : mSite.getUsbInfo()) info.revoke(); + for (ChosenObjectInfo info : mSite.getChosenObjectInfo()) info.revoke(); + mObjectPermissionCount = 0; // Clear the storage and finish the activity if necessary. if (mSite.getTotalUsage() > 0) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java index 91841b7..361ec92 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java
@@ -146,7 +146,7 @@ } if (CATEGORY_USB.equals(category)) { return new SiteSettingsCategory( - CATEGORY_USB, "", ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA); + CATEGORY_USB, "", ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_GUARD); } return null; @@ -198,7 +198,7 @@ if (contentSettingsType == ContentSettingsType.CONTENT_SETTINGS_TYPE_SOUND) { return fromString(CATEGORY_SOUND); } - if (contentSettingsType == ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA) { + if (contentSettingsType == ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_GUARD) { return fromString(CATEGORY_USB); } @@ -324,7 +324,7 @@ * Returns whether this category is the USB category. */ public boolean showUsbDevices() { - return mContentSettingsType == ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA; + return mContentSettingsType == ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_GUARD; } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java index 24b3a7d..3add814 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
@@ -108,6 +108,8 @@ return ContentSettingsType.CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER; } else if (SOUND_KEY.equals(key)) { return ContentSettingsType.CONTENT_SETTINGS_TYPE_SOUND; + } else if (USB_KEY.equals(key)) { + return ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_GUARD; } return -1; } @@ -197,6 +199,7 @@ if (ChromeFeatureList.isEnabled(ChromeFeatureList.SOUND_CONTENT_SETTING)) { websitePrefs.add(SOUND_KEY); } + websitePrefs.add(USB_KEY); } // Initialize the summary and icon for all preferences that have an @@ -230,6 +233,8 @@ checked = PrefServiceBridge.getInstance().isProtectedMediaIdentifierEnabled(); } else if (SOUND_KEY.equals(prefName)) { checked = PrefServiceBridge.getInstance().isSoundEnabled(); + } else if (USB_KEY.equals(prefName)) { + checked = PrefServiceBridge.getInstance().isUsbEnabled(); } int contentType = keyToContentSettingsType(prefName); @@ -271,8 +276,6 @@ // TODO(finnur): Re-move this for Storage once it can be moved to the 'Usage' menu. p = findPreference(STORAGE_KEY); if (p != null) p.setOnPreferenceClickListener(this); - p = findPreference(USB_KEY); - if (p != null) p.setOnPreferenceClickListener(this); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbChooserPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbChooserPreferences.java deleted file mode 100644 index 99f3662..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbChooserPreferences.java +++ /dev/null
@@ -1,178 +0,0 @@ -// Copyright 2016 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.preferences.website; - -import android.os.Bundle; -import android.preference.Preference; -import android.preference.PreferenceFragment; -import android.support.v4.view.MenuItemCompat; -import android.support.v7.widget.SearchView; -import android.util.Pair; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.inputmethod.EditorInfo; -import android.widget.ListView; -import android.widget.TextView; - -import org.chromium.chrome.R; -import org.chromium.chrome.browser.help.HelpAndFeedback; -import org.chromium.chrome.browser.preferences.PreferenceUtils; -import org.chromium.chrome.browser.profiles.Profile; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -/** - * Shows a list of USB devices that the user has granted websites permission to access. - * - * When the user selects an item UsbDevicePreferences is launched to show which sites have access - * to the device. - */ -public class UsbChooserPreferences extends PreferenceFragment { - // The site settings category we are showing. - private SiteSettingsCategory mCategory; - // Multiple sites may have access to the same device. A canonical UsbInfo for each device is - // therefore arbitrarily chosen to represent it. - private Map<String, Pair<ArrayList<UsbInfo>, ArrayList<Website>>> mPermissionsByObject = - new HashMap<>(); - // The view to show when the list is empty. - private TextView mEmptyView; - // The view for searching the list of items. - private SearchView mSearchView; - // If not blank, represents a substring to use to search for site names. - private String mSearch = ""; - - @Override - public void onActivityCreated(Bundle savedInstanceState) { - PreferenceUtils.addPreferencesFromResource(this, R.xml.usb_chooser_preferences); - ListView listView = (ListView) getView().findViewById(android.R.id.list); - mEmptyView = (TextView) getView().findViewById(android.R.id.empty); - listView.setEmptyView(mEmptyView); - listView.setDivider(null); - - String category = getArguments().getString(SingleCategoryPreferences.EXTRA_CATEGORY); - mCategory = SiteSettingsCategory.fromString(category); - String title = getArguments().getString(SingleCategoryPreferences.EXTRA_TITLE); - getActivity().setTitle(title); - - setHasOptionsMenu(true); - - super.onActivityCreated(savedInstanceState); - } - - @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - menu.clear(); - inflater.inflate(R.menu.website_preferences_menu, menu); - - MenuItem searchItem = menu.findItem(R.id.search); - mSearchView = (SearchView) MenuItemCompat.getActionView(searchItem); - mSearchView.setImeOptions(EditorInfo.IME_FLAG_NO_FULLSCREEN); - SearchView.OnQueryTextListener queryTextListener = new SearchView.OnQueryTextListener() { - @Override - public boolean onQueryTextSubmit(String query) { - return true; - } - - @Override - public boolean onQueryTextChange(String query) { - // Make search case-insensitive. - query = query.toLowerCase(); - - if (query.equals(mSearch)) return true; - - mSearch = query; - getInfo(); - return true; - } - }; - mSearchView.setOnQueryTextListener(queryTextListener); - - MenuItem help = - menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help); - help.setIcon(R.drawable.ic_help_and_feedback); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - if (item.getItemId() == R.id.menu_id_targeted_help) { - HelpAndFeedback.getInstance(getActivity()) - .show(getActivity(), getString(R.string.help_context_settings), - Profile.getLastUsedProfile(), null); - return true; - } - return false; - } - - @Override - public void onResume() { - super.onResume(); - - getInfo(); - } - - private class ResultsPopulator implements WebsitePermissionsFetcher.WebsitePermissionsCallback { - @Override - public void onWebsitePermissionsAvailable(Collection<Website> sites) { - // This method may be called after the activity has been destroyed. - // In that case, bail out. - if (getActivity() == null) return; - - mPermissionsByObject.clear(); - for (Website site : sites) { - for (UsbInfo info : site.getUsbInfo()) { - if (mSearch.isEmpty() || info.getName().toLowerCase().contains(mSearch)) { - Pair<ArrayList<UsbInfo>, ArrayList<Website>> entry = - mPermissionsByObject.get(info.getObject()); - if (entry == null) { - entry = Pair.create(new ArrayList<UsbInfo>(), new ArrayList<Website>()); - mPermissionsByObject.put(info.getObject(), entry); - } - entry.first.add(info); - entry.second.add(site); - } - } - } - - resetList(); - } - } - - /** - * Refreshes |mPermissionsByObject| with new data from native. - * - * resetList() is called to refresh the view when the data is ready. - */ - private void getInfo() { - WebsitePermissionsFetcher fetcher = new WebsitePermissionsFetcher(new ResultsPopulator()); - fetcher.fetchPreferencesForCategory(mCategory); - } - - private void resetList() { - getPreferenceScreen().removeAll(); - PreferenceUtils.addPreferencesFromResource(this, R.xml.usb_chooser_preferences); - - if (mPermissionsByObject.isEmpty() && mSearch.isEmpty() && mEmptyView != null) { - mEmptyView.setText(R.string.website_settings_usb_no_devices); - } - - for (Pair<ArrayList<UsbInfo>, ArrayList<Website>> entry : mPermissionsByObject.values()) { - Preference preference = new Preference(getActivity()); - Bundle extras = preference.getExtras(); - extras.putInt(UsbDevicePreferences.EXTRA_CATEGORY, mCategory.toContentSettingsType()); - extras.putString( - SingleCategoryPreferences.EXTRA_TITLE, getActivity().getTitle().toString()); - extras.putSerializable(UsbDevicePreferences.EXTRA_USB_INFOS, entry.first); - extras.putSerializable(UsbDevicePreferences.EXTRA_SITES, entry.second); - preference.setIcon(R.drawable.settings_usb); - preference.setTitle(entry.first.get(0).getName()); - preference.setFragment(UsbDevicePreferences.class.getCanonicalName()); - getPreferenceScreen().addPreference(preference); - } - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbInfo.java deleted file mode 100644 index 58acb76..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbInfo.java +++ /dev/null
@@ -1,62 +0,0 @@ -// Copyright 2016 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.preferences.website; - -import java.io.Serializable; - -/** - * USB device information for a given origin. - * - * These objects are compared only by the identity of the device, not by which site has permission - * to access it. - */ -public class UsbInfo implements Serializable { - private final String mOrigin; - private final String mEmbedder; - private final String mName; - private final String mObject; - - UsbInfo(String origin, String embedder, String name, String object) { - mOrigin = origin; - mEmbedder = embedder; - mName = name; - mObject = object; - } - - /** - * Returns the origin that requested the permission. - */ - public String getOrigin() { - return mOrigin; - } - - /** - * Returns the origin that the requester was embedded in. - */ - public String getEmbedder() { - return mEmbedder; - } - - /** - * Returns the name of the USB device for display in the UI. - */ - public String getName() { - return mName; - } - - /** - * Returns the opaque object string that represents the device. - */ - public String getObject() { - return mObject; - } - - /** - * Revokes permission for the origin to access the USB device. - */ - public void revoke() { - WebsitePreferenceBridge.nativeRevokeUsbPermission(mOrigin, mEmbedder, mObject); - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java index 644dd327..d17eeda 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java
@@ -46,7 +46,11 @@ private ContentSettingException mSoundException; private final List<StorageInfo> mStorageInfo = new ArrayList<StorageInfo>(); private int mStorageInfoCallbacksLeft; - private final List<UsbInfo> mUsbInfo = new ArrayList<UsbInfo>(); + + // The collection of chooser-based permissions (e.g. USB device access) granted to this site. + // Each entry declares its own ContentSettingsType and so depending on how this object was + // built this list could contain multiple types of objects. + private final List<ChosenObjectInfo> mObjectInfo = new ArrayList<ChosenObjectInfo>(); public Website(WebsiteAddress origin, WebsiteAddress embedder) { mOrigin = origin; @@ -555,16 +559,16 @@ } /** - * Add information about a USB device permission to the set stored in this object. + * Add information about an object the user has granted permission for this site to access. */ - public void addUsbInfo(UsbInfo info) { - mUsbInfo.add(info); + public void addChosenObjectInfo(ChosenObjectInfo info) { + mObjectInfo.add(info); } /** - * Returns the set of USB devices this website has been granted permission to access. + * Returns the set of objects this website has been granted permission to access. */ - public List<UsbInfo> getUsbInfo() { - return new ArrayList<UsbInfo>(mUsbInfo); + public List<ChosenObjectInfo> getChosenObjectInfo() { + return new ArrayList<ChosenObjectInfo>(mObjectInfo); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java index e7fe7a1..a2f2561 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java
@@ -461,11 +461,12 @@ private class UsbInfoFetcher extends Task { @Override public void run() { - for (UsbInfo info : WebsitePreferenceBridge.getUsbInfo()) { + for (ChosenObjectInfo info : WebsitePreferenceBridge.getChosenObjectInfo( + ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA)) { WebsiteAddress origin = WebsiteAddress.create(info.getOrigin()); if (origin == null) continue; WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder()); - findOrCreateSite(origin, embedder).addUsbInfo(info); + findOrCreateSite(origin, embedder).addChosenObjectInfo(info); } } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java index 7d28d7f..387ac30 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java
@@ -213,25 +213,26 @@ } /** - * Returns the list of all USB device permissions. + * Returns the list of all chosen object permissions for the given ContentSettingsType. * - * There will be one UsbInfo instance for each granted permission. That - * means that if two origin/embedder pairs have permission for the same - * device there will be two UsbInfo instances. + * There will be one ChosenObjectInfo instance for each granted permission. That means that if + * two origin/embedder pairs have permission for the same object there will be two + * ChosenObjectInfo instances. */ - public static List<UsbInfo> getUsbInfo() { - ArrayList<UsbInfo> list = new ArrayList<UsbInfo>(); - nativeGetUsbOrigins(list); + public static List<ChosenObjectInfo> getChosenObjectInfo( + @ContentSettingsType int contentSettingsType) { + ArrayList<ChosenObjectInfo> list = new ArrayList<ChosenObjectInfo>(); + nativeGetChosenObjects(contentSettingsType, list); return list; } /** - * Inserts USB device information into a list. + * Inserts a ChosenObjectInfo into a list. */ @CalledByNative - private static void insertUsbInfoIntoList( - ArrayList<UsbInfo> list, String origin, String embedder, String name, String object) { - list.add(new UsbInfo(origin, embedder, name, object)); + private static void insertChosenObjectInfoIntoList(ArrayList<ChosenObjectInfo> list, + int contentSettingsType, String origin, String embedder, String name, String object) { + list.add(new ChosenObjectInfo(contentSettingsType, origin, embedder, name, object)); } /** @@ -294,8 +295,9 @@ private static native void nativeFetchStorageInfo(Object callback); static native boolean nativeIsContentSettingsPatternValid(String pattern); static native boolean nativeUrlMatchesContentSettingsPattern(String url, String pattern); - static native void nativeGetUsbOrigins(Object list); - static native void nativeRevokeUsbPermission(String origin, String embedder, String object); + static native void nativeGetChosenObjects(@ContentSettingsType int type, Object list); + static native void nativeRevokeObjectPermission( + @ContentSettingsType int type, String origin, String embedder, String object); static native void nativeClearBannerData(String origin); private static native boolean nativeIsPermissionControlledByDSE( @ContentSettingsType int contentSettingsType, String origin, boolean isIncognito);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java index c10d0963..c89ca6d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java
@@ -395,7 +395,7 @@ if (isIncognito() || needLightIcon) { // For a dark theme color, use light icons. list = ApiCompatibilityUtils.getColorStateList(resources, R.color.light_mode_tint); - } else if (isUsingBrandColor() + } else if (!hasTab() || isUsingBrandColor() || ChromeFeatureList.isEnabled( ChromeFeatureList.OMNIBOX_HIDE_SCHEME_DOMAIN_IN_STEADY_STATE)) { // For theme colors which are not dark and are also not
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetController.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetController.java index b0f800d..a322a3b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetController.java
@@ -111,12 +111,18 @@ }; final TabModelObserver tabSelectionObserver = new EmptyTabModelObserver() { + /** The currently active tab. */ + private Tab mCurrentTab = tabModelSelector.getCurrentTab(); + @Override public void didSelectTab(Tab tab, TabModel.TabSelectionType type, int lastId) { + if (tab == mCurrentTab) return; + mCurrentTab = tab; clearRequestsAndHide(); } }; + tabModelSelector.getCurrentModel().addObserver(tabSelectionObserver); tabModelSelector.addObserver(new TabModelSelectorObserver() { @Override public void onChange() {} @@ -283,12 +289,11 @@ if (content == mBottomSheet.getCurrentSheetContent()) return true; if (!canShowInLayout(mLayoutManager.getActiveLayout())) return false; - boolean shouldSuppressExistingContent = mBottomSheet.getCurrentSheetContent() != null - && mBottomSheet.getSheetState() <= BottomSheet.SHEET_STATE_PEEK - && content.getPriority() < mBottomSheet.getCurrentSheetContent().getPriority() + BottomSheetContent shownContent = mBottomSheet.getCurrentSheetContent(); + boolean shouldSuppressExistingContent = shownContent != null + && content.getPriority() < shownContent.getPriority() && canBottomSheetSwitchContent(); - BottomSheetContent shownContent = mBottomSheet.getCurrentSheetContent(); if (shouldSuppressExistingContent) { mContentQueue.add(mBottomSheet.getCurrentSheetContent()); shownContent = content; @@ -386,6 +391,7 @@ // objects when all content requests are cleared. hideContent(mBottomSheet.getCurrentSheetContent(), true); mWasShownForCurrentTab = false; + mIsSuppressed = false; } /** @@ -407,6 +413,6 @@ * @return Whether the sheet currently supports switching its content. */ protected boolean canBottomSheetSwitchContent() { - return mBottomSheet.isSheetOpen(); + return !mBottomSheet.isSheetOpen(); } }
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd index d822a607..6f117eb 100644 --- a/chrome/android/java/strings/android_chrome_strings.grd +++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -927,6 +927,12 @@ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_SOUND_BLOCKED_LIST" desc="Summary text explaining that the sound permission is set to mute sound on some sites. To be shown in the list of permission categories."> Muted </message> + <message name="IDS_WEBSITE_SETTINGS_CATEGORY_USB_ASK" desc="Summary text explaining that the USB permission is set to ask the user for permission to access individual devices. To be shown in the list of permission categories."> + Ask before allowing sites to connect to a device (recommended) + </message> + <message name="IDS_WEBSITE_SETTINGS_CATEGORY_USB_BLOCKED" desc="Summary text explaining that the USB permission is set to block all requests for access to devices. To be shown in the list of permission categories."> + Block sites from connecting to devices + </message> <message name="IDS_WEBSITE_SETTINGS_CATEGORY_POPUPS_BLOCKED" desc="Summary text explaining that sites are blocked from showing popups and that it is the recommended setting."> Block sites from showing pop-ups (recommended) </message> @@ -1095,9 +1101,6 @@ <message name="IDS_WEBSITE_SETTINGS_REVOKE_DEVICE_PERMISSION" desc="Content description for revoking a website's permission to access a device."> Revoke device permission </message> - <message name="IDS_WEBSITE_SETTINGS_USB_NO_DEVICES" desc="Empty list text for a list of USB devices that sites have been granted access to."> - No USB devices here - </message> <!-- Data Saver --> <message name="IDS_DATA_REDUCTION_TITLE" desc="Menu item for Data Saver, which allows users to save mobile data by compressing network traffic.">
diff --git a/chrome/android/java/strings/android_chrome_strings_grd/IDS_WEBSITE_SETTINGS_CATEGORY_USB_ASK.png.sha1 b/chrome/android/java/strings/android_chrome_strings_grd/IDS_WEBSITE_SETTINGS_CATEGORY_USB_ASK.png.sha1 new file mode 100644 index 0000000..17d0e5a --- /dev/null +++ b/chrome/android/java/strings/android_chrome_strings_grd/IDS_WEBSITE_SETTINGS_CATEGORY_USB_ASK.png.sha1
@@ -0,0 +1 @@ +7f0811d64701b6ba6c970e3f56c5e4239ff642ae \ No newline at end of file
diff --git a/chrome/android/java/strings/android_chrome_strings_grd/IDS_WEBSITE_SETTINGS_CATEGORY_USB_BLOCKED.png.sha1 b/chrome/android/java/strings/android_chrome_strings_grd/IDS_WEBSITE_SETTINGS_CATEGORY_USB_BLOCKED.png.sha1 new file mode 100644 index 0000000..840ee3d --- /dev/null +++ b/chrome/android/java/strings/android_chrome_strings_grd/IDS_WEBSITE_SETTINGS_CATEGORY_USB_BLOCKED.png.sha1
@@ -0,0 +1 @@ +5c25088cb6508d322bf8bb38fbec89f157b4077d \ No newline at end of file
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index acc8026..e42d9a7 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -313,6 +313,7 @@ "java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsSource.java", "java/src/org/chromium/chrome/browser/contextual_suggestions/EnabledStateMonitor.java", "java/src/org/chromium/chrome/browser/contextual_suggestions/FetchHelper.java", + "java/src/org/chromium/chrome/browser/contextual_suggestions/PageViewTimer.java", "java/src/org/chromium/chrome/browser/contextual_suggestions/ToolbarCoordinator.java", "java/src/org/chromium/chrome/browser/contextual_suggestions/ToolbarView.java", "java/src/org/chromium/chrome/browser/contextual_suggestions/ToolbarViewBinder.java", @@ -945,12 +946,7 @@ "java/src/org/chromium/chrome/browser/photo_picker/PickerCategoryView.java", "java/src/org/chromium/chrome/browser/physicalweb/HttpRequest.java", "java/src/org/chromium/chrome/browser/physicalweb/JsonObjectHttpRequest.java", - "java/src/org/chromium/chrome/browser/physicalweb/NearbyBackgroundSubscription.java", - "java/src/org/chromium/chrome/browser/physicalweb/NearbyForegroundSubscription.java", - "java/src/org/chromium/chrome/browser/physicalweb/NearbyMessageIntentService.java", - "java/src/org/chromium/chrome/browser/physicalweb/NearbySubscription.java", "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java", - "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java", "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java", "java/src/org/chromium/chrome/browser/physicalweb/PwsClient.java", "java/src/org/chromium/chrome/browser/physicalweb/PwsClientImpl.java", @@ -1083,9 +1079,8 @@ "java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java", "java/src/org/chromium/chrome/browser/preferences/website/StorageInfo.java", "java/src/org/chromium/chrome/browser/preferences/website/TranslatePreferences.java", - "java/src/org/chromium/chrome/browser/preferences/website/UsbChooserPreferences.java", - "java/src/org/chromium/chrome/browser/preferences/website/UsbDevicePreferences.java", - "java/src/org/chromium/chrome/browser/preferences/website/UsbInfo.java", + "java/src/org/chromium/chrome/browser/preferences/website/ChosenObjectPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/website/ChosenObjectInfo.java", "java/src/org/chromium/chrome/browser/preferences/website/Website.java", "java/src/org/chromium/chrome/browser/preferences/website/WebsiteAddress.java", "java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java", @@ -1945,7 +1940,9 @@ "javatests/src/org/chromium/chrome/browser/widget/ThumbnailProviderImplTest.java", "javatests/src/org/chromium/chrome/browser/widget/ToolbarProgressBarTest.java", "javatests/src/org/chromium/chrome/browser/widget/ViewHighlighterTest.java", + "javatests/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetControllerTest.java", "javatests/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetObserverTest.java", + "javatests/src/org/chromium/chrome/browser/widget/bottomsheet/TestBottomSheetContent.java", "javatests/src/org/chromium/chrome/browser/widget/findinpage/FindTest.java", "javatests/src/org/chromium/chrome/test/crash/IntentionalCrashTest.java", "javatests/src/org/chromium/chrome/test/util/ChromeSigninUtilsTest.java", @@ -1973,6 +1970,7 @@ "junit/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionControllerTest.java", "junit/src/org/chromium/chrome/browser/contextualsearch/SelectionClientManagerTest.java", "junit/src/org/chromium/chrome/browser/contextual_suggestions/FetchHelperTest.java", + "junit/src/org/chromium/chrome/browser/contextual_suggestions/PageViewTimerTest.java", "junit/src/org/chromium/chrome/browser/cookies/CanonicalCookieTest.java", "junit/src/org/chromium/chrome/browser/crash/LogcatExtractionRunnableUnitTest.java", "junit/src/org/chromium/chrome/browser/customtabs/NavigationInfoCaptureTriggerTest.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadForegroundServiceManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadForegroundServiceManagerTest.java index 3149e90..6234e077 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadForegroundServiceManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadForegroundServiceManagerTest.java
@@ -8,7 +8,6 @@ import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; -import static org.chromium.chrome.browser.download.DownloadForegroundServiceManager.DownloadStatus; import static org.chromium.chrome.browser.notifications.NotificationConstants.DEFAULT_NOTIFICATION_ID; import android.app.Notification; @@ -66,7 +65,7 @@ void startAndBindServiceInternal(Context context) {} @Override - void stopAndUnbindService(DownloadStatus downloadStatus) { + void stopAndUnbindService(DownloadNotificationService2.DownloadStatus downloadStatus) { mIsServiceBound = false; super.stopAndUnbindService(downloadStatus); } @@ -132,35 +131,40 @@ @Feature({"Download"}) public void testBasicStartAndStop() { // Service starts and stops with addition and removal of one active download. - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_1, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_1, + mNotification); assertTrue(mDownloadServiceManager.mIsServiceBound); mDownloadServiceManager.onServiceConnected(); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.COMPLETE, FAKE_DOWNLOAD_1, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.COMPLETED, FAKE_DOWNLOAD_1, + mNotification); assertFalse(mDownloadServiceManager.mIsServiceBound); // Service does not get affected by addition of inactive download. - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_1, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_1, + mNotification); assertTrue(mDownloadServiceManager.mIsServiceBound); mDownloadServiceManager.onServiceConnected(); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.PAUSE, FAKE_DOWNLOAD_2, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.PAUSED, FAKE_DOWNLOAD_2, mNotification); assertTrue(mDownloadServiceManager.mIsServiceBound); // Service continues as long as there is at least one active download. - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_3, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_3, + mNotification); assertTrue(mDownloadServiceManager.mIsServiceBound); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.PAUSE, FAKE_DOWNLOAD_1, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.PAUSED, FAKE_DOWNLOAD_1, mNotification); assertEquals(FAKE_DOWNLOAD_3, mDownloadServiceManager.mUpdatedNotificationId); assertTrue(mDownloadServiceManager.mIsServiceBound); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.COMPLETE, FAKE_DOWNLOAD_3, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.COMPLETED, FAKE_DOWNLOAD_3, + mNotification); assertFalse(mDownloadServiceManager.mIsServiceBound); } @@ -170,10 +174,12 @@ public void testDelayedStartStop() { // Calls to start and stop service. assertFalse(mDownloadServiceManager.mIsServiceBound); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_1, mNotification); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.COMPLETE, FAKE_DOWNLOAD_1, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_1, + mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.COMPLETED, FAKE_DOWNLOAD_1, + mNotification); assertTrue(mDownloadServiceManager.mIsServiceBound); @@ -188,12 +194,15 @@ public void testDelayedStartStopStart() { // Calls to start and stop and start service. assertFalse(mDownloadServiceManager.mIsServiceBound); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_1, mNotification); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.COMPLETE, FAKE_DOWNLOAD_1, mNotification); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_2, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_1, + mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.COMPLETED, FAKE_DOWNLOAD_1, + mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_2, + mNotification); assertTrue(mDownloadServiceManager.mIsServiceBound); // Service actually starts, continues and is pinned to second download. @@ -202,8 +211,9 @@ assertEquals(FAKE_DOWNLOAD_2, mDownloadServiceManager.mUpdatedNotificationId); // Make sure service is able to be shut down. - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.COMPLETE, FAKE_DOWNLOAD_2, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.COMPLETED, FAKE_DOWNLOAD_2, + mNotification); assertFalse(mDownloadServiceManager.mIsServiceBound); } @@ -212,37 +222,42 @@ @Feature({"Download"}) public void testIsNotificationKilledOrDetached() { // Service starts and is paused, not complete, so notification not killed but is detached. - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_1, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_1, + mNotification); assertTrue(mDownloadServiceManager.mIsServiceBound); mDownloadServiceManager.onServiceConnected(); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.PAUSE, FAKE_DOWNLOAD_1, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.PAUSED, FAKE_DOWNLOAD_1, mNotification); assertFalse(mDownloadServiceManager.mIsServiceBound); assertEquals(DownloadForegroundService.StopForegroundNotification.DETACH_OR_PERSIST, mDownloadServiceManager.mStopForegroundNotificationFlag); // Service restarts and then is cancelled, so notification is killed. - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_1, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_1, + mNotification); assertTrue(mDownloadServiceManager.mIsServiceBound); mDownloadServiceManager.onServiceConnected(); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.CANCEL, FAKE_DOWNLOAD_1, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.CANCELLED, FAKE_DOWNLOAD_1, + mNotification); assertFalse(mDownloadServiceManager.mIsServiceBound); assertEquals(DownloadForegroundService.StopForegroundNotification.KILL, mDownloadServiceManager.mStopForegroundNotificationFlag); // Download starts and completes, notification is either detached or killed. - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_2, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_2, + mNotification); assertTrue(mDownloadServiceManager.mIsServiceBound); mDownloadServiceManager.onServiceConnected(); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.COMPLETE, FAKE_DOWNLOAD_2, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.COMPLETED, FAKE_DOWNLOAD_2, + mNotification); assertFalse(mDownloadServiceManager.mIsServiceBound); assertEquals(DownloadForegroundService.StopForegroundNotification.DETACH_OR_ADJUST, mDownloadServiceManager.mStopForegroundNotificationFlag); @@ -254,43 +269,49 @@ public void testStopInitiallyAndCleanQueue() { // First call is a download being cancelled. assertFalse(mDownloadServiceManager.mIsServiceBound); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.CANCEL, FAKE_DOWNLOAD_1, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.CANCELLED, FAKE_DOWNLOAD_1, + mNotification); // Make sure that nothing gets called, service is still not bound, and queue is empty. assertFalse(mDownloadServiceManager.mIsServiceBound); assertTrue(mDownloadServiceManager.mDownloadUpdateQueue.isEmpty()); // Start next two downloads. - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_2, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_2, + mNotification); assertEquals(1, mDownloadServiceManager.mDownloadUpdateQueue.size()); assertTrue(mDownloadServiceManager.mIsServiceBound); mDownloadServiceManager.onServiceConnected(); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_3, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_3, + mNotification); assertEquals(2, mDownloadServiceManager.mDownloadUpdateQueue.size()); assertTrue(mDownloadServiceManager.mIsServiceBound); // Queue is cleaned as each download becomes inactive (paused or complete). - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.PAUSE, FAKE_DOWNLOAD_2, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.PAUSED, FAKE_DOWNLOAD_2, mNotification); assertTrue(mDownloadServiceManager.mIsServiceBound); assertEquals(1, mDownloadServiceManager.mDownloadUpdateQueue.size()); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_2, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.IN_PROGRESS, FAKE_DOWNLOAD_2, + mNotification); assertTrue(mDownloadServiceManager.mIsServiceBound); assertEquals(2, mDownloadServiceManager.mDownloadUpdateQueue.size()); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.COMPLETE, FAKE_DOWNLOAD_2, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.COMPLETED, FAKE_DOWNLOAD_2, + mNotification); assertTrue(mDownloadServiceManager.mIsServiceBound); assertEquals(1, mDownloadServiceManager.mDownloadUpdateQueue.size()); - mDownloadServiceManager.updateDownloadStatus( - mContext, DownloadStatus.COMPLETE, FAKE_DOWNLOAD_3, mNotification); + mDownloadServiceManager.updateDownloadStatus(mContext, + DownloadNotificationService2.DownloadStatus.COMPLETED, FAKE_DOWNLOAD_3, + mNotification); assertTrue(mDownloadServiceManager.mDownloadUpdateQueue.isEmpty()); assertFalse(mDownloadServiceManager.mIsServiceBound); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java index 75054d2c..2daa0ea 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java
@@ -215,7 +215,7 @@ } /** - * Regression test for crash observed on Samsung Marshmallow devices - see crbug/829367. + * Regression test for crash observed on Samsung/Coolpad Marshmallow devices - see crbug/829367. */ @Test @MinAndroidSdkLevel(Build.VERSION_CODES.M)
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferencesTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferencesTest.java index 90959e61..74a5a53 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferencesTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferencesTest.java
@@ -218,79 +218,42 @@ }); } - private void setEnablePopups(final boolean enabled) { - final Preferences preferenceActivity = - startSiteSettingsCategory(SiteSettingsPreferences.POPUPS_KEY); + private void setGlobalToggleForCategory(final String category, final boolean enabled) { + final Preferences preferenceActivity = startSiteSettingsCategory(category); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - SingleCategoryPreferences websitePreferences = + SingleCategoryPreferences preferences = (SingleCategoryPreferences) preferenceActivity.getFragmentForTest(); - ChromeSwitchPreference popups = (ChromeSwitchPreference) - websitePreferences.findPreference( - SingleCategoryPreferences.READ_WRITE_TOGGLE_KEY); - websitePreferences.onPreferenceChange(popups, enabled); + ChromeSwitchPreference toggle = (ChromeSwitchPreference) preferences.findPreference( + SingleCategoryPreferences.READ_WRITE_TOGGLE_KEY); + preferences.onPreferenceChange(toggle, enabled); + } + }); + preferenceActivity.finish(); + } + + private void setEnablePopups(final boolean enabled) { + setGlobalToggleForCategory(SiteSettingsCategory.CATEGORY_POPUPS, enabled); + + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { Assert.assertEquals("Popups should be " + (enabled ? "allowed" : "blocked"), enabled, PrefServiceBridge.getInstance().popupsEnabled()); } }); - preferenceActivity.finish(); } private void setEnableCamera(final boolean enabled) { - final Preferences preferenceActivity = - startSiteSettingsCategory(SiteSettingsPreferences.CAMERA_KEY); - - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - SingleCategoryPreferences websitePreferences = - (SingleCategoryPreferences) preferenceActivity.getFragmentForTest(); - ChromeSwitchPreference toggle = (ChromeSwitchPreference) - websitePreferences.findPreference( - SingleCategoryPreferences.READ_WRITE_TOGGLE_KEY); - websitePreferences.onPreferenceChange(toggle, enabled); - Assert.assertEquals("Camera should be " + (enabled ? "allowed" : "blocked"), - enabled, PrefServiceBridge.getInstance().isCameraEnabled()); - } - }); - preferenceActivity.finish(); - } - - private void setEnableMic(final boolean enabled) { - final Preferences preferenceActivity = - startSiteSettingsCategory(SiteSettingsPreferences.MICROPHONE_KEY); - - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - SingleCategoryPreferences websitePreferences = - (SingleCategoryPreferences) preferenceActivity.getFragmentForTest(); - ChromeSwitchPreference toggle = (ChromeSwitchPreference) - websitePreferences.findPreference( - SingleCategoryPreferences.READ_WRITE_TOGGLE_KEY); - websitePreferences.onPreferenceChange(toggle, enabled); - Assert.assertEquals("Mic should be " + (enabled ? "allowed" : "blocked"), enabled, - PrefServiceBridge.getInstance().isMicEnabled()); - } - }); - preferenceActivity.finish(); - } - - private void setEnableBackgroundSync(final boolean enabled) { - final Preferences preferenceActivity = - startSiteSettingsCategory(SiteSettingsCategory.CATEGORY_BACKGROUND_SYNC); + setGlobalToggleForCategory(SiteSettingsCategory.CATEGORY_CAMERA, enabled); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - SingleCategoryPreferences backgroundSyncPreferences = - (SingleCategoryPreferences) preferenceActivity.getFragmentForTest(); - ChromeSwitchPreference toggle = - (ChromeSwitchPreference) backgroundSyncPreferences.findPreference( - SingleCategoryPreferences.READ_WRITE_TOGGLE_KEY); - backgroundSyncPreferences.onPreferenceChange(toggle, enabled); + Assert.assertEquals("Camera should be " + (enabled ? "allowed" : "blocked"), + enabled, PrefServiceBridge.getInstance().isCameraEnabled()); } }); } @@ -501,7 +464,15 @@ @CommandLineFlags.Add({ContentSwitches.USE_FAKE_DEVICE_FOR_MEDIA_STREAM, "disable-features=" + ChromeFeatureList.MODAL_PERMISSION_PROMPTS}) public void testMicBlocked() throws Exception { - setEnableMic(false); + setGlobalToggleForCategory(SiteSettingsCategory.CATEGORY_MICROPHONE, false); + + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + Assert.assertFalse( + "Mic should be blocked", PrefServiceBridge.getInstance().isMicEnabled()); + } + }); // Test that the microphone permission doesn't get requested. mActivityTestRule.loadUrl(mTestServer.getURL("/content/test/data/media/getusermedia.html")); @@ -569,7 +540,7 @@ * @param enabled true to test enabling background sync, false to test disabling the feature. */ private void doTestBackgroundSyncPermission(final boolean enabled) { - setEnableBackgroundSync(enabled); + setGlobalToggleForCategory(SiteSettingsCategory.CATEGORY_BACKGROUND_SYNC, enabled); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { @@ -594,6 +565,35 @@ doTestBackgroundSyncPermission(false); } + /** + * Helper function to test allowing and blocking the USB chooser. + * @param enabled true to test enabling the USB chooser, false to test disabling the feature. + */ + private void doTestUsbGuardPermission(final boolean enabled) { + setGlobalToggleForCategory(SiteSettingsCategory.CATEGORY_USB, enabled); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + Assert.assertEquals("USB should be " + (enabled ? "enabled" : "disabled"), + PrefServiceBridge.getInstance().isUsbEnabled(), enabled); + } + }); + } + + @Test + @SmallTest + @Feature({"Preferences"}) + public void testAllowUsb() { + doTestUsbGuardPermission(true); + } + + @Test + @SmallTest + @Feature({"Preferences"}) + public void testBlockUsb() { + doTestUsbGuardPermission(false); + } + private int getTabCount() { return ThreadUtils.runOnUiThreadBlockingNoException(new Callable<Integer>() { @Override
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetControllerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetControllerTest.java new file mode 100644 index 0000000..703260c --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetControllerTest.java
@@ -0,0 +1,272 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.widget.bottomsheet; + +import static org.junit.Assert.assertEquals; + +import android.support.test.InstrumentationRegistry; +import android.support.test.filters.MediumTest; +import android.support.test.filters.SmallTest; +import android.view.ViewGroup; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.ThreadUtils; +import org.chromium.base.test.util.CallbackHelper; +import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.Feature; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.browser.ChromeTabbedActivity; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.tabmodel.EmptyTabModelObserver; +import org.chromium.chrome.browser.tabmodel.TabModel; +import org.chromium.chrome.browser.widget.FadingBackgroundView; +import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet.BottomSheetContent; +import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet.ContentPriority; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.chrome.test.util.ChromeTabUtils; +import org.chromium.content_public.browser.LoadUrlParams; + +import java.util.concurrent.TimeoutException; + +/** + * This class contains tests for the logic that shows and hides the bottom sheet as a result of + * different browser events. These tests use a bottom sheet and controller different from the ones + * created by the activity that are used by different experiments. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +@CommandLineFlags.Add(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE) +public class BottomSheetControllerTest { + @Rule + public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); + + private BottomSheet mBottomSheet; + private BottomSheetController mSheetController; + private TestBottomSheetContent mLowPriorityContent; + private TestBottomSheetContent mHighPriorityContent; + + @Before + public void setUp() throws Exception { + mActivityTestRule.startMainActivityOnBlankPage(); + final ChromeTabbedActivity activity = mActivityTestRule.getActivity(); + + ThreadUtils.runOnUiThreadBlocking(() -> { + ViewGroup coordinator = activity.findViewById(org.chromium.chrome.R.id.coordinator); + mBottomSheet = activity.getLayoutInflater() + .inflate(org.chromium.chrome.R.layout.bottom_sheet, coordinator) + .findViewById(org.chromium.chrome.R.id.bottom_sheet) + .findViewById(org.chromium.chrome.R.id.bottom_sheet); + mBottomSheet.init(coordinator, activity); + + FadingBackgroundView scrim = coordinator.findViewById(R.id.fading_focus_target); + + mSheetController = new BottomSheetController(activity, activity.getTabModelSelector(), + activity.getCompositorViewHolder().getLayoutManager(), scrim, + activity.getContextualSearchManager(), mBottomSheet); + + mLowPriorityContent = new TestBottomSheetContent( + mActivityTestRule.getActivity(), ContentPriority.LOW); + mHighPriorityContent = new TestBottomSheetContent( + mActivityTestRule.getActivity(), ContentPriority.HIGH); + }); + } + + @Test + @SmallTest + @Feature({"BottomSheetController"}) + public void testSheetPeek() throws InterruptedException, TimeoutException { + requestContentInSheet(mLowPriorityContent, true); + assertEquals("The bottom sheet should be peeking.", BottomSheet.SHEET_STATE_PEEK, + mBottomSheet.getSheetState()); + assertEquals("The bottom sheet is showing incorrect content.", mLowPriorityContent, + mBottomSheet.getCurrentSheetContent()); + } + + @Test + @SmallTest + @Feature({"BottomSheetController"}) + public void testSheetPriorityInPeekState() throws InterruptedException, TimeoutException { + requestContentInSheet(mLowPriorityContent, true); + requestContentInSheet(mHighPriorityContent, true); + assertEquals("The bottom sheet is showing incorrect content.", mHighPriorityContent, + mBottomSheet.getCurrentSheetContent()); + } + + @Test + @SmallTest + @Feature({"BottomSheetController"}) + public void testSheetPriorityInExpandedState() throws InterruptedException, TimeoutException { + requestContentInSheet(mLowPriorityContent, true); + expandSheet(); + requestContentInSheet(mHighPriorityContent, false); + assertEquals("The bottom sheet is showing incorrect content.", mLowPriorityContent, + mBottomSheet.getCurrentSheetContent()); + } + + @Test + @MediumTest + @Feature({"BottomSheetController"}) + public void testSheetPeekAfterTabSwitcher() throws InterruptedException, TimeoutException { + requestContentInSheet(mLowPriorityContent, true); + enterAndExitTabSwitcher(); + assertEquals("The bottom sheet should be peeking.", BottomSheet.SHEET_STATE_PEEK, + mBottomSheet.getSheetState()); + assertEquals("The bottom sheet is showing incorrect content.", mLowPriorityContent, + mBottomSheet.getCurrentSheetContent()); + } + + @Test + @MediumTest + @Feature({"BottomSheetController"}) + public void testOpenTabInBackground() throws InterruptedException, TimeoutException { + requestContentInSheet(mLowPriorityContent, true); + expandSheet(); + openNewTabInBackground(); + + assertEquals("The bottom sheet should be expanded.", BottomSheet.SHEET_STATE_HALF, + mBottomSheet.getSheetState()); + assertEquals("The bottom sheet is showing incorrect content.", mLowPriorityContent, + mBottomSheet.getCurrentSheetContent()); + } + + @Test + @MediumTest + @Feature({"BottomSheetController"}) + public void testSwitchTabs() throws InterruptedException, TimeoutException { + requestContentInSheet(mLowPriorityContent, true); + + assertEquals("The bottom sheet should be peeking.", BottomSheet.SHEET_STATE_PEEK, + mBottomSheet.getSheetState()); + + openNewTabInForeground(); + + assertEquals("The bottom sheet should be hidden.", BottomSheet.SHEET_STATE_HIDDEN, + mBottomSheet.getSheetState()); + assertEquals("The bottom sheet is showing incorrect content.", null, + mBottomSheet.getCurrentSheetContent()); + } + + @Test + @MediumTest + @Feature({"BottomSheetController"}) + public void testSwitchTabsMultipleTimes() throws InterruptedException, TimeoutException { + ChromeTabbedActivity activity = mActivityTestRule.getActivity(); + final int originalTabIndex = + activity.getTabModelSelector().getCurrentModel().indexOf(activity.getActivityTab()); + requestContentInSheet(mLowPriorityContent, true); + + assertEquals("The bottom sheet should be peeking.", BottomSheet.SHEET_STATE_PEEK, + mBottomSheet.getSheetState()); + + openNewTabInForeground(); + + assertEquals("The bottom sheet should be hidden.", BottomSheet.SHEET_STATE_HIDDEN, + mBottomSheet.getSheetState()); + assertEquals("The bottom sheet is showing incorrect content.", null, + mBottomSheet.getCurrentSheetContent()); + + ThreadUtils.runOnUiThreadBlocking(() -> { + activity.getTabModelSelector().getCurrentModel().setIndex( + originalTabIndex, TabModel.TabSelectionType.FROM_USER); + }); + + // Request content be shown again. + requestContentInSheet(mLowPriorityContent, true); + expandSheet(); + + openNewTabInBackground(); + + assertEquals("The bottom sheet should be expanded.", BottomSheet.SHEET_STATE_HALF, + mBottomSheet.getSheetState()); + assertEquals("The bottom sheet is showing incorrect content.", mLowPriorityContent, + mBottomSheet.getCurrentSheetContent()); + } + + /** + * Request content be shown in the bottom sheet and end animations. + * @param content The content to show. + * @param expectContentChange If the content is expected to change, setting this to true will + * cause the method to wait for + * BottomSheetObserver#onSheetContentChanged. + */ + private void requestContentInSheet(BottomSheetContent content, boolean expectContentChange) + throws InterruptedException, TimeoutException { + CallbackHelper contentChangedHelper = new CallbackHelper(); + mBottomSheet.addObserver(new EmptyBottomSheetObserver() { + @Override + public void onSheetContentChanged(BottomSheetContent content) { + contentChangedHelper.notifyCalled(); + } + }); + int currentCallCount = contentChangedHelper.getCallCount(); + ThreadUtils.runOnUiThreadBlocking( + () -> { mSheetController.requestShowContent(content, false); }); + + if (expectContentChange) contentChangedHelper.waitForCallback(currentCallCount, 1); + } + + /** + * Expand the bottom sheet to a non-peek height. If the sheet has no content, an assert is + * thrown. + */ + private void expandSheet() { + ThreadUtils.runOnUiThreadBlocking( + () -> mBottomSheet.setSheetState(BottomSheet.SHEET_STATE_HALF, false)); + } + + /** + * Enter and immediately exit the tab switcher. This function will assert that the sheet is not + * showing in the tab switcher. + */ + private void enterAndExitTabSwitcher() { + ThreadUtils.runOnUiThreadBlocking(() -> { + mActivityTestRule.getActivity().getLayoutManager().showOverview(false); + mBottomSheet.endAnimations(); + assertEquals("The bottom sheet should be hidden.", BottomSheet.SHEET_STATE_HIDDEN, + mBottomSheet.getSheetState()); + mActivityTestRule.getActivity().getLayoutManager().hideOverview(false); + mBottomSheet.endAnimations(); + }); + } + + /** + * Open a new tab behind the active tab and wait for the tab selection event. + */ + private void openNewTabInBackground() throws InterruptedException, TimeoutException { + CallbackHelper tabSelectedHelper = new CallbackHelper(); + mActivityTestRule.getActivity().getTabModelSelector().getCurrentModel().addObserver( + new EmptyTabModelObserver() { + @Override + public void didSelectTab(Tab tab, TabModel.TabSelectionType type, int lastId) { + tabSelectedHelper.notifyCalled(); + } + }); + + int previousCallCount = tabSelectedHelper.getCallCount(); + + ThreadUtils.runOnUiThreadBlocking(() -> { + mActivityTestRule.getActivity().getTabCreator(false).createNewTab( + new LoadUrlParams("about:blank"), + TabModel.TabLaunchType.FROM_LONGPRESS_BACKGROUND, null); + }); + + tabSelectedHelper.waitForCallback(previousCallCount, 1); + ThreadUtils.runOnUiThreadBlocking(() -> mBottomSheet.endAnimations()); + } + + /** + * Open a new tab in front of the active tab and wait for it to be completely loaded. + */ + private void openNewTabInForeground() throws InterruptedException, TimeoutException { + ChromeTabUtils.fullyLoadUrlInNewTab(InstrumentationRegistry.getInstrumentation(), + mActivityTestRule.getActivity(), "about:blank", false); + ThreadUtils.runOnUiThreadBlocking(() -> mBottomSheet.endAnimations()); + } +}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/widget/bottomsheet/TestBottomSheetContent.java b/chrome/android/javatests/src/org/chromium/chrome/browser/widget/bottomsheet/TestBottomSheetContent.java new file mode 100644 index 0000000..d522ea4 --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/widget/bottomsheet/TestBottomSheetContent.java
@@ -0,0 +1,78 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.widget.bottomsheet; + +import android.content.Context; +import android.graphics.Color; +import android.graphics.drawable.ColorDrawable; +import android.support.annotation.Nullable; +import android.view.View; +import android.view.ViewGroup; + +import org.chromium.base.ThreadUtils; +import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet.BottomSheetContent; +import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet.ContentPriority; + +/** A simple sheet content to test with. This only displays two empty white views. */ +class TestBottomSheetContent implements BottomSheetContent { + /** Empty view that represents the toolbar. */ + private View mToolbarView; + + /** Empty view that represents the content. */ + private View mContentView; + + /** This content's priority. */ + private @ContentPriority int mPriority; + + /** + * @param context A context to inflate views with. + * @param priority The content's priority. + */ + public TestBottomSheetContent(Context context, @ContentPriority int priority) { + mPriority = priority; + ThreadUtils.runOnUiThreadBlocking(() -> { + mToolbarView = new View(context); + ViewGroup.LayoutParams params = + new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 100); + mToolbarView.setLayoutParams(params); + mToolbarView.setBackground(new ColorDrawable(Color.WHITE)); + + mContentView = new View(context); + params = new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + mContentView.setLayoutParams(params); + mToolbarView.setBackground(new ColorDrawable(Color.WHITE)); + }); + } + + @Override + public View getContentView() { + return mContentView; + } + + @Nullable + @Override + public View getToolbarView() { + return mToolbarView; + } + + @Override + public int getVerticalScrollOffset() { + return 0; + } + + @Override + public void destroy() {} + + @Override + public int getPriority() { + return mPriority; + } + + @Override + public boolean swipeToDismissEnabled() { + return false; + } +}
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/contextual_suggestions/PageViewTimerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/contextual_suggestions/PageViewTimerTest.java new file mode 100644 index 0000000..00eb66e --- /dev/null +++ b/chrome/android/junit/src/org/chromium/chrome/browser/contextual_suggestions/PageViewTimerTest.java
@@ -0,0 +1,263 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.contextual_suggestions; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.robolectric.annotation.Config; +import org.robolectric.shadows.ShadowSystemClock; + +import org.chromium.base.metrics.test.ShadowRecordHistogram; +import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.tab.TabObserver; +import org.chromium.chrome.browser.tabmodel.TabModel; +import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType; +import org.chromium.chrome.browser.tabmodel.TabModelObserver; +import org.chromium.chrome.browser.tabmodel.TabModelSelector; +import org.chromium.chrome.browser.util.test.ShadowUrlUtilities; + +import java.util.ArrayList; +import java.util.List; + +/** Unit tests for PageViewTimer. */ +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE, shadows = {ShadowRecordHistogram.class, ShadowUrlUtilities.class}) +public final class PageViewTimerTest { + private static final String STARTING_URL = "http://starting.url"; + private static final String DIFFERENT_URL = "http://different.url"; + private static final int SAMPLE_PAGE_VIEW_TIME = 5678; + private static final String PAGE_VIEW_TIME_METRIC = "ContextualSuggestions.PageViewTime"; + + @Mock + private TabModelSelector mTabModelSelector; + @Mock + private TabModel mTabModel; + @Mock + private Tab mTab; + @Mock + private Tab mTab2; + @Captor + private ArgumentCaptor<TabObserver> mTabObserverCaptor; + @Captor + private ArgumentCaptor<TabModelObserver> mTabModelObserverCaptor; + + private PageViewTimer mTimer; + + private TabObserver getTabObserver() { + return mTabObserverCaptor.getValue(); + } + + private TabModelObserver getTabModelObserver() { + return mTabModelObserverCaptor.getValue(); + } + + @Before + public void setUp() { + ShadowRecordHistogram.reset(); + MockitoAnnotations.initMocks(this); + + // Default tab setup. + doReturn(false).when(mTab).isIncognito(); + doReturn(true).when(mTab).isLoading(); + doReturn(77).when(mTab).getId(); + doReturn(STARTING_URL).when(mTab).getUrl(); + + // Default tab model selector setup. + List<TabModel> tabModels = new ArrayList<>(); + tabModels.add(mTabModel); + doReturn(tabModels).when(mTabModelSelector).getModels(); + doReturn(mTab).when(mTabModelSelector).getCurrentTab(); + } + + @Test + public void createPageViewTimer_withNoTab_noCrash() { + doReturn(null).when(mTabModelSelector).getCurrentTab(); + PageViewTimer timer = createPageViewTimer(); + } + + @Test + public void selectTab_didFirstVisuallyNonEmptyPaint_reported() { + selectTab_showContent_stopTimer( + showContentByDidFirstVisuallyNonEmptyPaint(mTab), stopTimerByClosingTab(mTab), 1); + } + + @Test + public void selectTab_onPageLoadFinished_close_reported() { + selectTab_showContent_stopTimer( + showContentByOnPageLoadFinished(mTab), stopTimerByClosingTab(mTab), 1); + } + + @Test + public void selectTab_onLoadStopped_close_reported() { + selectTab_showContent_stopTimer( + showContentByOnLoadStopped(mTab), stopTimerByClosingTab(mTab), 1); + } + + @Test + public void selectTab_whenLoaded_close_reported() { + doReturn(false).when(mTab).isLoading(); + selectTab_showContent_stopTimer(doNothingToShowContent(), stopTimerByClosingTab(mTab), 1); + } + + @Test + public void selectTab_notLoaded_close_ignored() { + selectTab_showContent_stopTimer(doNothingToShowContent(), stopTimerByClosingTab(mTab), 0); + } + + @Test + public void selectTab_didFirstVisuallyNonEmptyPaint_onUpdateUrl_reported() { + selectTab_showContent_stopTimer(showContentByDidFirstVisuallyNonEmptyPaint(mTab), + stopTimerByOnUpdateUrl(mTab, DIFFERENT_URL), 1); + } + + @Test + public void selectTab_onPageLoadFinished_onUpdateUrl_reported() { + selectTab_showContent_stopTimer(showContentByOnPageLoadFinished(mTab), + stopTimerByOnUpdateUrl(mTab, DIFFERENT_URL), 1); + } + + @Test + public void selectTab_onLoadStopped_onUpdateUrl_reported() { + selectTab_showContent_stopTimer( + showContentByOnLoadStopped(mTab), stopTimerByOnUpdateUrl(mTab, DIFFERENT_URL), 1); + } + + @Test + public void selectTab_whenLoaded_onUpdateUrl_reported() { + doReturn(false).when(mTab).isLoading(); + selectTab_showContent_stopTimer( + doNothingToShowContent(), stopTimerByOnUpdateUrl(mTab, DIFFERENT_URL), 1); + } + + @Test + public void selectTab_notLoaded_onUpdateUrl_ignored() { + selectTab_showContent_stopTimer( + doNothingToShowContent(), stopTimerByOnUpdateUrl(mTab, DIFFERENT_URL), 0); + } + + @Test + public void selectTab_whenLoaded_onUpdateUrlToSame_ignored() { + doReturn(false).when(mTab).isLoading(); + selectTab_showContent_stopTimer( + doNothingToShowContent(), stopTimerByOnUpdateUrl(mTab, STARTING_URL), 0); + } + + @Test + public void selectTab_whenNonHttpOrHttpsUrlLoaded_tabRemoved_ignored() { + doReturn(false).when(mTab).isLoading(); + doReturn("chrome://snippets-internals").when(mTab).getUrl(); + selectTab_showContent_stopTimer(doNothingToShowContent(), stopTimerByRemovingTab(mTab), 0); + } + + @Test + public void selectTab_whenLoaded_switchTabs_reported() { + doReturn(false).when(mTab).isLoading(); + selectTab_showContent_stopTimer( + doNothingToShowContent(), stopTimerBySwitchingTab(mTab, mTab2), 1); + } + + @Test + public void selectTab_notLoaded_switchTabs_ignored() { + selectTab_showContent_stopTimer( + doNothingToShowContent(), stopTimerBySwitchingTab(mTab, mTab2), 0); + } + + @Test + public void selectTab_whenLoaded_tabRemoved_reported() { + doReturn(false).when(mTab).isLoading(); + selectTab_showContent_stopTimer(doNothingToShowContent(), stopTimerByRemovingTab(mTab), 1); + } + + @Test + public void selectTab_notLoaded_tabRemoved_ignored() { + selectTab_showContent_stopTimer(doNothingToShowContent(), stopTimerByRemovingTab(mTab), 0); + } + + @Test + public void selectTab_whenLoaded_closeChrome_reported() { + doReturn(false).when(mTab).isLoading(); + selectTab_showContent_stopTimer(doNothingToShowContent(), stopTimerByClosingChrome(), 1); + } + + @Test + public void selectTab_notLoaded_closeChrome_reported() { + selectTab_showContent_stopTimer(doNothingToShowContent(), stopTimerByClosingChrome(), 0); + } + + private Runnable doNothingToShowContent() { + return () -> {}; + } + + private Runnable showContentByDidFirstVisuallyNonEmptyPaint(Tab tab) { + return () -> getTabObserver().didFirstVisuallyNonEmptyPaint(tab); + } + private Runnable showContentByOnPageLoadFinished(Tab tab) { + return () -> getTabObserver().onPageLoadFinished(tab); + } + + private Runnable showContentByOnLoadStopped(Tab tab) { + return () -> getTabObserver().onLoadStopped(tab, /*toDifferentDocument=*/false); + } + + private Runnable stopTimerByClosingTab(Tab tab) { + return () -> getTabModelObserver().willCloseTab(tab, /*animate=*/false); + } + + private Runnable stopTimerByOnUpdateUrl(Tab tab, String url) { + return () -> getTabObserver().onUpdateUrl(tab, url); + } + + private Runnable stopTimerByRemovingTab(Tab tab) { + return () -> getTabModelObserver().tabRemoved(tab); + } + + private Runnable stopTimerBySwitchingTab(Tab fromTab, Tab toTab) { + return () -> switchTabs(fromTab, toTab); + } + + private Runnable stopTimerByClosingChrome() { + return () -> mTimer.destroy(); + } + + private void selectTab_showContent_stopTimer( + Runnable showContentRunnable, Runnable stopTimerRunnable, int expectedSamples) { + mTimer = createPageViewTimer(); + switchTabs(null, mTab); + showContentRunnable.run(); + ShadowSystemClock.sleep(SAMPLE_PAGE_VIEW_TIME); + stopTimerRunnable.run(); + assertEquals(expectedSamples, + ShadowRecordHistogram.getHistogramValueCountForTesting( + PAGE_VIEW_TIME_METRIC, SAMPLE_PAGE_VIEW_TIME)); + } + + public PageViewTimer createPageViewTimer() { + PageViewTimer timer = new PageViewTimer(mTabModelSelector); + verify(mTabModel, times(1)).addObserver(mTabModelObserverCaptor.capture()); + return timer; + } + + private void switchTabs(Tab fromTab, Tab toTab) { + getTabModelObserver().didSelectTab(toTab, TabSelectionType.FROM_USER, 0); + if (fromTab != null) { + verify(fromTab, times(1)).removeObserver(eq(getTabObserver())); + } + if (toTab != null) { + verify(toTab, times(1)).addObserver(mTabObserverCaptor.capture()); + } + } +}
diff --git a/chrome/app/BUILD.gn b/chrome/app/BUILD.gn index 4293d420a..0d611aad 100644 --- a/chrome/app/BUILD.gn +++ b/chrome/app/BUILD.gn
@@ -406,10 +406,13 @@ } if (enable_extensions) { - chrome_packaged_services += [ - "//chrome/services/media_gallery_util:manifest", - "//chrome/services/removable_storage_writer:manifest", - ] + chrome_packaged_services += + [ "//chrome/services/removable_storage_writer:manifest" ] +} + +if (enable_extensions || is_android) { + chrome_packaged_services += + [ "//chrome/services/media_gallery_util:manifest" ] } if (is_chromeos) {
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc index 3efa97c..065898e 100644 --- a/chrome/app/chrome_main_delegate.cc +++ b/chrome/app/chrome_main_delegate.cc
@@ -11,6 +11,7 @@ #include "base/command_line.h" #include "base/cpu.h" #include "base/files/file_path.h" +#include "base/files/file_util.h" #include "base/i18n/rtl.h" #include "base/lazy_instance.h" #include "base/macros.h" @@ -114,6 +115,7 @@ #include "base/android/java_exception_reporter.h" #include "chrome/browser/android/crash/pure_java_exception_handler.h" #include "chrome/common/descriptors_android.h" +#include "ui/base/resource/resource_bundle_android.h" #else // Diagnostics is only available on non-android platforms. #include "chrome/browser/diagnostics/diagnostics_controller.h" @@ -165,11 +167,6 @@ g_chrome_content_utility_client = LAZY_INSTANCE_INITIALIZER; #endif -#if !defined(CHROME_MULTIPLE_DLL_CHILD) -base::LazyInstance<ChromeContentBrowserClient>::DestructorAtExit - g_chrome_content_browser_client = LAZY_INSTANCE_INITIALIZER; -#endif - #if defined(OS_POSIX) base::LazyInstance<ChromeCrashReporterClient>::Leaky g_chrome_crash_client = LAZY_INSTANCE_INITIALIZER; @@ -503,6 +500,14 @@ // This doesn't matter as it simply sets global variables. RecordMainStartupMetrics(exe_entry_point_ticks); #endif // !defined(CHROME_MULTIPLE_DLL_CHILD) + + chrome::RegisterPathProvider(); +#if defined(OS_CHROMEOS) + chromeos::RegisterPathProvider(); +#endif +#if BUILDFLAG(ENABLE_NACL) && defined(OS_LINUX) + nacl::RegisterPathProvider(); +#endif } ChromeMainDelegate::~ChromeMainDelegate() { @@ -572,14 +577,6 @@ #endif - chrome::RegisterPathProvider(); -#if defined(OS_CHROMEOS) - chromeos::RegisterPathProvider(); -#endif -#if BUILDFLAG(ENABLE_NACL) && defined(OS_LINUX) - nacl::RegisterPathProvider(); -#endif - ContentSettingsPattern::SetNonWildcardDomainNonPortSchemes( kNonWildcardDomainNonPortSchemes, kNonWildcardDomainNonPortSchemesSize); @@ -1054,7 +1051,13 @@ #if defined(CHROME_MULTIPLE_DLL_CHILD) return NULL; #else - return g_chrome_content_browser_client.Pointer(); + if (chrome_content_browser_client_ == nullptr) { + DCHECK(service_manifest_data_pack_); + chrome_content_browser_client_ = + std::make_unique<ChromeContentBrowserClient>( + std::move(service_manifest_data_pack_)); + } + return chrome_content_browser_client_.get(); #endif } @@ -1084,6 +1087,33 @@ #endif } +ui::DataPack* ChromeMainDelegate::LoadServiceManifestDataPack() { + DCHECK(!service_manifest_data_pack_ && !chrome_content_browser_client_); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + std::string process_type = + command_line.GetSwitchValueASCII(switches::kProcessType); + DCHECK(process_type.empty()); + +#if defined(OS_MACOSX) + SetUpBundleOverrides(); +#endif + + base::FilePath resources_pack_path; + PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); + +#if defined(OS_ANDROID) + service_manifest_data_pack_ = + ui::GetDataPackFromPackFile("assets/resources.pak", resources_pack_path); +#else + if (base::PathExists(resources_pack_path)) { + service_manifest_data_pack_.reset(new ui::DataPack(ui::SCALE_FACTOR_NONE)); + service_manifest_data_pack_->LoadFromPath(resources_pack_path); + } +#endif // defined(OS_ANDROID) + return service_manifest_data_pack_.get(); +} + bool ChromeMainDelegate::ShouldEnableProfilerRecording() { switch (chrome::GetChannel()) { case version_info::Channel::UNKNOWN:
diff --git a/chrome/app/chrome_main_delegate.h b/chrome/app/chrome_main_delegate.h index b957cf7..1105b5fe 100644 --- a/chrome/app/chrome_main_delegate.h +++ b/chrome/app/chrome_main_delegate.h
@@ -13,11 +13,14 @@ #include "build/build_config.h" #include "chrome/common/chrome_content_client.h" #include "content/public/app/content_main_delegate.h" +#include "ui/base/resource/data_pack.h" namespace base { class CommandLine; } +class ChromeContentBrowserClient; + // Chrome implementation of ContentMainDelegate. class ChromeMainDelegate : public content::ContentMainDelegate { public: @@ -57,6 +60,7 @@ content::ContentGpuClient* CreateContentGpuClient() override; content::ContentRendererClient* CreateContentRendererClient() override; content::ContentUtilityClient* CreateContentUtilityClient() override; + ui::DataPack* LoadServiceManifestDataPack() override; #if defined(OS_MACOSX) void InitMacCrashReporter(const base::CommandLine& command_line, @@ -66,6 +70,12 @@ ChromeContentClient chrome_content_client_; + std::unique_ptr<ChromeContentBrowserClient> chrome_content_browser_client_; + + // This field is loaded by LoadServiceManifestDataPack() and passed to + // ContentBrowserClient in CreateContentBrowserClient() + std::unique_ptr<ui::DataPack> service_manifest_data_pack_; + DISALLOW_COPY_AND_ASSIGN(ChromeMainDelegate); };
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index a3a3194..36e07db1 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -3272,6 +3272,8 @@ <message name="IDS_UTILITY_PROCESS_IMAGE_WRITER_NAME" desc="The name of the utility process used for writing Chrome OS system images."> Chrome OS System Image Writer </message> + </if> + <if expr="enable_extensions or is_android"> <message name="IDS_UTILITY_PROCESS_MEDIA_GALLERY_UTILITY_NAME" desc="The name of the utility process used for checking media files."> Media File Checker </message>
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index ee7c1409..3df068d 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <!-- Settings-specific strings (included from generated_resources.grd). --> <grit-part> + <message name="IDS_SETTINGS_EMPTY_STRING" desc="Empty string, exist only to make code generic. No translation required."></message> + <!-- Main Page --> <if expr="chromeos"> <message name="IDS_SETTINGS_SECONDARY_USER_BANNER" desc="Banner displayed in settings page when the user is secondary in a multi-profile session."> @@ -2269,6 +2271,12 @@ <message name="IDS_SETTINGS_LINKDOCTOR_PREF" desc="The documentation string of the 'Use Link Doctor' preference to help with navigation errors."> Use a web service to help resolve navigation errors </message> + <message name="IDS_SETTINGS_LINKDOCTOR_PREF_UNIFIED_CONSENT" desc="The documentation string of the 'Use Link Doctor' preference to help with navigation errors."> + Show suggestions for similar pages when a page can't be found + </message> + <message name="IDS_SETTINGS_LINKDOCTOR_PREF_DESC_UNIFIED_CONSENT" desc="The description of the 'Use Link Doctor' preference to help with navigation errors."> + Sends the web address of the page you're trying to reach to Google + </message> <if expr="chromeos"> <message name="IDS_SETTINGS_SUGGEST_PREF" desc="The documentation string of the 'Use Suggest' preference"> Use a prediction service to help complete searches and URLs typed in the address bar or the app launcher search box @@ -2279,30 +2287,66 @@ Use a prediction service to help complete searches and URLs typed in the address bar </message> </if> - <message name="IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_DESCRIPTION" desc="In the advanced options tab, the text next to the checkbox that enables prediction of network actions. Actions include browser-initiated DNS prefetching, TCP and SSL preconnection, and prerendering of webpages."> + <message name="IDS_SETTINGS_SUGGEST_PREF_UNIFIED_CONSENT" desc="The documentation string of the 'Use Suggest' preference"> + Autocomplete searches and web addresses + </message> + <message name="IDS_SETTINGS_SUGGEST_PREF_DESC_UNIFIED_CONSENT" desc="The description of the 'Use Suggest' preference"> + Sends searches from the address bar and search box and some cookies to your default search engine + </message> + <message name="IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_LABEL" desc="In the advanced options tab, the text next to the checkbox that enables prediction of network actions. Actions include browser-initiated DNS prefetching, TCP and SSL preconnection, and prerendering of webpages."> Use a prediction service to load pages more quickly </message> + <message name="IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_LABEL_UNIFIED_CONSENT" desc="In the advanced options tab, the text next to the checkbox that enables prediction of network actions. Actions include browser-initiated DNS prefetching, TCP and SSL preconnection, and prerendering of webpages."> + Preload pages for faster browsing and searching + </message> + <message name="IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_DESC_UNIFIED_CONSENT" desc="In the advanced options tab, the secondary text next to the checkbox that enables prediction of network actions."> + Uses cookies to remember your preferences, even if you don’t visit those pages + </message> <message name="IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION" desc="The label of the 'Protect you and your device from dangerous sites' checkbox"> Protect you and your device from dangerous sites </message> + <message name="IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION_UNIFIED_CONSENT" desc="The label of the 'Protect you and your device from dangerous sites' checkbox"> + Protect you and your device from dangerous sites (Safe Browsing) + </message> + <message name="IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION_DESC_UNIFIED_CONSENT" desc="The secondary label of the 'Protect you and your device from dangerous sites' checkbox"> + Checks sites you visit and files you download for harmful behavior or content, like phishing or malware + </message> <message name="IDS_SETTINGS_SAFEBROWSING_ENABLE_EXTENDED_REPORTING" desc="Checkbox label: should Chrome upload information about suspicious downloads and websites to Safe Browsing"> Automatically report details of possible security incidents to Google </message> <message name="IDS_SETTINGS_SAFEBROWSING_ENABLE_SCOUT_REPORTING" desc="Checkbox label: should Chrome upload some system information and page content to Safe Browsing for malware detection"> Automatically send some system information and page content to Google to help detect dangerous apps and sites </message> + <message name="IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING_UNIFIED_CONSENT" desc="Checkbox label: should Chrome upload some system information and page content to Safe Browsing"> + Help improve Safe Browsing + </message> + <message name="IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING_DESC_UNIFIED_CONSENT" desc="Checkbox label: should Chrome upload some system information and page content to Safe Browsing"> + Sends some system information and page content to Google + </message> <message name="IDS_SETTINGS_SPELLING_PREF" desc="The documentation string of the 'Use Spelling' preference"> Use a web service to help resolve spelling errors </message> <message name="IDS_SETTINGS_SPELLING_DESCRIPTION" desc="Description of using a web serviced to help resolve spelling errors. It is important to convey that what the user types will be sent to Google."> Smarter spell-checking by sending what you type in the browser to Google </message> + <message name="IDS_SETTINGS_SPELLING_PREF_UNIFIED_CONSENT" desc="The documentation string of the 'Use Spelling' preference"> + Spell check + </message> + <message name="IDS_SETTINGS_SPELLING_DESCRIPTION_UNIFIED_CONSENT" desc="Description of using a web serviced to help resolve spelling errors. It is important to convey that what the user types will be sent to Google."> + Control this setting in <ph name="BEGIN_LINK"><a href="chrome://settings/languages"><ex><a href="chrome://settings/languages"></ex></ph>Languages<ph name="END_LINK"></a><ex></a></ex></ph> + </message> <message name="IDS_SETTINGS_ENABLE_LOGGING" desc="The label of the checkbox to enable/disable crash and user metrics logging"> Automatically send usage statistics and crash reports to Google </message> <message name="IDS_SETTINGS_ENABLE_LOGGING_DIAGNOSTIC_AND_USAGE_DATA" desc="The label of the checkbox to enable/disable diagnostic and user metrics logging"> Automatically send diagnostic and usage data to Google </message> + <message name="IDS_SETTINGS_ENABLE_LOGGING_UNIFIED_CONSENT" desc="The label of the checkbox to enable/disable crash and user metrics logging. This string does not need a Chromium counter-part because it will only be visible if Google-branded."> + Help improve Chrome's features and performance + </message> + <message name="IDS_SETTINGS_ENABLE_LOGGING_DESC_UNIFIED_CONSENT" desc="The description of the checkbox to enable/disable crash and user metrics logging"> + Automatically sends usage statistics and crash reports to Google + </message> <message name="IDS_SETTINGS_ENABLE_DO_NOT_TRACK" desc="The label of the checkbox to enable/disable sending the 'Do Not track' header"> Send a "Do Not Track" request with your browsing traffic </message>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index c9769c2..7d0adb6 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -1761,7 +1761,6 @@ "//media/mojo/interfaces:mirror_service_remoting", "//media/mojo/interfaces:remoting", "//media/mojo/services", - "//mojo/common", "//mojo/edk", "//mojo/public/cpp/bindings", "//net:extras", @@ -1989,6 +1988,8 @@ "android/download/download_location_dialog_bridge_impl.h", "android/download/download_manager_service.cc", "android/download/download_manager_service.h", + "android/download/download_media_parser.cc", + "android/download/download_media_parser.h", "android/download/duplicate_download_infobar_delegate.cc", "android/download/duplicate_download_infobar_delegate.h", "android/download/intercept_download_resource_throttle.cc", @@ -1996,6 +1997,8 @@ "android/download/intercept_oma_download_navigation_throttle.cc", "android/download/intercept_oma_download_navigation_throttle.h", "android/download/items/offline_content_aggregator_factory_android.cc", + "android/download/local_media_data_source_factory.cc", + "android/download/local_media_data_source_factory.h", "android/download/service/download_background_task.cc", "android/download/service/download_task_scheduler.cc", "android/download/service/download_task_scheduler.h", @@ -2325,6 +2328,8 @@ ":delta_file_proto", ":jni_headers", "//chrome/browser/android/webapk:proto", + "//chrome/services/media_gallery_util:manifest", # TODO(xingliu): Tries to remove this. + "//chrome/services/media_gallery_util/public/cpp", "//components/cdm/browser", "//components/data_usage/android", "//components/feed:feature_list", @@ -2540,6 +2545,9 @@ "metrics/tab_stats_data_store.h", "metrics/tab_stats_tracker.cc", "metrics/tab_stats_tracker.h", + "metrics/tab_stats_tracker_delegate.h", + "metrics/tab_stats_tracker_delegate_win.cc", + "metrics/tab_stats_tracker_win.cc", "metrics/tab_usage_recorder.cc", "metrics/tab_usage_recorder.h", "notifications/message_center_notification_manager.cc", @@ -2935,6 +2943,7 @@ "//third_party/iaccessible2", "//third_party/isimpledom", "//third_party/wtl", + "//ui/aura_extra", "//ui/base:fullscreen_win", ]
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 8d89c5b..1acfd2c5 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -139,6 +139,7 @@ #if defined(OS_CHROMEOS) #include "ash/public/cpp/ash_features.h" #include "ash/public/cpp/ash_switches.h" +#include "chromeos/chromeos_features.h" #include "chromeos/chromeos_switches.h" #include "components/arc/arc_features.h" #include "third_party/cros_system_api/switches/chrome_switches.h" @@ -1537,11 +1538,11 @@ {"enable_unified_multidevice_settings", flag_descriptions::kEnableUnifiedMultiDeviceSettingsName, flag_descriptions::kEnableUnifiedMultiDeviceSettingsDescription, kOsCrOS, - FEATURE_VALUE_TYPE(features::kEnableUnifiedMultiDeviceSettings)}, + FEATURE_VALUE_TYPE(chromeos::features::kEnableUnifiedMultiDeviceSettings)}, {"enable_unified_multidevice_setup", flag_descriptions::kEnableUnifiedMultiDeviceSetupName, flag_descriptions::kEnableUnifiedMultiDeviceSetupDescription, kOsCrOS, - FEATURE_VALUE_TYPE(features::kEnableUnifiedMultiDeviceSetup)}, + FEATURE_VALUE_TYPE(chromeos::features::kEnableUnifiedMultiDeviceSetup)}, {"enable-video-player-chromecast-support", flag_descriptions::kVideoPlayerChromecastSupportName, flag_descriptions::kVideoPlayerChromecastSupportDescription, kOsCrOS,
diff --git a/chrome/browser/android/document/document_web_contents_delegate.cc b/chrome/browser/android/document/document_web_contents_delegate.cc index 410c125..bd91615 100644 --- a/chrome/browser/android/document/document_web_contents_delegate.cc +++ b/chrome/browser/android/document/document_web_contents_delegate.cc
@@ -29,7 +29,7 @@ void DocumentWebContentsDelegate::AddNewContents( content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture,
diff --git a/chrome/browser/android/document/document_web_contents_delegate.h b/chrome/browser/android/document/document_web_contents_delegate.h index bc989ce..3537cb06 100644 --- a/chrome/browser/android/document/document_web_contents_delegate.h +++ b/chrome/browser/android/document/document_web_contents_delegate.h
@@ -30,7 +30,7 @@ // Overridden from WebContentsDelegate. void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture,
diff --git a/chrome/browser/android/download/download_media_parser.cc b/chrome/browser/android/download/download_media_parser.cc new file mode 100644 index 0000000..091cb8a2 --- /dev/null +++ b/chrome/browser/android/download/download_media_parser.cc
@@ -0,0 +1,49 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/android/download/download_media_parser.h" + +#include "base/bind.h" +#include "base/files/file.h" +#include "chrome/browser/android/download/local_media_data_source_factory.h" +#include "content/public/common/service_manager_connection.h" + +namespace { + +void OnParseMetadataDone( + std::unique_ptr<SafeMediaMetadataParser> parser_keep_alive, + SafeMediaMetadataParser::DoneCallback done_callback, + bool parse_success, + chrome::mojom::MediaMetadataPtr metadata, + std::unique_ptr<std::vector<metadata::AttachedImage>> attached_images) { + // Call done callback on main thread. + std::move(done_callback) + .Run(parse_success, std::move(metadata), std::move(attached_images)); +} + +} // namespace + +DownloadMediaParser::DownloadMediaParser( + scoped_refptr<base::SequencedTaskRunner> file_task_runner) + : file_task_runner_(file_task_runner) {} + +DownloadMediaParser::~DownloadMediaParser() = default; + +void DownloadMediaParser::ParseMediaFile( + int64_t size, + const std::string& mime_type, + const base::FilePath& file_path, + SafeMediaMetadataParser::DoneCallback callback) { + auto media_data_source_factory = + std::make_unique<LocalMediaDataSourceFactory>(file_path, + file_task_runner_); + auto parser = std::make_unique<SafeMediaMetadataParser>( + size, mime_type, true /* get_attached_images */, + std::move(media_data_source_factory)); + SafeMediaMetadataParser* parser_ptr = parser.get(); + parser_ptr->Start( + content::ServiceManagerConnection::GetForProcess()->GetConnector(), + base::BindOnce(&OnParseMetadataDone, std::move(parser), + std::move(callback))); +}
diff --git a/chrome/browser/android/download/download_media_parser.h b/chrome/browser/android/download/download_media_parser.h new file mode 100644 index 0000000..bb90893 --- /dev/null +++ b/chrome/browser/android/download/download_media_parser.h
@@ -0,0 +1,44 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MEDIA_PARSER_H_ +#define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MEDIA_PARSER_H_ + +#include <memory> +#include <string> +#include <vector> + +#include "base/files/file_path.h" +#include "base/macros.h" +#include "base/memory/scoped_refptr.h" +#include "base/sequenced_task_runner.h" +#include "chrome/common/media_galleries/metadata_types.h" +#include "chrome/services/media_gallery_util/public/cpp/safe_media_metadata_parser.h" +#include "chrome/services/media_gallery_util/public/mojom/media_parser.mojom.h" + +// Local media files parser is used to process local media files. This object +// lives on main thread in browser process. +class DownloadMediaParser { + public: + explicit DownloadMediaParser( + scoped_refptr<base::SequencedTaskRunner> file_task_runner); + ~DownloadMediaParser(); + + // Parse media metadata in a local file. All file IO will run on + // |file_task_runner|. The metadata is parsed in an utility process safely. + // However, the result is still comes from user-defined input, thus should be + // used with caution. + void ParseMediaFile(int64_t size, + const std::string& mime_type, + const base::FilePath& file_path, + SafeMediaMetadataParser::DoneCallback callback); + + private: + // The task runner to do blocking disk IO. + scoped_refptr<base::SequencedTaskRunner> file_task_runner_; + + DISALLOW_COPY_AND_ASSIGN(DownloadMediaParser); +}; + +#endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MEDIA_PARSER_H_
diff --git a/chrome/browser/android/download/local_media_data_source_factory.cc b/chrome/browser/android/download/local_media_data_source_factory.cc new file mode 100644 index 0000000..ea25f90 --- /dev/null +++ b/chrome/browser/android/download/local_media_data_source_factory.cc
@@ -0,0 +1,129 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/android/download/local_media_data_source_factory.h" + +#include <vector> + +#include "base/callback.h" +#include "base/files/file.h" +#include "base/files/file_path.h" +#include "base/memory/weak_ptr.h" +#include "base/message_loop/message_loop_current.h" +#include "mojo/public/cpp/bindings/binding.h" + +namespace { + +using MediaDataCallback = + SafeMediaMetadataParser::MediaDataSourceFactory::MediaDataCallback; +using ReadFileCallback = base::OnceCallback<void(bool, std::vector<char>)>; + +// Reads a chunk of the file on a file thread, and reply the data or error to +// main thread. +void ReadFile(const base::FilePath& file_path, + int64_t position, + int64_t length, + scoped_refptr<base::SequencedTaskRunner> main_task_runner, + ReadFileCallback cb) { + base::File file(file_path, + base::File::Flags::FLAG_OPEN | base::File::Flags::FLAG_READ); + if (!file.IsValid()) { + main_task_runner->PostTask( + FROM_HERE, + base::BindOnce(std::move(cb), false /*success*/, std::vector<char>())); + return; + } + + auto buffer = std::vector<char>(length); + int bytes_read = file.Read(position, buffer.data(), length); + if (bytes_read == -1) { + main_task_runner->PostTask( + FROM_HERE, + base::BindOnce(std::move(cb), false /*success*/, std::vector<char>())); + return; + } + DCHECK_GE(bytes_read, 0); + if (bytes_read < length) + buffer.resize(bytes_read); + + main_task_runner->PostTask( + FROM_HERE, + base::BindOnce(std::move(cb), true /*success*/, std::move(buffer))); +} + +// Read media file incrementally and send data to the utility process to parse +// media metadata. Must live and die on main thread and does blocking IO on +// |file_task_runner_|. +class LocalMediaDataSource : public chrome::mojom::MediaDataSource { + public: + LocalMediaDataSource( + chrome::mojom::MediaDataSourcePtr* interface, + const base::FilePath& file_path, + scoped_refptr<base::SequencedTaskRunner> file_task_runner, + MediaDataCallback media_data_callback) + : file_path_(file_path), + file_task_runner_(file_task_runner), + media_data_callback_(media_data_callback), + binding_(this, mojo::MakeRequest(interface)), + weak_ptr_factory_(this) {} + ~LocalMediaDataSource() override = default; + + private: + // chrome::mojom::MediaDataSource implementation. + void Read(int64_t position, + int64_t length, + chrome::mojom::MediaDataSource::ReadCallback callback) override { + DCHECK(!ipc_read_callback_); + ipc_read_callback_ = std::move(callback); + + // Read file on a file thread. + ReadFileCallback read_file_done = base::BindOnce( + &LocalMediaDataSource::OnReadFileDone, weak_ptr_factory_.GetWeakPtr()); + file_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&ReadFile, file_path_, position, length, + base::MessageLoopCurrent::Get()->task_runner(), + std::move(read_file_done))); + } + + void OnReadFileDone(bool success, std::vector<char> buffer) { + // TODO(xingliu): Handle file IO error when success is false, the IPC + // channel for chrome::mojom::MediaParser should be closed. + DCHECK(ipc_read_callback_); + media_data_callback_.Run( + std::move(ipc_read_callback_), + std::make_unique<std::string>(buffer.begin(), buffer.end())); + } + + base::FilePath file_path_; + scoped_refptr<base::SequencedTaskRunner> file_task_runner_; + + // Called when a chunk of the file is read. + MediaDataCallback media_data_callback_; + + // Pass through callback that is used to send data across IPC channel. + chrome::mojom::MediaDataSource::ReadCallback ipc_read_callback_; + + mojo::Binding<chrome::mojom::MediaDataSource> binding_; + base::WeakPtrFactory<LocalMediaDataSource> weak_ptr_factory_; + + DISALLOW_COPY_AND_ASSIGN(LocalMediaDataSource); +}; + +} // namespace + +LocalMediaDataSourceFactory::LocalMediaDataSourceFactory( + const base::FilePath& file_path, + scoped_refptr<base::SequencedTaskRunner> file_task_runner) + : file_path_(file_path), file_task_runner_(file_task_runner) {} + +LocalMediaDataSourceFactory::~LocalMediaDataSourceFactory() = default; + +std::unique_ptr<chrome::mojom::MediaDataSource> +LocalMediaDataSourceFactory::CreateMediaDataSource( + chrome::mojom::MediaDataSourcePtr* request, + MediaDataCallback media_data_callback) { + return std::make_unique<LocalMediaDataSource>( + request, file_path_, file_task_runner_, media_data_callback); +}
diff --git a/chrome/browser/android/download/local_media_data_source_factory.h b/chrome/browser/android/download/local_media_data_source_factory.h new file mode 100644 index 0000000..4f4b352c --- /dev/null +++ b/chrome/browser/android/download/local_media_data_source_factory.h
@@ -0,0 +1,43 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_LOCAL_MEDIA_DATA_SOURCE_FACTORY_H_ +#define CHROME_BROWSER_ANDROID_DOWNLOAD_LOCAL_MEDIA_DATA_SOURCE_FACTORY_H_ + +#include <memory> + +#include "base/memory/scoped_refptr.h" +#include "base/sequenced_task_runner.h" +#include "chrome/services/media_gallery_util/public/cpp/safe_media_metadata_parser.h" +#include "chrome/services/media_gallery_util/public/mojom/media_parser.mojom.h" + +namespace base { +class FilePath; +} // namespace base + +// Provides local media data in the browser process and send it to media gallery +// util service to parse media metadata safely in an utility process. +class LocalMediaDataSourceFactory + : public SafeMediaMetadataParser::MediaDataSourceFactory { + public: + LocalMediaDataSourceFactory( + const base::FilePath& file_path, + scoped_refptr<base::SequencedTaskRunner> file_task_runner); + + ~LocalMediaDataSourceFactory() override; + + private: + // SafeMediaMetadataParser::MediaDataSourceFactory implementation. + std::unique_ptr<chrome::mojom::MediaDataSource> CreateMediaDataSource( + chrome::mojom::MediaDataSourcePtr* request, + MediaDataCallback media_data_callback) override; + + // Local downloaded media file path. This is user-defined input. + base::FilePath file_path_; + scoped_refptr<base::SequencedTaskRunner> file_task_runner_; + + DISALLOW_COPY_AND_ASSIGN(LocalMediaDataSourceFactory); +}; + +#endif // CHROME_BROWSER_ANDROID_DOWNLOAD_LOCAL_MEDIA_DATA_SOURCE_FACTORY_H_
diff --git a/chrome/browser/android/preferences/pref_service_bridge.cc b/chrome/browser/android/preferences/pref_service_bridge.cc index 0780e56..e0e2ded4 100644 --- a/chrome/browser/android/preferences/pref_service_bridge.cc +++ b/chrome/browser/android/preferences/pref_service_bridge.cc
@@ -166,7 +166,8 @@ DCHECK(content_settings_type == CONTENT_SETTINGS_TYPE_JAVASCRIPT || content_settings_type == CONTENT_SETTINGS_TYPE_POPUPS || content_settings_type == CONTENT_SETTINGS_TYPE_ADS || - content_settings_type == CONTENT_SETTINGS_TYPE_CLIPBOARD_READ); + content_settings_type == CONTENT_SETTINGS_TYPE_CLIPBOARD_READ || + content_settings_type == CONTENT_SETTINGS_TYPE_USB_GUARD); ContentSettingsType type = static_cast<ContentSettingsType>(content_settings_type); return GetBooleanForContentSetting(type); @@ -181,13 +182,22 @@ // that the new category supports ALLOW/BLOCK pairs and, if not, handle them. DCHECK(content_settings_type == CONTENT_SETTINGS_TYPE_JAVASCRIPT || content_settings_type == CONTENT_SETTINGS_TYPE_POPUPS || - content_settings_type == CONTENT_SETTINGS_TYPE_ADS); + content_settings_type == CONTENT_SETTINGS_TYPE_ADS || + content_settings_type == CONTENT_SETTINGS_TYPE_USB_GUARD); + + ContentSetting value = CONTENT_SETTING_BLOCK; + if (allow) { + if (content_settings_type == CONTENT_SETTINGS_TYPE_USB_GUARD) { + value = CONTENT_SETTING_ASK; + } else { + value = CONTENT_SETTING_ALLOW; + } + } HostContentSettingsMap* host_content_settings_map = HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile()); host_content_settings_map->SetDefaultContentSetting( - static_cast<ContentSettingsType>(content_settings_type), - allow ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); + static_cast<ContentSettingsType>(content_settings_type), value); } static void JNI_PrefServiceBridge_SetContentSettingForPattern(
diff --git a/chrome/browser/android/preferences/website_preference_bridge.cc b/chrome/browser/android/preferences/website_preference_bridge.cc index d969296..a829a865 100644 --- a/chrome/browser/android/preferences/website_preference_bridge.cc +++ b/chrome/browser/android/preferences/website_preference_bridge.cc
@@ -260,6 +260,18 @@ WebSiteSettingsUmaUtil::LogPermissionChange(content_type, setting); } +ChooserContextBase* GetChooserContext(ContentSettingsType type) { + Profile* profile = ProfileManager::GetActiveUserProfile(); + + switch (type) { + case CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA: + return UsbChooserContextFactory::GetForProfile(profile); + default: + NOTREACHED(); + return nullptr; + } +} + } // anonymous namespace static void JNI_WebsitePreferenceBridge_GetClipboardOrigins( @@ -533,12 +545,13 @@ return pattern.Matches(GURL(ConvertJavaStringToUTF8(env, jurl))); } -static void JNI_WebsitePreferenceBridge_GetUsbOrigins( +static void JNI_WebsitePreferenceBridge_GetChosenObjects( JNIEnv* env, const JavaParamRef<jclass>& clazz, + jint content_settings_type, const JavaParamRef<jobject>& list) { - Profile* profile = ProfileManager::GetActiveUserProfile(); - UsbChooserContext* context = UsbChooserContextFactory::GetForProfile(profile); + ChooserContextBase* context = GetChooserContext( + static_cast<ContentSettingsType>(content_settings_type)); for (const auto& object : context->GetAllGrantedObjects()) { // Remove the trailing slash so that origins are matched correctly in // SingleWebsitePreferences.mergePermissionInfoForTopLevelOrigin. @@ -554,10 +567,8 @@ if (embedder != origin) jembedder = ConvertUTF8ToJavaString(env, embedder); - std::string name; - bool found = object->object.GetString("name", &name); - DCHECK(found); - ScopedJavaLocalRef<jstring> jname = ConvertUTF8ToJavaString(env, name); + ScopedJavaLocalRef<jstring> jname = + ConvertUTF8ToJavaString(env, context->GetObjectName(object->object)); std::string serialized; bool written = base::JSONWriter::Write(object->object, &serialized); @@ -565,19 +576,19 @@ ScopedJavaLocalRef<jstring> jserialized = ConvertUTF8ToJavaString(env, serialized); - Java_WebsitePreferenceBridge_insertUsbInfoIntoList( - env, list, jorigin, jembedder, jname, jserialized); + Java_WebsitePreferenceBridge_insertChosenObjectInfoIntoList( + env, list, content_settings_type, jorigin, jembedder, jname, + jserialized); } } -static void JNI_WebsitePreferenceBridge_RevokeUsbPermission( +static void JNI_WebsitePreferenceBridge_RevokeObjectPermission( JNIEnv* env, const JavaParamRef<jclass>& clazz, + jint content_settings_type, const JavaParamRef<jstring>& jorigin, const JavaParamRef<jstring>& jembedder, const JavaParamRef<jstring>& jobject) { - Profile* profile = ProfileManager::GetActiveUserProfile(); - UsbChooserContext* context = UsbChooserContextFactory::GetForProfile(profile); GURL origin(ConvertJavaStringToUTF8(env, jorigin)); DCHECK(origin.is_valid()); // If embedder == origin above then a null embedder was sent to Java instead @@ -588,6 +599,8 @@ std::unique_ptr<base::DictionaryValue> object = base::DictionaryValue::From( base::JSONReader::Read(ConvertJavaStringToUTF8(env, jobject))); DCHECK(object); + ChooserContextBase* context = GetChooserContext( + static_cast<ContentSettingsType>(content_settings_type)); context->RevokeObjectPermission(origin, embedder, *object); }
diff --git a/chrome/browser/android/tab_web_contents_delegate_android.cc b/chrome/browser/android/tab_web_contents_delegate_android.cc index 378ef958f..0463d7c 100644 --- a/chrome/browser/android/tab_web_contents_delegate_android.cc +++ b/chrome/browser/android/tab_web_contents_delegate_android.cc
@@ -398,7 +398,7 @@ void TabWebContentsDelegateAndroid::AddNewContents( WebContents* source, - WebContents* new_contents, + std::unique_ptr<WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture, @@ -411,9 +411,9 @@ // At this point the |new_contents| is beyond the popup blocker, but we use // the same logic for determining if the popup tracker needs to be attached. if (source && PopupBlockerTabHelper::ConsiderForPopupBlocking(disposition)) - PopupTracker::CreateForWebContents(new_contents, source); + PopupTracker::CreateForWebContents(new_contents.get(), source); - TabHelpers::AttachTabHelpers(new_contents); + TabHelpers::AttachTabHelpers(new_contents.get()); JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); @@ -433,8 +433,11 @@ if (was_blocked) *was_blocked = !handled; - if (!handled) - delete new_contents; + + // When handled is |true|, ownership has been passed to java, which in turn + // creates a new TabAndroid instance to own the WebContents. + if (handled) + new_contents.release(); } blink::WebSecurityStyle TabWebContentsDelegateAndroid::GetSecurityStyle(
diff --git a/chrome/browser/android/tab_web_contents_delegate_android.h b/chrome/browser/android/tab_web_contents_delegate_android.h index efffb9d..892ed29 100644 --- a/chrome/browser/android/tab_web_contents_delegate_android.h +++ b/chrome/browser/android/tab_web_contents_delegate_android.h
@@ -77,7 +77,7 @@ const content::OpenURLParams& params) override; bool ShouldResumeRequestsForCreatedWindow() override; void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/chrome/browser/apps/app_browsertest.cc b/chrome/browser/apps/app_browsertest.cc index b33ad16..667431a6 100644 --- a/chrome/browser/apps/app_browsertest.cc +++ b/chrome/browser/apps/app_browsertest.cc
@@ -32,6 +32,7 @@ #include "chrome/browser/ui/extensions/app_launch_params.h" #include "chrome/browser/ui/extensions/application_launch.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "chrome/browser/ui/views_mode_controller.h" #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" #include "chrome/common/chrome_switches.h" @@ -1172,7 +1173,8 @@ } // This test currently only passes on OS X (on other platforms the print preview -// dialog's size is limited by the size of the window being printed). +// dialog's size is limited by the size of the window being printed). It also +// doesn't pass in Views mode on OS X. #if !defined(OS_MACOSX) #define MAYBE_PrintPreviewShouldNotBeTooSmall \ DISABLED_PrintPreviewShouldNotBeTooSmall @@ -1183,6 +1185,10 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MAYBE_PrintPreviewShouldNotBeTooSmall) { +#if defined(OS_MACOSX) + if (!views_mode_controller::IsViewsBrowserCocoa()) + return; +#endif // Print preview dialogs with widths less than 410 pixels will have preview // areas that are too small, and ones with heights less than 191 pixels will // have vertical scrollers for their controls that are too small.
diff --git a/chrome/browser/autofill/autofill_provider_browsertest.cc b/chrome/browser/autofill/autofill_provider_browsertest.cc index 87ac144a..af6eb50 100644 --- a/chrome/browser/autofill/autofill_provider_browsertest.cc +++ b/chrome/browser/autofill/autofill_provider_browsertest.cc
@@ -40,7 +40,7 @@ ~MockAutofillProvider() override {} MOCK_METHOD5(OnFormSubmitted, - bool(AutofillHandlerProxy* handler, + void(AutofillHandlerProxy* handler, const FormData& form, bool, SubmissionSource, @@ -62,13 +62,12 @@ is_queried_ = true; } - bool OnFormSubmittedImpl(AutofillHandlerProxy*, + void OnFormSubmittedImpl(AutofillHandlerProxy*, const FormData& form, bool success, SubmissionSource source, base::TimeTicks timestamp) { submitted_form_ = form; - return false; } const FormData& queried_form() { return queried_form_; }
diff --git a/chrome/browser/background/background_contents.cc b/chrome/browser/background/background_contents.cc index 49a8ac07..1eca1ed 100644 --- a/chrome/browser/background/background_contents.cc +++ b/chrome/browser/background/background_contents.cc
@@ -150,14 +150,15 @@ } // Forward requests to add a new WebContents to our delegate. -void BackgroundContents::AddNewContents(WebContents* source, - WebContents* new_contents, - WindowOpenDisposition disposition, - const gfx::Rect& initial_rect, - bool user_gesture, - bool* was_blocked) { - delegate_->AddWebContents( - new_contents, disposition, initial_rect, user_gesture, was_blocked); +void BackgroundContents::AddNewContents( + WebContents* source, + std::unique_ptr<WebContents> new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_rect, + bool user_gesture, + bool* was_blocked) { + delegate_->AddWebContents(std::move(new_contents), disposition, initial_rect, + user_gesture, was_blocked); } bool BackgroundContents::IsNeverVisible(content::WebContents* web_contents) {
diff --git a/chrome/browser/background/background_contents.h b/chrome/browser/background/background_contents.h index 29db768..2048d19 100644 --- a/chrome/browser/background/background_contents.h +++ b/chrome/browser/background/background_contents.h
@@ -45,11 +45,12 @@ // WebContents to a suitable container (e.g. browser) or to show it if it's // a popup window. If |was_blocked| is non-NULL, then |*was_blocked| will be // set to true if the popup gets blocked, and left unchanged otherwise. - virtual void AddWebContents(content::WebContents* new_contents, - WindowOpenDisposition disposition, - const gfx::Rect& initial_rect, - bool user_gesture, - bool* was_blocked) = 0; + virtual void AddWebContents( + std::unique_ptr<content::WebContents> new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_rect, + bool user_gesture, + bool* was_blocked) = 0; protected: virtual ~Delegate() {} @@ -77,7 +78,7 @@ bool ShouldSuppressDialogs(content::WebContents* source) override; void DidNavigateMainFramePostCommit(content::WebContents* tab) override; void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc index 7bd71ae..901f2d5 100644 --- a/chrome/browser/background/background_contents_service.cc +++ b/chrome/browser/background/background_contents_service.cc
@@ -815,7 +815,7 @@ } void BackgroundContentsService::AddWebContents( - WebContents* new_contents, + std::unique_ptr<WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture, @@ -823,7 +823,7 @@ Browser* browser = chrome::FindLastActiveWithProfile( Profile::FromBrowserContext(new_contents->GetBrowserContext())); if (browser) { - chrome::AddWebContents(browser, nullptr, new_contents, disposition, - initial_rect, user_gesture); + chrome::AddWebContents(browser, nullptr, std::move(new_contents), + disposition, initial_rect, user_gesture); } }
diff --git a/chrome/browser/background/background_contents_service.h b/chrome/browser/background/background_contents_service.h index 7fe46083..d71b548 100644 --- a/chrome/browser/background/background_contents_service.h +++ b/chrome/browser/background/background_contents_service.h
@@ -97,7 +97,7 @@ std::vector<BackgroundContents*> GetBackgroundContents() const; // BackgroundContents::Delegate implementation. - void AddWebContents(content::WebContents* new_contents, + void AddWebContents(std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index 376e246..34dcceac 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc
@@ -186,6 +186,7 @@ #include "net/url_request/url_request.h" #include "printing/buildflags/buildflags.h" #include "rlz/buildflags/buildflags.h" +#include "services/service_manager/embedder/main_delegate.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/layout.h" #include "ui/base/material_design/material_design_controller.h" @@ -655,7 +656,8 @@ // Initializes the shared instance of ResourceBundle and returns the locale. An // empty string return value indicates failure. std::string InitResourceBundleAndDetermineLocale( - const content::MainFunctionParams& params) { + const content::MainFunctionParams& params, + std::unique_ptr<ui::DataPack> data_pack) { #if defined(OS_MACOSX) // TODO(markusheintz): Read preference pref::kApplicationLocale in order // to enforce the application locale. @@ -672,23 +674,8 @@ // method InitSharedInstance is ignored. locale = ui::ResourceBundle::InitSharedInstanceWithLocale( locale, nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES); - if (locale.empty()) - return locale; - // First run prefs needs data from the ResourceBundle, so load it now. - { - TRACE_EVENT0("startup", - "ChromeBrowserMainParts::InitResourceBundleAndDetermineLocale:" - ":AddDataPack"); - base::FilePath resources_pack_path; - PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); -#if defined(OS_ANDROID) - ui::LoadMainAndroidPackFile("assets/resources.pak", resources_pack_path); -#else - ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( - resources_pack_path, ui::SCALE_FACTOR_NONE); -#endif // defined(OS_ANDROID) - } + ui::ResourceBundle::GetSharedInstance().AddDataPack(std::move(data_pack)); return locale; } @@ -841,7 +828,8 @@ // BrowserMainParts ------------------------------------------------------------ ChromeBrowserMainParts::ChromeBrowserMainParts( - const content::MainFunctionParams& parameters) + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack) : parameters_(parameters), parsed_command_line_(parameters.command_line), result_code_(content::RESULT_CODE_NORMAL_EXIT), @@ -851,7 +839,8 @@ should_call_pre_main_loop_start_startup_on_variations_service_( !parameters.ui_task), profile_(NULL), - run_message_loop_(true) { + run_message_loop_(true), + service_manifest_data_pack_(std::move(data_pack)) { // If we're running tests (ui_task is non-null). if (parameters.ui_task) browser_defaults::enable_help_app = false; @@ -1163,7 +1152,9 @@ // First run prefs may use the ResourceBundle (and get data from it), so this // needs to be before ApplyFirstRunPrefs(). - std::string locale = InitResourceBundleAndDetermineLocale(parameters()); + std::string locale = InitResourceBundleAndDetermineLocale( + parameters(), std::move(service_manifest_data_pack_)); + if (locale.empty()) { *failed_to_load_resource_bundle = true; return chrome::RESULT_CODE_MISSING_DATA;
diff --git a/chrome/browser/chrome_browser_main.h b/chrome/browser/chrome_browser_main.h index a1e253e0..8c745da 100644 --- a/chrome/browser/chrome_browser_main.h +++ b/chrome/browser/chrome_browser_main.h
@@ -6,10 +6,8 @@ #define CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ #include <memory> -#include <vector> #include "base/macros.h" -#include "build/build_config.h" #include "chrome/browser/chrome_browser_field_trials.h" #include "chrome/browser/chrome_process_singleton.h" #include "chrome/browser/first_run/first_run.h" @@ -18,6 +16,7 @@ #include "chrome/common/thread_profiler.h" #include "content/public/browser/browser_main_parts.h" #include "content/public/common/main_function_params.h" +#include "ui/base/resource/data_pack.h" class BrowserProcessImpl; class ChromeBrowserMainExtraParts; @@ -56,8 +55,8 @@ class DeferringTaskRunner; #endif - explicit ChromeBrowserMainParts( - const content::MainFunctionParams& parameters); + explicit ChromeBrowserMainParts(const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack); // content::BrowserMainParts overrides. bool ShouldContentCreateFeatureList() override; @@ -211,6 +210,10 @@ scoped_refptr<DeferringTaskRunner> initial_task_runner_; #endif + // This is used to store the ui data pack. The data pack is moved when + // resource bundle gets created. + std::unique_ptr<ui::DataPack> service_manifest_data_pack_; + DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainParts); };
diff --git a/chrome/browser/chrome_browser_main_android.cc b/chrome/browser/chrome_browser_main_android.cc index 773d8419..db13c4df 100644 --- a/chrome/browser/chrome_browser_main_android.cc +++ b/chrome/browser/chrome_browser_main_android.cc
@@ -34,9 +34,9 @@ #include "ui/base/ui_base_paths.h" ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( - const content::MainFunctionParams& parameters) - : ChromeBrowserMainParts(parameters) { -} + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack) + : ChromeBrowserMainParts(parameters, std::move(data_pack)) {} ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { }
diff --git a/chrome/browser/chrome_browser_main_android.h b/chrome/browser/chrome_browser_main_android.h index 63ae1e2..7cf7c8cb 100644 --- a/chrome/browser/chrome_browser_main_android.h +++ b/chrome/browser/chrome_browser_main_android.h
@@ -12,7 +12,8 @@ class ChromeBrowserMainPartsAndroid : public ChromeBrowserMainParts { public: explicit ChromeBrowserMainPartsAndroid( - const content::MainFunctionParams& parameters); + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack); ~ChromeBrowserMainPartsAndroid() override; // content::BrowserMainParts overrides.
diff --git a/chrome/browser/chrome_browser_main_linux.cc b/chrome/browser/chrome_browser_main_linux.cc index f41c5a6..be63d8b 100644 --- a/chrome/browser/chrome_browser_main_linux.cc +++ b/chrome/browser/chrome_browser_main_linux.cc
@@ -34,9 +34,9 @@ #endif ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux( - const content::MainFunctionParams& parameters) - : ChromeBrowserMainPartsPosix(parameters) { -} + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack) + : ChromeBrowserMainPartsPosix(parameters, std::move(data_pack)) {} ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() { }
diff --git a/chrome/browser/chrome_browser_main_linux.h b/chrome/browser/chrome_browser_main_linux.h index 0aea1165..cfbdda6 100644 --- a/chrome/browser/chrome_browser_main_linux.h +++ b/chrome/browser/chrome_browser_main_linux.h
@@ -14,7 +14,8 @@ class ChromeBrowserMainPartsLinux : public ChromeBrowserMainPartsPosix { public: explicit ChromeBrowserMainPartsLinux( - const content::MainFunctionParams& parameters); + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack); ~ChromeBrowserMainPartsLinux() override; // ChromeBrowserMainParts overrides.
diff --git a/chrome/browser/chrome_browser_main_mac.h b/chrome/browser/chrome_browser_main_mac.h index 2f36120..5cd8d8e 100644 --- a/chrome/browser/chrome_browser_main_mac.h +++ b/chrome/browser/chrome_browser_main_mac.h
@@ -11,7 +11,8 @@ class ChromeBrowserMainPartsMac : public ChromeBrowserMainPartsPosix { public: explicit ChromeBrowserMainPartsMac( - const content::MainFunctionParams& parameters); + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack); ~ChromeBrowserMainPartsMac() override; // BrowserParts overrides.
diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm index 8e87b52a7..d59e1ab8 100644 --- a/chrome/browser/chrome_browser_main_mac.mm +++ b/chrome/browser/chrome_browser_main_mac.mm
@@ -66,9 +66,9 @@ // ChromeBrowserMainPartsMac --------------------------------------------------- ChromeBrowserMainPartsMac::ChromeBrowserMainPartsMac( - const content::MainFunctionParams& parameters) - : ChromeBrowserMainPartsPosix(parameters) { -} + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack) + : ChromeBrowserMainPartsPosix(parameters, std::move(data_pack)) {} ChromeBrowserMainPartsMac::~ChromeBrowserMainPartsMac() { }
diff --git a/chrome/browser/chrome_browser_main_posix.cc b/chrome/browser/chrome_browser_main_posix.cc index c9195fb..47b29d5 100644 --- a/chrome/browser/chrome_browser_main_posix.cc +++ b/chrome/browser/chrome_browser_main_posix.cc
@@ -108,9 +108,9 @@ // ChromeBrowserMainPartsPosix ------------------------------------------------- ChromeBrowserMainPartsPosix::ChromeBrowserMainPartsPosix( - const content::MainFunctionParams& parameters) - : ChromeBrowserMainParts(parameters) { -} + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack) + : ChromeBrowserMainParts(parameters, std::move(data_pack)) {} int ChromeBrowserMainPartsPosix::PreEarlyInitialization() { const int result = ChromeBrowserMainParts::PreEarlyInitialization();
diff --git a/chrome/browser/chrome_browser_main_posix.h b/chrome/browser/chrome_browser_main_posix.h index 265c4c29..334a2fc 100644 --- a/chrome/browser/chrome_browser_main_posix.h +++ b/chrome/browser/chrome_browser_main_posix.h
@@ -11,7 +11,8 @@ class ChromeBrowserMainPartsPosix : public ChromeBrowserMainParts { public: explicit ChromeBrowserMainPartsPosix( - const content::MainFunctionParams& parameters); + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack); // content::BrowserMainParts overrides. int PreEarlyInitialization() override;
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index 73c416d..940e72e 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc
@@ -452,9 +452,9 @@ // ChromeBrowserMainPartsWin --------------------------------------------------- ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin( - const content::MainFunctionParams& parameters) - : ChromeBrowserMainParts(parameters) { -} + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack) + : ChromeBrowserMainParts(parameters, std::move(data_pack)) {} ChromeBrowserMainPartsWin::~ChromeBrowserMainPartsWin() { }
diff --git a/chrome/browser/chrome_browser_main_win.h b/chrome/browser/chrome_browser_main_win.h index 2e8ac43..4dc9464d 100644 --- a/chrome/browser/chrome_browser_main_win.h +++ b/chrome/browser/chrome_browser_main_win.h
@@ -27,7 +27,8 @@ class ChromeBrowserMainPartsWin : public ChromeBrowserMainParts { public: explicit ChromeBrowserMainPartsWin( - const content::MainFunctionParams& parameters); + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack); ~ChromeBrowserMainPartsWin() override;
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index c39022a..8e41b4c 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -316,6 +316,7 @@ #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" #include "chrome/browser/chrome_browser_main_android.h" #include "chrome/common/descriptors_android.h" +#include "chrome/services/media_gallery_util/public/mojom/constants.mojom.h" #include "components/crash/content/browser/crash_dump_observer_android.h" #include "components/navigation_interception/intercept_navigation_delegate.h" #include "content/public/browser/android/java_interfaces.h" @@ -937,7 +938,8 @@ } // namespace -ChromeContentBrowserClient::ChromeContentBrowserClient() +ChromeContentBrowserClient::ChromeContentBrowserClient( + std::unique_ptr<ui::DataPack> data_pack) : weak_factory_(this) { #if BUILDFLAG(ENABLE_PLUGINS) for (size_t i = 0; i < arraysize(kPredefinedAllowedDevChannelOrigins); ++i) @@ -966,6 +968,8 @@ gpu_binder_registry_.AddInterface( base::Bind(&metrics::CallStackProfileCollector::Create, metrics::CallStackProfileParams::GPU_PROCESS)); + + service_manifest_data_pack_ = std::move(data_pack); } ChromeContentBrowserClient::~ChromeContentBrowserClient() { @@ -1025,20 +1029,27 @@ ChromeBrowserMainParts* main_parts; // Construct the Main browser parts based on the OS type. #if defined(OS_WIN) - main_parts = new ChromeBrowserMainPartsWin(parameters); + main_parts = new ChromeBrowserMainPartsWin( + parameters, std::move(service_manifest_data_pack_)); #elif defined(OS_MACOSX) - main_parts = new ChromeBrowserMainPartsMac(parameters); + main_parts = new ChromeBrowserMainPartsMac( + parameters, std::move(service_manifest_data_pack_)); #elif defined(OS_CHROMEOS) - main_parts = new chromeos::ChromeBrowserMainPartsChromeos(parameters); + main_parts = new chromeos::ChromeBrowserMainPartsChromeos( + parameters, std::move(service_manifest_data_pack_)); #elif defined(OS_LINUX) - main_parts = new ChromeBrowserMainPartsLinux(parameters); + main_parts = new ChromeBrowserMainPartsLinux( + parameters, std::move(service_manifest_data_pack_)); #elif defined(OS_ANDROID) - main_parts = new ChromeBrowserMainPartsAndroid(parameters); + main_parts = new ChromeBrowserMainPartsAndroid( + parameters, std::move(service_manifest_data_pack_)); #elif defined(OS_POSIX) - main_parts = new ChromeBrowserMainPartsPosix(parameters); + main_parts = new ChromeBrowserMainPartsPosix( + parameters, std::move(service_manifest_data_pack_)); #else NOTREACHED(); - main_parts = new ChromeBrowserMainParts(parameters); + main_parts = new ChromeBrowserMainParts( + parameters, std::move(service_manifest_data_pack_)); #endif chrome::AddProfilesExtraParts(main_parts); @@ -3370,9 +3381,12 @@ (*services)[heap_profiling::mojom::kServiceName] = base::ASCIIToUTF16("Profiling Service"); -#if BUILDFLAG(ENABLE_EXTENSIONS) +#if BUILDFLAG(ENABLE_EXTENSIONS) || defined(OS_ANDROID) (*services)[chrome::mojom::kMediaGalleryUtilServiceName] = l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_MEDIA_GALLERY_UTILITY_NAME); +#endif + +#if BUILDFLAG(ENABLE_EXTENSIONS) (*services)[chrome::mojom::kRemovableStorageWriterServiceName] = l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_IMAGE_WRITER_NAME); #endif
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index edb3833..93fd3f2 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -26,6 +26,7 @@ #include "ppapi/buildflags/buildflags.h" #include "services/network/public/mojom/network_service.mojom.h" #include "services/service_manager/public/cpp/binder_registry.h" +#include "ui/base/resource/data_pack.h" class ChromeContentBrowserClientParts; class PrefRegistrySimple; @@ -64,7 +65,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { public: - ChromeContentBrowserClient(); + explicit ChromeContentBrowserClient( + std::unique_ptr<ui::DataPack> data_pack = nullptr); ~ChromeContentBrowserClient() override; // TODO(https://crbug.com/787567): This file is about calls from content/ out @@ -515,6 +517,8 @@ const url::Origin&>> worker_interfaces_parameterized_; + std::unique_ptr<ui::DataPack> service_manifest_data_pack_; + base::WeakPtrFactory<ChromeContentBrowserClient> weak_factory_; DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClient);
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index bca7c56..7e848eb 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -162,7 +162,6 @@ "//mash/public/mojom", "//media", "//media/mojo/interfaces", - "//mojo/common", "//net", "//ppapi/proxy:ipc", # For PpapiMsg_LoadPlugin "//services/data_decoder/public/cpp",
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index ca6047a8..0bc0f44e 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -600,8 +600,9 @@ // ChromeBrowserMainPartsChromeos ---------------------------------------------- ChromeBrowserMainPartsChromeos::ChromeBrowserMainPartsChromeos( - const content::MainFunctionParams& parameters) - : ChromeBrowserMainPartsLinux(parameters) {} + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack) + : ChromeBrowserMainPartsLinux(parameters, std::move(data_pack)) {} ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { // To be precise, logout (browser shutdown) is not yet done, but the
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.h b/chrome/browser/chromeos/chrome_browser_main_chromeos.h index 1fc598c..cbf8b08 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.h +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.h
@@ -69,7 +69,8 @@ class ChromeBrowserMainPartsChromeos : public ChromeBrowserMainPartsLinux { public: explicit ChromeBrowserMainPartsChromeos( - const content::MainFunctionParams& parameters); + const content::MainFunctionParams& parameters, + std::unique_ptr<ui::DataPack> data_pack); ~ChromeBrowserMainPartsChromeos() override; // ChromeBrowserMainParts overrides.
diff --git a/chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api.cc b/chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api.cc index 88280311..c737767 100644 --- a/chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api.cc +++ b/chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api.cc
@@ -80,7 +80,7 @@ void ComputeActiveModes(Profile* profile, ActiveModeCallback result) { user_manager::User* user = chromeos::ProfileHelper::Get()->GetUserByProfile(profile); - chromeos::quick_unlock::PinBackend::IsSet( + chromeos::quick_unlock::PinBackend::GetInstance()->IsSet( user->GetAccountId(), base::BindOnce( [](ActiveModeCallback result, bool is_set) { @@ -521,13 +521,13 @@ user_manager::User* user = chromeos::ProfileHelper::Get()->GetUserByProfile(profile); if (pin_credential.empty()) { - chromeos::quick_unlock::PinBackend::Remove( + chromeos::quick_unlock::PinBackend::GetInstance()->Remove( user->GetAccountId(), params_->token, base::BindOnce( &QuickUnlockPrivateSetModesFunction::PinBackendCallComplete, this)); } else { - chromeos::quick_unlock::PinBackend::Set( + chromeos::quick_unlock::PinBackend::GetInstance()->Set( user->GetAccountId(), params_->token, pin_credential, base::BindOnce( &QuickUnlockPrivateSetModesFunction::PinBackendCallComplete,
diff --git a/chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api_unittest.cc b/chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api_unittest.cc index 8aa5254..472e795c 100644 --- a/chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api_unittest.cc +++ b/chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api_unittest.cc
@@ -113,7 +113,7 @@ void SetUp() override { ExtensionApiUnittest::SetUp(); - quick_unlock::EnableForTesting(quick_unlock::PinStorageType::kPrefs); + quick_unlock::EnableForTesting(); run_loop_ = std::make_unique<base::RunLoop>(); @@ -390,7 +390,7 @@ bool called = false; bool is_set = false; - quick_unlock::PinBackend::IsSet( + quick_unlock::PinBackend::GetInstance()->IsSet( account_id, base::BindOnce( [](bool* out_called, bool* out_is_set, bool is_set) { *out_called = true; @@ -407,7 +407,7 @@ const AccountId account_id = AccountId::FromUserEmail(kTestUserEmail); bool called = false; bool success = false; - quick_unlock::PinBackend::TryAuthenticate( + quick_unlock::PinBackend::GetInstance()->TryAuthenticate( account_id, password, Key::KEY_TYPE_PASSWORD_PLAIN, base::BindOnce( [](bool* out_called, bool* out_success, bool success) {
diff --git a/chrome/browser/chromeos/login/lock/screen_locker.cc b/chrome/browser/chromeos/login/lock/screen_locker.cc index a3190a19..813e842d 100644 --- a/chrome/browser/chromeos/login/lock/screen_locker.cc +++ b/chrome/browser/chromeos/login/lock/screen_locker.cc
@@ -378,7 +378,7 @@ Key::KeyType key_type = user_context.GetKey()->GetKeyType(); if (unlock_attempt_type_ == AUTH_PIN) { - quick_unlock::PinBackend::TryAuthenticate( + quick_unlock::PinBackend::GetInstance()->TryAuthenticate( user_context.GetAccountId(), pin, key_type, base::BindOnce(&ScreenLocker::OnPinAttemptDone, weak_factory_.GetWeakPtr(), user_context));
diff --git a/chrome/browser/chromeos/login/quick_unlock/fingerprint_storage_unittest.cc b/chrome/browser/chromeos/login/quick_unlock/fingerprint_storage_unittest.cc index 0f8a823..d7d08ab3 100644 --- a/chrome/browser/chromeos/login/quick_unlock/fingerprint_storage_unittest.cc +++ b/chrome/browser/chromeos/login/quick_unlock/fingerprint_storage_unittest.cc
@@ -23,9 +23,7 @@ ~FingerprintStorageUnitTest() override {} // testing::Test: - void SetUp() override { - quick_unlock::EnableForTesting(quick_unlock::PinStorageType::kPrefs); - } + void SetUp() override { quick_unlock::EnableForTesting(); } void SetRecords(int records_number) { profile_->GetPrefs()->SetInteger(prefs::kQuickUnlockFingerprintRecord,
diff --git a/chrome/browser/chromeos/login/quick_unlock/pin_backend.cc b/chrome/browser/chromeos/login/quick_unlock/pin_backend.cc index f591d74..6caef45 100644 --- a/chrome/browser/chromeos/login/quick_unlock/pin_backend.cc +++ b/chrome/browser/chromeos/login/quick_unlock/pin_backend.cc
@@ -11,17 +11,13 @@ #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h" #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h" #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" +#include "components/signin/core/account_id/account_id.h" namespace chromeos { namespace quick_unlock { namespace { -PinStorageCryptohome* GetCryptohomeStorage() { - static base::NoDestructor<PinStorageCryptohome> instance; - return instance.get(); -} - QuickUnlockStorage* GetPrefsBackend(const AccountId& account_id) { return QuickUnlockFactory::GetForAccountId(account_id); } @@ -34,9 +30,36 @@ } // namespace // static +PinBackend* PinBackend::GetInstance() { + static base::NoDestructor<PinBackend> instance; + return instance.get(); +} + +// static +void PinBackend::ResetForTesting() { + new (GetInstance()) PinStorageCryptohome(); +} + +PinBackend::PinBackend() { + // Always use prefs backend. + // TODO(jdufault): Add support for cryptohome backend. + resolving_backend_ = false; +} + +PinBackend::~PinBackend() { + DCHECK(on_cryptohome_support_received_.empty()); +} + void PinBackend::IsSet(const AccountId& account_id, BoolCallback result) { - if (GetPinStorageType() == PinStorageType::kCryptohome) { - GetCryptohomeStorage()->IsPinSetInCryptohome(account_id, std::move(result)); + if (resolving_backend_) { + on_cryptohome_support_received_.push_back( + base::BindOnce(&PinBackend::IsSet, base::Unretained(this), account_id, + std::move(result))); + return; + } + + if (cryptohome_backend_) { + cryptohome_backend_->IsPinSetInCryptohome(account_id, std::move(result)); } else { QuickUnlockStorage* storage = GetPrefsBackend(account_id); PostResponse(std::move(result), @@ -44,15 +67,21 @@ } } -// static void PinBackend::Set(const AccountId& account_id, const std::string& token, const std::string& pin, BoolCallback did_set) { + if (resolving_backend_) { + on_cryptohome_support_received_.push_back( + base::BindOnce(&PinBackend::Set, base::Unretained(this), account_id, + token, pin, std::move(did_set))); + return; + } + QuickUnlockStorage* storage = GetPrefsBackend(account_id); DCHECK(storage); - if (GetPinStorageType() == PinStorageType::kCryptohome) { + if (cryptohome_backend_) { // If |user_context| is null, then the token timed out. UserContext* user_context = storage->GetUserContext(token); if (!user_context) { @@ -62,7 +91,7 @@ // There may be a pref value if resetting PIN and the device now supports // cryptohome-based PIN. storage->pin_storage_prefs()->RemovePin(); - GetCryptohomeStorage()->SetPin(*user_context, pin, std::move(did_set)); + cryptohome_backend_->SetPin(*user_context, pin, std::move(did_set)); } else { storage->pin_storage_prefs()->SetPin(pin); storage->MarkStrongAuth(); @@ -70,21 +99,27 @@ } } -// static void PinBackend::Remove(const AccountId& account_id, const std::string& token, BoolCallback did_remove) { + if (resolving_backend_) { + on_cryptohome_support_received_.push_back( + base::BindOnce(&PinBackend::Remove, base::Unretained(this), account_id, + token, std::move(did_remove))); + return; + } + QuickUnlockStorage* storage = GetPrefsBackend(account_id); DCHECK(storage); - if (GetPinStorageType() == PinStorageType::kCryptohome) { + if (cryptohome_backend_) { // If |user_context| is null, then the token timed out. UserContext* user_context = storage->GetUserContext(token); if (!user_context) { PostResponse(std::move(did_remove), false); return; } - GetCryptohomeStorage()->RemovePin(*user_context, std::move(did_remove)); + cryptohome_backend_->RemovePin(*user_context, std::move(did_remove)); } else { const bool had_pin = storage->pin_storage_prefs()->IsPinSet(); storage->pin_storage_prefs()->RemovePin(); @@ -92,11 +127,17 @@ } } -// static void PinBackend::CanAuthenticate(const AccountId& account_id, BoolCallback result) { - if (GetPinStorageType() == PinStorageType::kCryptohome) { - GetCryptohomeStorage()->IsPinSetInCryptohome(account_id, std::move(result)); + if (resolving_backend_) { + on_cryptohome_support_received_.push_back( + base::BindOnce(&PinBackend::CanAuthenticate, base::Unretained(this), + account_id, std::move(result))); + return; + } + + if (cryptohome_backend_) { + cryptohome_backend_->IsPinSetInCryptohome(account_id, std::move(result)); } else { QuickUnlockStorage* storage = GetPrefsBackend(account_id); PostResponse( @@ -106,14 +147,20 @@ } } -// static void PinBackend::TryAuthenticate(const AccountId& account_id, const std::string& key, const Key::KeyType& key_type, BoolCallback result) { - if (GetPinStorageType() == PinStorageType::kCryptohome) { - GetCryptohomeStorage()->TryAuthenticate(account_id, key, key_type, - std::move(result)); + if (resolving_backend_) { + on_cryptohome_support_received_.push_back( + base::BindOnce(&PinBackend::TryAuthenticate, base::Unretained(this), + account_id, key, key_type, std::move(result))); + return; + } + + if (cryptohome_backend_) { + cryptohome_backend_->TryAuthenticate(account_id, key, key_type, + std::move(result)); } else { QuickUnlockStorage* storage = GetPrefsBackend(account_id); DCHECK(storage); @@ -128,7 +175,6 @@ } } -// static std::string PinBackend::ComputeSecret(const std::string& pin, const std::string& salt, Key::KeyType key_type) { @@ -142,10 +188,5 @@ return key.GetSecret(); } -// static -void PinBackend::ResetForTesting() { - new (GetCryptohomeStorage()) PinStorageCryptohome(); -} - } // namespace quick_unlock } // namespace chromeos
diff --git a/chrome/browser/chromeos/login/quick_unlock/pin_backend.h b/chrome/browser/chromeos/login/quick_unlock/pin_backend.h index 418d621..4de6be96 100644 --- a/chrome/browser/chromeos/login/quick_unlock/pin_backend.h +++ b/chrome/browser/chromeos/login/quick_unlock/pin_backend.h
@@ -16,46 +16,67 @@ namespace quick_unlock { +class PinStorageCryptohome; + // Provides high-level access to the user's PIN. The underlying storage can be // either cryptohome or prefs. class PinBackend { public: using BoolCallback = base::OnceCallback<void(bool)>; + // Fetch the PinBackend instance. + static PinBackend* GetInstance(); + + // Use GetInstance(). + PinBackend(); + ~PinBackend(); + // Check if the given account_id has a PIN registered. - static void IsSet(const AccountId& account_id, BoolCallback result); + void IsSet(const AccountId& account_id, BoolCallback result); // Set the PIN for the given user. - static void Set(const AccountId& account_id, - const std::string& auth_token, - const std::string& pin, - BoolCallback did_set); + void Set(const AccountId& account_id, + const std::string& auth_token, + const std::string& pin, + BoolCallback did_set); // Remove the given user's PIN. - static void Remove(const AccountId& account_id, - const std::string& auth_token, - BoolCallback did_remove); + void Remove(const AccountId& account_id, + const std::string& auth_token, + BoolCallback did_remove); // Is PIN authentication available for the given account? Even if PIN is set, // it may not be available for authentication due to some additional // restrictions. - static void CanAuthenticate(const AccountId& account_id, BoolCallback result); + void CanAuthenticate(const AccountId& account_id, BoolCallback result); // Try to authenticate. - static void TryAuthenticate(const AccountId& account_id, - const std::string& key, - const Key::KeyType& key_type, - BoolCallback result); + void TryAuthenticate(const AccountId& account_id, + const std::string& key, + const Key::KeyType& key_type, + BoolCallback result); // Computes the secret for a given |pin| and |salt|. - static std::string ComputeSecret(const std::string& pin, - const std::string& salt, - Key::KeyType key_type); + std::string ComputeSecret(const std::string& pin, + const std::string& salt, + Key::KeyType key_type); // Resets any cached state for testing purposes. static void ResetForTesting(); private: + // True if still trying to determine which backend should be used. + bool resolving_backend_ = true; + // Determining if the device supports cryptohome-based keys requires an async + // dbus call to cryptohome. If we receive a request before we know which + // backend to use, the request will be pushed to this list and invoked once + // the backend configuration is determined. + std::vector<base::OnceClosure> on_cryptohome_support_received_; + + // Non-null if we should use the cryptohome backend. If null, the prefs + // backend should be used. + std::unique_ptr<PinStorageCryptohome> cryptohome_backend_; + DISALLOW_COPY_AND_ASSIGN(PinBackend); };
diff --git a/chrome/browser/chromeos/login/quick_unlock/pin_storage_prefs_unittest.cc b/chrome/browser/chromeos/login/quick_unlock/pin_storage_prefs_unittest.cc index ce568e1a..9e11e1b61 100644 --- a/chrome/browser/chromeos/login/quick_unlock/pin_storage_prefs_unittest.cc +++ b/chrome/browser/chromeos/login/quick_unlock/pin_storage_prefs_unittest.cc
@@ -22,9 +22,7 @@ ~PinStoragePrefsUnitTest() override = default; // testing::Test: - void SetUp() override { - quick_unlock::EnableForTesting(quick_unlock::PinStorageType::kPrefs); - } + void SetUp() override { quick_unlock::EnableForTesting(); } quick_unlock::PinStoragePrefs* PinStoragePrefs() const { return quick_unlock::QuickUnlockFactory::GetForProfile(profile_.get())
diff --git a/chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage_unittest.cc b/chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage_unittest.cc index 6a31b32..31fafb0 100644 --- a/chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage_unittest.cc +++ b/chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage_unittest.cc
@@ -43,9 +43,7 @@ ~QuickUnlockStorageUnitTest() override {} // testing::Test: - void SetUp() override { - quick_unlock::EnableForTesting(quick_unlock::PinStorageType::kPrefs); - } + void SetUp() override { quick_unlock::EnableForTesting(); } void ExpireAuthToken() { quick_unlock::QuickUnlockFactory::GetForProfile(profile_.get())
diff --git a/chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.cc b/chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.cc index e033bb52..27e8ae4 100644 --- a/chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.cc +++ b/chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.cc
@@ -21,9 +21,6 @@ // Quick unlock is enabled regardless of flags. bool enable_for_testing_ = false; bool disable_pin_by_policy_for_testing_ = false; -// If testing is enabled, PIN will use prefs as backend. Otherwise, it will use -// cryptohome. -PinStorageType testing_pin_storage_type_ = PinStorageType::kPrefs; // Options for the quick unlock whitelist. const char kQuickUnlockWhitelistOptionAll[] = "all"; @@ -102,17 +99,6 @@ return base::FeatureList::IsEnabled(features::kQuickUnlockPin); } -// TODO(jdufault): Remove PinStorageType and make the backend transparent to -// callers. -PinStorageType GetPinStorageType() { - if (enable_for_testing_) - return testing_pin_storage_type_; - - if (base::FeatureList::IsEnabled(features::kQuickUnlockPinSignin)) - return PinStorageType::kCryptohome; - return PinStorageType::kPrefs; -} - bool IsFingerprintEnabled() { if (enable_for_testing_) return true; @@ -121,9 +107,8 @@ return base::FeatureList::IsEnabled(features::kQuickUnlockFingerprint); } -void EnableForTesting(PinStorageType pin_storage_type) { +void EnableForTesting() { enable_for_testing_ = true; - testing_pin_storage_type_ = pin_storage_type; } void DisablePinByPolicyForTesting(bool disable) {
diff --git a/chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h b/chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h index a86d83c..bfe3d8c 100644 --- a/chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h +++ b/chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h
@@ -38,18 +38,11 @@ // Returns true if the quick unlock feature flag is present. bool IsPinEnabled(PrefService* pref_service); -// What subsystem should provide pin storage and authentication? -enum class PinStorageType { kPrefs, kCryptohome }; - -// Returns the pin storage type that should be used. IsPinEnabled() must -// return true for this result to be valid. -PinStorageType GetPinStorageType(); - // Returns true if the fingerprint unlock feature flag is present. bool IsFingerprintEnabled(); // Forcibly enable all quick-unlock modes for testing. -void EnableForTesting(PinStorageType pin_storage_type); +void EnableForTesting(); // Forcibly disable PIN for testing purposes. void DisablePinByPolicyForTesting(bool disable);
diff --git a/chrome/browser/chromeos/login/screens/user_selection_screen.cc b/chrome/browser/chromeos/login/screens/user_selection_screen.cc index 4a9c72fe..ffce758 100644 --- a/chrome/browser/chromeos/login/screens/user_selection_screen.cc +++ b/chrome/browser/chromeos/login/screens/user_selection_screen.cc
@@ -31,6 +31,7 @@ #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" +#include "chrome/browser/ui/ash/login_screen_client.h" #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chrome/grit/generated_resources.h" @@ -864,6 +865,13 @@ public_session_recommended_locales, login_user_info.get()); login_user_info->can_remove = CanRemoveUser(*it); + + // Send a request to get keyboard layouts for default locale. + if (is_public_account && LoginScreenClient::HasInstance()) { + LoginScreenClient::Get()->RequestPublicSessionKeyboardLayouts( + account_id, login_user_info->public_account_info->default_locale); + } + user_info_list.push_back(std::move(login_user_info)); }
diff --git a/chrome/browser/chromeos/login/screens/user_selection_screen.h b/chrome/browser/chromeos/login/screens/user_selection_screen.h index 6b45a27..4721ef1f 100644 --- a/chrome/browser/chromeos/login/screens/user_selection_screen.h +++ b/chrome/browser/chromeos/login/screens/user_selection_screen.h
@@ -120,9 +120,6 @@ const user_manager::User* user); // Fills |user_info| with information about |user|. - // TODO: Public sesssions exist in login screen, but not lock screen. - // We will need public session locales in the future when we change login - // screen to view-based as well. See crbug.com/732452. static void FillUserMojoStruct( const user_manager::User* user, bool is_owner,
diff --git a/chrome/browser/chromeos/login/user_board_view_mojo.cc b/chrome/browser/chromeos/login/user_board_view_mojo.cc index 83f636a..dadb141 100644 --- a/chrome/browser/chromeos/login/user_board_view_mojo.cc +++ b/chrome/browser/chromeos/login/user_board_view_mojo.cc
@@ -83,6 +83,10 @@ LoginScreenClient::Get()->login_screen()->SetPublicSessionLocales( account_id, std::move(*locales), default_locale, multiple_recommended_locales); + + // Send a request to get keyboard layouts for |default_locale|. + LoginScreenClient::Get()->RequestPublicSessionKeyboardLayouts(account_id, + default_locale); } void UserBoardViewMojo::ShowUserPodCustomIcon(
diff --git a/chrome/browser/chromeos/ui/request_pin_view.cc b/chrome/browser/chromeos/ui/request_pin_view.cc index d905ac1..19762ff 100644 --- a/chrome/browser/chromeos/ui/request_pin_view.cc +++ b/chrome/browser/chromeos/ui/request_pin_view.cc
@@ -24,6 +24,16 @@ namespace chromeos { +namespace { + +// Default width of the dialog. +constexpr int kDefaultWidth = 448; + +// Default width of the text field. +constexpr int kDefaultTextWidth = 200; + +} // namespace + RequestPinView::RequestPinView(const std::string& extension_name, RequestPinView::RequestPinCodeType code_type, int attempts_left, @@ -116,6 +126,12 @@ return true; } +gfx::Size RequestPinView::CalculatePreferredSize() const { + return gfx::Size( + kDefaultWidth, + GetLayoutManager()->GetPreferredHeightForWidth(this, kDefaultWidth)); +} + bool RequestPinView::IsLocked() { return callback_.is_null(); } @@ -197,7 +213,8 @@ textfield_->set_controller(this); textfield_->SetEnabled(true); textfield_->SetAssociatedLabel(header_label_); - layout->AddView(textfield_); + layout->AddView(textfield_, 1, 1, views::GridLayout::LEADING, + views::GridLayout::FILL, kDefaultTextWidth, 0); layout->AddPaddingRow(0, related_vertical_spacing); @@ -248,12 +265,15 @@ case RequestPinErrorType::NONE: if (attempts_left < 0) { error_label_->SetVisible(false); + textfield_->SetInvalid(false); return; } break; } if (attempts_left >= 0) { + if (!error_message.empty()) + error_message.append(base::ASCIIToUTF16(" ")); error_message.append(l10n_util::GetStringFUTF16( IDS_REQUEST_PIN_DIALOG_ATTEMPTS_LEFT, base::ASCIIToUTF16(std::to_string(attempts_left)))); @@ -264,6 +284,7 @@ error_label_->SetTooltipText(error_message); error_label_->SetEnabledColor(SK_ColorRED); error_label_->SizeToPreferredSize(); + textfield_->SetInvalid(true); } } // namespace chromeos
diff --git a/chrome/browser/chromeos/ui/request_pin_view.h b/chrome/browser/chromeos/ui/request_pin_view.h index 2884a75f..5a86c12e 100644 --- a/chrome/browser/chromeos/ui/request_pin_view.h +++ b/chrome/browser/chromeos/ui/request_pin_view.h
@@ -82,6 +82,9 @@ views::View* GetInitiallyFocusedView() override; bool IsDialogButtonEnabled(ui::DialogButton button) const override; + // views::View + gfx::Size CalculatePreferredSize() const override; + // Returns whether the view is locked while waiting the extension to process // the user input data. bool IsLocked();
diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc index 4f2b9681..8140cbd 100644 --- a/chrome/browser/devtools/devtools_window.cc +++ b/chrome/browser/devtools/devtools_window.cc
@@ -1138,12 +1138,16 @@ } void DevToolsWindow::AddNewContents(WebContents* source, - WebContents* new_contents, + std::unique_ptr<WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture, bool* was_blocked) { - if (new_contents == toolbox_web_contents_) { + if (new_contents.get() == toolbox_web_contents_) { + // TODO(erikchen): Fix ownership semantics for WebContents. + // https://crbug.com/832879. + new_contents.release(); + toolbox_web_contents_->SetDelegate( new DevToolsToolboxDelegate(toolbox_web_contents_, inspected_contents_observer_.get())); @@ -1160,8 +1164,8 @@ WebContents* inspected_web_contents = GetInspectedWebContents(); if (inspected_web_contents) { inspected_web_contents->GetDelegate()->AddNewContents( - source, new_contents, disposition, initial_rect, user_gesture, - was_blocked); + source, std::move(new_contents), disposition, initial_rect, + user_gesture, was_blocked); } }
diff --git a/chrome/browser/devtools/devtools_window.h b/chrome/browser/devtools/devtools_window.h index c8cb1bed..ad48848 100644 --- a/chrome/browser/devtools/devtools_window.h +++ b/chrome/browser/devtools/devtools_window.h
@@ -293,7 +293,7 @@ // content::WebContentsDelegate: void ActivateContents(content::WebContents* contents) override; void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/chrome/browser/extensions/content_script_apitest.cc b/chrome/browser/extensions/content_script_apitest.cc index a5756ca7..7af0f6e 100644 --- a/chrome/browser/extensions/content_script_apitest.cc +++ b/chrome/browser/extensions/content_script_apitest.cc
@@ -766,4 +766,36 @@ EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); } +// Tests that extension content scripts can execute (including asynchronously +// through timeouts) in pages with Content-Security-Policy: sandbox. +// See https://crbug.com/811528. +IN_PROC_BROWSER_TEST_F(ContentScriptApiTest, ExecuteScriptBypassingSandbox) { + ASSERT_TRUE(StartEmbeddedTestServer()); + + TestExtensionDir test_dir; + test_dir.WriteManifest( + R"({ + "name": "Bypass Sandbox CSP", + "description": "Extensions should bypass a page's CSP sandbox.", + "version": "0.1", + "manifest_version": 2, + "content_scripts": [{ + "matches": ["*://example.com:*/*"], + "js": ["script.js"] + }] + })"); + test_dir.WriteFile( + FILE_PATH_LITERAL("script.js"), + R"(window.setTimeout(() => { chrome.test.notifyPass(); }, 10);)"); + + ResultCatcher catcher; + const Extension* extension = LoadExtension(test_dir.UnpackedPath()); + ASSERT_TRUE(extension); + + GURL url = embedded_test_server()->GetURL( + "example.com", "/extensions/page_with_sandbox_csp.html"); + ui_test_utils::NavigateToURL(browser(), url); + ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); +} + } // namespace extensions
diff --git a/chrome/browser/media/encrypted_media_browsertest.cc b/chrome/browser/media/encrypted_media_browsertest.cc index 7b97a96..a9acadd 100644 --- a/chrome/browser/media/encrypted_media_browsertest.cc +++ b/chrome/browser/media/encrypted_media_browsertest.cc
@@ -78,15 +78,15 @@ // Supported media types. const char kWebMVorbisAudioOnly[] = "audio/webm; codecs=\"vorbis\""; -const char kWebMVorbisAudioVP8Video[] = "video/webm; codecs=\"vorbis, vp8\""; -const char kWebMOpusAudioVP9Video[] = "video/webm; codecs=\"opus, vp9\""; -const char kWebMVP9VideoOnly[] = "video/webm; codecs=\"vp9\""; +const char kWebMVorbisAudioVp8Video[] = "video/webm; codecs=\"vorbis, vp8\""; +const char kWebMOpusAudioVp9Video[] = "video/webm; codecs=\"opus, vp9\""; +const char kWebMVp9VideoOnly[] = "video/webm; codecs=\"vp9\""; #if BUILDFLAG(ENABLE_LIBRARY_CDMS) -const char kWebMVP8VideoOnly[] = "video/webm; codecs=\"vp8\""; +const char kWebMVp8VideoOnly[] = "video/webm; codecs=\"vp8\""; #endif #if BUILDFLAG(USE_PROPRIETARY_CODECS) -const char kMP4VideoOnly[] = "video/mp4; codecs=\"avc1.64001E\""; -const char kMP4VideoVp9Only[] = +const char kMp4Avc1VideoOnly[] = "video/mp4; codecs=\"avc1.64001E\""; +const char kMp4Vp9VideoOnly[] = "video/mp4; codecs=\"vp09.00.10.08.01.02.02.02.00\""; #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) @@ -340,18 +340,19 @@ const std::string& session_to_load, const std::string& expected_title) { RunEncryptedMediaTest(kDefaultEmePlayer, "bear-320x240-v_enc-v.webm", - kWebMVP8VideoOnly, key_system, SrcType::MSE, + kWebMVp8VideoOnly, key_system, SrcType::MSE, session_to_load, false, PlayCount::ONCE, expected_title); } #if BUILDFLAG(USE_PROPRIETARY_CODECS) - void TestMP4EncryptionPlayback(const std::string& key_system, + void TestMp4EncryptionPlayback(const std::string& key_system, const std::string& media_file, + const std::string& media_type, const std::string& expected_title) { // MP4 playback is only supported with MSE. - RunEncryptedMediaTest(kDefaultEmePlayer, media_file, kMP4VideoOnly, - key_system, SrcType::MSE, kNoSessionToLoad, false, + RunEncryptedMediaTest(kDefaultEmePlayer, media_file, media_type, key_system, + SrcType::MSE, kNoSessionToLoad, false, PlayCount::ONCE, expected_title); } #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) @@ -403,7 +404,7 @@ void RunInvalidResponseTest() { RunEncryptedMediaTest(kDefaultEmePlayer, "bear-320x240-av_enc-av.webm", - kWebMVorbisAudioVP8Video, CurrentKeySystem(), + kWebMVorbisAudioVp8Video, CurrentKeySystem(), CurrentSourceType(), kNoSessionToLoad, true, PlayCount::ONCE, kEmeUpdateFailed); } @@ -411,7 +412,7 @@ void TestFrameSizeChange() { RunEncryptedMediaTest( "encrypted_frame_size_change.html", "frame_size_change-av_enc-v.webm", - kWebMVorbisAudioVP8Video, CurrentKeySystem(), CurrentSourceType(), + kWebMVorbisAudioVp8Video, CurrentKeySystem(), CurrentSourceType(), kNoSessionToLoad, false, PlayCount::ONCE, media::kEnded); } @@ -467,6 +468,19 @@ void TestDifferentContainers(EncryptedContainer video_format, EncryptedContainer audio_format) { + // MP4 without MSE is not support yet, http://crbug.com/170793. + if ((video_format == EncryptedContainer::ENCRYPTED_MP4 || + audio_format == EncryptedContainer::ENCRYPTED_MP4) && + CurrentSourceType() != SrcType::MSE) { + DVLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE."; + return; + } + + if (!IsPlayBackPossible(CurrentKeySystem())) { + DVLOG(0) << "Skipping test - Test requires video playback."; + return; + } + base::StringPairs query_params; query_params.emplace_back("keySystem", CurrentKeySystem()); query_params.emplace_back("runEncrypted", "1"); @@ -528,34 +542,34 @@ #endif // defined(WIDEVINE_CDM_AVAILABLE) IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) { - TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMVorbisAudioVP8Video); + TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMVorbisAudioVp8Video); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoAudio_WebM) { - TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMVorbisAudioVP8Video); + TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMVorbisAudioVp8Video); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM) { - TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMVorbisAudioVP8Video); + TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMVorbisAudioVp8Video); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VP9Video_WebM_Fullsample) { TestSimplePlayback("bear-320x240-v-vp9_fullsample_enc-v.webm", - kWebMVP9VideoOnly); + kWebMVp9VideoOnly); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VP9Video_WebM_Subsample) { TestSimplePlayback("bear-320x240-v-vp9_subsample_enc-v.webm", - kWebMVP9VideoOnly); + kWebMVp9VideoOnly); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoAudio_WebM_Opus) { TestSimplePlayback("bear-320x240-opus-av_enc-av.webm", - kWebMOpusAudioVP9Video); + kWebMOpusAudioVp9Video); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM_Opus) { - TestSimplePlayback("bear-320x240-opus-av_enc-v.webm", kWebMOpusAudioVP9Video); + TestSimplePlayback("bear-320x240-opus-av_enc-v.webm", kWebMOpusAudioVp9Video); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_Multiple_VideoAudio_WebM) { @@ -563,7 +577,7 @@ DVLOG(0) << "Skipping test - Playback_Multiple test requires playback."; return; } - TestMultiplePlayback("bear-320x240-av_enc-av.webm", kWebMVorbisAudioVP8Video); + TestMultiplePlayback("bear-320x240-av_enc-av.webm", kWebMVorbisAudioVp8Video); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, InvalidResponseKeyError) { @@ -622,7 +636,7 @@ DVLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE."; return; } - TestSimplePlayback("bear-640x360-v_frag-cenc.mp4", kMP4VideoOnly); + TestSimplePlayback("bear-640x360-v_frag-cenc.mp4", kMp4Avc1VideoOnly); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_MDAT) { @@ -631,7 +645,7 @@ DVLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE."; return; } - TestSimplePlayback("bear-640x360-v_frag-cenc-mdat.mp4", kMP4VideoOnly); + TestSimplePlayback("bear-640x360-v_frag-cenc-mdat.mp4", kMp4Avc1VideoOnly); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_VP9) { @@ -640,50 +654,23 @@ DVLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE."; return; } - TestSimplePlayback("bear-320x240-v_frag-vp9-cenc.mp4", kMP4VideoVp9Only); + TestSimplePlayback("bear-320x240-v_frag-vp9-cenc.mp4", kMp4Vp9VideoOnly); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_EncryptedVideo_MP4_ClearAudio_WEBM) { - // MP4 without MSE is not support yet, http://crbug.com/170793. - if (CurrentSourceType() != SrcType::MSE) { - DVLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE."; - return; - } - if (!IsPlayBackPossible(CurrentKeySystem())) { - DVLOG(0) << "Skipping test - Test requires video playback."; - return; - } TestDifferentContainers(EncryptedContainer::ENCRYPTED_MP4, EncryptedContainer::CLEAR_WEBM); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_ClearVideo_WEBM_EncryptedAudio_MP4) { - // MP4 without MSE is not support yet, http://crbug.com/170793. - if (CurrentSourceType() != SrcType::MSE) { - DVLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE."; - return; - } - if (!IsPlayBackPossible(CurrentKeySystem())) { - DVLOG(0) << "Skipping test - Test requires video playback."; - return; - } TestDifferentContainers(EncryptedContainer::CLEAR_WEBM, EncryptedContainer::ENCRYPTED_MP4); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_EncryptedVideo_WEBM_EncryptedAudio_MP4) { - // MP4 without MSE is not support yet, http://crbug.com/170793. - if (CurrentSourceType() != SrcType::MSE) { - DVLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE."; - return; - } - if (!IsPlayBackPossible(CurrentKeySystem())) { - DVLOG(0) << "Skipping test - Test requires video playback."; - return; - } TestDifferentContainers(EncryptedContainer::ENCRYPTED_WEBM, EncryptedContainer::ENCRYPTED_MP4); } @@ -764,7 +751,7 @@ IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, DecryptOnly_VideoAudio_WebM) { RunSimpleEncryptedMediaTest( - "bear-320x240-av_enc-av.webm", kWebMVorbisAudioVP8Video, + "bear-320x240-av_enc-av.webm", kWebMVorbisAudioVp8Video, kExternalClearKeyDecryptOnlyKeySystem, SrcType::MSE); } @@ -772,30 +759,34 @@ IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, DecryptOnly_VideoOnly_MP4_VP9) { RunSimpleEncryptedMediaTest( - "bear-320x240-v_frag-vp9-cenc.mp4", kMP4VideoVp9Only, + "bear-320x240-v_frag-vp9-cenc.mp4", kMp4Vp9VideoOnly, kExternalClearKeyDecryptOnlyKeySystem, SrcType::MSE); } // Encryption Scheme tests. ClearKey key system is covered in // content/browser/media/encrypted_media_browsertest.cc. IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, Playback_Encryption_CENC) { - TestMP4EncryptionPlayback(kExternalClearKeyKeySystem, - "bear-640x360-v_frag-cenc.mp4", media::kEnded); + TestMp4EncryptionPlayback(kExternalClearKeyKeySystem, + "bear-640x360-v_frag-cenc.mp4", kMp4Avc1VideoOnly, + media::kEnded); } IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, Playback_Encryption_CBC1) { - TestMP4EncryptionPlayback(kExternalClearKeyKeySystem, - "bear-640x360-v_frag-cbc1.mp4", media::kError); + TestMp4EncryptionPlayback(kExternalClearKeyKeySystem, + "bear-640x360-v_frag-cbc1.mp4", kMp4Avc1VideoOnly, + media::kError); } IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, Playback_Encryption_CENS) { - TestMP4EncryptionPlayback(kExternalClearKeyKeySystem, - "bear-640x360-v_frag-cens.mp4", media::kError); + TestMp4EncryptionPlayback(kExternalClearKeyKeySystem, + "bear-640x360-v_frag-cens.mp4", kMp4Avc1VideoOnly, + media::kError); } IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, Playback_Encryption_CBCS) { - TestMP4EncryptionPlayback(kExternalClearKeyKeySystem, - "bear-640x360-v_frag-cbcs.mp4", media::kError); + TestMp4EncryptionPlayback(kExternalClearKeyKeySystem, + "bear-640x360-v_frag-cbcs.mp4", kMp4Avc1VideoOnly, + media::kError); } #endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
diff --git a/chrome/browser/metrics/tab_stats_tracker.cc b/chrome/browser/metrics/tab_stats_tracker.cc index c3e1fffb..4b58f23 100644 --- a/chrome/browser/metrics/tab_stats_tracker.cc +++ b/chrome/browser/metrics/tab_stats_tracker.cc
@@ -45,6 +45,11 @@ base::TimeDelta::FromMinutes(10), base::TimeDelta::FromHours(1), base::TimeDelta::FromHours(5), base::TimeDelta::FromHours(12)}; +#if defined(OS_WIN) +const base::TimeDelta kNativeWindowOcclusionCalculationInterval = + base::TimeDelta::FromMinutes(10); +#endif + // The global TabStatsTracker instance. TabStatsTracker* g_tab_stats_tracker_instance = nullptr; @@ -87,6 +92,7 @@ TabStatsTracker::TabStatsTracker(PrefService* pref_service) : reporting_delegate_(std::make_unique<UmaStatsReportingDelegate>()), + delegate_(std::make_unique<TabStatsTrackerDelegate>()), tab_stats_data_store_(std::make_unique<TabStatsDataStore>(pref_service)), daily_event_( std::make_unique<DailyEvent>(pref_service, @@ -130,6 +136,14 @@ interval, interval_map)); usage_interval_timers_.push_back(std::move(timer)); } + +// The native window occlusion calculation is specific to Windows. +#if defined(OS_WIN) + native_window_occlusion_timer_.Start( + FROM_HERE, kNativeWindowOcclusionCalculationInterval, + Bind(&TabStatsTracker::CalculateAndRecordNativeWindowVisibilities, + base::Unretained(this))); +#endif } TabStatsTracker::~TabStatsTracker() { @@ -162,6 +176,11 @@ DailyEvent::RegisterPref(registry, ::prefs::kTabStatsDailySample); } +void TabStatsTracker::SetDelegateForTesting( + std::unique_ptr<TabStatsTrackerDelegate> new_delegate) { + delegate_ = std::move(new_delegate); +} + void TabStatsTracker::TabStatsDailyObserver::OnDailyEvent( DailyEvent::IntervalType type) { reporting_delegate_->ReportDailyMetrics(data_store_->tab_stats());
diff --git a/chrome/browser/metrics/tab_stats_tracker.h b/chrome/browser/metrics/tab_stats_tracker.h index 370b350..e012981 100644 --- a/chrome/browser/metrics/tab_stats_tracker.h +++ b/chrome/browser/metrics/tab_stats_tracker.h
@@ -10,13 +10,16 @@ #include <string> #include <vector> +#include "base/containers/flat_map.h" #include "base/containers/flat_set.h" #include "base/gtest_prod_util.h" #include "base/macros.h" #include "base/power_monitor/power_observer.h" #include "base/sequence_checker.h" #include "base/timer/timer.h" +#include "build/build_config.h" #include "chrome/browser/metrics/tab_stats_data_store.h" +#include "chrome/browser/metrics/tab_stats_tracker_delegate.h" #include "chrome/browser/ui/browser_list_observer.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" #include "components/metrics/daily_event.h" @@ -26,7 +29,6 @@ class PrefService; namespace metrics { - FORWARD_DECLARE_TEST(TabStatsTrackerBrowserTest, TabDeletionGetsHandledProperly); @@ -53,12 +55,19 @@ // Registers prefs used to track tab stats. static void RegisterPrefs(PrefRegistrySimple* registry); + void SetDelegateForTesting( + std::unique_ptr<TabStatsTrackerDelegate> new_delegate); + // Accessors. const TabStatsDataStore::TabsStats& tab_stats() const; protected: FRIEND_TEST_ALL_PREFIXES(TabStatsTrackerBrowserTest, TabDeletionGetsHandledProperly); +#if defined(OS_WIN) + FRIEND_TEST_ALL_PREFIXES(TabStatsTrackerBrowserTest, + TestCalculateAndRecordNativeWindowVisibilities); +#endif // The UmaStatsReportingDelegate is responsible for delivering statistics // reported by the TabStatsTracker via UMA. @@ -146,6 +155,12 @@ // Functions to call when a WebContents get destroyed. void OnWebContentsDestroyed(content::WebContents* web_contents); +#if defined(OS_WIN) + // Function to call aura_extra::ComputeNativeWindowOcclusionStatus() and + // record the Visibility of all Chrome browser windows on Windows. + void CalculateAndRecordNativeWindowVisibilities(); +#endif + // The name of the histogram used to report that the daily event happened. static const char kTabStatsDailyEventHistogramName[]; @@ -157,6 +172,9 @@ // The delegate that reports the events. std::unique_ptr<UmaStatsReportingDelegate> reporting_delegate_; + // Delegate to collect data; + std::unique_ptr<TabStatsTrackerDelegate> delegate_; + // The tab stats. std::unique_ptr<TabStatsDataStore> tab_stats_data_store_; @@ -167,6 +185,12 @@ // triggered. base::RepeatingTimer timer_; +#if defined(OS_WIN) + // The timer used to periodically calculate the occlusion status of native + // windows on Windows. + base::RepeatingTimer native_window_occlusion_timer_; +#endif + // The timers used to analyze how tabs are used during a given interval of // time. std::vector<std::unique_ptr<base::RepeatingTimer>> usage_interval_timers_; @@ -222,6 +246,12 @@ const TabStatsDataStore::TabsStateDuringIntervalMap& interval_map, base::TimeDelta interval); +#if defined(OS_WIN) + void RecordNativeWindowVisibilities(size_t num_occluded, + size_t num_visible, + size_t num_hidden); +#endif + protected: // Generates the name of the histograms that will track tab usage during a // given period of time.
diff --git a/chrome/browser/metrics/tab_stats_tracker_browsertest.cc b/chrome/browser/metrics/tab_stats_tracker_browsertest.cc index 4b08d9f5..9a25e15 100644 --- a/chrome/browser/metrics/tab_stats_tracker_browsertest.cc +++ b/chrome/browser/metrics/tab_stats_tracker_browsertest.cc
@@ -4,8 +4,12 @@ #include "chrome/browser/metrics/tab_stats_tracker.h" +#include "base/containers/flat_map.h" +#include "base/test/histogram_tester.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_window.h" #include "chrome/test/base/in_process_browser_test.h" #include "testing/gtest/include/gtest/gtest.h" @@ -26,6 +30,33 @@ } // namespace +class MockTabStatsTrackerDelegate : public TabStatsTrackerDelegate { + public: + MockTabStatsTrackerDelegate() = default; + ~MockTabStatsTrackerDelegate() override = default; + +#if defined(OS_WIN) + OcclusionStatusMap CallComputeNativeWindowOcclusionStatus( + std::vector<aura::WindowTreeHost*> hosts) override { + // Checking that the hosts are not nullptr, because of a bug where nullptr + // was being passed in addition to the desired aura::WindowTreeHost + // pointers, causing a crash when dereferenced. Crash bug found at: + // crbug.com/837541 + for (aura::WindowTreeHost* host : hosts) + DCHECK(host); + + return mock_occlusion_results_; + } + + void SetMockOcclusionResults(OcclusionStatusMap mock_occlusion_results) { + mock_occlusion_results_ = mock_occlusion_results; + } + + private: + OcclusionStatusMap mock_occlusion_results_; +#endif +}; + class TabStatsTrackerBrowserTest : public InProcessBrowserTest { public: TabStatsTrackerBrowserTest() : tab_stats_tracker_(nullptr) {} @@ -36,6 +67,9 @@ } protected: + // Used to make sure that the metrics are reported properly. + base::HistogramTester histogram_tester_; + TabStatsTracker* tab_stats_tracker_; DISALLOW_COPY_AND_ASSIGN(TabStatsTrackerBrowserTest); @@ -134,4 +168,85 @@ EXPECT_EQ(0U, interval_map->size()); } +#if defined(OS_WIN) +IN_PROC_BROWSER_TEST_F(TabStatsTrackerBrowserTest, + TestCalculateAndRecordNativeWindowVisibilities) { + std::unique_ptr<MockTabStatsTrackerDelegate> mock_delegate = + std::make_unique<MockTabStatsTrackerDelegate>(); + + // Maintaining this reference to |mock_delegate| is safe because the + // TabStatsTracker will outlive this test class. + MockTabStatsTrackerDelegate* mock_delegate_raw = mock_delegate.get(); + tab_stats_tracker_->SetDelegateForTesting(std::move(mock_delegate)); + + TabStatsTrackerDelegate::OcclusionStatusMap mock_occlusion_results; + + mock_delegate_raw->SetMockOcclusionResults(mock_occlusion_results); + + tab_stats_tracker_->CalculateAndRecordNativeWindowVisibilities(); + + // There should be 1 entry for each zero window bucket. + histogram_tester_.ExpectBucketCount("Windows.NativeWindowVisibility.Occluded", + 0, 1); + histogram_tester_.ExpectBucketCount("Windows.NativeWindowVisibility.Visible", + 0, 1); + histogram_tester_.ExpectBucketCount("Windows.NativeWindowVisibility.Hidden", + 0, 1); + + // There should be no entries in the 1 window bucket. + histogram_tester_.ExpectBucketCount("Windows.NativeWindowVisibility.Occluded", + 1, 0); + histogram_tester_.ExpectBucketCount("Windows.NativeWindowVisibility.Visible", + 1, 0); + histogram_tester_.ExpectBucketCount("Windows.NativeWindowVisibility.Hidden", + 1, 0); + + // Create a browser for each aura::Window::OcclusionState. + mock_occlusion_results[CreateBrowser(ProfileManager::GetActiveUserProfile()) + ->window() + ->GetNativeWindow() + ->GetHost()] = + aura::Window::OcclusionState::HIDDEN; + mock_occlusion_results[CreateBrowser(ProfileManager::GetActiveUserProfile()) + ->window() + ->GetNativeWindow() + ->GetHost()] = + aura::Window::OcclusionState::VISIBLE; + mock_occlusion_results[CreateBrowser(ProfileManager::GetActiveUserProfile()) + ->window() + ->GetNativeWindow() + ->GetHost()] = + aura::Window::OcclusionState::OCCLUDED; + + mock_delegate_raw->SetMockOcclusionResults(mock_occlusion_results); + + // There should now be 1 entry for each 1 window bucket. + tab_stats_tracker_->CalculateAndRecordNativeWindowVisibilities(); + histogram_tester_.ExpectBucketCount("Windows.NativeWindowVisibility.Occluded", + 1, 1); + histogram_tester_.ExpectBucketCount("Windows.NativeWindowVisibility.Visible", + 1, 1); + histogram_tester_.ExpectBucketCount("Windows.NativeWindowVisibility.Hidden", + 1, 1); + + mock_occlusion_results.clear(); + + // Create 5 aura::Window::OcclusionState browsers. + for (int count = 0; count < 5; count++) { + mock_occlusion_results[CreateBrowser(ProfileManager::GetActiveUserProfile()) + ->window() + ->GetNativeWindow() + ->GetHost()] = + aura::Window::OcclusionState::OCCLUDED; + } + + mock_delegate_raw->SetMockOcclusionResults(mock_occlusion_results); + tab_stats_tracker_->CalculateAndRecordNativeWindowVisibilities(); + + // There should be 1 entry in the 5 window occluded bucket. + histogram_tester_.ExpectBucketCount("Windows.NativeWindowVisibility.Occluded", + 5, 1); +} + +#endif // defined(OS_WIN) } // namespace metrics
diff --git a/chrome/browser/metrics/tab_stats_tracker_delegate.h b/chrome/browser/metrics/tab_stats_tracker_delegate.h new file mode 100644 index 0000000..b93719d5 --- /dev/null +++ b/chrome/browser/metrics/tab_stats_tracker_delegate.h
@@ -0,0 +1,29 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_METRICS_TAB_STATS_TRACKER_DELEGATE_H_ +#define CHROME_BROWSER_METRICS_TAB_STATS_TRACKER_DELEGATE_H_ + +#include "build/build_config.h" + +#if defined(OS_WIN) +#include "ui/aura/window.h" +#include "ui/aura/window_tree_host.h" +#endif + +class TabStatsTrackerDelegate { + public: + TabStatsTrackerDelegate() {} + virtual ~TabStatsTrackerDelegate() {} + +#if defined(OS_WIN) + using OcclusionStatusMap = + base::flat_map<aura::WindowTreeHost*, aura::Window::OcclusionState>; + + virtual OcclusionStatusMap CallComputeNativeWindowOcclusionStatus( + std::vector<aura::WindowTreeHost*> hosts); +#endif // OS_WIN +}; + +#endif // CHROME_BROWSER_METRICS_TAB_STATS_TRACKER_DELEGATE_H_
diff --git a/chrome/browser/metrics/tab_stats_tracker_delegate_win.cc b/chrome/browser/metrics/tab_stats_tracker_delegate_win.cc new file mode 100644 index 0000000..37c35d1 --- /dev/null +++ b/chrome/browser/metrics/tab_stats_tracker_delegate_win.cc
@@ -0,0 +1,13 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/metrics/tab_stats_tracker_delegate.h" + +#include "ui/aura_extra/window_occlusion_win.h" + +TabStatsTrackerDelegate::OcclusionStatusMap +TabStatsTrackerDelegate::CallComputeNativeWindowOcclusionStatus( + std::vector<aura::WindowTreeHost*> hosts) { + return aura_extra::ComputeNativeWindowOcclusionStatus(hosts); +}
diff --git a/chrome/browser/metrics/tab_stats_tracker_win.cc b/chrome/browser/metrics/tab_stats_tracker_win.cc new file mode 100644 index 0000000..4812ff95 --- /dev/null +++ b/chrome/browser/metrics/tab_stats_tracker_win.cc
@@ -0,0 +1,71 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/metrics/tab_stats_tracker.h" + +#include "base/metrics/histogram_macros.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_list.h" +#include "chrome/browser/ui/browser_window.h" + +namespace metrics { + +void TabStatsTracker::CalculateAndRecordNativeWindowVisibilities() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + BrowserList* browser_list = BrowserList::GetInstance(); + std::vector<aura::WindowTreeHost*> hosts; + hosts.reserve(browser_list->size()); + + // Get the aura::WindowTreeHost for each Chrome browser. + for (Browser* browser : *browser_list) { + aura::WindowTreeHost* host = + browser->window()->GetNativeWindow()->GetHost(); + hosts.push_back(host); + } + + // Compute native window occlusion if not using mock occlusion results. + TabStatsTrackerDelegate::OcclusionStatusMap native_window_visibilities = + delegate_->CallComputeNativeWindowOcclusionStatus(hosts); + + size_t num_occluded = 0; + size_t num_visible = 0; + size_t num_hidden = 0; + + // Determine the number of Chrome browser windows in each visibility state. + for (auto& window_visibility_pair : native_window_visibilities) { + aura::Window::OcclusionState visibility = window_visibility_pair.second; + + switch (visibility) { + case aura::Window::OcclusionState::OCCLUDED: + num_occluded++; + break; + case aura::Window::OcclusionState::VISIBLE: + num_visible++; + break; + case aura::Window::OcclusionState::HIDDEN: + num_hidden++; + break; + case aura::Window::OcclusionState::UNKNOWN: + break; + } + } + + reporting_delegate_->RecordNativeWindowVisibilities(num_occluded, num_visible, + num_hidden); +} + +void TabStatsTracker::UmaStatsReportingDelegate::RecordNativeWindowVisibilities( + size_t num_occluded, + size_t num_visible, + size_t num_hidden) { + UMA_HISTOGRAM_COUNTS_10000("Windows.NativeWindowVisibility.Occluded", + num_occluded); + UMA_HISTOGRAM_COUNTS_10000("Windows.NativeWindowVisibility.Visible", + num_visible); + UMA_HISTOGRAM_COUNTS_10000("Windows.NativeWindowVisibility.Hidden", + num_hidden); +} + +} // namespace metrics
diff --git a/chrome/browser/permissions/chooser_context_base.h b/chrome/browser/permissions/chooser_context_base.h index 1c551ede..11b3fe86 100644 --- a/chrome/browser/permissions/chooser_context_base.h +++ b/chrome/browser/permissions/chooser_context_base.h
@@ -86,6 +86,9 @@ // |host_content_settings_map_|. virtual bool IsValidObject(const base::DictionaryValue& object) = 0; + // Returns the human readable string representing the given object. + virtual std::string GetObjectName(const base::DictionaryValue& object) = 0; + private: std::unique_ptr<base::DictionaryValue> GetWebsiteSetting( const GURL& requesting_origin,
diff --git a/chrome/browser/permissions/chooser_context_base_unittest.cc b/chrome/browser/permissions/chooser_context_base_unittest.cc index 7f34252..a881034 100644 --- a/chrome/browser/permissions/chooser_context_base_unittest.cc +++ b/chrome/browser/permissions/chooser_context_base_unittest.cc
@@ -27,6 +27,11 @@ return object.size() == 2 && object.HasKey(kRequiredKey1) && object.HasKey(kRequiredKey2); } + + std::string GetObjectName(const base::DictionaryValue& object) override { + NOTREACHED(); + return std::string(); + } }; } // namespace
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index 1cac287..fdfddfd7 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -798,6 +798,12 @@ { key::kDefaultWebUsbGuardSetting, prefs::kManagedDefaultWebUsbGuardSetting, base::Value::Type::INTEGER }, + { key::kWebUsbAskForUrls, + prefs::kManagedWebUsbAskForUrls, + base::Value::Type::LIST }, + { key::kWebUsbBlockedForUrls, + prefs::kManagedWebUsbBlockedForUrls, + base::Value::Type::LIST }, }; // clang-format on
diff --git a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc index 0e1b709b..22c983db 100644 --- a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc +++ b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc
@@ -199,7 +199,8 @@ base::FilePath executable_path = command_line->GetSwitchValuePath(kTestExecutablePath); EXPECT_FALSE(executable_path.empty()); - MockLaunchd mock_launchd(executable_path, &main_message_loop, true, true); + MockLaunchd mock_launchd(executable_path, main_message_loop.task_runner(), + true, true); Launchd::ScopedInstance use_mock(&mock_launchd); #endif @@ -393,9 +394,8 @@ EXPECT_TRUE(MockLaunchd::MakeABundle(temp_dir_.GetPath(), "CloudPrintProxyTest", &bundle_path_, &executable_path_)); - mock_launchd_.reset(new MockLaunchd(executable_path_, - base::MessageLoopForUI::current(), - true, false)); + mock_launchd_.reset(new MockLaunchd( + executable_path_, base::ThreadTaskRunnerHandle::Get(), true, false)); scoped_launchd_instance_.reset( new Launchd::ScopedInstance(mock_launchd_.get())); #endif
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 97d9be97..f9d9362 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc
@@ -146,6 +146,7 @@ #include "chromeos/account_manager/account_manager.h" #include "chromeos/account_manager/account_manager_factory.h" #include "chromeos/assistant/buildflags.h" +#include "chromeos/chromeos_features.h" #include "chromeos/services/multidevice_setup/multidevice_setup_service.h" #include "chromeos/services/multidevice_setup/public/mojom/constants.mojom.h" #include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h" @@ -1148,7 +1149,8 @@ } #endif - if (base::FeatureList::IsEnabled(features::kEnableUnifiedMultiDeviceSetup)) { + if (base::FeatureList::IsEnabled( + chromeos::features::kEnableUnifiedMultiDeviceSetup)) { service_manager::EmbeddedServiceInfo info; info.task_runner = base::ThreadTaskRunnerHandle::Get(); info.factory = base::BindRepeating([] {
diff --git a/chrome/browser/resource_coordinator/local_site_characteristics_data_impl.cc b/chrome/browser/resource_coordinator/local_site_characteristics_data_impl.cc index a8f3e15..3131fe3 100644 --- a/chrome/browser/resource_coordinator/local_site_characteristics_data_impl.cc +++ b/chrome/browser/resource_coordinator/local_site_characteristics_data_impl.cc
@@ -128,12 +128,7 @@ active_webcontents_count_(0U), delegate_(delegate) { DCHECK_NE(nullptr, delegate_); - // Initialize the feature elements with the default value, this is required - // because some fields might otherwise never be initialized. - for (auto* iter : GetAllFeaturesFromProto(&site_characteristics_)) - InitSiteCharacteristicsFeatureProtoWithDefaultValues(iter); - - site_characteristics_.set_last_loaded(kZeroIntervalInternalRepresentation); + InitWithDefaultValues(); } base::TimeDelta LocalSiteCharacteristicsDataImpl::FeatureObservationDuration( @@ -146,7 +141,7 @@ // If this site is still loaded and the feature isn't in use then the // observation time since load needs to be added. - if (active_webcontents_count_ > 0U && + if (IsLoaded() && InternalRepresentationToTimeDelta(feature_proto.use_timestamp()) .is_zero()) { base::TimeDelta observation_time_since_load = @@ -163,7 +158,7 @@ // It's currently required that the site gets unloaded before destroying this // object. // TODO(sebmarchand): Check if this is a valid assumption. - DCHECK_EQ(0U, active_webcontents_count_); + DCHECK(!IsLoaded()); DCHECK_NE(nullptr, delegate_); delegate_->OnLocalSiteCharacteristicsDataImplDestroyed(this); @@ -191,6 +186,29 @@ proto->set_use_timestamp(kZeroIntervalInternalRepresentation); } +void LocalSiteCharacteristicsDataImpl::InitWithDefaultValues() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + // Initialize the feature elements with the default value, this is required + // because some fields might otherwise never be initialized. + for (auto* iter : GetAllFeaturesFromProto(&site_characteristics_)) + InitSiteCharacteristicsFeatureProtoWithDefaultValues(iter); + + site_characteristics_.set_last_loaded(kZeroIntervalInternalRepresentation); +} + +void LocalSiteCharacteristicsDataImpl::ClearObservations() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + // Reset all the observations. + InitWithDefaultValues(); + + // Set the last loaded time to the current time if there's some loaded + // instances of this site. + if (IsLoaded()) { + site_characteristics_.set_last_loaded( + TimeDeltaToInternalRepresentation(GetTickDeltaSinceEpoch())); + } +} + SiteFeatureUsage LocalSiteCharacteristicsDataImpl::GetFeatureUsage( const SiteCharacteristicsFeatureProto& feature_proto, const base::TimeDelta min_obs_time) const { @@ -213,7 +231,7 @@ void LocalSiteCharacteristicsDataImpl::NotifyFeatureUsage( SiteCharacteristicsFeatureProto* feature_proto) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK_GT(active_webcontents_count_, 0U); + DCHECK(IsLoaded()); feature_proto->set_use_timestamp( TimeDeltaToInternalRepresentation(GetTickDeltaSinceEpoch()));
diff --git a/chrome/browser/resource_coordinator/local_site_characteristics_data_impl.h b/chrome/browser/resource_coordinator/local_site_characteristics_data_impl.h index fd0286b..f6d82dae 100644 --- a/chrome/browser/resource_coordinator/local_site_characteristics_data_impl.h +++ b/chrome/browser/resource_coordinator/local_site_characteristics_data_impl.h
@@ -70,6 +70,15 @@ // TODO(sebmarchand): Add the methods necessary to record other types of // observations (e.g. memory and CPU usage). + base::TimeDelta last_loaded_time_for_testing() const { + return InternalRepresentationToTimeDelta( + site_characteristics_.last_loaded()); + } + + const SiteCharacteristicsProto& site_characteristics_for_testing() const { + return site_characteristics_; + } + protected: friend class base::RefCounted<LocalSiteCharacteristicsDataImpl>; friend class LocalSiteCharacteristicsDataImplTest; @@ -98,21 +107,9 @@ base::TimeDelta FeatureObservationDuration( const SiteCharacteristicsFeatureProto& feature_proto) const; - // Accessors, for testing: - base::TimeDelta last_loaded_time_for_testing() const { - return InternalRepresentationToTimeDelta( - site_characteristics_.last_loaded()); - } - - const SiteCharacteristicsProto& site_characteristics_for_testing() const { - return site_characteristics_; - } - - const std::string& origin_str() const { return origin_str_; } - + private: static const int64_t kZeroIntervalInternalRepresentation; - private: // Add |extra_observation_duration| to the observation window of a given // feature if it hasn't been used yet, do nothing otherwise. static void IncrementFeatureObservationDuration( @@ -124,6 +121,14 @@ static void InitSiteCharacteristicsFeatureProtoWithDefaultValues( SiteCharacteristicsFeatureProto* proto); + // Initialize this object with default values. + // NOTE: Do not call this directly while the site is loaded as this will not + // properly update the last_loaded time, instead call |ClearObservations|. + void InitWithDefaultValues(); + + // Clear all the past observations about this site. + void ClearObservations(); + // Returns the usage of |site_feature| for this site. SiteFeatureUsage GetFeatureUsage( const SiteCharacteristicsFeatureProto& feature_proto, @@ -133,6 +138,10 @@ // feature gets used. void NotifyFeatureUsage(SiteCharacteristicsFeatureProto* feature_proto); + const std::string& origin_str() const { return origin_str_; } + + bool IsLoaded() const { return active_webcontents_count_ > 0U; } + // This site's characteristics, contains the features and other values are // measured. SiteCharacteristicsProto site_characteristics_;
diff --git a/chrome/browser/resource_coordinator/local_site_characteristics_data_impl_unittest.cc b/chrome/browser/resource_coordinator/local_site_characteristics_data_impl_unittest.cc index eb68a7e0..35a01e66 100644 --- a/chrome/browser/resource_coordinator/local_site_characteristics_data_impl_unittest.cc +++ b/chrome/browser/resource_coordinator/local_site_characteristics_data_impl_unittest.cc
@@ -25,7 +25,6 @@ : public LocalSiteCharacteristicsDataImpl { public: using LocalSiteCharacteristicsDataImpl::FeatureObservationDuration; - using LocalSiteCharacteristicsDataImpl::last_loaded_time_for_testing; using LocalSiteCharacteristicsDataImpl::OnDestroyDelegate; using LocalSiteCharacteristicsDataImpl::site_characteristics_for_testing; using LocalSiteCharacteristicsDataImpl::TimeDeltaToInternalRepresentation;
diff --git a/chrome/browser/resource_coordinator/local_site_characteristics_data_store.cc b/chrome/browser/resource_coordinator/local_site_characteristics_data_store.cc index 0e0e827f..6521917 100644 --- a/chrome/browser/resource_coordinator/local_site_characteristics_data_store.cc +++ b/chrome/browser/resource_coordinator/local_site_characteristics_data_store.cc
@@ -6,12 +6,21 @@ #include "base/memory/ptr_util.h" #include "base/stl_util.h" +#include "chrome/browser/history/history_service_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/resource_coordinator/local_site_characteristics_data_reader.h" +#include "components/history/core/browser/history_service.h" namespace resource_coordinator { -LocalSiteCharacteristicsDataStore::LocalSiteCharacteristicsDataStore() = - default; +LocalSiteCharacteristicsDataStore::LocalSiteCharacteristicsDataStore( + Profile* profile) + : history_observer_(this) { + history::HistoryService* history = + HistoryServiceFactory::GetForProfileWithoutCreating(profile); + if (history) + history_observer_.Add(history); +} LocalSiteCharacteristicsDataStore::~LocalSiteCharacteristicsDataStore() = default; @@ -55,4 +64,40 @@ DCHECK_EQ(1U, num_erased); } +LocalSiteCharacteristicsDataStore::LocalSiteCharacteristicsMap::iterator +LocalSiteCharacteristicsDataStore::ResetLocalSiteCharacteristicsEntry( + LocalSiteCharacteristicsMap::iterator entry) { + if (entry->second->IsLoaded()) { + entry->second->ClearObservations(); + entry++; + } else { + entry = origin_data_map_.erase(entry); + } + return entry; +} + +void LocalSiteCharacteristicsDataStore::OnURLsDeleted( + history::HistoryService* history_service, + const history::DeletionTimeRange& time_range, + bool expired, + const history::URLRows& deleted_rows, + const std::set<GURL>& favicon_urls) { + // TODO(sebmarchand): Removes these entry from the on-disk database once it's + // implemented. + if (time_range.IsAllTime()) { + for (auto iter = origin_data_map_.begin(); + iter != origin_data_map_.end();) { + iter = ResetLocalSiteCharacteristicsEntry(iter); + } + } else { + for (auto deleted_row : deleted_rows) { + auto map_iter = + origin_data_map_.find(deleted_row.url().GetOrigin().GetContent()); + if (map_iter != origin_data_map_.end()) { + ResetLocalSiteCharacteristicsEntry(map_iter); + } + } + } +} + } // namespace resource_coordinator
diff --git a/chrome/browser/resource_coordinator/local_site_characteristics_data_store.h b/chrome/browser/resource_coordinator/local_site_characteristics_data_store.h index 1f8b0e3..e6d291d 100644 --- a/chrome/browser/resource_coordinator/local_site_characteristics_data_store.h +++ b/chrome/browser/resource_coordinator/local_site_characteristics_data_store.h
@@ -6,9 +6,14 @@ #define CHROME_BROWSER_RESOURCE_COORDINATOR_LOCAL_SITE_CHARACTERISTICS_DATA_STORE_H_ #include "base/containers/flat_map.h" +#include "base/gtest_prod_util.h" #include "base/macros.h" +#include "base/scoped_observer.h" #include "chrome/browser/resource_coordinator/local_site_characteristics_data_impl.h" #include "chrome/browser/resource_coordinator/site_characteristics_data_store.h" +#include "components/history/core/browser/history_service_observer.h" + +class Profile; namespace resource_coordinator { @@ -16,12 +21,13 @@ // characteristics database as a backend. class LocalSiteCharacteristicsDataStore : public SiteCharacteristicsDataStore, - public internal::LocalSiteCharacteristicsDataImpl::OnDestroyDelegate { + public internal::LocalSiteCharacteristicsDataImpl::OnDestroyDelegate, + public history::HistoryServiceObserver { public: using LocalSiteCharacteristicsMap = base::flat_map<std::string, internal::LocalSiteCharacteristicsDataImpl*>; - LocalSiteCharacteristicsDataStore(); + explicit LocalSiteCharacteristicsDataStore(Profile* profile); ~LocalSiteCharacteristicsDataStore() override; // SiteCharacteristicDataStore: @@ -33,6 +39,10 @@ } private: + FRIEND_TEST_ALL_PREFIXES(LocalSiteCharacteristicsDataStoreTest, EndToEnd); + FRIEND_TEST_ALL_PREFIXES(LocalSiteCharacteristicsDataStoreTest, + HistoryServiceObserver); + // Returns a pointer to the LocalSiteCharacteristicsDataImpl object // associated with |origin|, create one and add it to |origin_data_map_| // if it doesn't exist. @@ -43,10 +53,26 @@ void OnLocalSiteCharacteristicsDataImplDestroyed( internal::LocalSiteCharacteristicsDataImpl* impl) override; + // history::HistoryServiceObserver: + void OnURLsDeleted(history::HistoryService* history_service, + const history::DeletionTimeRange& time_range, + bool expired, + const history::URLRows& deleted_rows, + const std::set<GURL>& favicon_urls) override; + + // Reset the observations about a given LocalSiteCharacteristicsMap entry, + // removes this entry from the map if it's not loaded by any tab. + // Returns an iterator to the next element in the map. + LocalSiteCharacteristicsMap::iterator ResetLocalSiteCharacteristicsEntry( + LocalSiteCharacteristicsMap::iterator entry); + // Map a serialized origin to a LocalSiteCharacteristicDataInternal // pointer. LocalSiteCharacteristicsMap origin_data_map_; + ScopedObserver<history::HistoryService, LocalSiteCharacteristicsDataStore> + history_observer_; + DISALLOW_COPY_AND_ASSIGN(LocalSiteCharacteristicsDataStore); };
diff --git a/chrome/browser/resource_coordinator/local_site_characteristics_data_store_unittest.cc b/chrome/browser/resource_coordinator/local_site_characteristics_data_store_unittest.cc index ab507ab..8964e455 100644 --- a/chrome/browser/resource_coordinator/local_site_characteristics_data_store_unittest.cc +++ b/chrome/browser/resource_coordinator/local_site_characteristics_data_store_unittest.cc
@@ -5,39 +5,141 @@ #include "chrome/browser/resource_coordinator/local_site_characteristics_data_store.h" #include "base/macros.h" +#include "base/test/simple_test_tick_clock.h" #include "chrome/browser/resource_coordinator/local_site_characteristics_data_impl.h" +#include "chrome/browser/resource_coordinator/time.h" +#include "chrome/test/base/testing_profile.h" +#include "components/history/core/browser/history_types.h" +#include "components/history/core/browser/url_row.h" +#include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" namespace resource_coordinator { -using LocalSiteCharacteristicsDataStoreTest = testing::Test; +namespace { +const char kTestOrigin[] = "http://www.foo.com"; +const char kTestOrigin2[] = "http://www.bar.com"; +} // namespace + +class LocalSiteCharacteristicsDataStoreTest : public ::testing::Test { + public: + LocalSiteCharacteristicsDataStoreTest() + : scoped_set_tick_clock_for_testing_(&test_clock_), + data_store_(&profile_) { + test_clock_.SetNowTicks(base::TimeTicks::UnixEpoch()); + test_clock_.Advance(base::TimeDelta::FromHours(1)); + } + + protected: + base::SimpleTestTickClock test_clock_; + ScopedSetTickClockForTesting scoped_set_tick_clock_for_testing_; + content::TestBrowserThreadBundle test_browser_thread_bundle_; + TestingProfile profile_; + LocalSiteCharacteristicsDataStore data_store_; +}; TEST_F(LocalSiteCharacteristicsDataStoreTest, EndToEnd) { - const std::string kOrigin = "foo.com"; - LocalSiteCharacteristicsDataStore data_store; - EXPECT_TRUE(data_store.origin_data_map_for_testing().empty()); - auto reader = data_store.GetReaderForOrigin(kOrigin); + auto reader = data_store_.GetReaderForOrigin(kTestOrigin); EXPECT_NE(nullptr, reader.get()); - EXPECT_EQ(1U, data_store.origin_data_map_for_testing().size()); + EXPECT_EQ(1U, data_store_.origin_data_map_for_testing().size()); - internal::LocalSiteCharacteristicsDataImpl* impl = - data_store.origin_data_map_for_testing().find(kOrigin)->second; - EXPECT_NE(nullptr, impl); + internal::LocalSiteCharacteristicsDataImpl* data = + data_store_.origin_data_map_for_testing().find(kTestOrigin)->second; + EXPECT_NE(nullptr, data); EXPECT_EQ(SiteFeatureUsage::kSiteFeatureUsageUnknown, reader->UpdatesTitleInBackground()); - impl->NotifySiteLoaded(); - impl->NotifyUpdatesTitleInBackground(); - impl->NotifySiteUnloaded(); + data->NotifySiteLoaded(); + data->NotifyUpdatesTitleInBackground(); + EXPECT_EQ(SiteFeatureUsage::kSiteFeatureInUse, + reader->UpdatesTitleInBackground()); + data->NotifySiteUnloaded(); EXPECT_EQ(SiteFeatureUsage::kSiteFeatureInUse, reader->UpdatesTitleInBackground()); - auto reader_copy = data_store.GetReaderForOrigin(kOrigin); - EXPECT_EQ(1U, data_store.origin_data_map_for_testing().size()); + auto reader_copy = data_store_.GetReaderForOrigin(kTestOrigin); + EXPECT_EQ(1U, data_store_.origin_data_map_for_testing().size()); + auto reader2 = data_store_.GetReaderForOrigin(kTestOrigin2); + EXPECT_EQ(2U, data_store_.origin_data_map_for_testing().size()); + reader2.reset(); + EXPECT_EQ(1U, data_store_.origin_data_map_for_testing().size()); reader_copy.reset(); reader.reset(); - EXPECT_TRUE(data_store.origin_data_map_for_testing().empty()); + EXPECT_TRUE(data_store_.origin_data_map_for_testing().empty()); + + data_store_.OnURLsDeleted(nullptr, history::DeletionTimeRange::AllTime(), + false, history::URLRows(), std::set<GURL>()); +} + +TEST_F(LocalSiteCharacteristicsDataStoreTest, HistoryServiceObserver) { + // Load a first origin, and then make use of a feature on it. + + const std::string kOrigin1Url = GURL(kTestOrigin).GetOrigin().GetContent(); + auto reader = data_store_.GetReaderForOrigin(kOrigin1Url); + EXPECT_TRUE(reader); + internal::LocalSiteCharacteristicsDataImpl* data = + data_store_.origin_data_map_for_testing().find(kOrigin1Url)->second; + EXPECT_NE(nullptr, data); + + constexpr base::TimeDelta kDelay = base::TimeDelta::FromHours(1); + + EXPECT_EQ(SiteFeatureUsage::kSiteFeatureUsageUnknown, + reader->UpdatesTitleInBackground()); + data->NotifySiteLoaded(); + base::TimeDelta last_loaded_time = data->last_loaded_time_for_testing(); + data->NotifyUpdatesTitleInBackground(); + EXPECT_EQ(SiteFeatureUsage::kSiteFeatureInUse, + reader->UpdatesTitleInBackground()); + test_clock_.Advance(kDelay); + + // Load a second origin, make use of a feature on it too. + const std::string kOrigin2Url = GURL(kTestOrigin2).GetOrigin().GetContent(); + auto reader2 = data_store_.GetReaderForOrigin(kOrigin2Url); + EXPECT_TRUE(reader2); + internal::LocalSiteCharacteristicsDataImpl* data2 = + data_store_.origin_data_map_for_testing().find(kOrigin2Url)->second; + EXPECT_NE(nullptr, data2); + data2->NotifySiteLoaded(); + data2->NotifyUpdatesFaviconInBackground(); + + // This site hasn'be been unloaded yet, so the last loaded time shouldn't have + // changed. + EXPECT_EQ(data->last_loaded_time_for_testing(), last_loaded_time); + + history::URLRows urls_to_delete = { + history::URLRow(GURL(kTestOrigin)), + history::URLRow(GURL("http://www.url-not-in-map.com"))}; + data_store_.OnURLsDeleted(nullptr, history::DeletionTimeRange::Invalid(), + false, urls_to_delete, std::set<GURL>()); + + // The information for this site have been reset, so the last loaded time + // should now be equal to the current time and the title update feature + // observation should have been cleared. + EXPECT_NE(data->last_loaded_time_for_testing(), last_loaded_time); + EXPECT_EQ(data->last_loaded_time_for_testing(), + test_clock_.NowTicks() - base::TimeTicks::UnixEpoch()); + EXPECT_EQ(SiteFeatureUsage::kSiteFeatureUsageUnknown, + reader->UpdatesTitleInBackground()); + // The second site shouldn't have been cleared. + EXPECT_EQ(SiteFeatureUsage::kSiteFeatureInUse, + reader2->UpdatesFaviconInBackground()); + + test_clock_.Advance(kDelay); + + // Delete all the information stored in the data store. + data_store_.OnURLsDeleted(nullptr, history::DeletionTimeRange::AllTime(), + false, history::URLRows(), std::set<GURL>()); + + EXPECT_EQ(SiteFeatureUsage::kSiteFeatureUsageUnknown, + reader2->UpdatesFaviconInBackground()); + EXPECT_EQ(data->last_loaded_time_for_testing(), + test_clock_.NowTicks() - base::TimeTicks::UnixEpoch()); + EXPECT_EQ(data2->last_loaded_time_for_testing(), + test_clock_.NowTicks() - base::TimeTicks::UnixEpoch()); + + data->NotifySiteUnloaded(); + data2->NotifySiteUnloaded(); } } // namespace resource_coordinator
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js index ac67c15c..ad81633 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -1795,6 +1795,14 @@ if (node.state[StateType.EDITABLE] && cvox.ChromeVox.isStickyPrefOn) this.format_(node, '@sticky_mode_enabled', buff); + if (node.state[StateType.EDITABLE] && node.state[StateType.FOCUSED] && + !this.formatOptions_.braille) { + this.format_(node, '@hint_is_editing', buff); + if (node.state[StateType.MULTILINE] || + node.state[StateType.RICHLY_EDITABLE]) + this.format_(node, '@hint_search_within_text_field', buff); + } + if (AutomationPredicate.checkable(node)) this.format_(node, '@hint_checkable', buff); if (AutomationPredicate.clickable(node))
diff --git a/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd b/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd index ae6a4ef..4f67c6f 100644 --- a/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd +++ b/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd
@@ -2828,6 +2828,12 @@ <message desc="Describes the action of scrolling forward." name="IDS_CHROMEVOX_ACTION_SCROLL_FORWARD_DESCRIPTION"> Scroll forward </message> + <message desc="A hint to the user that they are editing text within a text field. This text will be spoken using text to speech along with a description of the text field's name and value" name="IDS_CHROMEVOX_HINT_IS_EDITING"> + is editing + </message> + <message desc="A hint to the user about the special behavior of the Search key with arrows within a text field. This text will be spoken using text to speech along with a description of the text field's name and value. The text is intentionally in fragments to reduce the time needed to convey this information via text to speech. Keys are capitalized and do not contain plus separators because it adds to the spoken announcement's duration. As a general guide, try to read the string aloud." name="IDS_CHROMEVOX_HINT_SEARCH_WITHIN_TEXT_FIELD"> + Use Search Left or Right for Home or End, Search Control Left or Right for Control Home or End, Search Up or Down for Page Up or Down. + </message> </messages> </release> </grit>
diff --git a/chrome/browser/resources/settings/privacy_page/BUILD.gn b/chrome/browser/resources/settings/privacy_page/BUILD.gn index e6cce126..d2bb5b5 100644 --- a/chrome/browser/resources/settings/privacy_page/BUILD.gn +++ b/chrome/browser/resources/settings/privacy_page/BUILD.gn
@@ -6,11 +6,23 @@ js_type_check("closure_compile") { deps = [ + ":personalization_options", ":privacy_page", ":privacy_page_browser_proxy", ] } +js_library("personalization_options") { + deps = [ + ":privacy_page_browser_proxy", + "..:page_visibility", + "..:route", + "../controls:settings_toggle_button", + "//ui/webui/resources/js:web_ui_listener_behavior", + ] + externs_list = [ "$externs_path/settings_private.js" ] +} + js_library("privacy_page_browser_proxy") { deps = [ "..:lifetime_browser_proxy",
diff --git a/chrome/browser/resources/settings/privacy_page/personalization_options.html b/chrome/browser/resources/settings/privacy_page/personalization_options.html new file mode 100644 index 0000000..3ac7cca --- /dev/null +++ b/chrome/browser/resources/settings/privacy_page/personalization_options.html
@@ -0,0 +1,83 @@ +<link rel="import" href="chrome://resources/html/polymer.html"> + +<link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html"> +<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../lifetime_browser_proxy.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="privacy_page_browser_proxy.html"> + +<dom-module id="settings-personalization-options"> + <template> + <style include="settings-shared"></style> + <settings-toggle-button pref="{{prefs.alternate_error_pages.enabled}}" + label="$i18n{linkDoctorPref}" + sub-label="$i18n{linkDoctorPrefDesc}"> + </settings-toggle-button> + <settings-toggle-button hidden="[[!pageVisibility.searchPrediction]]" + pref="{{prefs.search.suggest_enabled}}" + label="$i18n{searchSuggestPref}" + sub-label="$i18n{searchSuggestPrefDesc}"> + </settings-toggle-button> + <settings-toggle-button id="safeBrowsingExtendedReportingControl" + pref="[[safeBrowsingExtendedReportingPref_]]" + label="$i18n{safeBrowsingEnableExtendedReporting}" + sub-label="$i18n{safeBrowsingEnableExtendedReportingDesc}" + on-settings-boolean-control-change="onSberChange_" + no-set-pref> + </settings-toggle-button> + <settings-toggle-button hidden="[[!pageVisibility.networkPrediction]]" + pref="{{prefs.net.network_prediction_options}}" + label="$i18n{networkPredictionEnabled}" + sub-label="$i18n{networkPredictionEnabledDesc}" + numeric-unchecked-value="[[networkPredictionEnum_.NEVER]]"> + </settings-toggle-button> + <settings-toggle-button pref="{{prefs.safebrowsing.enabled}}" + label="$i18n{safeBrowsingEnableProtection}" + sub-label="$i18n{safeBrowsingEnableProtectionDesc}"> + </settings-toggle-button> +<if expr="_google_chrome"> + <template is="dom-if" if="[[!unifiedConsentEnabled_]]"> + <settings-toggle-button id="spellCheckControl" + pref="{{prefs.spellcheck.use_spelling_service}}" + label="$i18n{spellingPref}" + sub-label="$i18n{spellingDescription}"> + </settings-toggle-button> + </template> + <template is="dom-if" if="[[unifiedConsentEnabled_]]"> + <div class="settings-box two-line" id="spellCheckLinkBox"> + <div class="start"> + $i18n{spellingPref} + <div class="secondary" on-click="onLanguageLinkBoxClick_"> + $i18nRaw{spellingDescription} + </div> + </div> + <cr-toggle checked="[[prefs.spellcheck.use_spelling_service]]" disabled> + </cr-toggle> + </div> + </template> +<if expr="chromeos"> + <settings-toggle-button pref="{{prefs.cros.metrics.reportingEnabled}}" + label="$i18n{enableLogging}" + sub-label="$i18n{enableLoggingDesc}"> + </settings-toggle-button> +</if><!-- chromeos --> +<if expr="not chromeos"> + <settings-toggle-button id="metricsReportingControl" + pref="[[metricsReportingPref_]]" label="$i18n{enableLogging}" + sub-label="$i18n{enableLoggingDesc}" no-set-pref + on-settings-boolean-control-change="onMetricsReportingChange_"> + <template is="dom-if" if="[[showRestart_]]" restamp> + <paper-button on-click="onRestartTap_" id="restart" + slot="more-actions"> + $i18n{restart} + </paper-button> + </template> + </settings-toggle-button> +</if><!-- not chromeos --> +</if><!-- _google_chrome --> + </template> + <script src="personalization_options.js"></script> +</dom-module> \ No newline at end of file
diff --git a/chrome/browser/resources/settings/privacy_page/personalization_options.js b/chrome/browser/resources/settings/privacy_page/personalization_options.js new file mode 100644 index 0000000..400eef4 --- /dev/null +++ b/chrome/browser/resources/settings/privacy_page/personalization_options.js
@@ -0,0 +1,183 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview + * 'personalization-options' contains several toggles related to + * personalizations. + */ +(function() { + +/** + * Must be kept in sync with the C++ enum of the same name. + * @enum {number} + */ +const NetworkPredictionOptions = { + ALWAYS: 0, + WIFI_ONLY: 1, + NEVER: 2, + DEFAULT: 1, +}; + +Polymer({ + is: 'settings-personalization-options', + + behaviors: [ + WebUIListenerBehavior, + ], + + properties: { + prefs: { + type: Object, + notify: true, + }, + + pageVisibility: Object, + + /** @private {chrome.settingsPrivate.PrefObject} */ + safeBrowsingExtendedReportingPref_: { + type: Object, + value: function() { + return /** @type {chrome.settingsPrivate.PrefObject} */ ({}); + }, + }, + + /** + * Used for HTML bindings. This is defined as a property rather than within + * the ready callback, because the value needs to be available before + * local DOM initialization - otherwise, the toggle has unexpected behavior. + * @private + */ + networkPredictionEnum_: { + type: Object, + value: NetworkPredictionOptions, + }, + + /** + * This flag is used to conditionally show a set of sync UIs to the + * profiles that have been migrated to have a unified consent flow. + * TODO(scottchen): In the future when all profiles are completely migrated, + * this should be removed, and UIs hidden behind it should become default. + * @private + */ + unifiedConsentEnabled_: { + type: Boolean, + value: function() { + return loadTimeData.getBoolean('unifiedConsentEnabled'); + }, + }, + + // <if expr="_google_chrome and not chromeos"> + // TODO(dbeam): make a virtual.* pref namespace and set/get this normally + // (but handled differently in C++). + /** @private {chrome.settingsPrivate.PrefObject} */ + metricsReportingPref_: { + type: Object, + value: function() { + // TODO(dbeam): this is basically only to appease PrefControlBehavior. + // Maybe add a no-validate attribute instead? This makes little sense. + return /** @type {chrome.settingsPrivate.PrefObject} */ ({}); + }, + }, + + /** @private */ + showRestart_: Boolean, + // </if> + }, + + /** @override */ + ready: function() { + this.browserProxy_ = settings.PrivacyPageBrowserProxyImpl.getInstance(); + + const setSber = this.setSafeBrowsingExtendedReporting_.bind(this); + this.addWebUIListener('safe-browsing-extended-reporting-change', setSber); + this.browserProxy_.getSafeBrowsingExtendedReporting().then(setSber); + + // <if expr="_google_chrome and not chromeos"> + const setMetricsReportingPref = this.setMetricsReportingPref_.bind(this); + this.addWebUIListener('metrics-reporting-change', setMetricsReportingPref); + this.browserProxy_.getMetricsReporting().then(setMetricsReportingPref); + // </if> + }, + + /** @private */ + onSberChange_: function() { + const enabled = this.$.safeBrowsingExtendedReportingControl.checked; + this.browserProxy_.setSafeBrowsingExtendedReportingEnabled(enabled); + }, + + /** + * @param {!Event} e + * @private + */ + onLanguageLinkBoxClick_: function(e) { + if (e.target.tagName === 'A') { + e.preventDefault(); + settings.navigateTo(settings.routes.LANGUAGES); + } + }, + + /** + * @param {!SberPrefState} sberPrefState SBER enabled and managed state. + * @private + */ + setSafeBrowsingExtendedReporting_: function(sberPrefState) { + // Ignore the next change because it will happen when we set the pref. + const pref = { + key: '', + type: chrome.settingsPrivate.PrefType.BOOLEAN, + value: sberPrefState.enabled, + }; + if (sberPrefState.managed) { + pref.enforcement = chrome.settingsPrivate.Enforcement.ENFORCED; + pref.controlledBy = chrome.settingsPrivate.ControlledBy.USER_POLICY; + } + this.safeBrowsingExtendedReportingPref_ = pref; + }, + + // <if expr="_google_chrome and not chromeos"> + /** @private */ + onMetricsReportingChange_: function() { + const enabled = this.$.metricsReportingControl.checked; + this.browserProxy_.setMetricsReportingEnabled(enabled); + }, + + /** + * @param {!MetricsReporting} metricsReporting + * @private + */ + setMetricsReportingPref_: function(metricsReporting) { + const hadPreviousPref = this.metricsReportingPref_.value !== undefined; + const pref = { + key: '', + type: chrome.settingsPrivate.PrefType.BOOLEAN, + value: metricsReporting.enabled, + }; + if (metricsReporting.managed) { + pref.enforcement = chrome.settingsPrivate.Enforcement.ENFORCED; + pref.controlledBy = chrome.settingsPrivate.ControlledBy.USER_POLICY; + } + + // Ignore the next change because it will happen when we set the pref. + this.metricsReportingPref_ = pref; + + // TODO(dbeam): remember whether metrics reporting was enabled when Chrome + // started. + if (metricsReporting.managed) + this.showRestart_ = false; + else if (hadPreviousPref) + this.showRestart_ = true; + }, + + /** + * @param {!Event} e + * @private + */ + onRestartTap_: function(e) { + e.stopPropagation(); + settings.LifetimeBrowserProxyImpl.getInstance().restart(); + }, + // </if> +}); +})();
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html index c938b42ff..3a3fdc6a 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.html +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html
@@ -33,6 +33,7 @@ <link rel="import" href="chrome://resources/cr_components/certificate_manager/certificate_manager.html"> </if> <link rel="import" href="privacy_page_browser_proxy.html"> +<link rel="import" href="personalization_options.html"> <dom-module id="settings-privacy-page"> <template> @@ -68,47 +69,9 @@ <div class="settings-box first"> <p class="privacy-explanation">$i18nRaw{improveBrowsingExperience}</p> </div> - <settings-toggle-button pref="{{prefs.alternate_error_pages.enabled}}" - label="$i18n{linkDoctorPref}"> - </settings-toggle-button> - <settings-toggle-button hidden="[[!pageVisibility.searchPrediction]]" - pref="{{prefs.search.suggest_enabled}}" - label="$i18n{searchSuggestPref}"> - </settings-toggle-button> - <settings-toggle-button hidden="[[!pageVisibility.networkPrediction]]" - pref="{{prefs.net.network_prediction_options}}" - label="$i18n{networkPredictionEnabled}" - numeric-unchecked-value="[[networkPredictionEnum_.NEVER]]"> - </settings-toggle-button> - <settings-toggle-button id="safeBrowsingExtendedReportingControl" - pref="[[safeBrowsingExtendedReportingPref_]]" - label="$i18n{safeBrowsingEnableExtendedReporting}" - on-settings-boolean-control-change="onSberChange_" - no-set-pref> - </settings-toggle-button> - <settings-toggle-button pref="{{prefs.safebrowsing.enabled}}" - label="$i18n{safeBrowsingEnableProtection}"> - </settings-toggle-button> -<if expr="_google_chrome"> -<if expr="chromeos"> - <settings-toggle-button pref="{{prefs.cros.metrics.reportingEnabled}}" - label="$i18n{enableLogging}"> - </settings-toggle-button> -</if><!-- chromeos --> -<if expr="not chromeos"> - <settings-toggle-button id="metricsReportingControl" - pref="[[metricsReportingPref_]]" label="$i18n{enableLogging}" - on-settings-boolean-control-change="onMetricsReportingChange_" - no-set-pref> - <template is="dom-if" if="[[showRestart_]]" restamp> - <paper-button on-click="onRestartTap_" id="restart" - slot="more-actions"> - $i18n{restart} - </paper-button> - </template> - </settings-toggle-button> -</if><!-- not chromeos --> -</if><!-- _google_chrome --> + <settings-personalization-options prefs="{{prefs}}" + page-visibility="[[pageVisibility]]"> + </settings-personalization-options> <settings-toggle-button id="doNotTrack" pref="{{prefs.enable_do_not_track}}" label="$i18n{doNotTrack}" on-settings-boolean-control-change="onDoNotTrackChange_" @@ -124,13 +87,6 @@ label="$i18n{wakeOnWifi}"> </settings-toggle-button> </if> -<if expr="_google_chrome"> - <settings-toggle-button - pref="{{prefs.spellcheck.use_spelling_service}}" - label="$i18n{spellingPref}" - sub-label="$i18n{spellingDescription}"> - </settings-toggle-button> -</if> <if expr="use_nss_certs or is_win or is_macosx"> <div id="manageCertificates" class="settings-box two-line" actionable on-click="onManageCertificatesTap_">
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.js b/chrome/browser/resources/settings/privacy_page/privacy_page.js index c8a41ea..d484ec80 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.js +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.js
@@ -9,17 +9,6 @@ */ (function() { -/** - * Must be kept in sync with the C++ enum of the same name. - * @enum {number} - */ -const NetworkPredictionOptions = { - ALWAYS: 0, - WIFI_ONLY: 1, - NEVER: 2, - DEFAULT: 1, -}; - Polymer({ is: 'settings-privacy-page', @@ -52,30 +41,6 @@ } }, - // <if expr="_google_chrome and not chromeos"> - // TODO(dbeam): make a virtual.* pref namespace and set/get this normally - // (but handled differently in C++). - /** @private {chrome.settingsPrivate.PrefObject} */ - metricsReportingPref_: { - type: Object, - value: function() { - // TODO(dbeam): this is basically only to appease PrefControlBehavior. - // Maybe add a no-validate attribute instead? This makes little sense. - return /** @type {chrome.settingsPrivate.PrefObject} */ ({}); - }, - }, - - showRestart_: Boolean, - // </if> - - /** @private {chrome.settingsPrivate.PrefObject} */ - safeBrowsingExtendedReportingPref_: { - type: Object, - value: function() { - return /** @type {chrome.settingsPrivate.PrefObject} */ ({}); - }, - }, - /** @private */ showClearBrowsingDataDialog_: Boolean, @@ -85,17 +50,6 @@ value: false, }, - /** - * Used for HTML bindings. This is defined as a property rather than within - * the ready callback, because the value needs to be available before - * local DOM initialization - otherwise, the toggle has unexpected behavior. - * @private - */ - networkPredictionEnum_: { - type: Object, - value: NetworkPredictionOptions, - }, - /** @private */ enableSafeBrowsingSubresourceFilter_: { type: Boolean, @@ -168,16 +122,6 @@ this.ContentSettingsTypes = settings.ContentSettingsTypes; this.browserProxy_ = settings.PrivacyPageBrowserProxyImpl.getInstance(); - - // <if expr="_google_chrome and not chromeos"> - const setMetricsReportingPref = this.setMetricsReportingPref_.bind(this); - this.addWebUIListener('metrics-reporting-change', setMetricsReportingPref); - this.browserProxy_.getMetricsReporting().then(setMetricsReportingPref); - // </if> - - const setSber = this.setSafeBrowsingExtendedReporting_.bind(this); - this.addWebUIListener('safe-browsing-extended-reporting-change', setSber); - this.browserProxy_.getSafeBrowsingExtendedReporting().then(setSber); }, /** @protected */ @@ -295,74 +239,6 @@ cr.ui.focusWithoutInk(assert(this.$.clearBrowsingDataTrigger)); }, - /** @private */ - onSberChange_: function() { - const enabled = this.$.safeBrowsingExtendedReportingControl.checked; - this.browserProxy_.setSafeBrowsingExtendedReportingEnabled(enabled); - }, - - // <if expr="_google_chrome and not chromeos"> - /** @private */ - onMetricsReportingChange_: function() { - const enabled = this.$.metricsReportingControl.checked; - this.browserProxy_.setMetricsReportingEnabled(enabled); - }, - - /** - * @param {!MetricsReporting} metricsReporting - * @private - */ - setMetricsReportingPref_: function(metricsReporting) { - const hadPreviousPref = this.metricsReportingPref_.value !== undefined; - const pref = { - key: '', - type: chrome.settingsPrivate.PrefType.BOOLEAN, - value: metricsReporting.enabled, - }; - if (metricsReporting.managed) { - pref.enforcement = chrome.settingsPrivate.Enforcement.ENFORCED; - pref.controlledBy = chrome.settingsPrivate.ControlledBy.USER_POLICY; - } - - // Ignore the next change because it will happen when we set the pref. - this.metricsReportingPref_ = pref; - - // TODO(dbeam): remember whether metrics reporting was enabled when Chrome - // started. - if (metricsReporting.managed) - this.showRestart_ = false; - else if (hadPreviousPref) - this.showRestart_ = true; - }, - - /** - * @param {!Event} e - * @private - */ - onRestartTap_: function(e) { - e.stopPropagation(); - settings.LifetimeBrowserProxyImpl.getInstance().restart(); - }, - // </if> - - /** - * @param {!SberPrefState} sberPrefState SBER enabled and managed state. - * @private - */ - setSafeBrowsingExtendedReporting_: function(sberPrefState) { - // Ignore the next change because it will happen when we set the pref. - const pref = { - key: '', - type: chrome.settingsPrivate.PrefType.BOOLEAN, - value: sberPrefState.enabled, - }; - if (sberPrefState.managed) { - pref.enforcement = chrome.settingsPrivate.Enforcement.ENFORCED; - pref.controlledBy = chrome.settingsPrivate.ControlledBy.USER_POLICY; - } - this.safeBrowsingExtendedReportingPref_ = pref; - }, - /** * The sub-page title for the site or content settings. * @return {string}
diff --git a/chrome/browser/resources/settings/settings_resources.grd b/chrome/browser/resources/settings/settings_resources.grd index c6fcf83..e942ca9d 100644 --- a/chrome/browser/resources/settings/settings_resources.grd +++ b/chrome/browser/resources/settings/settings_resources.grd
@@ -921,6 +921,15 @@ <structure name="IDR_SETTINGS_PDF_DOCUMENTS_JS" file="site_settings/pdf_documents.js" type="chrome_html" /> + <structure name="IDR_SETTINGS_PERSONALIZATION_OPTIONS_HTML" + file="privacy_page/personalization_options.html" + type="chrome_html" + preprocess="true" + allowexternalscript="true" /> + <structure name="IDR_SETTINGS_PERSONALIZATION_OPTIONS_JS" + file="privacy_page/personalization_options.js" + preprocess="true" + type="chrome_html" /> <structure name="IDR_SETTINGS_PRIVACY_PAGE_HTML" file="privacy_page/privacy_page.html" type="chrome_html"
diff --git a/chrome/browser/ssl/ssl_browsertest.cc b/chrome/browser/ssl/ssl_browsertest.cc index 5535fb5..15654c8 100644 --- a/chrome/browser/ssl/ssl_browsertest.cc +++ b/chrome/browser/ssl/ssl_browsertest.cc
@@ -5472,19 +5472,21 @@ restored_entry->SetPageState(entry->GetPageState()); WebContents::CreateParams params(tab->GetBrowserContext()); - WebContents* tab2 = WebContents::Create(params); - tab->GetDelegate()->AddNewContents(nullptr, tab2, + std::unique_ptr<WebContents> tab2 = + base::WrapUnique(WebContents::Create(params)); + WebContents* raw_tab2 = tab2.get(); + tab->GetDelegate()->AddNewContents(nullptr, std::move(tab2), WindowOpenDisposition::NEW_FOREGROUND_TAB, gfx::Rect(), false, nullptr); std::vector<std::unique_ptr<NavigationEntry>> entries; entries.push_back(std::move(restored_entry)); - content::TestNavigationObserver observer(tab2); - tab2->GetController().Restore( + content::TestNavigationObserver observer(raw_tab2); + raw_tab2->GetController().Restore( entries.size() - 1, content::RestoreType::LAST_SESSION_EXITED_CLEANLY, &entries); - tab2->GetController().LoadIfNecessary(); + raw_tab2->GetController().LoadIfNecessary(); observer.Wait(); - CheckAuthenticatedState(tab2, AuthState::NONE); + CheckAuthenticatedState(raw_tab2, AuthState::NONE); } void SetupRestoredTabWithNavigation(
diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc index e080ac8..4b3671d 100644 --- a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc +++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
@@ -26,7 +26,6 @@ #include "chrome/browser/ui/webui/signin/login_ui_test_utils.h" #include "chrome/common/channel_info.h" #include "chrome/common/chrome_switches.h" -#include "components/browser_sync/profile_sync_service.h" #include "components/invalidation/impl/p2p_invalidation_service.h" #include "components/sync/base/progress_marker_map.h" #include "components/sync/driver/about_sync_util.h" @@ -243,10 +242,13 @@ return true; } -bool ProfileSyncServiceHarness::RestartSyncService() { +void ProfileSyncServiceHarness::StopSyncService( + syncer::SyncService::SyncStopDataFate data_fate) { DVLOG(1) << "Requesting stop for service."; - service()->RequestStop(ProfileSyncService::CLEAR_DATA); + service()->RequestStop(data_fate); +} +bool ProfileSyncServiceHarness::StartSyncService() { std::unique_ptr<syncer::SyncSetupInProgressHandle> blocker = service()->GetSetupInProgressHandle(); DVLOG(1) << "Requesting start for service";
diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.h b/chrome/browser/sync/test/integration/profile_sync_service_harness.h index bd56e5b8a..8d6867a 100644 --- a/chrome/browser/sync/test/integration/profile_sync_service_harness.h +++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.h
@@ -11,15 +11,12 @@ #include "base/compiler_specific.h" #include "base/macros.h" +#include "components/browser_sync/profile_sync_service.h" #include "components/sync/base/model_type.h" #include "components/sync/engine/cycle/sync_cycle_snapshot.h" class Profile; -namespace browser_sync { -class ProfileSyncService; -} // namespace browser_sync - namespace syncer { class SyncSetupInProgressHandle; } // namespace syncer @@ -55,7 +52,7 @@ // Setup sync without the authenticating through the passphrase encryption. // Use this method when you need to setup a client that you're going to call - // RestartSyncService() directly after. + // StopSyncService(), StartSyncService() directly after. bool SetupSyncForClearingServerData(); // Both SetupSync and SetupSyncForClear call into this method. @@ -64,10 +61,20 @@ bool SetupSync(syncer::ModelTypeSet synced_datatypes, bool skip_passphrase_verification = false); - // Restart sync service to simulate a sign-in/sign-out. This is useful - // to recover from a lost birthday. Use directly after a clear server data - // command to start from clean slate. - bool RestartSyncService(); + // Methods to stop and restart the sync service. + // + // For example, this can be used to simulate a sign-in/sign-out or can be + // useful to recover from a lost birthday. + // To start from a clear slate, clear server + // data first, then call StopSyncService(syncer::SyncService::CLEAR_DATA) + // followed by StartSyncService(). + // To simulate the user being offline for a while, call + // StopSyncService(syncer::SyncService::KEEP_DATA) followed by + // StartSyncService(); + // Stops the sync service. + void StopSyncService(syncer::SyncService::SyncStopDataFate data_fate); + // Starts the sync service after a previous stop. + bool StartSyncService(); // Sign out of sync service. void SignoutSyncService();
diff --git a/chrome/browser/sync/test/integration/single_client_polling_sync_test.cc b/chrome/browser/sync/test/integration/single_client_polling_sync_test.cc new file mode 100644 index 0000000..f63fba1 --- /dev/null +++ b/chrome/browser/sync/test/integration/single_client_polling_sync_test.cc
@@ -0,0 +1,109 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/macros.h" +#include "base/run_loop.h" +#include "build/build_config.h" +#include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" +#include "chrome/browser/sync/test/integration/session_hierarchy_match_checker.h" +#include "chrome/browser/sync/test/integration/sessions_helper.h" +#include "chrome/browser/sync/test/integration/sync_test.h" +#include "chrome/common/webui_url_constants.h" +#include "components/browser_sync/profile_sync_service.h" +#include "components/sync/base/sync_prefs.h" +#include "components/sync/engine/polling_constants.h" +#include "components/sync/protocol/client_commands.pb.h" +#include "testing/gmock/include/gmock/gmock.h" + +using testing::Eq; +using sessions_helper::CheckInitialState; +using sessions_helper::OpenTab; +using syncer::SyncPrefs; + +namespace { + +class SingleClientPollingSyncTest : public SyncTest { + public: + SingleClientPollingSyncTest() : SyncTest(SINGLE_CLIENT) {} + ~SingleClientPollingSyncTest() override {} + + private: + DISALLOW_COPY_AND_ASSIGN(SingleClientPollingSyncTest); +}; + +// This test verifies that the poll intervals in prefs get initialized if no +// data is available yet. +IN_PROC_BROWSER_TEST_F(SingleClientPollingSyncTest, ShouldInitializePollPrefs) { + // Setup clients and verify no poll intervals are present yet. + ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; + SyncPrefs sync_prefs(GetProfile(0)->GetPrefs()); + EXPECT_TRUE(sync_prefs.GetShortPollInterval().is_zero()); + EXPECT_TRUE(sync_prefs.GetLongPollInterval().is_zero()); + ASSERT_TRUE(sync_prefs.GetLastPollTime().is_null()); + + // Execute a sync cycle and verify the client set up (and persisted) the + // default values. + ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; + EXPECT_THAT(sync_prefs.GetShortPollInterval().InSeconds(), + Eq(syncer::kDefaultShortPollIntervalSeconds)); + EXPECT_THAT(sync_prefs.GetLongPollInterval().InSeconds(), + Eq(syncer::kDefaultLongPollIntervalSeconds)); +} + +// This test verifies that updates of the poll intervals get persisted +// That's important make sure clients with short live times will eventually poll +// (e.g. Android). +IN_PROC_BROWSER_TEST_F(SingleClientPollingSyncTest, ShouldUpdatePollPrefs) { + ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; + + sync_pb::ClientCommand client_command; + client_command.set_set_sync_poll_interval(67); + client_command.set_set_sync_long_poll_interval(199); + GetFakeServer()->SetClientCommand(client_command); + + // Trigger a sync-cycle. + ASSERT_TRUE(CheckInitialState(0)); + ASSERT_TRUE(OpenTab(0, GURL(chrome::kChromeUIHistoryURL))); + SessionHierarchyMatchChecker checker( + fake_server::SessionsHierarchy( + {{GURL(chrome::kChromeUIHistoryURL).spec()}}), + GetSyncService(0), GetFakeServer()); + ASSERT_TRUE(checker.Wait()); + + SyncPrefs sync_prefs(GetProfile(0)->GetPrefs()); + EXPECT_THAT(sync_prefs.GetShortPollInterval().InSeconds(), Eq(67)); + EXPECT_THAT(sync_prefs.GetLongPollInterval().InSeconds(), Eq(199)); +} + +IN_PROC_BROWSER_TEST_F(SingleClientPollingSyncTest, + ShouldUsePollIntervalsFromPrefs) { + // Setup clients and provide new poll intervals via prefs. + ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; + SyncPrefs sync_prefs(GetProfile(0)->GetPrefs()); + sync_prefs.SetShortPollInterval(base::TimeDelta::FromSeconds(123)); + sync_prefs.SetLongPollInterval(base::TimeDelta::FromSeconds(1234)); + + // Execute a sync cycle and verify this cycle used those intervals. + // This test assumes the SyncScheduler reads the actual intervals from the + // context. This is covered in the SyncSchedulerImpl's unittest. + ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; + EXPECT_THAT( + GetClient(0)->GetLastCycleSnapshot().short_poll_interval().InSeconds(), + Eq(123)); + EXPECT_THAT( + GetClient(0)->GetLastCycleSnapshot().long_poll_interval().InSeconds(), + Eq(1234)); +} + +// TODO(tschumann): Add a test that tests a poll on start-up in a simpler set +// up: Bring up a single client, let it sync a local mode and do a fake restart. +// After that, GetLastCycleSnapshot() should be an empty snapshot, so the we can +// use the UpdatedProgressMarker checker to verify a poll has taken place. This +// might require changing +// UpdatedProgressMarkerChecker::IsExitConditionSatisfied() to require non-empty +// progress markers. +// This test could also verify that the last poll time gets not simply set +// to the start-up time but kept if not yet expired. + +} // namespace
diff --git a/chrome/browser/sync/test/integration/single_client_user_events_sync_test.cc b/chrome/browser/sync/test/integration/single_client_user_events_sync_test.cc index bdce1e9..96f386a 100644 --- a/chrome/browser/sync/test/integration/single_client_user_events_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_user_events_sync_test.cc
@@ -360,7 +360,8 @@ event_service->RecordUserEvent(testEvent1); event_service->RecordUserEvent(consent1); - ASSERT_TRUE(GetClient(0)->RestartSyncService()); + GetClient(0)->StopSyncService(syncer::SyncService::CLEAR_DATA); + ASSERT_TRUE(GetClient(0)->StartSyncService()); EXPECT_TRUE(ExpectUserEvents({consent1})); }
diff --git a/chrome/browser/sync/test/integration/sync_client_command_test.cc b/chrome/browser/sync/test/integration/sync_client_command_test.cc deleted file mode 100644 index 89c968c5..0000000 --- a/chrome/browser/sync/test/integration/sync_client_command_test.cc +++ /dev/null
@@ -1,91 +0,0 @@ -// Copyright (c) 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/macros.h" -#include "base/run_loop.h" -#include "build/build_config.h" - -#include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" -#include "chrome/browser/sync/test/integration/session_hierarchy_match_checker.h" -#include "chrome/browser/sync/test/integration/sessions_helper.h" -#include "chrome/browser/sync/test/integration/sync_test.h" -#include "chrome/common/webui_url_constants.h" -#include "components/sync/base/sync_prefs.h" -#include "components/sync/engine/polling_constants.h" -#include "components/sync/protocol/client_commands.pb.h" -#include "components/sync/test/fake_server/sessions_hierarchy.h" - -#include "components/sync/protocol/client_commands.pb.h" - -using sessions_helper::CheckInitialState; -using sessions_helper::OpenTab; -using syncer::SyncPrefs; - -namespace { - -class SyncClientCommandTest : public SyncTest { - public: - SyncClientCommandTest() : SyncTest(SINGLE_CLIENT) {} - ~SyncClientCommandTest() override {} - - private: - DISALLOW_COPY_AND_ASSIGN(SyncClientCommandTest); -}; - -IN_PROC_BROWSER_TEST_F(SyncClientCommandTest, ShouldPersistPollIntervals) { - // Setup clients and verify no poll intervals are present yet. - ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; - std::unique_ptr<SyncPrefs> sync_prefs = - std::make_unique<SyncPrefs>(GetProfile(0)->GetPrefs()); - EXPECT_TRUE(sync_prefs->GetShortPollInterval().is_zero()); - EXPECT_TRUE(sync_prefs->GetLongPollInterval().is_zero()); - - // Execute a sync cycle and verify the client set up (and persisted) the - // default values. - ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; - EXPECT_EQ(sync_prefs->GetShortPollInterval().InSeconds(), - syncer::kDefaultShortPollIntervalSeconds); - EXPECT_EQ(sync_prefs->GetLongPollInterval().InSeconds(), - syncer::kDefaultLongPollIntervalSeconds); - - // Simulate server-provided poll intervals and make sure they get persisted. - sync_pb::ClientCommand client_command; - client_command.set_set_sync_poll_interval(67); - client_command.set_set_sync_long_poll_interval(199); - GetFakeServer()->SetClientCommand(client_command); - - // Trigger a sync-cycle. - ASSERT_TRUE(CheckInitialState(0)); - ASSERT_TRUE(OpenTab(0, GURL(chrome::kChromeUIHistoryURL))); - SessionHierarchyMatchChecker checker( - fake_server::SessionsHierarchy( - {{GURL(chrome::kChromeUIHistoryURL).spec()}}), - GetSyncService(0), GetFakeServer()); - EXPECT_TRUE(checker.Wait()); - - EXPECT_EQ(sync_prefs->GetShortPollInterval().InSeconds(), 67); - EXPECT_EQ(sync_prefs->GetLongPollInterval().InSeconds(), 199); -} - -IN_PROC_BROWSER_TEST_F(SyncClientCommandTest, ShouldUsePollIntervalsFromPrefs) { - // Setup clients and provide new poll intervals via prefs. - ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; - std::unique_ptr<SyncPrefs> sync_prefs = - std::make_unique<SyncPrefs>(GetProfile(0)->GetPrefs()); - sync_prefs->SetShortPollInterval(base::TimeDelta::FromSeconds(123)); - sync_prefs->SetLongPollInterval(base::TimeDelta::FromSeconds(1234)); - - // Execute a sync cycle and verify this cycle used those intervals. - // This test assumes the SyncScheduler reads the actual intervals from the - // context. This is covered in the SyncSchedulerImpl's unittest. - ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; - EXPECT_EQ( - 123, - GetClient(0)->GetLastCycleSnapshot().short_poll_interval().InSeconds()); - EXPECT_EQ( - 1234, - GetClient(0)->GetLastCycleSnapshot().long_poll_interval().InSeconds()); -} - -} // namespace
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index 9d162524..6ea2dd9 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -198,7 +198,6 @@ server_type_(SERVER_TYPE_UNDECIDED), previous_profile_(nullptr), num_clients_(-1), - configuration_refresher_(std::make_unique<ConfigurationRefresher>()), use_verifier_(true), create_gaia_account_at_runtime_(false) { sync_datatype_helper::AssociateWithTest(this); @@ -611,7 +610,12 @@ InitializeInvalidations(index); } +void SyncTest::DisableNotificationsForClient(int index) { + fake_server_->RemoveObserver(fake_server_invalidation_services_[index]); +} + void SyncTest::InitializeInvalidations(int index) { + configuration_refresher_ = std::make_unique<ConfigurationRefresher>(); if (UsingExternalServers()) { // DO NOTHING. External live sync servers use GCM to notify profiles of any // invalidations in sync'ed data. In this case, to notify other profiles of @@ -1168,6 +1172,10 @@ GetSyncService(index)->TriggerRefresh(model_types); } +void SyncTest::StopConfigurationRefresher() { + configuration_refresher_.reset(); +} + arc::SyncArcPackageHelper* SyncTest::sync_arc_helper() { #if defined(OS_CHROMEOS) return arc::SyncArcPackageHelper::GetInstance(); @@ -1189,5 +1197,6 @@ // Our birthday is invalidated on the server here so restart sync to get // the new birthday from the server. - return harness->RestartSyncService(); + harness->StopSyncService(syncer::SyncService::CLEAR_DATA); + return harness->StartSyncService(); }
diff --git a/chrome/browser/sync/test/integration/sync_test.h b/chrome/browser/sync/test/integration/sync_test.h index fbd22670..7ddacb2 100644 --- a/chrome/browser/sync/test/integration/sync_test.h +++ b/chrome/browser/sync/test/integration/sync_test.h
@@ -250,6 +250,11 @@ // Triggers a sync for the given |model_types| for the Profile at |index|. void TriggerSyncForModelTypes(int index, syncer::ModelTypeSet model_types); + // The configuration refresher is triggering refreshes after the configuration + // phase is done (during start-up). Call this function before SetupSync() to + // avoid its effects. + void StopConfigurationRefresher(); + arc::SyncArcPackageHelper* sync_arc_helper(); protected: @@ -277,6 +282,9 @@ // used for UI Signin. Blocks until profile is created. static Profile* MakeProfileForUISignin(base::FilePath profile_path); + // Stops notificatinos being sent to a client. + void DisableNotificationsForClient(int index); + base::test::ScopedFeatureList feature_list_; // GAIA account used by the test case.
diff --git a/chrome/browser/sync/test/integration/two_client_polling_sync_test.cc b/chrome/browser/sync/test/integration/two_client_polling_sync_test.cc new file mode 100644 index 0000000..0ec54c4 --- /dev/null +++ b/chrome/browser/sync/test/integration/two_client_polling_sync_test.cc
@@ -0,0 +1,110 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/macros.h" +#include "base/run_loop.h" +#include "build/build_config.h" +#include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" +#include "chrome/browser/sync/test/integration/session_hierarchy_match_checker.h" +#include "chrome/browser/sync/test/integration/sessions_helper.h" +#include "chrome/browser/sync/test/integration/sync_test.h" +#include "chrome/common/webui_url_constants.h" +#include "components/browser_sync/profile_sync_service.h" +#include "components/sync/base/sync_prefs.h" +#include "components/sync/engine/polling_constants.h" +#include "components/sync/protocol/client_commands.pb.h" +#include "components/sync/test/fake_server/sessions_hierarchy.h" +#include "testing/gmock/include/gmock/gmock.h" + +using sessions_helper::CheckInitialState; +using sessions_helper::OpenTab; +using syncer::SyncPrefs; +using testing::Gt; + +namespace { + +const char kURL1[] = "data:text/html,<html><title>Test</title></html>"; + +class TwoClientPollingSyncTest : public SyncTest { + public: + TwoClientPollingSyncTest() : SyncTest(TWO_CLIENT) {} + ~TwoClientPollingSyncTest() override {} + + private: + DISALLOW_COPY_AND_ASSIGN(TwoClientPollingSyncTest); +}; + +class SessionCountMatchChecker : public SingleClientStatusChangeChecker { + public: + SessionCountMatchChecker(int expected_count, + browser_sync::ProfileSyncService* service, + fake_server::FakeServer* fake_server) + : SingleClientStatusChangeChecker(service), + expected_count_(expected_count), + verifier_(fake_server) {} + + // StatusChangeChecker implementation. + bool IsExitConditionSatisfied() override { + return verifier_.VerifyEntityCountByType(expected_count_, syncer::SESSIONS); + } + + std::string GetDebugMessage() const override { + return "Waiting for a matching number of sessions to be refleted on the " + "fake server."; + } + + private: + const int expected_count_; + fake_server::FakeServerVerifier verifier_; +}; + +// This test writes from one client (0) and makes sure the data arrives +// on a remote client (1) even if notifications don't work. +// Because the initial run of sync is doing a number of extra sync cycles, +// this test is structured in 2 phases. In the first phase, we simply bring +// up two clients and have them sync some data. +// In the seconed phase, we take down client 1 and while it's down upload more +// data from client 0. That second phase will rely on polling on client 1 to +// receive the update. +IN_PROC_BROWSER_TEST_F(TwoClientPollingSyncTest, ShouldPollOnStartup) { + ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; + + // Phase 1. + ASSERT_TRUE(CheckInitialState(0)); + ASSERT_TRUE(CheckInitialState(1)); + ASSERT_TRUE(OpenTab(0, GURL(chrome::kChromeUIHistoryURL))); + GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)); + + // Phase 2. + // Disconnect client 1 from sync and write another change from client 0. + // Disconnnect the remote client from the invalidation service. + DisableNotificationsForClient(1); + // Make sure no extra sync cycles get triggered by test infrastructure. + StopConfigurationRefresher(); + GetClient(1)->StopSyncService(syncer::SyncService::KEEP_DATA); + + ASSERT_TRUE(OpenTab(0, GURL(kURL1))); + SessionCountMatchChecker server_checker(4, GetSyncService(0), + GetFakeServer()); + EXPECT_TRUE(server_checker.Wait()); + + // Now start up the remote client (make sure it should start a poll after + // start-up) and verify it receives the latest changes and the poll cycle + // updated the last-poll-time. + // All data is already there, so we can get it in the first poll. Choose + // larger intervals to verify the poll-on-start logic. + SyncPrefs remote_prefs(GetProfile(1)->GetPrefs()); + remote_prefs.SetShortPollInterval(base::TimeDelta::FromMinutes(2)); + remote_prefs.SetLongPollInterval(base::TimeDelta::FromMinutes(2)); + base::Time remote_start = base::Time::Now(); + base::Time new_last_poll_time = base::Time::Now() - + base::TimeDelta::FromMinutes(2) - + base::TimeDelta::FromMilliseconds(100); + remote_prefs.SetLastPollTime(new_last_poll_time); + ASSERT_TRUE(GetClient(1)->StartSyncService()) << "SetupSync() failed."; + GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)); + EXPECT_THAT(remote_prefs.GetLastPollTime(), Gt(remote_start)); +} + +} // namespace
diff --git a/chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc b/chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc index b2179e57..5e49228 100644 --- a/chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc +++ b/chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc
@@ -295,13 +295,8 @@ } // https://crbug.com/832981 -#if defined(OS_CHROMEOS) -#define MAYBE_StartupTracingThrottle DISABLED_StartupTracingThrottle -#else -#define MAYBE_StartupTracingThrottle StartupTracingThrottle -#endif IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTestOnStartup, - MAYBE_StartupTracingThrottle) { + DISABLED_StartupTracingThrottle) { // The startup scenario should *not* be started, since not enough // time has elapsed since the last upload (set in the PRE_ above). EXPECT_FALSE(
diff --git a/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager.cc b/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager.cc index 8d6008b..3bec03d5 100644 --- a/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager.cc +++ b/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager.cc
@@ -164,11 +164,11 @@ const base::Value* access_permision_list_value = arc_app_list_prefs_->GetPackagePrefs(package, kUsbAccessPermission); if (!access_permision_list_value) - return; + continue; if (!access_permision_list_value->is_list()) { LOG(ERROR) << "Wrong value type found for device access permission list."; - return; + continue; } for (const auto& access_permision :
diff --git a/chrome/browser/ui/apps/chrome_app_delegate.cc b/chrome/browser/ui/apps/chrome_app_delegate.cc index a3fd28a..8fedda5e 100644 --- a/chrome/browser/ui/apps/chrome_app_delegate.cc +++ b/chrome/browser/ui/apps/chrome_app_delegate.cc
@@ -125,11 +125,18 @@ NewWindowContentsDelegate() {} ~NewWindowContentsDelegate() override {} + void BecomeOwningDeletageOf( + std::unique_ptr<content::WebContents> web_contents) { + web_contents->SetDelegate(this); + owned_contents_.push_back(std::move(web_contents)); + } + content::WebContents* OpenURLFromTab( content::WebContents* source, const content::OpenURLParams& params) override; private: + std::vector<std::unique_ptr<content::WebContents>> owned_contents_; DISALLOW_COPY_AND_ASSIGN(NewWindowContentsDelegate); }; @@ -144,7 +151,16 @@ // NewWindowContentsDelegate actually sees the WebContents. Here ownership // is captured and passed to OpenURLAfterCheckIsDefaultBrowser(), which // destroys it after the default browser worker completes. - std::unique_ptr<content::WebContents> source_ptr(source); + std::unique_ptr<content::WebContents> owned_source; + for (auto it = owned_contents_.begin(); it != owned_contents_.end(); ++it) { + if (it->get() == source) { + owned_source = std::move(*it); + owned_contents_.erase(it); + break; + } + } + DCHECK(owned_source); + // Object lifetime notes: StartCheckIsDefault() takes lifetime ownership of // check_if_default_browser_worker and will clean up after the asynchronous // tasks. @@ -152,7 +168,7 @@ check_if_default_browser_worker = new shell_integration::DefaultBrowserWorker( base::Bind(&OpenURLAfterCheckIsDefaultBrowser, - base::Passed(&source_ptr), params)); + base::Passed(&owned_source), params)); check_if_default_browser_worker->StartCheckIsDefault(); } return NULL; @@ -226,19 +242,22 @@ return OpenURLFromTabInternal(context, params); } -void ChromeAppDelegate::AddNewContents(content::BrowserContext* context, - content::WebContents* new_contents, - WindowOpenDisposition disposition, - const gfx::Rect& initial_rect, - bool user_gesture) { +void ChromeAppDelegate::AddNewContents( + content::BrowserContext* context, + std::unique_ptr<content::WebContents> new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_rect, + bool user_gesture) { if (!disable_external_open_for_testing_) { // We don't really want to open a window for |new_contents|, but we need to // capture its intended navigation. Here we give ownership to the // NewWindowContentsDelegate, which will dispose of the contents once // a navigation is captured. - new_contents->SetDelegate(new_window_contents_delegate_.get()); + new_window_contents_delegate_->BecomeOwningDeletageOf( + std::move(new_contents)); return; } + chrome::ScopedTabbedBrowserDisplayer displayer( Profile::FromBrowserContext(context)); // Force all links to open in a new tab, even if they were trying to open a @@ -246,8 +265,8 @@ disposition = disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB ? disposition : WindowOpenDisposition::NEW_FOREGROUND_TAB; - chrome::AddWebContents(displayer.browser(), NULL, new_contents, disposition, - initial_rect, user_gesture); + chrome::AddWebContents(displayer.browser(), NULL, std::move(new_contents), + disposition, initial_rect, user_gesture); } content::ColorChooser* ChromeAppDelegate::ShowColorChooser(
diff --git a/chrome/browser/ui/apps/chrome_app_delegate.h b/chrome/browser/ui/apps/chrome_app_delegate.h index 830c910c..bdebbac9 100644 --- a/chrome/browser/ui/apps/chrome_app_delegate.h +++ b/chrome/browser/ui/apps/chrome_app_delegate.h
@@ -48,7 +48,7 @@ content::WebContents* source, const content::OpenURLParams& params) override; void AddNewContents(content::BrowserContext* context, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture) override;
diff --git a/chrome/browser/ui/ash/launcher/crostini_app_window_shelf_controller.cc b/chrome/browser/ui/ash/launcher/crostini_app_window_shelf_controller.cc index 23d6439..1844a81 100644 --- a/chrome/browser/ui/ash/launcher/crostini_app_window_shelf_controller.cc +++ b/chrome/browser/ui/ash/launcher/crostini_app_window_shelf_controller.cc
@@ -15,7 +15,9 @@ #include "chrome/browser/ui/ash/launcher/app_window_base.h" #include "chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h" #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" +#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" #include "components/exo/shell_surface.h" +#include "components/user_manager/user_manager.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/env.h" #include "ui/base/base_window.h" @@ -39,6 +41,59 @@ env->RemoveObserver(this); } +void CrostiniAppWindowShelfController::AddToShelf(aura::Window* window, + AppWindowBase* app_window) { + ash::ShelfID shelf_id = app_window->shelf_id(); + AppWindowLauncherItemController* item_controller = + owner()->shelf_model()->GetAppWindowLauncherItemController(shelf_id); + if (item_controller == nullptr) { + auto controller = + std::make_unique<AppWindowLauncherItemController>(shelf_id); + item_controller = controller.get(); + if (!owner()->GetItem(shelf_id)) { + owner()->CreateAppLauncherItem(std::move(controller), + ash::STATUS_RUNNING); + } else { + owner()->shelf_model()->SetShelfItemDelegate(shelf_id, + std::move(controller)); + owner()->SetItemStatus(shelf_id, ash::STATUS_RUNNING); + } + window->SetProperty(ash::kShelfIDKey, + new std::string(shelf_id.Serialize())); + } + + item_controller->AddWindow(app_window); + app_window->SetController(item_controller); +} + +void CrostiniAppWindowShelfController::RemoveFromShelf( + aura::Window* window, + AppWindowBase* app_window) { + UnregisterAppWindow(app_window); + + // Check if we may close controller now, at this point we can safely remove + // controllers without window. + AppWindowLauncherItemController* item_controller = + owner()->shelf_model()->GetAppWindowLauncherItemController( + app_window->shelf_id()); + + if (item_controller != nullptr && item_controller->window_count() == 0) + owner()->CloseLauncherItem(item_controller->shelf_id()); +} + +void CrostiniAppWindowShelfController::ActiveUserChanged( + const std::string& user_email) { + for (auto& w : aura_window_to_app_window_) { + if (MultiUserWindowManager::GetInstance() + ->GetWindowOwner(w.first) + .GetUserEmail() == user_email) { + AddToShelf(w.first, w.second.get()); + } else { + RemoveFromShelf(w.first, w.second.get()); + } + } +} + void CrostiniAppWindowShelfController::OnWindowInitialized( aura::Window* window) { // An Crostini window has type WINDOW_TYPE_NORMAL, a WindowDelegate and @@ -69,6 +124,7 @@ exo::ShellSurface::GetApplicationId(window); if (window_app_id == nullptr) return; + crostini::CrostiniRegistryService* registry_service = crostini::CrostiniRegistryServiceFactory::GetForProfile( owner()->profile()); @@ -78,6 +134,10 @@ if (shelf_app_id.empty()) return; + // Prevent Crostini window from showing up after user switch. + MultiUserWindowManager::GetInstance()->SetWindowOwner( + window, + user_manager::UserManager::Get()->GetActiveUser()->GetAccountId()); RegisterAppWindow(window, shelf_app_id); } @@ -89,27 +149,7 @@ aura_window_to_app_window_[window] = std::make_unique<AppWindowBase>(shelf_id, widget); AppWindowBase* app_window = aura_window_to_app_window_[window].get(); - - AppWindowLauncherItemController* item_controller = - owner()->shelf_model()->GetAppWindowLauncherItemController(shelf_id); - if (item_controller == nullptr) { - auto controller = - std::make_unique<AppWindowLauncherItemController>(shelf_id); - item_controller = controller.get(); - if (!owner()->GetItem(shelf_id)) { - owner()->CreateAppLauncherItem(std::move(controller), - ash::STATUS_RUNNING); - } else { - owner()->shelf_model()->SetShelfItemDelegate(shelf_id, - std::move(controller)); - owner()->SetItemStatus(shelf_id, ash::STATUS_RUNNING); - } - window->SetProperty(ash::kShelfIDKey, - new std::string(shelf_id.Serialize())); - } - - item_controller->AddWindow(app_window); - app_window->SetController(item_controller); + AddToShelf(window, app_window); } void CrostiniAppWindowShelfController::OnWindowDestroying( @@ -123,16 +163,8 @@ auto app_window_it = aura_window_to_app_window_.find(window); if (app_window_it == aura_window_to_app_window_.end()) return; - UnregisterAppWindow(app_window_it->second.get()); - // Check if we may close controller now, at this point we can safely remove - // controllers without window. - AppWindowLauncherItemController* item_controller = - owner()->shelf_model()->GetAppWindowLauncherItemController( - app_window_it->second->shelf_id()); - - if (item_controller != nullptr && item_controller->window_count() == 0) - owner()->CloseLauncherItem(item_controller->shelf_id()); + RemoveFromShelf(window, app_window_it->second.get()); aura_window_to_app_window_.erase(app_window_it); }
diff --git a/chrome/browser/ui/ash/launcher/crostini_app_window_shelf_controller.h b/chrome/browser/ui/ash/launcher/crostini_app_window_shelf_controller.h index 6dac2b6..cbfc17088 100644 --- a/chrome/browser/ui/ash/launcher/crostini_app_window_shelf_controller.h +++ b/chrome/browser/ui/ash/launcher/crostini_app_window_shelf_controller.h
@@ -34,6 +34,9 @@ explicit CrostiniAppWindowShelfController(ChromeLauncherController* owner); ~CrostiniAppWindowShelfController() override; + // AppWindowLauncherController: + void ActiveUserChanged(const std::string& user_email) override; + // aura::EnvObserver: void OnWindowInitialized(aura::Window* window) override; @@ -47,6 +50,8 @@ void RegisterAppWindow(aura::Window* window, const std::string& shelf_app_id); void UnregisterAppWindow(AppWindowBase* app_window); + void AddToShelf(aura::Window* window, AppWindowBase* app_window); + void RemoveFromShelf(aura::Window* window, AppWindowBase* app_window); // AppWindowLauncherController: AppWindowLauncherItemController* ControllerForWindow(
diff --git a/chrome/browser/ui/ash/login_screen_client.cc b/chrome/browser/ui/ash/login_screen_client.cc index 199d03f..0a5263b 100644 --- a/chrome/browser/ui/ash/login_screen_client.cc +++ b/chrome/browser/ui/ash/login_screen_client.cc
@@ -13,6 +13,7 @@ #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" #include "chrome/browser/profiles/profile_metrics.h" #include "chrome/browser/ui/ash/wallpaper_controller_client.h" +#include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" #include "components/user_manager/remove_user_delegate.h" #include "content/public/common/service_manager_connection.h" #include "services/service_manager/public/cpp/connector.h" @@ -24,7 +25,8 @@ LoginScreenClient::Delegate::Delegate() = default; LoginScreenClient::Delegate::~Delegate() = default; -LoginScreenClient::LoginScreenClient() : binding_(this) { +LoginScreenClient::LoginScreenClient() + : binding_(this), weak_ptr_factory_(this) { content::ServiceManagerConnection::GetForProcess() ->GetConnector() ->BindInterface(ash::mojom::kServiceName, &login_screen_); @@ -136,6 +138,15 @@ delegate_->HandleLaunchPublicSession(account_id, locale, input_method); } +void LoginScreenClient::RequestPublicSessionKeyboardLayouts( + const AccountId& account_id, + const std::string& locale) { + chromeos::GetKeyboardLayoutsForLocale( + base::BindRepeating(&LoginScreenClient::SetPublicSessionKeyboardLayout, + weak_ptr_factory_.GetWeakPtr(), account_id, locale), + locale); +} + void LoginScreenClient::LoadWallpaper(const AccountId& account_id) { WallpaperControllerClient::Get()->ShowUserWallpaper(account_id); } @@ -158,3 +169,33 @@ RecordReauthReason(account_id, chromeos::ReauthReason::INCORRECT_PASSWORD_ENTERED); } + +void LoginScreenClient::SetPublicSessionKeyboardLayout( + const AccountId& account_id, + const std::string& locale, + std::unique_ptr<base::ListValue> keyboard_layouts) { + std::vector<ash::mojom::InputMethodItemPtr> result; + + for (const auto& i : *keyboard_layouts) { + const base::DictionaryValue* dictionary; + if (!i.GetAsDictionary(&dictionary)) + continue; + + ash::mojom::InputMethodItemPtr input_method_item = + ash::mojom::InputMethodItem::New(); + std::string ime_id; + dictionary->GetString("value", &ime_id); + input_method_item->ime_id = ime_id; + + std::string title; + dictionary->GetString("title", &title); + input_method_item->title = title; + + bool selected; + dictionary->GetBoolean("selected", &selected); + input_method_item->selected = selected; + result.push_back(std::move(input_method_item)); + } + login_screen_->SetPublicSessionKeyboardLayouts(account_id, locale, + std::move(result)); +}
diff --git a/chrome/browser/ui/ash/login_screen_client.h b/chrome/browser/ui/ash/login_screen_client.h index a5f49c3..65bb044 100644 --- a/chrome/browser/ui/ash/login_screen_client.h +++ b/chrome/browser/ui/ash/login_screen_client.h
@@ -82,8 +82,15 @@ void LaunchPublicSession(const AccountId& account_id, const std::string& locale, const std::string& input_method) override; + void RequestPublicSessionKeyboardLayouts(const AccountId& account_id, + const std::string& locale) override; private: + void SetPublicSessionKeyboardLayout( + const AccountId& account_id, + const std::string& locale, + std::unique_ptr<base::ListValue> keyboard_layouts); + // Lock screen mojo service in ash. ash::mojom::LoginScreenPtr login_screen_; @@ -91,6 +98,8 @@ mojo::Binding<ash::mojom::LoginScreenClient> binding_; Delegate* delegate_ = nullptr; + base::WeakPtrFactory<LoginScreenClient> weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(LoginScreenClient); };
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index b0727a2..8e59ba2 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc
@@ -1512,7 +1512,7 @@ } void Browser::AddNewContents(WebContents* source, - WebContents* new_contents, + std::unique_ptr<WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture, @@ -1520,9 +1520,9 @@ // At this point the |new_contents| is beyond the popup blocker, but we use // the same logic for determining if the popup tracker needs to be attached. if (source && PopupBlockerTabHelper::ConsiderForPopupBlocking(disposition)) - PopupTracker::CreateForWebContents(new_contents, source); - chrome::AddWebContents(this, source, new_contents, disposition, initial_rect, - user_gesture); + PopupTracker::CreateForWebContents(new_contents.get(), source); + chrome::AddWebContents(this, source, std::move(new_contents), disposition, + initial_rect, user_gesture); } void Browser::ActivateContents(WebContents* contents) {
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index 7e7c49b9..ea03a29 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h
@@ -587,7 +587,7 @@ content::InvalidateTypes changed_flags) override; void VisibleSecurityStateChanged(content::WebContents* source) override; void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/chrome/browser/ui/browser_tabstrip.cc b/chrome/browser/ui/browser_tabstrip.cc index 5d3c9a44..2db923f 100644 --- a/chrome/browser/ui/browser_tabstrip.cc +++ b/chrome/browser/ui/browser_tabstrip.cc
@@ -48,7 +48,7 @@ void AddWebContents(Browser* browser, content::WebContents* source_contents, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture) { @@ -57,8 +57,7 @@ // Can't create a new contents for the current tab - invalid case. DCHECK(disposition != WindowOpenDisposition::CURRENT_TAB); - // TODO(erikchen): Fix ownership semantics. https://crbug.com/832879. - NavigateParams params(browser, base::WrapUnique(new_contents)); + NavigateParams params(browser, std::move(new_contents)); params.source_contents = source_contents; params.disposition = disposition; params.window_bounds = initial_rect;
diff --git a/chrome/browser/ui/browser_tabstrip.h b/chrome/browser/ui/browser_tabstrip.h index adc1090..c8d1a35 100644 --- a/chrome/browser/ui/browser_tabstrip.h +++ b/chrome/browser/ui/browser_tabstrip.h
@@ -36,7 +36,7 @@ // the initial position and size. void AddWebContents(Browser* browser, content::WebContents* source_contents, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture);
diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm index 0965d5fa..3b65983 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm
@@ -98,7 +98,7 @@ create_params.initially_hidden = true; std::unique_ptr<content::WebContents> web_contents( content::WebContents::Create(create_params)); - chrome::AddWebContents(browser(), NULL, web_contents.release(), + chrome::AddWebContents(browser(), NULL, std::move(web_contents), WindowOpenDisposition::NEW_BACKGROUND_TAB, gfx::Rect(), false); content::WebContents* tab2 =
diff --git a/chrome/browser/ui/views/exclusive_access_bubble_views.cc b/chrome/browser/ui/views/exclusive_access_bubble_views.cc index 4a782d4..3c06f1f 100644 --- a/chrome/browser/ui/views/exclusive_access_bubble_views.cc +++ b/chrome/browser/ui/views/exclusive_access_bubble_views.cc
@@ -23,6 +23,7 @@ #include "chrome/browser/ui/views/subtle_notification_view.h" #include "chrome/grit/generated_resources.h" #include "content/public/browser/notification_service.h" +#include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/gfx/animation/slide_animation.h" @@ -234,6 +235,8 @@ void ExclusiveAccessBubbleViews::AnimationEnded( const gfx::Animation* animation) { + if (animation_->IsShowing()) + GetView()->NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true); AnimationProgressed(animation); } @@ -288,6 +291,8 @@ } void ExclusiveAccessBubbleViews::Show() { + if (animation_->IsShowing()) + return; animation_->SetSlideDuration(kSlideInDurationMs); animation_->Show(); }
diff --git a/chrome/browser/ui/views/subtle_notification_view.cc b/chrome/browser/ui/views/subtle_notification_view.cc index daab038..31c56888 100644 --- a/chrome/browser/ui/views/subtle_notification_view.cc +++ b/chrome/browser/ui/views/subtle_notification_view.cc
@@ -10,6 +10,7 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/views/harmony/chrome_typography.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/accessibility/ax_node_data.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/font_list.h" #include "ui/gfx/geometry/insets.h" @@ -41,6 +42,9 @@ // really a dialog, but a dialog title is a good fit. constexpr int kInstructionTextContext = views::style::CONTEXT_DIALOG_TITLE; +// Delimiter indicating there should be a segment displayed as a keyboard key. +const char kKeyNameDelimiter[] = "|"; + } // namespace // Class containing the instruction text. Contains fancy styling on the keyboard @@ -55,6 +59,7 @@ SkColor foreground_color, SkColor background_color); + const base::string16 text() const { return text_; } void SetText(const base::string16& text); private: @@ -93,8 +98,8 @@ // Parse |text|, looking for pipe-delimited segment. std::vector<base::string16> segments = - base::SplitString(text, base::ASCIIToUTF16("|"), base::TRIM_WHITESPACE, - base::SPLIT_WANT_ALL); + base::SplitString(text, base::ASCIIToUTF16(kKeyNameDelimiter), + base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); // SplitString() returns empty strings for zero-length segments, so given an // even number of pipes, there should always be an odd number of segments. // The exception is if |text| is entirely empty, in which case the returned @@ -203,3 +208,11 @@ return popup; } + +void SubtleNotificationView::GetAccessibleNodeData(ui::AXNodeData* node_data) { + node_data->role = ax::mojom::Role::kAlert; + base::string16 accessible_name; + base::RemoveChars(instruction_view_->text(), + base::ASCIIToUTF16(kKeyNameDelimiter), &accessible_name); + node_data->SetName(accessible_name); +}
diff --git a/chrome/browser/ui/views/subtle_notification_view.h b/chrome/browser/ui/views/subtle_notification_view.h index c04296a..9c3c4d3b 100644 --- a/chrome/browser/ui/views/subtle_notification_view.h +++ b/chrome/browser/ui/views/subtle_notification_view.h
@@ -36,6 +36,8 @@ static views::Widget* CreatePopupWidget(gfx::NativeView parent_view, SubtleNotificationView* view, bool accept_events); + // views::View + void GetAccessibleNodeData(ui::AXNodeData* node_data) override; private: class InstructionView;
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc index 4d64962..755d39b 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -68,8 +68,11 @@ #include "ui/views/widget/widget.h" #include "ui/views/window/non_client_view.h" -#if defined(OS_WIN) +#if defined(OS_WIN) || defined(OS_MACOSX) #include "chrome/browser/recovery/recovery_install_global_error_factory.h" +#endif + +#if defined(OS_WIN) #include "chrome/browser/ui/views/conflicting_module_view_win.h" #include "chrome/browser/ui/views/critical_notification_bubble_view.h" #endif @@ -230,7 +233,7 @@ // Start global error services now so we set the icon on the menu correctly. #if !defined(OS_CHROMEOS) SigninGlobalErrorFactory::GetForProfile(browser_->profile()); -#if defined(OS_WIN) +#if defined(OS_WIN) || defined(OS_MACOSX) RecoveryInstallGlobalErrorFactory::GetForProfile(browser_->profile()); #endif #endif // OS_CHROMEOS
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc index 54fe4ad..3af82c2 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -904,7 +904,7 @@ if (user_manager::UserManager::IsInitialized()) { for (user_manager::User* user : user_manager::UserManager::Get()->GetUnlockUsers()) { - quick_unlock::PinBackend::CanAuthenticate( + quick_unlock::PinBackend::GetInstance()->CanAuthenticate( user->GetAccountId(), base::BindOnce(&SigninScreenHandler::PreloadPinKeyboard, weak_factory_.GetWeakPtr())); @@ -977,7 +977,7 @@ } void SigninScreenHandler::UpdatePinKeyboardState(const AccountId& account_id) { - quick_unlock::PinBackend::CanAuthenticate( + quick_unlock::PinBackend::GetInstance()->CanAuthenticate( account_id, base::BindOnce(&SigninScreenHandler::SetPinEnabledForUser, weak_factory_.GetWeakPtr(), account_id)); }
diff --git a/chrome/browser/ui/webui/policy_tool_ui_browsertest.cc b/chrome/browser/ui/webui/policy_tool_ui_browsertest.cc index f5bd47c..c8bc6c57 100644 --- a/chrome/browser/ui/webui/policy_tool_ui_browsertest.cc +++ b/chrome/browser/ui/webui/policy_tool_ui_browsertest.cc
@@ -403,7 +403,7 @@ EXPECT_EQ(GetElementDisabledState("session-choice", "saving"), 1); } -IN_PROC_BROWSER_TEST_F(PolicyToolUITest, DefaultSession) { +IN_PROC_BROWSER_TEST_F(PolicyToolUITest, DISABLED_DefaultSession) { // Navigate to the tool to make sure the sessions directory is created. ui_test_utils::NavigateToURL(browser(), GURL("chrome://policy-tool"));
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc index 1683b8d..2b6fc05 100644 --- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -18,6 +18,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_shortcut_manager.h" #include "chrome/browser/signin/account_consistency_mode_manager.h" +#include "chrome/browser/signin/unified_consent_helper.h" #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" #include "chrome/common/chrome_features.h" #include "chrome/common/chrome_switches.h" @@ -1795,19 +1796,6 @@ Profile* profile) { LocalizedString localized_strings[] = { {"privacyPageTitle", IDS_SETTINGS_PRIVACY}, - {"linkDoctorPref", IDS_SETTINGS_LINKDOCTOR_PREF}, - {"searchSuggestPref", IDS_SETTINGS_SUGGEST_PREF}, - {"networkPredictionEnabled", - IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_DESCRIPTION}, - {"safeBrowsingEnableProtection", - IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION}, - {"spellingPref", IDS_SETTINGS_SPELLING_PREF}, - {"spellingDescription", IDS_SETTINGS_SPELLING_DESCRIPTION}, -#if defined(OS_CHROMEOS) - {"enableLogging", IDS_SETTINGS_ENABLE_LOGGING_DIAGNOSTIC_AND_USAGE_DATA}, -#else - {"enableLogging", IDS_SETTINGS_ENABLE_LOGGING}, -#endif {"doNotTrack", IDS_SETTINGS_ENABLE_DO_NOT_TRACK}, {"doNotTrackDialogTitle", IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_TITLE}, {"enableContentProtectionAttestation", @@ -1827,16 +1815,73 @@ AddLocalizedStringsBulk(html_source, localized_strings, arraysize(localized_strings)); + // Select strings depending on unified-consent enabledness. + bool is_unified_consent_enabled = IsUnifiedConsentEnabled(profile); + if (is_unified_consent_enabled) { + LocalizedString conditional_localized_strings[] = { + {"searchSuggestPref", IDS_SETTINGS_SUGGEST_PREF_UNIFIED_CONSENT}, + {"searchSuggestPrefDesc", + IDS_SETTINGS_SUGGEST_PREF_DESC_UNIFIED_CONSENT}, + {"safeBrowsingEnableExtendedReporting", + IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING_UNIFIED_CONSENT}, + {"safeBrowsingEnableExtendedReportingDesc", + IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING_DESC_UNIFIED_CONSENT}, + {"networkPredictionEnabled", + IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_LABEL_UNIFIED_CONSENT}, + {"networkPredictionEnabledDesc", + IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_DESC_UNIFIED_CONSENT}, + {"linkDoctorPref", IDS_SETTINGS_LINKDOCTOR_PREF_UNIFIED_CONSENT}, + {"linkDoctorPrefDesc", + IDS_SETTINGS_LINKDOCTOR_PREF_DESC_UNIFIED_CONSENT}, + {"safeBrowsingEnableProtection", + IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION_UNIFIED_CONSENT}, + {"safeBrowsingEnableProtectionDesc", + IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION_DESC_UNIFIED_CONSENT}, + {"spellingPref", IDS_SETTINGS_SPELLING_PREF_UNIFIED_CONSENT}, + {"spellingDescription", + IDS_SETTINGS_SPELLING_DESCRIPTION_UNIFIED_CONSENT}, + {"enableLogging", IDS_SETTINGS_ENABLE_LOGGING_UNIFIED_CONSENT}, + {"enableLoggingDesc", IDS_SETTINGS_ENABLE_LOGGING_DESC_UNIFIED_CONSENT}, + }; + AddLocalizedStringsBulk(html_source, conditional_localized_strings, + arraysize(conditional_localized_strings)); + } else { + LocalizedString conditional_localized_strings[] = { + {"searchSuggestPref", IDS_SETTINGS_SUGGEST_PREF}, + {"searchSuggestPrefDesc", IDS_SETTINGS_EMPTY_STRING}, + {"safeBrowsingEnableExtendedReportingDesc", IDS_SETTINGS_EMPTY_STRING}, + {"networkPredictionEnabled", + IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_LABEL}, + {"networkPredictionEnabledDesc", IDS_SETTINGS_EMPTY_STRING}, + {"linkDoctorPref", IDS_SETTINGS_LINKDOCTOR_PREF}, + {"linkDoctorPrefDesc", IDS_SETTINGS_EMPTY_STRING}, + {"safeBrowsingEnableProtection", + IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION}, + {"safeBrowsingEnableProtectionDesc", IDS_SETTINGS_EMPTY_STRING}, + {"spellingPref", IDS_SETTINGS_SPELLING_PREF}, + {"spellingDescription", IDS_SETTINGS_SPELLING_DESCRIPTION}, +#if defined(OS_CHROMEOS) + {"enableLogging", IDS_SETTINGS_ENABLE_LOGGING_DIAGNOSTIC_AND_USAGE_DATA}, +#else + {"enableLogging", IDS_SETTINGS_ENABLE_LOGGING}, +#endif + {"enableLoggingDesc", IDS_SETTINGS_EMPTY_STRING}, + }; + AddLocalizedStringsBulk(html_source, conditional_localized_strings, + arraysize(conditional_localized_strings)); + + html_source->AddLocalizedString( + "safeBrowsingEnableExtendedReporting", + safe_browsing::ChooseOptInTextResource( + *profile->GetPrefs(), + IDS_SETTINGS_SAFEBROWSING_ENABLE_EXTENDED_REPORTING, + IDS_SETTINGS_SAFEBROWSING_ENABLE_SCOUT_REPORTING)); + } + html_source->AddBoolean( "importantSitesInCbd", base::FeatureList::IsEnabled(features::kImportantSitesInCbd)); - html_source->AddLocalizedString( - "safeBrowsingEnableExtendedReporting", - safe_browsing::ChooseOptInTextResource( - *profile->GetPrefs(), - IDS_SETTINGS_SAFEBROWSING_ENABLE_EXTENDED_REPORTING, - IDS_SETTINGS_SAFEBROWSING_ENABLE_SCOUT_REPORTING)); html_source->AddString( "improveBrowsingExperience", l10n_util::GetStringFUTF16(
diff --git a/chrome/browser/ui/webui/site_settings_helper.cc b/chrome/browser/ui/webui/site_settings_helper.cc index c6e1e92..de6fa11 100644 --- a/chrome/browser/ui/webui/site_settings_helper.cc +++ b/chrome/browser/ui/webui/site_settings_helper.cc
@@ -14,6 +14,7 @@ #include "chrome/browser/permissions/permission_manager.h" #include "chrome/browser/permissions/permission_result.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/usb/usb_chooser_context.h" #include "chrome/browser/usb/usb_chooser_context_factory.h" #include "chrome/common/pref_names.h" #include "components/content_settings/core/browser/host_content_settings_map.h" @@ -33,11 +34,6 @@ constexpr char kObject[] = "object"; constexpr char kObjectName[] = "objectName"; -ChooserContextBase* GetUsbChooserContext(Profile* profile) { - return reinterpret_cast<ChooserContextBase*>( - UsbChooserContextFactory::GetForProfile(profile)); -} - namespace { // Maps from the UI string to the object it represents (for sorting purposes). @@ -204,6 +200,14 @@ return SiteSettingSource::kPreference; } +ChooserContextBase* GetUsbChooserContext(Profile* profile) { + return UsbChooserContextFactory::GetForProfile(profile); +} + +const ChooserTypeNameEntry kChooserTypeGroupNames[] = { + {&GetUsbChooserContext, kGroupTypeUsb}, +}; + } // namespace bool HasRegisteredGroupName(ContentSettingsType type) { @@ -588,9 +592,7 @@ chooser_context->GetAllGrantedObjects(); AllOriginObjects all_origin_objects; for (const auto& object : objects) { - std::string name; - bool found = object->object.GetString(chooser_type.ui_name_key, &name); - DCHECK(found); + std::string name = chooser_context->GetObjectName(object->object); // It is safe for this structure to hold references into |objects| because // they are both destroyed at the end of this function. all_origin_objects[make_pair(object->requesting_origin, object->source)]
diff --git a/chrome/browser/ui/webui/site_settings_helper.h b/chrome/browser/ui/webui/site_settings_helper.h index 0a3065dc..2e2507b 100644 --- a/chrome/browser/ui/webui/site_settings_helper.h +++ b/chrome/browser/ui/webui/site_settings_helper.h
@@ -133,24 +133,15 @@ // for a given content settings type and is declared early so that it can used // by functions below. struct ChooserTypeNameEntry { - ContentSettingsType type; ChooserContextBase* (*get_context)(Profile*); const char* name; - const char* ui_name_key; }; -ChooserContextBase* GetUsbChooserContext(Profile* profile); - struct ContentSettingsTypeNameEntry { ContentSettingsType type; const char* name; }; -const ChooserTypeNameEntry kChooserTypeGroupNames[] = { - {CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA, &GetUsbChooserContext, - kGroupTypeUsb, "name"}, -}; - const ChooserTypeNameEntry* ChooserTypeFromGroupName(const std::string& name); // Fills in |exceptions| with Values for the given |chooser_type| from map.
diff --git a/chrome/browser/ui/webui/web_dialog_web_contents_delegate_unittest.cc b/chrome/browser/ui/webui/web_dialog_web_contents_delegate_unittest.cc index 58ee37f..b3d3f6a 100644 --- a/chrome/browser/ui/webui/web_dialog_web_contents_delegate_unittest.cc +++ b/chrome/browser/ui/webui/web_dialog_web_contents_delegate_unittest.cc
@@ -89,11 +89,11 @@ } TEST_F(WebDialogWebContentsDelegateTest, AddNewContentsForegroundTabTest) { - WebContents* contents = - WebContentsTester::CreateTestWebContents(profile(), NULL); + std::unique_ptr<WebContents> contents = base::WrapUnique( + WebContentsTester::CreateTestWebContents(profile(), NULL)); test_web_contents_delegate_->AddNewContents( - NULL, contents, WindowOpenDisposition::NEW_FOREGROUND_TAB, gfx::Rect(), - false, NULL); + NULL, std::move(contents), WindowOpenDisposition::NEW_FOREGROUND_TAB, + gfx::Rect(), false, NULL); // This should create a new foreground tab in the existing browser. EXPECT_EQ(1, browser()->tab_strip_model()->count()); EXPECT_EQ(1U, chrome::GetTotalBrowserCount());
diff --git a/chrome/browser/usb/usb_chooser_context.cc b/chrome/browser/usb/usb_chooser_context.cc index ff5f5f8..7ded789 100644 --- a/chrome/browser/usb/usb_chooser_context.cc +++ b/chrome/browser/usb/usb_chooser_context.cc
@@ -204,6 +204,15 @@ object.HasKey(kSerialNumberKey); } +std::string UsbChooserContext::GetObjectName( + const base::DictionaryValue& object) { + DCHECK(IsValidObject(object)); + std::string name; + bool found = object.GetString(kDeviceNameKey, &name); + DCHECK(found); + return name; +} + void UsbChooserContext::OnDeviceRemovedCleanup( scoped_refptr<UsbDevice> device) { for (auto& map_entry : ephemeral_devices_)
diff --git a/chrome/browser/usb/usb_chooser_context.h b/chrome/browser/usb/usb_chooser_context.h index 29801ec..7aeaa73 100644 --- a/chrome/browser/usb/usb_chooser_context.h +++ b/chrome/browser/usb/usb_chooser_context.h
@@ -54,6 +54,7 @@ private: // ChooserContextBase implementation. bool IsValidObject(const base::DictionaryValue& object) override; + std::string GetObjectName(const base::DictionaryValue& object) override; // device::UsbService::Observer implementation. void OnDeviceRemovedCleanup(scoped_refptr<device::UsbDevice> device) override;
diff --git a/chrome/browser/vr/BUILD.gn b/chrome/browser/vr/BUILD.gn index 5ee1c1a..41b0d812 100644 --- a/chrome/browser/vr/BUILD.gn +++ b/chrome/browser/vr/BUILD.gn
@@ -310,7 +310,6 @@ deps = [ ":vr_test_support", - "//mojo/common", "//mojo/public/cpp/bindings", "//testing/gmock", "//ui/gfx/geometry",
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 55fbb1d..4aa7e21d 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -215,16 +215,6 @@ base::FEATURE_DISABLED_BY_DEFAULT}; #endif -#if defined(OS_CHROMEOS) -// If enabled, the Chrome OS Settings UI will include a menu for the unified -// MultiDevice settings. -const base::Feature kEnableUnifiedMultiDeviceSettings{ - "EnableUnifiedMultiDeviceSettings", base::FEATURE_DISABLED_BY_DEFAULT}; -// Enable the device to setup all MultiDevice services in a single workflow. -const base::Feature kEnableUnifiedMultiDeviceSetup{ - "EnableUnifiedMultiDeviceSetup", base::FEATURE_DISABLED_BY_DEFAULT}; -#endif - // Enables Expect CT reporting, which sends reports for opted-in sites // that don't serve sufficient Certificate Transparency information. const base::Feature kExpectCTReporting{"ExpectCTReporting",
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index a61c9bfe..404d4b03 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -118,11 +118,6 @@ extern const base::Feature kDownloadsLocationChange; #endif -#if defined(OS_CHROMEOS) -extern const base::Feature kEnableUnifiedMultiDeviceSettings; -extern const base::Feature kEnableUnifiedMultiDeviceSetup; -#endif - extern const base::Feature kExpectCTReporting; extern const base::Feature kExperimentalAppBanners;
diff --git a/chrome/common/mac/mock_launchd.cc b/chrome/common/mac/mock_launchd.cc index 1f12331..8ab7b63 100644 --- a/chrome/common/mac/mock_launchd.cc +++ b/chrome/common/mac/mock_launchd.cc
@@ -91,21 +91,21 @@ return bundle.get(); } -MockLaunchd::MockLaunchd(const base::FilePath& file, - base::MessageLoop* loop, - bool create_socket, - bool as_service) +MockLaunchd::MockLaunchd( + const base::FilePath& file, + scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, + bool create_socket, + bool as_service) : file_(file), pipe_name_(GetServiceProcessChannel().name), - message_loop_(loop), + main_task_runner_(std::move(main_task_runner)), create_socket_(create_socket), as_service_(as_service), restart_called_(false), remove_called_(false), checkin_called_(false), write_called_(false), - delete_called_(false) { -} + delete_called_(false) {} MockLaunchd::~MockLaunchd() { } @@ -227,8 +227,8 @@ bool MockLaunchd::RemoveJob(CFStringRef label, CFErrorRef* error) { remove_called_ = true; - message_loop_->task_runner()->PostTask( - FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); + main_task_runner_->PostTask(FROM_HERE, + base::MessageLoop::QuitWhenIdleClosure()); return true; } @@ -237,8 +237,8 @@ CFStringRef name, CFStringRef session_type) { restart_called_ = true; - message_loop_->task_runner()->PostTask( - FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); + main_task_runner_->PostTask(FROM_HERE, + base::MessageLoop::QuitWhenIdleClosure()); return true; }
diff --git a/chrome/common/mac/mock_launchd.h b/chrome/common/mac/mock_launchd.h index 4d056c7..d590d286 100644 --- a/chrome/common/mac/mock_launchd.h +++ b/chrome/common/mac/mock_launchd.h
@@ -12,11 +12,12 @@ #include "base/files/file_path.h" #include "base/mac/scoped_cftyperef.h" +#include "base/memory/scoped_refptr.h" #include "chrome/common/mac/launchd.h" #include "chrome/common/multi_process_lock.h" namespace base { -class MessageLoop; +class SingleThreadTaskRunner; } // TODO(dmaclach): Write this in terms of a real mock. @@ -28,8 +29,10 @@ base::FilePath* bundle_root, base::FilePath* executable); - MockLaunchd(const base::FilePath& file, base::MessageLoop* loop, - bool create_socket, bool as_service); + MockLaunchd(const base::FilePath& file, + scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, + bool create_socket, + bool as_service); ~MockLaunchd() override; CFDictionaryRef CopyJobDictionary(CFStringRef label) override; @@ -59,7 +62,7 @@ private: base::FilePath file_; std::string pipe_name_; - base::MessageLoop* message_loop_; + scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; std::unique_ptr<MultiProcessLock> running_lock_; bool create_socket_; bool as_service_;
diff --git a/chrome/common/service_process_util_mac_unittest.mm b/chrome/common/service_process_util_mac_unittest.mm index db20296..ad399a3d 100644 --- a/chrome/common/service_process_util_mac_unittest.mm +++ b/chrome/common/service_process_util_mac_unittest.mm
@@ -49,7 +49,7 @@ ASSERT_TRUE(MockLaunchd::MakeABundle(GetTempDirPath(), "Test", &bundle_path_, &executable_path_)); mock_launchd_.reset( - new MockLaunchd(executable_path_, &loop_, false, false)); + new MockLaunchd(executable_path_, loop_.task_runner(), false, false)); scoped_launchd_instance_.reset( new Launchd::ScopedInstance(mock_launchd_.get())); ASSERT_TRUE(service_process_state_.Initialize());
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index a5215b7b..e9d99f2 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -5288,6 +5288,7 @@ "../browser/sync/test/integration/single_client_directory_sync_test.cc", "../browser/sync/test/integration/single_client_extensions_sync_test.cc", "../browser/sync/test/integration/single_client_passwords_sync_test.cc", + "../browser/sync/test/integration/single_client_polling_sync_test.cc", "../browser/sync/test/integration/single_client_preferences_sync_test.cc", "../browser/sync/test/integration/single_client_printers_sync_test.cc", "../browser/sync/test/integration/single_client_search_engines_sync_test.cc", @@ -5298,7 +5299,6 @@ "../browser/sync/test/integration/single_client_wallet_sync_test.cc", "../browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc", "../browser/sync/test/integration/sync_auth_test.cc", - "../browser/sync/test/integration/sync_client_command_test.cc", "../browser/sync/test/integration/sync_errors_test.cc", "../browser/sync/test/integration/sync_exponential_backoff_test.cc", "../browser/sync/test/integration/two_client_app_list_sync_test.cc", @@ -5310,6 +5310,7 @@ "../browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc", "../browser/sync/test/integration/two_client_extensions_sync_test.cc", "../browser/sync/test/integration/two_client_passwords_sync_test.cc", + "../browser/sync/test/integration/two_client_polling_sync_test.cc", "../browser/sync/test/integration/two_client_preferences_sync_test.cc", "../browser/sync/test/integration/two_client_printers_sync_test.cc", "../browser/sync/test/integration/two_client_search_engines_sync_test.cc",
diff --git a/chrome/test/chromedriver/net/sync_websocket_impl.cc b/chrome/test/chromedriver/net/sync_websocket_impl.cc index eecba9b..56bdc4a 100644 --- a/chrome/test/chromedriver/net/sync_websocket_impl.cc +++ b/chrome/test/chromedriver/net/sync_websocket_impl.cc
@@ -55,10 +55,17 @@ bool success = false; base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent::InitialState::NOT_SIGNALED); - context_getter_->GetNetworkTaskRunner()->PostTask( - FROM_HERE, base::BindOnce(&SyncWebSocketImpl::Core::ConnectOnIO, this, - url, &success, &event)); - event.Wait(); + // Try to connect up to 3 times, with 10 seconds delay in between. + base::TimeDelta waitTime = base::TimeDelta::FromSeconds(10); + for (int i = 0; i < 3; i++) { + context_getter_->GetNetworkTaskRunner()->PostTask( + FROM_HERE, base::BindOnce(&SyncWebSocketImpl::Core::ConnectOnIO, this, + url, &success, &event)); + if (event.TimedWait(waitTime)) + break; + LOG(WARNING) << "Timed out connecting to Chrome, " + << (i < 2 ? "retrying..." : "giving up."); + } return success; } @@ -117,6 +124,14 @@ base::AutoLock lock(lock_); received_queue_.clear(); } + // If this is a retry to connect, there is a chance that the original attempt + // to connect has succeeded after the retry was initiated, so double check if + // we are already connected. The is_connected_ flag is only set on the I/O + // thread, so no additional synchronization is needed to check it here. + // Note: If is_connected_ is true, both |success| and |event| may point to + // stale memory, so don't use either parameters before returning. + if (socket_ && is_connected_) + return; socket_.reset(new WebSocket(url, this)); socket_->Connect(base::Bind( &SyncWebSocketImpl::Core::OnConnectCompletedOnIO,
diff --git a/chrome/test/data/extensions/page_with_sandbox_csp.html b/chrome/test/data/extensions/page_with_sandbox_csp.html new file mode 100644 index 0000000..6dee8f3 --- /dev/null +++ b/chrome/test/data/extensions/page_with_sandbox_csp.html
@@ -0,0 +1,3 @@ +<html> +Hello world! +</html>
diff --git a/chrome/test/data/extensions/page_with_sandbox_csp.html.mock-http-headers b/chrome/test/data/extensions/page_with_sandbox_csp.html.mock-http-headers new file mode 100644 index 0000000..c756a4a --- /dev/null +++ b/chrome/test/data/extensions/page_with_sandbox_csp.html.mock-http-headers
@@ -0,0 +1,3 @@ +HTTP/1.1 200 OK +Content-Type: text/html +Content-Security-Policy: sandbox;
diff --git a/chrome/test/data/policy/policy_test_cases.json b/chrome/test/data/policy/policy_test_cases.json index 6aaea0e7..4b91557 100644 --- a/chrome/test/data/policy/policy_test_cases.json +++ b/chrome/test/data/policy/policy_test_cases.json
@@ -1770,6 +1770,26 @@ "note": "TODO(bartfab): Flag this with can_be_recommended when http://crbug.com/106682 is fixed." }, + "WebUsbAskForUrls": { + "os": ["win", "linux", "mac", "chromeos", "android"], + "test_policy": { "WebUsbAskForUrls": ["[*.]google.com"] }, + "pref_mappings": [ + { "pref": "profile.managed_web_usb_ask_for_urls" } + ], + + "note": "TODO(reillyg): Add indicator tests. TODO(bartfab): Flag this with can_be_recommended when http://crbug.com/106682 is fixed." + }, + + "WebUsbBlockedForUrls": { + "os": ["win", "linux", "mac", "chromeos", "android"], + "test_policy": { "WebUsbBlockedForUrls": ["[*.]google.com"] }, + "pref_mappings": [ + { "pref": "profile.managed_web_usb_blocked_for_urls" } + ], + + "note": "TODO(reillyg): Add indicator tests. TODO(bartfab): Flag this with can_be_recommended when http://crbug.com/106682 is fixed." + }, + "Disable3DAPIs": { "os": ["win", "linux", "mac", "chromeos"], "test_policy": { "Disable3DAPIs": true },
diff --git a/chrome/test/data/webui/settings/cr_settings_browsertest.js b/chrome/test/data/webui/settings/cr_settings_browsertest.js index 414d4ca..81591fa 100644 --- a/chrome/test/data/webui/settings/cr_settings_browsertest.js +++ b/chrome/test/data/webui/settings/cr_settings_browsertest.js
@@ -805,6 +805,41 @@ * @constructor * @extends {CrSettingsBrowserTest} */ +function CrSettingsPersonalizationOptionsTest() {} + +CrSettingsPersonalizationOptionsTest.prototype = { + __proto__: CrSettingsBrowserTest.prototype, + + /** @override */ + browsePreload: 'chrome://settings/privacy_page/personalization_options.html', + + /** @override */ + extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ + ROOT_PATH + 'ui/webui/resources/js/promise_resolver.js', + 'test_util.js', + '../test_browser_proxy.js', + 'test_privacy_page_browser_proxy.js', + 'personalization_options_test.js', + ]), +}; + +TEST_F('CrSettingsPersonalizationOptionsTest', 'NonOfficialBuild', function() { + settings_personalization_options.registerTests(); + mocha.run(); +}); + +GEN('#if defined(GOOGLE_CHROME_BUILD)'); +TEST_F('CrSettingsPersonalizationOptionsTest', 'OfficialBuild', function() { + settings_personalization_options.registerOfficialBuildTests(); + mocha.run(); +}); +GEN('#endif'); + +/** + * Test fixture for chrome/browser/resources/settings/privacy_page/. + * @constructor + * @extends {CrSettingsBrowserTest} + */ function CrSettingsPrivacyPageTest() {} CrSettingsPrivacyPageTest.prototype = {
diff --git a/chrome/test/data/webui/settings/personalization_options_test.js b/chrome/test/data/webui/settings/personalization_options_test.js new file mode 100644 index 0000000..773621b --- /dev/null +++ b/chrome/test/data/webui/settings/personalization_options_test.js
@@ -0,0 +1,111 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +cr.define('settings_personalization_options', function() { + function registerTests() { + suite('SafeBrowsingExtendedReporting', function() { + /** @type {settings.TestPrivacyPageBrowserProxy} */ + let testBrowserProxy; + + /** @type {SettingsPersonalizationOptionsElement} */ + let testElement; + + setup(function() { + testBrowserProxy = new TestPrivacyPageBrowserProxy(); + settings.PrivacyPageBrowserProxyImpl.instance_ = testBrowserProxy; + PolymerTest.clearBody(); + testElement = + document.createElement('settings-personalization-options'); + document.body.appendChild(testElement); + }); + + teardown(function() { + testElement.remove(); + }); + + test('test whether extended reporting is enabled/managed', function() { + return testBrowserProxy.whenCalled('getSafeBrowsingExtendedReporting') + .then(function() { + Polymer.dom.flush(); + + // Control starts checked and managed by default. + assertTrue(testBrowserProxy.sberPrefState.enabled); + assertTrue(testBrowserProxy.sberPrefState.managed); + + const control = + testElement.$$('#safeBrowsingExtendedReportingControl'); + assertEquals(true, control.checked); + assertEquals(true, !!control.pref.controlledBy); + + // Change the managed and checked states + const changedPrefState = { + enabled: false, + managed: false, + }; + // Notification from browser can uncheck the box and make it not + // managed. + cr.webUIListenerCallback( + 'safe-browsing-extended-reporting-change', changedPrefState); + Polymer.dom.flush(); + assertEquals(false, control.checked); + assertEquals(false, !!control.pref.controlledBy); + + // Tapping on the box will check it again. + MockInteractions.tap(control); + + return testBrowserProxy.whenCalled( + 'setSafeBrowsingExtendedReportingEnabled'); + }) + .then(function(enabled) { + assertTrue(enabled); + }); + }); + }); + } + + function registerOfficialBuildTests() { + suite('SafeBrowsingExtendedReportingOfficialBuild', function() { + /** @type {settings.TestPrivacyPageBrowserProxy} */ + let testBrowserProxy; + + /** @type {SettingsPersonalizationOptionsElement} */ + let testElement; + + setup(function() { + testBrowserProxy = new TestPrivacyPageBrowserProxy(); + settings.PrivacyPageBrowserProxyImpl.instance_ = testBrowserProxy; + PolymerTest.clearBody(); + testElement = + document.createElement('settings-personalization-options'); + document.body.appendChild(testElement); + }); + + teardown(function() { + testElement.remove(); + }); + + test('displaying toggles depending on unified consent', function() { + // TODO(scottchen): this property will become public in a follow-up CL. + testElement.unifiedConsentEnabled_ = false; + Polymer.dom.flush(); + assertEquals( + 7, + testElement.root.querySelectorAll('settings-toggle-button').length); + testElement.unifiedConsentEnabled_ = true; + Polymer.dom.flush(); + // #spellCheckControl should be set to display: none by false dom-if. + assertTrue( + testElement.$$('#spellCheckControl').style.display === 'none'); + assertTrue(!!testElement.$$('#spellCheckLinkBox')); + assertTrue( + testElement.$$('#spellCheckLinkBox').style.display !== 'none'); + }); + }); + } + + return { + registerTests: registerTests, + registerOfficialBuildTests: registerOfficialBuildTests, + }; +});
diff --git a/chrome/test/data/webui/settings/privacy_page_test.js b/chrome/test/data/webui/settings/privacy_page_test.js index 62e2564..eedd11d 100644 --- a/chrome/test/data/webui/settings/privacy_page_test.js +++ b/chrome/test/data/webui/settings/privacy_page_test.js
@@ -413,67 +413,10 @@ }); } - function registerSafeBrowsingExtendedReportingTests() { - suite('SafeBrowsingExtendedReporting', function() { - /** @type {settings.TestPrivacyPageBrowserProxy} */ - let testBrowserProxy; - - /** @type {SettingsPrivacyPageElement} */ - let page; - - setup(function() { - testBrowserProxy = new TestPrivacyPageBrowserProxy(); - settings.PrivacyPageBrowserProxyImpl.instance_ = testBrowserProxy; - PolymerTest.clearBody(); - page = document.createElement('settings-privacy-page'); - }); - - teardown(function() { page.remove(); }); - - test('test whether extended reporting is enabled/managed', function() { - return testBrowserProxy.whenCalled( - 'getSafeBrowsingExtendedReporting').then(function() { - Polymer.dom.flush(); - - // Control starts checked and managed by default. - assertTrue(testBrowserProxy.sberPrefState.enabled); - assertTrue(testBrowserProxy.sberPrefState.managed); - - const control = page.$$('#safeBrowsingExtendedReportingControl'); - assertEquals(true, control.checked); - assertEquals(true, !!control.pref.controlledBy); - - // Change the managed and checked states - const changedPrefState = { - enabled: false, - managed: false, - }; - // Notification from browser can uncheck the box and make it not - // managed. - cr.webUIListenerCallback('safe-browsing-extended-reporting-change', - changedPrefState); - Polymer.dom.flush(); - assertEquals(false, control.checked); - assertEquals(false, !!control.pref.controlledBy); - - // Tapping on the box will check it again. - MockInteractions.tap(control); - - return testBrowserProxy.whenCalled( - 'setSafeBrowsingExtendedReportingEnabled'); - }) - .then(function(enabled) { - assertTrue(enabled); - }); - }); - }); - } - if (cr.isMac || cr.isWin) registerNativeCertificateManagerTests(); registerClearBrowsingDataTests(); registerImportantSitesTests(); registerPrivacyPageTests(); - registerSafeBrowsingExtendedReportingTests(); });
diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn index 4374e85..a484adf 100644 --- a/chrome/utility/BUILD.gn +++ b/chrome/utility/BUILD.gn
@@ -112,7 +112,6 @@ ] deps += [ "//chrome/common/extensions/api", - "//chrome/services/media_gallery_util:lib", "//chrome/services/removable_storage_writer:lib", ] @@ -193,6 +192,10 @@ deps += [ "//chrome/utility/safe_browsing/mac" ] } } + + if (is_android || enable_extensions) { + deps += [ "//chrome/services/media_gallery_util:lib" ] + } } if (!is_android) {
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc index 9353fb05..8bdab7f4 100644 --- a/chrome/utility/chrome_content_utility_client.cc +++ b/chrome/utility/chrome_content_utility_client.cc
@@ -45,8 +45,6 @@ #endif #if BUILDFLAG(ENABLE_EXTENSIONS) -#include "chrome/services/media_gallery_util/media_gallery_util_service.h" -#include "chrome/services/media_gallery_util/public/mojom/constants.mojom.h" #include "chrome/services/removable_storage_writer/public/mojom/constants.mojom.h" #include "chrome/services/removable_storage_writer/removable_storage_writer_service.h" #if defined(OS_WIN) @@ -55,6 +53,11 @@ #endif #endif +#if BUILDFLAG(ENABLE_EXTENSIONS) || defined(OS_ANDROID) +#include "chrome/services/media_gallery_util/media_gallery_util_service.h" +#include "chrome/services/media_gallery_util/public/mojom/constants.mojom.h" +#endif + #if defined(OS_CHROMEOS) #include "chrome/utility/mash_service_factory.h" #endif @@ -235,18 +238,19 @@ services->emplace(unzip::mojom::kServiceName, service_info); } -#if BUILDFLAG(ENABLE_EXTENSIONS) +#if BUILDFLAG(ENABLE_EXTENSIONS) && !defined(OS_WIN) + // On Windows the service is running elevated. + RegisterRemovableStorageWriterService(services); +#endif // BUILDFLAG(ENABLE_EXTENSIONS) && !defined(OS_WIN) + +#if BUILDFLAG(ENABLE_EXTENSIONS) || defined(OS_ANDROID) { service_manager::EmbeddedServiceInfo service_info; service_info.factory = base::Bind(&MediaGalleryUtilService::CreateService); services->emplace(chrome::mojom::kMediaGalleryUtilServiceName, service_info); } -#if !defined(OS_WIN) - // On Windows the service is running elevated. - RegisterRemovableStorageWriterService(services); -#endif -#endif // BUILDFLAG(ENABLE_EXTENSIONS) +#endif // BUILDFLAG(ENABLE_EXTENSIONS) || defined(OS_ANDROID) #if defined(OS_CHROMEOS) // TODO(jamescook): Figure out why we have to do this when not using mash.
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc index 9bc80e6e..75f5156 100644 --- a/chromecast/browser/cast_browser_main_parts.cc +++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -520,7 +520,7 @@ video_plane_controller_.reset(new media::VideoPlaneController( Size(display_size.width(), display_size.height()), GetMediaTaskRunner())); viz::OverlayStrategyUnderlayCast::SetOverlayCompositedCallback( - base::BindRepeating(&media::VideoPlaneController::SetGeometryGfx, + base::BindRepeating(&media::VideoPlaneController::SetGeometry, base::Unretained(video_plane_controller_.get()))); #endif
diff --git a/chromecast/media/base/video_plane_controller.cc b/chromecast/media/base/video_plane_controller.cc index bb3952e..382fe1d 100644 --- a/chromecast/media/base/video_plane_controller.cc +++ b/chromecast/media/base/video_plane_controller.cc
@@ -181,13 +181,15 @@ void VideoPlaneController::SetGeometryGfx(const gfx::RectF& display_rect, gfx::OverlayTransform transform) { - chromecast::RectF rect(display_rect.x(), display_rect.y(), - display_rect.width(), display_rect.height()); - SetGeometry(rect, ConvertTransform(transform)); + SetGeometry(display_rect, transform); } -void VideoPlaneController::SetGeometry(const RectF& display_rect, - VideoPlane::Transform transform) { +void VideoPlaneController::SetGeometry(const gfx::RectF& gfx_display_rect, + gfx::OverlayTransform gfx_transform) { + const RectF display_rect(gfx_display_rect.x(), gfx_display_rect.y(), + gfx_display_rect.width(), gfx_display_rect.height()); + VideoPlane::Transform transform = ConvertTransform(gfx_transform); + DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(DisplayRectFValid(display_rect)); if (have_video_plane_geometry_ &&
diff --git a/chromecast/media/base/video_plane_controller.h b/chromecast/media/base/video_plane_controller.h index e926c78..8a41f79 100644 --- a/chromecast/media/base/video_plane_controller.h +++ b/chromecast/media/base/video_plane_controller.h
@@ -42,10 +42,12 @@ // Sets the video plane geometry in *graphics plane coordinates*. If there is // no change to video plane parameters from the last call to this method, it // is a no-op. + // TODO(dnicoara): DEPRECATED, Remove once all users are updated. void SetGeometryGfx(const gfx::RectF& display_rect, gfx::OverlayTransform transform); - void SetGeometry(const RectF& display_rect, VideoPlane::Transform transform); + void SetGeometry(const gfx::RectF& display_rect, + gfx::OverlayTransform transform); // Sets physical screen resolution. This must be called at least once when // the final output resolution (HDMI signal or panel resolution) is known,
diff --git a/chromeos/BUILD.gn b/chromeos/BUILD.gn index 81d399a..cdc2397 100644 --- a/chromeos/BUILD.gn +++ b/chromeos/BUILD.gn
@@ -119,6 +119,8 @@ "chromeos_constants.cc", "chromeos_constants.h", "chromeos_export.h", + "chromeos_features.cc", + "chromeos_features.h", "chromeos_paths.cc", "chromeos_paths.h", "chromeos_pref_names.cc",
diff --git a/chromeos/OWNERS b/chromeos/OWNERS index 51badae..840fc2d5 100644 --- a/chromeos/OWNERS +++ b/chromeos/OWNERS
@@ -1,3 +1,5 @@ +per-file chromeos_features.cc=* +per-file chromeos_features.h=* per-file chromeos_switches.cc=* per-file chromeos_switches.h=* per-file chromeos.gyp=*
diff --git a/chromeos/chromeos_features.cc b/chromeos/chromeos_features.cc new file mode 100644 index 0000000..3fe1528 --- /dev/null +++ b/chromeos/chromeos_features.cc
@@ -0,0 +1,22 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromeos/chromeos_features.h" + +namespace chromeos { + +namespace features { + +// If enabled, the Chrome OS Settings UI will include a menu for the unified +// MultiDevice settings. +const base::Feature kEnableUnifiedMultiDeviceSettings{ + "EnableUnifiedMultiDeviceSettings", base::FEATURE_DISABLED_BY_DEFAULT}; + +// Enable the device to setup all MultiDevice services in a single workflow. +const base::Feature kEnableUnifiedMultiDeviceSetup{ + "EnableUnifiedMultiDeviceSetup", base::FEATURE_DISABLED_BY_DEFAULT}; + +} // namespace features + +} // namespace chromeos
diff --git a/chromeos/chromeos_features.h b/chromeos/chromeos_features.h new file mode 100644 index 0000000..5d41251 --- /dev/null +++ b/chromeos/chromeos_features.h
@@ -0,0 +1,25 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMEOS_CHROMEOS_FEATURES_H_ +#define CHROMEOS_CHROMEOS_FEATURES_H_ + +#include "base/feature_list.h" +#include "chromeos/chromeos_export.h" + +namespace chromeos { + +namespace features { + +// All features in alphabetical order. The features should be documented +// alongside the definition of their values in the .cc file. + +CHROMEOS_EXPORT extern const base::Feature kEnableUnifiedMultiDeviceSettings; +CHROMEOS_EXPORT extern const base::Feature kEnableUnifiedMultiDeviceSetup; + +} // namespace features + +} // namespace chromeos + +#endif // CHROMEOS_CHROMEOS_FEATURES_H_
diff --git a/chromeos/services/assistant/BUILD.gn b/chromeos/services/assistant/BUILD.gn index c9f23de7..83e069e 100644 --- a/chromeos/services/assistant/BUILD.gn +++ b/chromeos/services/assistant/BUILD.gn
@@ -54,6 +54,8 @@ "platform/system_provider_impl.h", "platform_api_impl.cc", "platform_api_impl.h", + "utils.cc", + "utils.h", ] deps += [
diff --git a/chromeos/services/assistant/assistant_manager_service_impl.cc b/chromeos/services/assistant/assistant_manager_service_impl.cc index a78dfaf..84d6757d 100644 --- a/chromeos/services/assistant/assistant_manager_service_impl.cc +++ b/chromeos/services/assistant/assistant_manager_service_impl.cc
@@ -15,6 +15,7 @@ #include "chromeos/assistant/internal/internal_constants.h" #include "chromeos/assistant/internal/internal_util.h" #include "chromeos/services/assistant/service.h" +#include "chromeos/services/assistant/utils.h" #include "chromeos/system/version_loader.h" #include "libassistant/shared/internal_api/assistant_manager_internal.h" #include "url/gurl.h" @@ -24,7 +25,7 @@ AssistantManagerServiceImpl::AssistantManagerServiceImpl( mojom::AudioInputPtr audio_input) - : platform_api_(kDefaultConfigStr, std::move(audio_input)), + : platform_api_(CreateLibAssistantConfig(), std::move(audio_input)), action_module_(std::make_unique<action::CrosActionModule>(this)), display_connection_(std::make_unique<CrosDisplayConnection>(this)), main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()), @@ -39,7 +40,7 @@ base::PostTaskWithTraitsAndReplyWithResult( FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE}, base::BindOnce(&assistant_client::AssistantManager::Create, - &platform_api_, kDefaultConfigStr), + &platform_api_, CreateLibAssistantConfig()), base::BindOnce(&AssistantManagerServiceImpl::StartAssistantInternal, base::Unretained(this), std::move(callback), access_token, chromeos::version_loader::GetARCVersion()));
diff --git a/chromeos/services/assistant/utils.cc b/chromeos/services/assistant/utils.cc new file mode 100644 index 0000000..cdf5f58 --- /dev/null +++ b/chromeos/services/assistant/utils.cc
@@ -0,0 +1,43 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromeos/services/assistant/utils.h" + +#include "base/json/json_writer.h" +#include "base/logging.h" +#include "base/sys_info.h" +#include "base/values.h" +#include "chromeos/assistant/internal/internal_constants.h" +#include "chromeos/system/version_loader.h" + +namespace chromeos { +namespace assistant { + +std::string CreateLibAssistantConfig() { + using Value = base::Value; + using Type = base::Value::Type; + + Value config(Type::DICTIONARY); + + Value device(Type::DICTIONARY); + device.SetKey("board_name", Value(base::SysInfo::GetLsbReleaseBoard())); + device.SetKey("board_revision", Value("1")); + device.SetKey("embedder_build_info", + Value(chromeos::version_loader::GetVersion( + chromeos::version_loader::VERSION_FULL))); + device.SetKey("model_id", Value(kModelId)); + device.SetKey("model_revision", Value(1)); + config.SetKey("device", std::move(device)); + + Value discovery(Type::DICTIONARY); + discovery.SetKey("enable_mdns", Value(false)); + config.SetKey("discovery", std::move(discovery)); + + std::string json; + base::JSONWriter::Write(config, &json); + return json; +} + +} // namespace assistant +} // namespace chromeos
diff --git a/chromeos/services/assistant/utils.h b/chromeos/services/assistant/utils.h new file mode 100644 index 0000000..781cc26 --- /dev/null +++ b/chromeos/services/assistant/utils.h
@@ -0,0 +1,20 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMEOS_SERVICES_ASSISTANT_UTILS_H_ +#define CHROMEOS_SERVICES_ASSISTANT_UTILS_H_ + +#include <string> + +#include "base/macros.h" + +namespace chromeos { +namespace assistant { + +std::string CreateLibAssistantConfig(); + +} // namespace assistant +} // namespace chromeos + +#endif // CHROMEOS_SERVICES_ASSISTANT_UTILS_H_
diff --git a/chromeos/services/device_sync/BUILD.gn b/chromeos/services/device_sync/BUILD.gn index b6a30855..38901258 100644 --- a/chromeos/services/device_sync/BUILD.gn +++ b/chromeos/services/device_sync/BUILD.gn
@@ -86,7 +86,6 @@ "//components/cryptauth:test_support", "//components/gcm_driver:test_support", "//components/prefs:test_support", - "//mojo/common", "//services/identity/public/cpp:test_support", "//services/service_manager/public/cpp:service_test_support", "//services/service_manager/public/cpp/test:test_support",
diff --git a/chromeos/services/device_sync/public/mojom/BUILD.gn b/chromeos/services/device_sync/public/mojom/BUILD.gn index e27a1f09..f239ae3 100644 --- a/chromeos/services/device_sync/public/mojom/BUILD.gn +++ b/chromeos/services/device_sync/public/mojom/BUILD.gn
@@ -27,7 +27,6 @@ "//base", "//base/test:test_support", "//components/cryptauth", - "//mojo/common", "//mojo/public/cpp/test_support:test_utils", "//testing/gtest", ]
diff --git a/components/arc/common/bluetooth.mojom b/components/arc/common/bluetooth.mojom index c3e0ebf..22b709e 100644 --- a/components/arc/common/bluetooth.mojom +++ b/components/arc/common/bluetooth.mojom
@@ -278,8 +278,8 @@ // change. This field is introduced between version 7 and 8, though // MinVersion is not annotated because of breaking change, too. // See details in the bug linked below. - // TODO(crbug.com/767313): Use mojo/common/values.mojom, when new libmojo - // (440057 or later) is rolled to ARC repository. + // TODO(crbug.com/767313): Use mojo/public/mojom/base/values.mojom, when new + // libmojo (440057 or later) is rolled to ARC repository. string? json_value@3; };
diff --git a/components/autofill/android/autofill_provider_android.cc b/components/autofill/android/autofill_provider_android.cc index fbc7832a..219cbc8 100644 --- a/components/autofill/android/autofill_provider_android.cc +++ b/components/autofill/android/autofill_provider_android.cc
@@ -157,26 +157,27 @@ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); if (obj.is_null()) return; + Java_AutofillProvider_onFormSubmitted(env, obj, (int)source); Reset(); } -bool AutofillProviderAndroid::OnFormSubmitted(AutofillHandlerProxy* handler, +void AutofillProviderAndroid::OnFormSubmitted(AutofillHandlerProxy* handler, const FormData& form, bool known_success, SubmissionSource source, base::TimeTicks timestamp) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!IsCurrentlyLinkedHandler(handler) || !IsCurrentlyLinkedForm(form)) - return false; + return; if (known_success || source == SubmissionSource::FORM_SUBMISSION) { FireSuccessfulSubmission(source); - } else { - check_submission_ = true; - pending_submission_source_ = source; + return; } - return true; + + check_submission_ = true; + pending_submission_source_ = source; } void AutofillProviderAndroid::OnFocusNoLongerOnForm(
diff --git a/components/autofill/android/autofill_provider_android.h b/components/autofill/android/autofill_provider_android.h index 6c30caa..9a707c54 100644 --- a/components/autofill/android/autofill_provider_android.h +++ b/components/autofill/android/autofill_provider_android.h
@@ -44,7 +44,7 @@ const FormData& form, const FormFieldData& field, const gfx::RectF& bounding_box) override; - bool OnFormSubmitted(AutofillHandlerProxy* handler, + void OnFormSubmitted(AutofillHandlerProxy* handler, const FormData& form, bool known_success, SubmissionSource source,
diff --git a/components/autofill/content/DEPS b/components/autofill/content/DEPS index 0baa569..d9c00e11 100644 --- a/components/autofill/content/DEPS +++ b/components/autofill/content/DEPS
@@ -1,6 +1,5 @@ include_rules = [ "+content/public/common", - "+mojo/common", "+mojo/public", "+services/service_manager/public/cpp", ]
diff --git a/components/autofill/core/browser/autofill_handler.cc b/components/autofill/core/browser/autofill_handler.cc index 4e3c8f7..89a5c7a 100644 --- a/components/autofill/core/browser/autofill_handler.cc +++ b/components/autofill/core/browser/autofill_handler.cc
@@ -15,13 +15,12 @@ AutofillHandler::~AutofillHandler() {} -bool AutofillHandler::OnFormSubmitted(const FormData& form, +void AutofillHandler::OnFormSubmitted(const FormData& form, bool known_success, SubmissionSource source, base::TimeTicks timestamp) { - if (!IsValidFormData(form)) - return false; - return OnFormSubmittedImpl(form, known_success, source, timestamp); + if (IsValidFormData(form)) + OnFormSubmittedImpl(form, known_success, source, timestamp); } void AutofillHandler::OnTextFieldDidChange(const FormData& form,
diff --git a/components/autofill/core/browser/autofill_handler.h b/components/autofill/core/browser/autofill_handler.h index 5e3f84b..b6592b1 100644 --- a/components/autofill/core/browser/autofill_handler.h +++ b/components/autofill/core/browser/autofill_handler.h
@@ -65,9 +65,8 @@ // Invoked when |form| has been submitted. // Processes the submitted |form|, saving any new Autofill data to the user's - // personal profile. Returns whether the upload process was started (used for - // testing). - bool OnFormSubmitted(const FormData& form, + // personal profile. + void OnFormSubmitted(const FormData& form, bool known_success, SubmissionSource source, base::TimeTicks timestamp); @@ -111,7 +110,7 @@ protected: AutofillHandler(AutofillDriver* driver); - virtual bool OnFormSubmittedImpl(const FormData& form, + virtual void OnFormSubmittedImpl(const FormData& form, bool known_success, SubmissionSource source, base::TimeTicks timestamp) = 0;
diff --git a/components/autofill/core/browser/autofill_handler_proxy.cc b/components/autofill/core/browser/autofill_handler_proxy.cc index 0b35d36..eee6adc4 100644 --- a/components/autofill/core/browser/autofill_handler_proxy.cc +++ b/components/autofill/core/browser/autofill_handler_proxy.cc
@@ -16,12 +16,11 @@ AutofillHandlerProxy::~AutofillHandlerProxy() {} -bool AutofillHandlerProxy::OnFormSubmittedImpl(const FormData& form, +void AutofillHandlerProxy::OnFormSubmittedImpl(const FormData& form, bool known_success, SubmissionSource source, base::TimeTicks timestamp) { - return provider_->OnFormSubmitted(this, form, known_success, source, - timestamp); + provider_->OnFormSubmitted(this, form, known_success, source, timestamp); } void AutofillHandlerProxy::OnTextFieldDidChangeImpl(
diff --git a/components/autofill/core/browser/autofill_handler_proxy.h b/components/autofill/core/browser/autofill_handler_proxy.h index 6f9c6742..34af776 100644 --- a/components/autofill/core/browser/autofill_handler_proxy.h +++ b/components/autofill/core/browser/autofill_handler_proxy.h
@@ -41,7 +41,7 @@ } protected: - bool OnFormSubmittedImpl(const FormData& form, + void OnFormSubmittedImpl(const FormData& form, bool known_success, SubmissionSource source, base::TimeTicks timestamp) override;
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index 9d983f1..e594e6f 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc
@@ -348,19 +348,19 @@ ParseForms(forms); } -bool AutofillManager::OnFormSubmittedImpl(const FormData& form, +void AutofillManager::OnFormSubmittedImpl(const FormData& form, bool known_success, SubmissionSource source, base::TimeTicks timestamp) { // TODO(crbug.com/801698): handle PROBABLY_FORM_SUBMITTED. if (source == SubmissionSource::PROBABLY_FORM_SUBMITTED) - return false; + return; // We will always give Autocomplete a chance to save the data. std::unique_ptr<FormStructure> submitted_form = ValidateSubmittedForm(form); if (!submitted_form) { autocomplete_history_manager_->OnWillSubmitForm(form); - return false; + return; } // However, if Autofill has recognized a field as CVC, that shouldn't be @@ -378,14 +378,15 @@ if (IsCreditCardAutofillEnabled()) credit_card_form_event_logger_->OnWillSubmitForm(); - bool ret = StartUploadProcess(std::move(submitted_form), timestamp, true); + MaybeStartVoteUploadProcess(std::move(submitted_form), timestamp, + /*observed_submission=*/true); // TODO(crbug.com/803334): Add FormStructure::Clone() method. // Create another FormStructure instance. submitted_form = ValidateSubmittedForm(form); DCHECK(submitted_form); if (!submitted_form) - return ret; + return; CreditCard credit_card = form_data_importer_->ExtractCreditCardFromForm(*submitted_form); @@ -398,17 +399,16 @@ credit_card_form_event_logger_->OnFormSubmitted(enable_ablation_logging_, card_number_status); + if (!submitted_form->IsAutofillable()) + return; + // Update Personal Data with the form's submitted data. // Also triggers offering local/upload credit card save, if applicable. - if (submitted_form->IsAutofillable()) { - form_data_importer_->ImportFormData(*submitted_form, - IsCreditCardAutofillEnabled()); - } - - return ret; + form_data_importer_->ImportFormData(*submitted_form, + IsCreditCardAutofillEnabled()); } -bool AutofillManager::StartUploadProcess( +bool AutofillManager::MaybeStartVoteUploadProcess( std::unique_ptr<FormStructure> form_structure, const TimeTicks& timestamp, bool observed_submission) { @@ -478,7 +478,8 @@ if (!upload_form) return; - StartUploadProcess(std::move(upload_form), TimeTicks::Now(), false); + MaybeStartVoteUploadProcess(std::move(upload_form), TimeTicks::Now(), + /*observed_submission=*/false); } void AutofillManager::OnTextFieldDidChangeImpl(const FormData& form, @@ -1394,15 +1395,14 @@ AutofillField* cached_field = form_structure->field(i); FieldTypeGroup field_group_type = cached_field->Type().group(); - // Don't fill non-focusable fields, with the exception of <select> fields. - if (!cached_field->is_focusable && + // Don't fill hidden fields, with the exception of <select> fields, for + // the sake of filling the synthetic fields. + if ((!cached_field->is_focusable || + cached_field->role == FormFieldData::ROLE_ATTRIBUTE_PRESENTATION) && result.fields[i].form_control_type != "select-one") { continue; } - if (cached_field->role == FormFieldData::ROLE_ATTRIBUTE_PRESENTATION) - continue; - // Don't fill previously autofilled fields except the initiating field or // when it's a refill. if (result.fields[i].is_autofilled && !cached_field->SameFieldAs(field) &&
diff --git a/components/autofill/core/browser/autofill_manager.h b/components/autofill/core/browser/autofill_manager.h index 61d0e38..6f9df9f 100644 --- a/components/autofill/core/browser/autofill_manager.h +++ b/components/autofill/core/browser/autofill_manager.h
@@ -163,9 +163,10 @@ // Autofill profile data. |observed_submission| is specified if the upload // follows an observed submission event. Returns false if the upload couldn't // start. - virtual bool StartUploadProcess(std::unique_ptr<FormStructure> form_structure, - const base::TimeTicks& timestamp, - bool observed_submission); + virtual bool MaybeStartVoteUploadProcess( + std::unique_ptr<FormStructure> form_structure, + const base::TimeTicks& timestamp, + bool observed_submission); // Update the pending form with |form|, possibly processing the current // pending form for upload. @@ -240,7 +241,7 @@ std::string* profile_backend_id) const; // AutofillHandler: - bool OnFormSubmittedImpl(const FormData& form, + void OnFormSubmittedImpl(const FormData& form, bool known_success, SubmissionSource source, base::TimeTicks timestamp) override;
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc index a481df4..805a92b 100644 --- a/components/autofill/core/browser/autofill_manager_unittest.cc +++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -3613,6 +3613,73 @@ } } +// The hidden and the presentational fields should be filled, only if their +// control type is 'select-one'. This exception is made to support synthetic +// fields. +TEST_F(AutofillManagerTest, FormWithHiddenOrPresentationalSelects) { + FormData form; + form.name = ASCIIToUTF16("MyForm"); + form.origin = GURL("http://myform.com/form.html"); + form.action = GURL("http://myform.com/submit.html"); + + FormFieldData field; + + test::CreateTestFormField("First name", "firstname", "", "text", &field); + form.fields.push_back(field); + + test::CreateTestFormField("Last name", "lastname", "", "text", &field); + form.fields.push_back(field); + + { + const std::vector<const char*> values{"CA", "US", "BR"}; + const std::vector<const char*> contents{"Canada", "United States", + "Banana Republic"}; + test::CreateTestSelectField("Country", "country", "", values, contents, + values.size(), &field); + field.is_focusable = false; + form.fields.push_back(field); + } + { + const std::vector<const char*> values{"NY", "CA", "TN"}; + const std::vector<const char*> contents{"New York", "California", + "Tennessee"}; + test::CreateTestSelectField("State", "state", "", values, contents, + values.size(), &field); + field.role = FormFieldData::ROLE_ATTRIBUTE_PRESENTATION; + form.fields.push_back(field); + } + + test::CreateTestFormField("City", "city", "", "text", &field); + field.is_focusable = false; + form.fields.push_back(field); + + test::CreateTestFormField("Street Address", "address", "", "text", &field); + field.role = FormFieldData::ROLE_ATTRIBUTE_PRESENTATION; + form.fields.push_back(field); + + std::vector<FormData> forms(1, form); + FormsSeen(forms); + + const char guid[] = "00000000-0000-0000-0000-000000000001"; + int response_page_id = 0; + FormData response_data; + FillAutofillFormDataAndSaveResults(kDefaultPageID, form, form.fields[0], + MakeFrontendID(std::string(), guid), + &response_page_id, &response_data); + + ExpectFilledField("First name", "firstname", "Elvis", "text", + response_data.fields[0]); + ExpectFilledField("Last name", "lastname", "Presley", "text", + response_data.fields[1]); + ExpectFilledField("Country", "country", "US", "select-one", + response_data.fields[2]); + ExpectFilledField("State", "state", "TN", "select-one", + response_data.fields[3]); + ExpectFilledField("City", "city", "", "text", response_data.fields[4]); + ExpectFilledField("Street Address", "address", "", "text", + response_data.fields[5]); +} + TEST_F(AutofillManagerTest, FillFirstPhoneNumber_MultipleSectionFilledCorrectly) { AutofillProfile* work_profile = @@ -5964,8 +6031,8 @@ EXPECT_CALL(*download_manager_, StartUploadRequest(_, false, _, std::string(), true)) .WillOnce(DoAll(SaveArg<2>(&uploaded_available_types), Return(true))); - autofill_manager_->StartUploadProcess(std::move(form_structure), - base::TimeTicks::Now(), true); + autofill_manager_->MaybeStartVoteUploadProcess(std::move(form_structure), + base::TimeTicks::Now(), true); EXPECT_EQ(signature, autofill_manager_->GetSubmittedFormSignature()); EXPECT_NE(uploaded_available_types.end(),
diff --git a/components/autofill/core/browser/autofill_provider.h b/components/autofill/core/browser/autofill_provider.h index cb986feb..002b7051 100644 --- a/components/autofill/core/browser/autofill_provider.h +++ b/components/autofill/core/browser/autofill_provider.h
@@ -46,7 +46,7 @@ const FormFieldData& field, const gfx::RectF& bounding_box) = 0; - virtual bool OnFormSubmitted(AutofillHandlerProxy* handler, + virtual void OnFormSubmitted(AutofillHandlerProxy* handler, const FormData& form, bool known_success, SubmissionSource source,
diff --git a/components/autofill/core/browser/form_field.cc b/components/autofill/core/browser/form_field.cc index b9329ef..1c8e976 100644 --- a/components/autofill/core/browser/form_field.cc +++ b/components/autofill/core/browser/form_field.cc
@@ -48,10 +48,11 @@ // Ignore checkable fields as they interfere with parsers assuming context. // Eg., while parsing address, "Is PO box" checkbox after ADDRESS_LINE1 // interferes with correctly understanding ADDRESS_LINE2. - // Ignore fields marked as presentational. See - // http://www.w3.org/TR/wai-aria/roles#presentation + // Ignore fields marked as presentational, unless for 'select' fields (for + // synthetic fields.) if (IsCheckable(field->check_status) || - field->role == FormFieldData::ROLE_ATTRIBUTE_PRESENTATION) { + (field->role == FormFieldData::ROLE_ATTRIBUTE_PRESENTATION && + field->form_control_type != "select-one")) { continue; } processed_fields.push_back(field.get());
diff --git a/components/autofill/core/browser/test_autofill_manager.cc b/components/autofill/core/browser/test_autofill_manager.cc index a3afeef..a56f1d5 100644 --- a/components/autofill/core/browser/test_autofill_manager.cc +++ b/components/autofill/core/browser/test_autofill_manager.cc
@@ -64,13 +64,13 @@ AutofillManager::UploadFormData(submitted_form, observed_submission); } -bool TestAutofillManager::StartUploadProcess( +bool TestAutofillManager::MaybeStartVoteUploadProcess( std::unique_ptr<FormStructure> form_structure, const base::TimeTicks& timestamp, bool observed_submission) { run_loop_ = std::make_unique<base::RunLoop>(); - if (AutofillManager::StartUploadProcess(std::move(form_structure), timestamp, - observed_submission)) { + if (AutofillManager::MaybeStartVoteUploadProcess( + std::move(form_structure), timestamp, observed_submission)) { run_loop_->Run(); return true; }
diff --git a/components/autofill/core/browser/test_autofill_manager.h b/components/autofill/core/browser/test_autofill_manager.h index f4a2fd6..5864523 100644 --- a/components/autofill/core/browser/test_autofill_manager.h +++ b/components/autofill/core/browser/test_autofill_manager.h
@@ -52,9 +52,10 @@ bool IsCreditCardAutofillEnabled() override; void UploadFormData(const FormStructure& submitted_form, bool observed_submission) override; - bool StartUploadProcess(std::unique_ptr<FormStructure> form_structure, - const base::TimeTicks& timestamp, - bool observed_submission) override; + bool MaybeStartVoteUploadProcess( + std::unique_ptr<FormStructure> form_structure, + const base::TimeTicks& timestamp, + bool observed_submission) override; void UploadFormDataAsyncCallback(const FormStructure* submitted_form, const base::TimeTicks& load_time, const base::TimeTicks& interaction_time,
diff --git a/components/autofill/core/browser/test_autofill_provider.cc b/components/autofill/core/browser/test_autofill_provider.cc index 99889b26..47e77d62 100644 --- a/components/autofill/core/browser/test_autofill_provider.cc +++ b/components/autofill/core/browser/test_autofill_provider.cc
@@ -32,14 +32,6 @@ const FormFieldData& field, const gfx::RectF& bounding_box) {} -bool TestAutofillProvider::OnFormSubmitted(AutofillHandlerProxy* handler, - const FormData& form, - bool known_success, - SubmissionSource source, - base::TimeTicks timestamp) { - return false; -} - void TestAutofillProvider::OnFocusNoLongerOnForm( AutofillHandlerProxy* handler) {}
diff --git a/components/autofill/core/browser/test_autofill_provider.h b/components/autofill/core/browser/test_autofill_provider.h index b25e7c8..166556af 100644 --- a/components/autofill/core/browser/test_autofill_provider.h +++ b/components/autofill/core/browser/test_autofill_provider.h
@@ -32,11 +32,11 @@ const FormData& form, const FormFieldData& field, const gfx::RectF& bounding_box) override; - bool OnFormSubmitted(AutofillHandlerProxy* handler, + void OnFormSubmitted(AutofillHandlerProxy* handler, const FormData& form, bool known_success, SubmissionSource source, - base::TimeTicks timestamp) override; + base::TimeTicks timestamp) override {} void OnFocusNoLongerOnForm(AutofillHandlerProxy* handler) override; void OnFocusOnFormField(AutofillHandlerProxy* handler, const FormData& form,
diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc index 5487778c..85d6a8b 100644 --- a/components/browser_sync/profile_sync_service.cc +++ b/components/browser_sync/profile_sync_service.cc
@@ -1418,6 +1418,7 @@ return sync_prefs_.IsLocalSyncEnabled(); } +// TODO(tschumann): This is only called for tests. Add ForTesting name suffix. void ProfileSyncService::TriggerRefresh(const syncer::ModelTypeSet& types) { DCHECK(thread_checker_.CalledOnValidThread()); if (engine_initialized_)
diff --git a/components/content_settings/core/browser/content_settings_policy_provider.cc b/components/content_settings/core/browser/content_settings_policy_provider.cc index 8233001..8ce2963 100644 --- a/components/content_settings/core/browser/content_settings_policy_provider.cc +++ b/components/content_settings/core/browser/content_settings_policy_provider.cc
@@ -57,6 +57,10 @@ {prefs::kManagedPopupsAllowedForUrls, CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTING_ALLOW}, {prefs::kManagedPopupsBlockedForUrls, CONTENT_SETTINGS_TYPE_POPUPS, + CONTENT_SETTING_BLOCK}, + {prefs::kManagedWebUsbAskForUrls, CONTENT_SETTINGS_TYPE_USB_GUARD, + CONTENT_SETTING_ASK}, + {prefs::kManagedWebUsbBlockedForUrls, CONTENT_SETTINGS_TYPE_USB_GUARD, CONTENT_SETTING_BLOCK}}; } // namespace @@ -111,6 +115,8 @@ registry->RegisterListPref(prefs::kManagedPluginsBlockedForUrls); registry->RegisterListPref(prefs::kManagedPopupsAllowedForUrls); registry->RegisterListPref(prefs::kManagedPopupsBlockedForUrls); + registry->RegisterListPref(prefs::kManagedWebUsbAskForUrls); + registry->RegisterListPref(prefs::kManagedWebUsbBlockedForUrls); // Preferences for default content setting policies. If a policy is not set of // the corresponding preferences below is set to CONTENT_SETTING_DEFAULT. registry->RegisterIntegerPref(prefs::kManagedDefaultAdsSetting, @@ -162,6 +168,8 @@ pref_change_registrar_.Add(prefs::kManagedPluginsBlockedForUrls, callback); pref_change_registrar_.Add(prefs::kManagedPopupsAllowedForUrls, callback); pref_change_registrar_.Add(prefs::kManagedPopupsBlockedForUrls, callback); + pref_change_registrar_.Add(prefs::kManagedWebUsbAskForUrls, callback); + pref_change_registrar_.Add(prefs::kManagedWebUsbBlockedForUrls, callback); // The following preferences are only used to indicate if a default content // setting is managed and to hold the managed default setting value. If the // value for any of the following preferences is set then the corresponding
diff --git a/components/content_settings/core/common/pref_names.cc b/components/content_settings/core/common/pref_names.cc index d33b6a70..ed5f931 100644 --- a/components/content_settings/core/common/pref_names.cc +++ b/components/content_settings/core/common/pref_names.cc
@@ -73,4 +73,8 @@ "profile.managed_popups_allowed_for_urls"; const char kManagedPopupsBlockedForUrls[] = "profile.managed_popups_blocked_for_urls"; +const char kManagedWebUsbAskForUrls[] = "profile.managed_web_usb_ask_for_urls"; +const char kManagedWebUsbBlockedForUrls[] = + "profile.managed_web_usb_blocked_for_urls"; + } // namespace prefs
diff --git a/components/content_settings/core/common/pref_names.h b/components/content_settings/core/common/pref_names.h index fe33804..af5e4db 100644 --- a/components/content_settings/core/common/pref_names.h +++ b/components/content_settings/core/common/pref_names.h
@@ -43,6 +43,8 @@ extern const char kManagedNotificationsAllowedForUrls[]; extern const char kManagedNotificationsBlockedForUrls[]; extern const char kManagedAutoSelectCertificateForUrls[]; +extern const char kManagedWebUsbAskForUrls[]; +extern const char kManagedWebUsbBlockedForUrls[]; } // namespace prefs
diff --git a/components/download/content/internal/download_driver_impl.cc b/components/download/content/internal/download_driver_impl.cc index 050d79d7..6b2f626 100644 --- a/components/download/content/internal/download_driver_impl.cc +++ b/components/download/content/internal/download_driver_impl.cc
@@ -171,7 +171,9 @@ download::DownloadSource::INTERNAL_API); download_url_params->set_post_body(post_body); - download_manager_->DownloadUrl(std::move(download_url_params), nullptr); + download_manager_->DownloadUrl(std::move(download_url_params), + nullptr /* blob_data_handle */, + nullptr /* blob_url_loader_factory */); } void DownloadDriverImpl::Remove(const std::string& guid) {
diff --git a/components/gcm_driver/gcm_driver_desktop_unittest.cc b/components/gcm_driver/gcm_driver_desktop_unittest.cc index 99930fc3..28ba222 100644 --- a/components/gcm_driver/gcm_driver_desktop_unittest.cc +++ b/components/gcm_driver/gcm_driver_desktop_unittest.cc
@@ -79,9 +79,7 @@ } void PumpCurrentLoop() { - base::MessageLoop::ScopedNestableTaskAllower nestable_task_allower( - base::MessageLoopCurrent::Get()); - base::RunLoop().RunUntilIdle(); + base::RunLoop(base::RunLoop::Type::kNestableTasksAllowed).RunUntilIdle(); } void PumpUILoop() {
diff --git a/components/mirroring/DEPS b/components/mirroring/DEPS index a2f3fc1a..f5b9c0c2 100644 --- a/components/mirroring/DEPS +++ b/components/mirroring/DEPS
@@ -1,6 +1,5 @@ include_rules = [ "+media", - "+mojo/common", "+mojo/public", # For testing
diff --git a/components/offline_pages/content/background_loader/background_loader_contents.cc b/components/offline_pages/content/background_loader/background_loader_contents.cc index 6f8f80cc..0e66117 100644 --- a/components/offline_pages/content/background_loader/background_loader_contents.cc +++ b/components/offline_pages/content/background_loader/background_loader_contents.cc
@@ -88,7 +88,7 @@ void BackgroundLoaderContents::AddNewContents( content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/components/offline_pages/content/background_loader/background_loader_contents.h b/components/offline_pages/content/background_loader/background_loader_contents.h index 53863a7..0cfdf25 100644 --- a/components/offline_pages/content/background_loader/background_loader_contents.h +++ b/components/offline_pages/content/background_loader/background_loader_contents.h
@@ -71,7 +71,7 @@ content::SessionStorageNamespace* session_storage_namespace) override; void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/components/offline_pages/content/background_loader/background_loader_contents_unittest.cc b/components/offline_pages/content/background_loader/background_loader_contents_unittest.cc index 645ecd19..6910403 100644 --- a/components/offline_pages/content/background_loader/background_loader_contents_unittest.cc +++ b/components/offline_pages/content/background_loader/background_loader_contents_unittest.cc
@@ -5,6 +5,7 @@ #include "components/offline_pages/content/background_loader/background_loader_contents.h" #include "base/synchronization/waitable_event.h" +#include "content/public/browser/web_contents.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -139,7 +140,8 @@ TEST_F(BackgroundLoaderContentsTest, ShouldNotAddNewContents) { bool blocked; contents()->AddNewContents( - nullptr /* source */, nullptr /* new_contents */, + nullptr /* source */, + std::unique_ptr<content::WebContents>() /* new_contents */, WindowOpenDisposition::CURRENT_TAB /* disposition */, gfx::Rect() /* initial_rect */, false /* user_gesture */, &blocked /* was_blocked */);
diff --git a/components/password_manager/content/DEPS b/components/password_manager/content/DEPS index e86b350..f96967fa 100644 --- a/components/password_manager/content/DEPS +++ b/components/password_manager/content/DEPS
@@ -1,7 +1,6 @@ include_rules = [ "+components/autofill/core/common", "+content/public/common", - "+mojo/common", "+mojo/public", # Allow inclusion of WebKit API files. "+third_party/blink/public/platform",
diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc index 04b37fa..8cc1a3ee 100644 --- a/components/password_manager/core/browser/password_form_manager.cc +++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -1413,8 +1413,9 @@ DCHECK(form_structure->ShouldBeUploaded()); DCHECK_EQ(2u, form_structure->field_count()); form_structure->field(1)->set_possible_types({autofill::PASSWORD}); - autofill_manager->StartUploadProcess(std::move(form_structure), - base::TimeTicks::Now(), true); + autofill_manager->MaybeStartVoteUploadProcess(std::move(form_structure), + base::TimeTicks::Now(), + /*observed_submission=*/true); } void PasswordFormManager::SetUserAction(UserAction user_action) {
diff --git a/components/password_manager/core/browser/password_form_manager_unittest.cc b/components/password_manager/core/browser/password_form_manager_unittest.cc index 07a9339..c4cde4e5 100644 --- a/components/password_manager/core/browser/password_form_manager_unittest.cc +++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -302,15 +302,16 @@ } // Workaround for std::unique_ptr<> lacking a copy constructor. - bool StartUploadProcess(std::unique_ptr<FormStructure> form_structure, - const base::TimeTicks& timestamp, - bool observed_submission) { - StartUploadProcessPtr(form_structure.release(), timestamp, - observed_submission); + bool MaybeStartVoteUploadProcess( + std::unique_ptr<FormStructure> form_structure, + const base::TimeTicks& timestamp, + bool observed_submission) { + MaybeStartVoteUploadProcessPtr(form_structure.release(), timestamp, + observed_submission); return true; } - MOCK_METHOD3(StartUploadProcessPtr, + MOCK_METHOD3(MaybeStartVoteUploadProcessPtr, void(FormStructure*, const base::TimeTicks&, bool)); private: @@ -3607,7 +3608,8 @@ // for upload. auto* mock_autofill_manager = client()->mock_driver()->mock_autofill_manager(); - EXPECT_CALL(*mock_autofill_manager, StartUploadProcessPtr(_, _, true)) + EXPECT_CALL(*mock_autofill_manager, + MaybeStartVoteUploadProcessPtr(_, _, true)) .WillOnce(WithArg<0>(SaveToUniquePtr(&signin_vote_form_structure))); } else { autofill::ServerFieldTypeSet field_types; @@ -3863,7 +3865,8 @@ std::unique_ptr<FormStructure> uploaded_form_structure; auto* mock_autofill_manager = client()->mock_driver()->mock_autofill_manager(); - EXPECT_CALL(*mock_autofill_manager, StartUploadProcessPtr(_, _, true)) + EXPECT_CALL(*mock_autofill_manager, + MaybeStartVoteUploadProcessPtr(_, _, true)) .WillOnce(WithArg<0>(SaveToUniquePtr(&uploaded_form_structure))); form_manager.ProvisionallySave( form_to_save, PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); @@ -3899,7 +3902,8 @@ auto* mock_autofill_manager = client()->mock_driver()->mock_autofill_manager(); - EXPECT_CALL(*mock_autofill_manager, StartUploadProcessPtr(_, _, _)).Times(0); + EXPECT_CALL(*mock_autofill_manager, MaybeStartVoteUploadProcessPtr(_, _, _)) + .Times(0); form_manager.ProvisionallySave( form_to_save, PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); form_manager.Save();
diff --git a/components/policy/proto/device_management_backend.proto b/components/policy/proto/device_management_backend.proto index 4dfc37a..05e3a6a 100644 --- a/components/policy/proto/device_management_backend.proto +++ b/components/policy/proto/device_management_backend.proto
@@ -915,6 +915,184 @@ optional BrowserReport browser_report = 4; } +// A validation result from validating a policy value that was contained in +// the payload of the policy fetch response. +message PolicyValueValidationResult { + // Policy proto tag of the policy which caused this validation message. + // For device policy (i.e. when |policy_type| in + // PolicyValidationReportRequest is google/chromeos/device), this is a + // proto tag from ChromeDeviceSettingsProto. Example: proto tag = 1 would mean + // the device_policy_refresh_rate policy in this case. + // For user policy (i.e. when |policy_type| in + // PolicyValidationReportRequest is google/chromeos/user), this is a + // proto tag from ChromeSettingsProto. Example: proto tag = 3 would mean the + // HomepageLocation policy in this case. + // Proto tags are used because they are consistent identifiers shared across + // the server and the client implementation. + optional int32 policy_proto_tag = 1; + + enum ValidationResultSeverity { + // Default value for when a severity is not specified. + VALIDATION_RESULT_SEVERITY_UNSPECIFIED = 0; + + // This result is a warning. The policy blob has not been rejected. + VALIDATION_RESULT_SEVERITY_WARNING = 1; + + // This result is an error. The policy blob was rejected completely and not + // updated on the device. + VALIDATION_RESULT_SEVERITY_ERROR = 2; + } + + // Severity of this policy value validation result. + optional ValidationResultSeverity severity = 2; + + // If the error occurred in a policy which is a JSON value, this + // is the JSON path to the element where the error was raised. + // For example, if a validation message was raised in an ONC policy and the + // error is that the Security field of the WiFi NetworkConfiguration with guid + // ABC has an invalid value, ErrorType would be ERROR_TYPE_UNKNOWN_ENUM_VALUE + // and detailed_error_path would be: + // "$.NetworkConfigurations[?(@.GUID=='ABC')].WiFi.Security". + // If the error was that a NetworkConfigurations element is missing a GUID, + // ErrorType would be ERROR_TYPE_MISSING_FIELD and the path would be: + // "$.NetworkConfigurations[1].GUID". + optional string detailed_error_path = 3; + + enum ErrorType { + // An enum value was received which is not known in this version of the + // proto. + ERROR_TYPE_UNSPECIFIED = 0; + + // For JSON (e.g. ONC) policies: The JSON blob could not be + // parsed. |detailed_error_path| will be empty. + ERROR_TYPE_PARSE_ERROR = 1; + + // For JSON (e.g. ONC) policies: A field had an invalid type. + // |detailed_error_path| will be set to the path of the field. + ERROR_TYPE_INVALID_TYPE = 3; + + // For JSON (e.g. ONC) policies: A required field was not found. + // |detailed_error_path| will be set to the path of the missing + // field. + ERROR_TYPE_MISSING_FIELD = 4; + + // For ONC policy: An enum field had a value not known by the + // client. |detailed_error_path| will be set to the path of the + // field. + ERROR_TYPE_UNKNOWN_ENUM_VALUE = 5; + + // For ONC policy: The value of a field was out of bounds. + // |detailed_error_path| will be set to the path of the + // field. + ERROR_TYPE_OUT_OF_BOUNDS = 6; + + // For ONC policy: A GUID-referenced element could not be + // resolved. |detailed_error_path| will be set to the reference + // field. + ERROR_TYPE_INVALID_REFERENCE = 7; + } + + // The type of the error message. + optional ErrorType error_type = 4; + + // Debug info about the error message. This will not be presented to the + // administrator. It can give additional clues about what went wrong so the + // developers can diagnose the issue. + optional string error_debug_info = 5; +} + +// This message is used to upload the result of cloud policy validation after a +// PolicyFetchRequest. +message PolicyValidationReportRequest { + // |policy_type| sent in PolicyFetchRequest on the request which + // returned policy with validation errors. + optional string policy_type = 1; + + // |policy_token| from the PolicyFetchResponse. This is used to identify the + // specific policy fetch event that triggered this validation report. + optional string policy_token = 2; + + // Specifies the result type of the validation. + // Each enum value can correspond to one of three client behaviors (noted as + // 'Client behavior' in the comment for each enum value): + // - Unknown: + // It is not known if the fetched policy blob was accepted or rejected. + // - Policy blob accepted: + // The client has accepted and applied the fetched policy blob. + // - Policy blob rejected: + // The client has completely rejected the fetched policy blob. + enum ValidationResultType { + // An enum value was received which is not known in this version of the + // proto. + // Client behavior: Unknown. + VALIDATION_RESULT_TYPE_ERROR_UNSPECIFIED = 0; + // Policy validated successfully. + // Client behavior: Policy blob accepted. + // Note: This result is here for completeness, the client will not send + // reports with this enum value. + VALIDATION_RESULT_TYPE_SUCCESS = 1; + // Bad signature on the initial key. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_BAD_INITIAL_SIGNATURE = 2; + // Bad signature. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_BAD_SIGNATURE = 3; + // Policy blob contains error code. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_ERROR_CODE_PRESENT = 4; + // Policy payload failed to decode. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_PAYLOAD_PARSE_ERROR = 5; + // Unexpected policy type. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_WRONG_POLICY_TYPE = 6; + // Unexpected settings entity id. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_WRONG_SETTINGS_ENTITY_ID = 7; + // Timestamp is missing or is older than the timestamp of the previous + // policy. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_BAD_TIMESTAMP = 8; + // DM token is empty or doesn't match. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_BAD_DM_TOKEN = 9; + // Device id is empty or doesn't match. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_BAD_DEVICE_ID = 10; + // Username doesn't match. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_USER_MISMATCH = 11; + // Policy payload protobuf parse error. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_POLICY_PARSE_ERROR = 12; + // Policy key signature could not be verified using the hard-coded + // verification key. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_BAD_KEY_VERIFICATION_SIGNATURE = 13; + // There were validation warnings during validation of policy values in the + // payload. See |policy_value_validation_results|. + // Client behavior: Policy blob accepted. + VALIDATION_RESULT_TYPE_POLICY_VALUE_WARNINGS = 14; + // There were validation errors during validation of policy values in the + // payload. There may also have been warnings. See + // |policy_value_validation_results| - that list will contain at least one + // payload validation errors, and zero or more payload validation warnings. + // Client behavior: Policy blob rejected. + VALIDATION_RESULT_TYPE_POLICY_VALUE_ERRORS = 15; + } + + // The validation result. + optional ValidationResultType validation_result_type = 3; + + // Value validation results in the policy payload. Will be filled if + // |validation_result_type| is VALIDATION_RESULT_TYPE_POLICY_VALUE_WARNINGS + // or VALIDATION_RESULT_TYPE_POLICY_VALUE_ERRORS. + repeated PolicyValueValidationResult policy_value_validation_results = 4; +} + +// Response from DMServer to a policy validation report. +message PolicyValidationReportResponse {} + message AndroidStatus { // JSON string of ARC status report. optional string status_payload = 1; @@ -1572,6 +1750,7 @@ // * check_device_license // * active_directory_user_signin // * register_browser +// * policy_validation_report // * devicetype: MUST BE "1" for Android, "2" for Chrome OS or "3" for Chrome // browser. // * apptype: MUST BE Android or Chrome. @@ -1587,8 +1766,8 @@ // // * For unregister, policy, status, cert_upload, remote_commands, // gcm_id_update, active_directory_enroll_play_user, -// active_directory_play_activity, active_directory_user_signin requests, -// and chrome_desktop_report. +// active_directory_play_activity, active_directory_user_signin, +// policy_validation_report and chrome_desktop_report requests // Authorization: GoogleDMToken token=<dm token from register> // // * The Authorization header isn't used for enterprise_check or for @@ -1623,6 +1802,7 @@ // active_directory_user_signin: active_directory_user_signin_request // register_browser: register_browser_request // app_install_report: app_install_report_request +// policy_validation_report: policy_validation_report_request // message DeviceManagementRequest { reserved 24; // unused previous version of chrome_desktop_report_request. @@ -1705,6 +1885,9 @@ // A Chrome desktop report request. optional ChromeDesktopReportRequest chrome_desktop_report_request = 26; + + // Result of validating fetched policy on the client. + optional PolicyValidationReportRequest policy_validation_report_request = 27; } // Response from server to device. @@ -1833,4 +2016,8 @@ // Response a report on the status of app push-installs optional AppInstallReportResponse app_install_report_response = 25; + + // Response to a policy validation report. + optional PolicyValidationReportResponse policy_validation_report_response = + 26; }
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 177712c..f8b71aa1 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -145,7 +145,7 @@ # persistent IDs for all fields (but not for groups!) are needed. These are # specified by the 'id' keys of each policy. NEVER CHANGE EXISTING IDs, # because doing so would break the deployed wire format! -# For your editing convenience: highest ID currently used: 438 +# For your editing convenience: highest ID currently used: 440 # And don't forget to also update the EnterprisePolicies enum of # histograms.xml (run 'python tools/metrics/histograms/update_policies.py'). # @@ -438,6 +438,8 @@ 'PopupsBlockedForUrls', 'NotificationsAllowedForUrls', 'NotificationsBlockedForUrls', + 'WebUsbAskForUrls', + 'WebUsbBlockedForUrls', ], }, { @@ -3804,9 +3806,55 @@ 'tags': ['website-sharing'], 'desc': '''Allows you to set whether websites are allowed to get access to connected USB devices. Access can be completely blocked, or the user can be asked every time a website wants to get access to connected USB devices. + This policy can be overridden for specific URL patterns using the 'WebUsbAskForUrls' and 'WebUsbBlockedForUrls' policies. + If this policy is left not set, '3' will be used, and the user will be able to change it.''', }, { + 'name': 'WebUsbAskForUrls', + 'type': 'list', + 'schema': { + 'type': 'array', + 'items': { 'type': 'string' }, + }, + 'supported_on': ['chrome_os:68-', 'android:68-', 'chrome.*:68-'], + 'features': { + 'dynamic_refresh': True, + 'per_profile': True, + }, + 'example_value': ['https://www.example.com', '[*.]example.edu'], + 'id': 439, + 'caption': '''Allow WebUSB on these sites''', + 'tags': ['website-sharing'], + 'desc': '''Allows you to set a list of url patterns that specify sites which are allowed to ask the user to grant them access to a USB device. + + If this policy is left not set the global default value will be used for all sites either from the 'DefaultWebUsbGuardSetting' policy if it is set, or the user's personal configuration otherwise. + + URL patterns in this policy should not clash with ones configured via WebUsbBlockedForUrls. It is unspecified which of the two policies takes precedence if a URL matches with both.''', + }, + { + 'name': 'WebUsbBlockedForUrls', + 'type': 'list', + 'schema': { + 'type': 'array', + 'items': { 'type': 'string' }, + }, + 'supported_on': ['chrome_os:68-', 'android:68-', 'chrome.*:68-'], + 'features': { + 'dynamic_refresh': True, + 'per_profile': True, + }, + 'example_value': ['https://www.example.com', '[*.]example.edu'], + 'id': 440, + 'caption': '''Block WebUSB on these sites''', + 'tags': [], + 'desc': '''Allows you to set a list of url patterns that specify sites which are prevented from asking the user to grant them access to a USB device. + + If this policy is left not set the global default value will be used for all sites either from the 'DefaultWebUsbGuardSetting' policy if it is set, or the user's personal configuration otherwise. + + URL patterns in this policy should not clash with ones configured via WebUsbAskForUrls. It is unspecified which of the two policies takes precedence if a URL matches with both.''', + }, + { 'name': 'AutoSelectCertificateForUrls', 'type': 'list', 'schema': {
diff --git a/components/printing/service/BUILD.gn b/components/printing/service/BUILD.gn index 36a86e1..5b4d189 100644 --- a/components/printing/service/BUILD.gn +++ b/components/printing/service/BUILD.gn
@@ -60,7 +60,6 @@ "//cc/paint:paint", "//components/crash/core/common:crash_key", "//components/printing/service/public/interfaces", - "//mojo/common", "//services/service_manager/public/cpp:service_test_support", "//skia", "//testing/gmock",
diff --git a/components/services/filesystem/BUILD.gn b/components/services/filesystem/BUILD.gn index a28630b3..504758b 100644 --- a/components/services/filesystem/BUILD.gn +++ b/components/services/filesystem/BUILD.gn
@@ -27,7 +27,6 @@ deps = [ "//base", "//components/services/filesystem/public/interfaces", - "//mojo/common", "//mojo/public/cpp/system", "//services/service_manager/public/cpp", "//services/service_manager/public/mojom", @@ -48,7 +47,6 @@ ":lib", "//base", "//components/services/filesystem/public/interfaces", - "//mojo/common", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//services/service_manager/public/cpp", @@ -73,7 +71,6 @@ deps = [ "//base", "//components/services/filesystem/public/interfaces", - "//mojo/common", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//services/service_manager/public/cpp",
diff --git a/components/services/filesystem/DEPS b/components/services/filesystem/DEPS index 77608007..541d16a 100644 --- a/components/services/filesystem/DEPS +++ b/components/services/filesystem/DEPS
@@ -1,6 +1,5 @@ include_rules = [ "+components/prefs", - "+mojo/common", "+mojo/public", "+mojo/util", "+services/service_manager",
diff --git a/components/services/font/DEPS b/components/services/font/DEPS index 5504d41f..dccac32 100644 --- a/components/services/font/DEPS +++ b/components/services/font/DEPS
@@ -1,6 +1,5 @@ include_rules = [ "+services/service_manager", - "+mojo/common", "+mojo/public", "+skia", "+third_party/skia/include",
diff --git a/components/services/font/public/cpp/BUILD.gn b/components/services/font/public/cpp/BUILD.gn index 667d32a..da5ce239 100644 --- a/components/services/font/public/cpp/BUILD.gn +++ b/components/services/font/public/cpp/BUILD.gn
@@ -15,7 +15,6 @@ deps = [ "../interfaces", "//base", - "//mojo/common", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//services/service_manager/public/cpp",
diff --git a/components/services/leveldb/BUILD.gn b/components/services/leveldb/BUILD.gn index e69401ec..7fc6bd0 100644 --- a/components/services/leveldb/BUILD.gn +++ b/components/services/leveldb/BUILD.gn
@@ -27,7 +27,6 @@ ] deps = [ - "//mojo/common", "//mojo/public/cpp/system", "//services/service_manager/public/cpp", "//third_party/leveldatabase", @@ -44,7 +43,6 @@ deps = [ ":lib", "//components/services/leveldb/public/interfaces", - "//mojo/common", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//services/service_manager/public/cpp", @@ -70,7 +68,6 @@ "//components/services/filesystem/public/interfaces", "//components/services/leveldb/public/cpp", "//components/services/leveldb/public/interfaces", - "//mojo/common", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//services/service_manager/public/cpp",
diff --git a/components/services/leveldb/DEPS b/components/services/leveldb/DEPS index 048eb8af..031b4cc4 100644 --- a/components/services/leveldb/DEPS +++ b/components/services/leveldb/DEPS
@@ -1,6 +1,5 @@ include_rules = [ "+components/services/filesystem/public/interfaces", - "+mojo/common", "+mojo/public", "+mojo/util", "+services/service_manager",
diff --git a/components/services/leveldb/public/cpp/BUILD.gn b/components/services/leveldb/public/cpp/BUILD.gn index b43e96d8..aab9403 100644 --- a/components/services/leveldb/public/cpp/BUILD.gn +++ b/components/services/leveldb/public/cpp/BUILD.gn
@@ -13,7 +13,6 @@ deps = [ "//base", "//components/services/leveldb/public/interfaces", - "//mojo/common", "//services/service_manager/public/cpp", "//third_party/leveldatabase", ]
diff --git a/components/sync/BUILD.gn b/components/sync/BUILD.gn index 8e95c62..f83e796 100644 --- a/components/sync/BUILD.gn +++ b/components/sync/BUILD.gn
@@ -220,6 +220,8 @@ "engine/sync_engine.h", "engine/sync_engine_host.cc", "engine/sync_engine_host.h", + "engine/sync_engine_switches.cc", + "engine/sync_engine_switches.h", "engine/sync_manager.cc", "engine/sync_manager.h", "engine/sync_manager_factory.cc",
diff --git a/components/sync/driver/glue/sync_backend_host_impl.cc b/components/sync/driver/glue/sync_backend_host_impl.cc index 29f827a4..f3bd250 100644 --- a/components/sync/driver/glue/sync_backend_host_impl.cc +++ b/components/sync/driver/glue/sync_backend_host_impl.cc
@@ -102,10 +102,16 @@ void SyncBackendHostImpl::StartSyncingWithServer() { SDVLOG(1) << "SyncBackendHostImpl::StartSyncingWithServer called."; - + base::Time last_poll_time = sync_prefs_->GetLastPollTime(); + // If there's no known last poll time (e.g. on initial start-up), we treat + // this as if a poll just happened. + if (last_poll_time.is_null()) { + last_poll_time = base::Time::Now(); + sync_prefs_->SetLastPollTime(last_poll_time); + } sync_task_runner_->PostTask( - FROM_HERE, base::Bind(&SyncBackendHostCore::DoStartSyncing, core_, - sync_prefs_->GetLastPollTime())); + FROM_HERE, base::BindOnce(&SyncBackendHostCore::DoStartSyncing, core_, + last_poll_time)); } void SyncBackendHostImpl::SetEncryptionPassphrase(const std::string& passphrase,
diff --git a/components/sync/engine/cycle/sync_cycle_snapshot.cc b/components/sync/engine/cycle/sync_cycle_snapshot.cc index 69d99b4..92ddb4f 100644 --- a/components/sync/engine/cycle/sync_cycle_snapshot.cc +++ b/components/sync/engine/cycle/sync_cycle_snapshot.cc
@@ -6,12 +6,26 @@ #include <utility> +#include "base/i18n/time_formatting.h" #include "base/json/json_writer.h" +#include "base/strings/string16.h" #include "base/values.h" #include "components/sync/protocol/proto_enum_conversions.h" namespace syncer { +namespace { + +base::string16 FormatTimeDelta(base::TimeDelta delta) { + base::string16 value; + bool ok = + base::TimeDurationFormat(delta, base::DURATION_WIDTH_NARROW, &value); + DCHECK(ok); + return value; +} + +} // namespace + SyncCycleSnapshot::SyncCycleSnapshot() : is_silenced_(false), num_encryption_conflicts_(0), @@ -106,6 +120,12 @@ } value->Set("counter_entries", std::move(counter_entries)); value->SetBoolean("hasRemainingLocalChanges", has_remaining_local_changes_); + value->SetString("short_poll_interval", + FormatTimeDelta(short_poll_interval_)); + value->SetString("long_poll_interval", FormatTimeDelta(long_poll_interval_)); + value->SetString( + "poll_finish_time", + base::TimeFormatShortDateAndTimeWithTimeZone(poll_finish_time_)); return value; }
diff --git a/components/sync/engine/cycle/sync_cycle_snapshot_unittest.cc b/components/sync/engine/cycle/sync_cycle_snapshot_unittest.cc index 8d5b5f6..49aaaa4 100644 --- a/components/sync/engine/cycle/sync_cycle_snapshot_unittest.cc +++ b/components/sync/engine/cycle/sync_cycle_snapshot_unittest.cc
@@ -40,7 +40,6 @@ const int kNumEncryptionConflicts = 1054; const int kNumHierarchyConflicts = 1055; const int kNumServerConflicts = 1057; - SyncCycleSnapshot snapshot( model_neutral, download_progress_markers, kIsSilenced, kNumEncryptionConflicts, kNumHierarchyConflicts, kNumServerConflicts, @@ -51,7 +50,7 @@ /*long_poll_interval=*/base::TimeDelta::FromMinutes(180), /*has_remaining_local_changes=*/false); std::unique_ptr<base::DictionaryValue> value(snapshot.ToValue()); - EXPECT_EQ(17u, value->size()); + EXPECT_EQ(20u, value->size()); ExpectDictIntegerValue(model_neutral.num_successful_commits, *value, "numSuccessfulCommits"); ExpectDictIntegerValue(model_neutral.num_successful_bookmark_commits, *value, @@ -76,6 +75,12 @@ ExpectDictIntegerValue(kNumServerConflicts, *value, "numServerConflicts"); ExpectDictBooleanValue(false, *value, "notificationsEnabled"); ExpectDictBooleanValue(false, *value, "hasRemainingLocalChanges"); + ExpectDictStringValue("0h 30m", *value, "short_poll_interval"); + ExpectDictStringValue("3h 0m", *value, "long_poll_interval"); + // poll_finish_time includes the local time zone, so simply verify its + // existence. + EXPECT_TRUE( + value->FindKeyOfType("poll_finish_time", base::Value::Type::STRING)); } } // namespace
diff --git a/components/sync/engine/sync_engine_switches.cc b/components/sync/engine/sync_engine_switches.cc new file mode 100644 index 0000000..e1c4bfc1 --- /dev/null +++ b/components/sync/engine/sync_engine_switches.cc
@@ -0,0 +1,12 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/sync/engine/sync_engine_switches.h" + +namespace switches { + +const base::Feature kSyncResetPollIntervalOnStart{ + "SyncResetPollIntervalOnStart", base::FEATURE_DISABLED_BY_DEFAULT}; + +} // namespace switches
diff --git a/components/sync/engine/sync_engine_switches.h b/components/sync/engine/sync_engine_switches.h new file mode 100644 index 0000000..0d7e644 --- /dev/null +++ b/components/sync/engine/sync_engine_switches.h
@@ -0,0 +1,16 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_SYNC_ENGINE_SYNC_ENGINE_SWITCHES_H_ +#define COMPONENTS_SYNC_ENGINE_SYNC_ENGINE_SWITCHES_H_ + +#include "base/feature_list.h" + +namespace switches { + +extern const base::Feature kSyncResetPollIntervalOnStart; + +} // namespace switches + +#endif // COMPONENTS_SYNC_ENGINE_SYNC_ENGINE_SWITCHES_H_
diff --git a/components/sync/engine_impl/cycle/test_util.h b/components/sync/engine_impl/cycle/test_util.h index 2f17712b..704928d 100644 --- a/components/sync/engine_impl/cycle/test_util.h +++ b/components/sync/engine_impl/cycle/test_util.h
@@ -45,6 +45,8 @@ SyncCycle* cycle); // Poll successes and failures. +// TODO(tschumann): Move poll simulations into the only call site, +// sync_scheduler_impl_unittest.cc. void SimulatePollSuccess(ModelTypeSet requested_types, SyncCycle* cycle); void SimulatePollFailed(ModelTypeSet requested_types, SyncCycle* cycle); @@ -63,6 +65,9 @@ SyncCycle* cycle, const base::TimeDelta& new_poll); +// TODO(tschumann): Most of these actions are only used by +// sync_scheduler_impl_unittest.cc. Move them there to avoid unneccesary +// redirection and keep the context in one place. ACTION_P(SimulateThrottled, throttle) { SimulateThrottledImpl(arg0, throttle); }
diff --git a/components/sync/engine_impl/sync_scheduler_impl.cc b/components/sync/engine_impl/sync_scheduler_impl.cc index 97d7004..5d232eb 100644 --- a/components/sync/engine_impl/sync_scheduler_impl.cc +++ b/components/sync/engine_impl/sync_scheduler_impl.cc
@@ -13,10 +13,12 @@ #include "base/location.h" #include "base/logging.h" #include "base/metrics/histogram_macros.h" +#include "base/rand_util.h" #include "base/single_thread_task_runner.h" #include "base/threading/platform_thread.h" #include "base/threading/thread_task_runner_handle.h" #include "components/sync/base/logging.h" +#include "components/sync/engine/sync_engine_switches.h" #include "components/sync/engine_impl/backoff_delay_provider.h" #include "components/sync/protocol/proto_enum_conversions.h" #include "components/sync/protocol/sync.pb.h" @@ -211,15 +213,19 @@ } Mode old_mode = mode_; mode_ = mode; + base::Time now = base::Time::Now(); + // Only adjust the poll reset time if it was valid and in the past. - if (!last_poll_time.is_null() && last_poll_time < base::Time::Now()) { + if (!last_poll_time.is_null() && last_poll_time <= now) { // Convert from base::Time to base::TimeTicks. The reason we use Time // for persisting is that TimeTicks can stop making forward progress when // the machine is suspended. This implies that on resume the client might - // actually have miss the real poll, unless the client is restarted. Fixing - // that would require using an AlarmTimer though, which is only supported - // on certain platforms. - last_poll_reset_ = TimeTicks::Now() - (base::Time::Now() - last_poll_time); + // actually have miss the real poll, unless the client is restarted. + // Fixing that would require using an AlarmTimer though, which is only + // supported on certain platforms. + last_poll_reset_ = + TimeTicks::Now() - + (now - ComputeLastPollOnStart(last_poll_time, GetPollInterval(), now)); } if (old_mode != mode_ && mode_ == NORMAL_MODE) { @@ -236,6 +242,28 @@ } } +// static +base::Time SyncSchedulerImpl::ComputeLastPollOnStart( + base::Time last_poll, + base::TimeDelta poll_interval, + base::Time now) { + if (base::FeatureList::IsEnabled(switches::kSyncResetPollIntervalOnStart)) { + return now; + } + // Handle immediate polls on start-up separately. + if (last_poll + poll_interval <= now) { + // Doing polls on start-up is generally a risk as other bugs in Chrome + // might cause start-ups -- potentially synchronized to a specific time. + // (think about a system timer waking up Chrome). + // To minimize that risk, we randomly delay polls on start-up to a max + // of 1% of the poll interval. Assuming a poll rate of 4h, that's at + // most 2.4 mins. + base::TimeDelta random_delay = base::RandDouble() * 0.01 * poll_interval; + return now - (poll_interval - random_delay); + } + return last_poll; +} + ModelTypeSet SyncSchedulerImpl::GetEnabledAndUnblockedTypes() { ModelTypeSet enabled_types = cycle_context_->GetEnabledTypes(); ModelTypeSet enabled_protocol_types =
diff --git a/components/sync/engine_impl/sync_scheduler_impl.h b/components/sync/engine_impl/sync_scheduler_impl.h index be5907ef..f738ea6e 100644 --- a/components/sync/engine_impl/sync_scheduler_impl.h +++ b/components/sync/engine_impl/sync_scheduler_impl.h
@@ -219,6 +219,11 @@ bool IsEarlierThanCurrentPendingJob(const base::TimeDelta& delay); + // Computes the last poll time the system should assume on start-up. + static base::Time ComputeLastPollOnStart(base::Time last_poll, + base::TimeDelta poll_interval, + base::Time now); + // Used for logging. const std::string name_;
diff --git a/components/sync/engine_impl/sync_scheduler_impl_unittest.cc b/components/sync/engine_impl/sync_scheduler_impl_unittest.cc index 824c0c6..c7f6422 100644 --- a/components/sync/engine_impl/sync_scheduler_impl_unittest.cc +++ b/components/sync/engine_impl/sync_scheduler_impl_unittest.cc
@@ -14,11 +14,13 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" +#include "base/test/scoped_feature_list.h" #include "base/test/test_timeouts.h" #include "base/threading/thread_task_runner_handle.h" #include "components/sync/base/cancelation_signal.h" #include "components/sync/base/extensions_activity.h" #include "components/sync/base/model_type_test_util.h" +#include "components/sync/engine/sync_engine_switches.h" #include "components/sync/engine_impl/backoff_delay_provider.h" #include "components/sync/engine_impl/cycle/test_util.h" #include "components/sync/syncable/test_user_share.h" @@ -35,7 +37,11 @@ using testing::_; using testing::AtLeast; using testing::DoAll; +using testing::Eq; +using testing::Ge; +using testing::Gt; using testing::Invoke; +using testing::Lt; using testing::Mock; using testing::Return; using testing::WithArg; @@ -294,6 +300,14 @@ return scheduler_->pending_wakeup_timer_.GetCurrentDelay(); } + // Provide access for tests to private method. + base::Time ComputeLastPollOnStart(base::Time last_poll, + base::TimeDelta poll_interval, + base::Time now) { + return SyncSchedulerImpl::ComputeLastPollOnStart(last_poll, poll_interval, + now); + } + private: syncable::Directory* directory() { return test_user_share_.user_share()->directory.get(); @@ -2006,4 +2020,57 @@ EXPECT_TRUE(scheduler()->IsGlobalBackoff()); } +TEST_F(SyncSchedulerImplTest, PollOnStartUpAfterLongPause) { + base::Time now = base::Time::Now(); + base::TimeDelta poll_interval = base::TimeDelta::FromHours(4); + base::Time last_reset = ComputeLastPollOnStart( + /*last_poll=*/now - base::TimeDelta::FromDays(1), poll_interval, now); + EXPECT_THAT(last_reset, Gt(now - poll_interval)); + // The max poll delay is 1% of the poll_interval. + EXPECT_THAT(last_reset, Lt(now - 0.99 * poll_interval)); +} + +TEST_F(SyncSchedulerImplTest, PollOnStartUpAfterShortPause) { + base::Time now = base::Time::Now(); + base::TimeDelta poll_interval = base::TimeDelta::FromHours(4); + base::Time last_poll = now - base::TimeDelta::FromHours(2); + EXPECT_THAT(ComputeLastPollOnStart(last_poll, poll_interval, now), + Eq(last_poll)); +} + +// Verifies that the delay is in [0, 0.01*poll_interval) and spot checks the +// random number generation. +TEST_F(SyncSchedulerImplTest, PollOnStartUpWithinBoundsAfterLongPause) { + base::Time now = base::Time::Now(); + base::TimeDelta poll_interval = base::TimeDelta::FromHours(4); + base::Time last_poll = now - base::TimeDelta::FromDays(2); + bool found_delay_greater_than_5_permille = false; + bool found_delay_less_or_equal_5_permille = false; + for (int i = 0; i < 10000; ++i) { + base::Time result = ComputeLastPollOnStart(last_poll, poll_interval, now); + base::TimeDelta delay = result + poll_interval - now; + double fraction = delay.InSeconds() * 1.0 / poll_interval.InSeconds(); + if (fraction > 0.005) { + found_delay_greater_than_5_permille = true; + } else { + found_delay_less_or_equal_5_permille = true; + } + EXPECT_THAT(fraction, Ge(0)); + EXPECT_THAT(fraction, Lt(0.01)); + } + EXPECT_TRUE(found_delay_greater_than_5_permille); + EXPECT_TRUE(found_delay_less_or_equal_5_permille); +} + +TEST_F(SyncSchedulerImplTest, TestResetPollIntervalOnStartFeatureFlag) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(switches::kSyncResetPollIntervalOnStart); + base::Time now = base::Time::Now(); + base::TimeDelta poll_interval = base::TimeDelta::FromHours(4); + EXPECT_THAT( + ComputeLastPollOnStart( + /*last_poll=*/now - base::TimeDelta::FromDays(1), poll_interval, now), + Eq(now)); +} + } // namespace syncer
diff --git a/components/sync/engine_impl/syncer.cc b/components/sync/engine_impl/syncer.cc index 6a81698..1236482 100644 --- a/components/sync/engine_impl/syncer.cc +++ b/components/sync/engine_impl/syncer.cc
@@ -200,12 +200,12 @@ if (ExitRequested()) return false; - cycle->SendSyncCycleEndEventNotification(origin); bool success = !HasSyncerError(cycle->status_controller().model_neutral_state()); if (success && origin == sync_pb::SyncEnums::PERIODIC) { cycle->mutable_status_controller()->UpdatePollTime(); } + cycle->SendSyncCycleEndEventNotification(origin); return success; }
diff --git a/components/sync/test/fake_server/fake_server_verifier.cc b/components/sync/test/fake_server/fake_server_verifier.cc index aae4929f..4ce737d 100644 --- a/components/sync/test/fake_server/fake_server_verifier.cc +++ b/components/sync/test/fake_server/fake_server_verifier.cc
@@ -137,10 +137,11 @@ // Ensure that all session tags match the first entity. Only one session is // supported for verification at this time. - if (session_tag.empty()) + if (session_tag.empty()) { session_tag = session_specifics.session_tag(); - else if (session_specifics.session_tag() != session_tag) + } else if (session_specifics.session_tag() != session_tag) { return AssertionFailure() << "Multiple session tags found."; + } if (session_specifics.has_header()) { session_header = session_specifics.header();
diff --git a/components/translate/content/common/DEPS b/components/translate/content/common/DEPS deleted file mode 100644 index 6cfa565..0000000 --- a/components/translate/content/common/DEPS +++ /dev/null
@@ -1,3 +0,0 @@ -include_rules = [ - "+mojo/common", -]
diff --git a/components/viz/service/display/gl_renderer_unittest.cc b/components/viz/service/display/gl_renderer_unittest.cc index 4107c17..c2220e4 100644 --- a/components/viz/service/display/gl_renderer_unittest.cc +++ b/components/viz/service/display/gl_renderer_unittest.cc
@@ -2635,7 +2635,7 @@ child_context_provider->BindToCurrentThread(); auto child_resource_provider = cc::FakeResourceProvider::CreateLayerTreeResourceProvider( - child_context_provider.get(), nullptr); + child_context_provider.get()); auto transfer_resource = TransferableResource::MakeGLOverlay( gpu::Mailbox::Generate(), GL_LINEAR, GL_TEXTURE_2D, gpu::SyncToken(),
diff --git a/components/viz/service/display/overlay_unittest.cc b/components/viz/service/display/overlay_unittest.cc index 206b655f..02c49c5 100644 --- a/components/viz/service/display/overlay_unittest.cc +++ b/components/viz/service/display/overlay_unittest.cc
@@ -2473,7 +2473,7 @@ child_provider_->BindToCurrentThread(); child_resource_provider_ = cc::FakeResourceProvider::CreateLayerTreeResourceProvider( - child_provider_.get(), nullptr); + child_provider_.get()); } void Init(bool use_validator) {
diff --git a/content/DEPS b/content/DEPS index e47aa5e..e187ebec 100644 --- a/content/DEPS +++ b/content/DEPS
@@ -35,7 +35,6 @@ "+dbus", "+gpu", "+media", - "+mojo/common", "+mojo/edk/embedder", "+mojo/edk/js", "+mojo/message_pump",
diff --git a/content/app/content_service_manager_main_delegate.cc b/content/app/content_service_manager_main_delegate.cc index 62dceb5..74fda5f 100644 --- a/content/app/content_service_manager_main_delegate.cc +++ b/content/app/content_service_manager_main_delegate.cc
@@ -124,4 +124,8 @@ return nullptr; } +ui::DataPack* ContentServiceManagerMainDelegate::LoadServiceManifestDataPack() { + return content_main_params_.delegate->LoadServiceManifestDataPack(); +} + } // namespace content
diff --git a/content/app/content_service_manager_main_delegate.h b/content/app/content_service_manager_main_delegate.h index 4393a8f..3c664423 100644 --- a/content/app/content_service_manager_main_delegate.h +++ b/content/app/content_service_manager_main_delegate.h
@@ -39,6 +39,7 @@ service_manager::BackgroundServiceManager* service_manager) override; std::unique_ptr<service_manager::Service> CreateEmbeddedService( const std::string& service_name) override; + ui::DataPack* LoadServiceManifestDataPack() override; private: ContentMainParams content_main_params_;
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 8f3b802..ee24073 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -107,8 +107,6 @@ "//media/mojo/interfaces", "//media/mojo/interfaces:constants", "//media/mojo/services", - "//mojo/common", - "//mojo/common:values_struct_traits", "//mojo/edk", "//mojo/public/cpp/bindings", "//mojo/public/js:resources", @@ -720,6 +718,8 @@ "download/download_request_utils.cc", "download/download_resource_handler.cc", "download/download_resource_handler.h", + "download/download_url_loader_factory_getter_impl.cc", + "download/download_url_loader_factory_getter_impl.h", "download/download_utils.cc", "download/download_utils.h", "download/drag_download_file.cc",
diff --git a/content/browser/accessibility/accessibility_win_browsertest.cc b/content/browser/accessibility/accessibility_win_browsertest.cc index 5d928bb..754137f4 100644 --- a/content/browser/accessibility/accessibility_win_browsertest.cc +++ b/content/browser/accessibility/accessibility_win_browsertest.cc
@@ -48,14 +48,14 @@ namespace { - -const char INPUT_CONTENTS[] = "Moz/5.0 (ST 6.x; WWW33) " +constexpr char kInputContents[] = + "Moz/5.0 (ST 6.x; WWW33) " "WebKit \"KHTML, like\"."; -const char TEXTAREA_CONTENTS[] = "Moz/5.0 (ST 6.x; WWW33)\n" +constexpr char kTextareaContents[] = + "Moz/5.0 (ST 6.x; WWW33)\n" "WebKit \n\"KHTML, like\"."; -const LONG CONTENTS_LENGTH = static_cast<LONG>( - (sizeof(INPUT_CONTENTS) - 1) / sizeof(char)); - +constexpr LONG kContentsLength = + static_cast<LONG>((sizeof(kInputContents) - 1) / sizeof(char)); // AccessibilityWinBrowserTest ------------------------------------------------ @@ -70,18 +70,22 @@ const std::string& html, ui::AXMode accessibility_mode = ui::kAXModeComplete); IAccessible* GetRendererAccessible(); + base::string16 PrintAXTree() const; void ExecuteScript(const std::wstring& script); void SetUpInputField(Microsoft::WRL::ComPtr<IAccessibleText>* input_text); + void SetUpScrollableInputField( + Microsoft::WRL::ComPtr<IAccessibleText>* input_text); void SetUpTextareaField( Microsoft::WRL::ComPtr<IAccessibleText>* textarea_text); void SetUpSampleParagraph( Microsoft::WRL::ComPtr<IAccessibleText>* accessible_text, ui::AXMode accessibility_mode = ui::kAXModeComplete); - void SetUpSampleParagraphWithScroll( + void SetUpSampleParagraphInScrollableDocument( Microsoft::WRL::ComPtr<IAccessibleText>* accessible_text, ui::AXMode accessibility_mode = ui::kAXModeComplete); - void SetUpSampleParagraphHelper( - Microsoft::WRL::ComPtr<IAccessibleText>* accessible_text); + void SetUpSampleParagraphInScrollableEditable( + Microsoft::WRL::ComPtr<IAccessibleText>* accessible_text, + ui::AXMode accessibility_mode = ui::kAXModeComplete); static Microsoft::WRL::ComPtr<IAccessible> GetAccessibleFromVariant( IAccessible* parent, @@ -103,6 +107,11 @@ IAccessible* element); private: + void SetUpInputFieldHelper( + Microsoft::WRL::ComPtr<IAccessibleText>* input_text); + void SetUpSampleParagraphHelper( + Microsoft::WRL::ComPtr<IAccessibleText>* accessible_text); + DISALLOW_COPY_AND_ASSIGN(AccessibilityWinBrowserTest); }; @@ -123,6 +132,23 @@ waiter.WaitForNotification(); } +base::string16 AccessibilityWinBrowserTest::PrintAXTree() const { + std::unique_ptr<AccessibilityTreeFormatter> formatter( + AccessibilityTreeFormatter::Create()); + DCHECK(formatter); + formatter->set_show_ids(true); + formatter->SetFilters({AccessibilityTreeFormatter::Filter( + L"*", AccessibilityTreeFormatter::Filter::ALLOW)}); + + base::string16 str; + formatter->FormatAccessibilityTree( + static_cast<WebContentsImpl*>(shell()->web_contents()) + ->GetRootBrowserAccessibilityManager() + ->GetRoot(), + &str); + return str; +} + // Retrieve the MSAA client accessibility object for the Render Widget Host View // of the selected tab. IAccessible* AccessibilityWinBrowserTest::GetRendererAccessible() { @@ -135,35 +161,66 @@ } // Loads a page with an input text field and places sample text in it. Also, -// places the caret on the last character. +// places the caret before the last character. void AccessibilityWinBrowserTest::SetUpInputField( Microsoft::WRL::ComPtr<IAccessibleText>* input_text) { ASSERT_NE(nullptr, input_text); - LoadInitialAccessibilityTreeFromHtml(std::string("<!DOCTYPE html><html><body>" - "<form><label for='textField'>Browser name:</label>" - "<input type='text' id='textField' name='name' value='") + - net::EscapeQueryParamValue(INPUT_CONTENTS, false) + std::string( - "'></form></body></html>")); + LoadInitialAccessibilityTreeFromHtml(std::string( + R"HTML(<!DOCTYPE html> + <html> + <body> + <form> + <label for="textField">Browser name:</label> + <input type="text" id="textField" name="name" value=")HTML") + + net::EscapeForHTML(kInputContents) + + std::string(R"HTML("> + </form> + </body> + </html>)HTML")); - // Retrieve the IAccessible interface for the web page. + SetUpInputFieldHelper(input_text); +} + +// Loads a page with an input text field and places sample text in it that +// overflows its width. Also, places the caret before the last character. +void AccessibilityWinBrowserTest::SetUpScrollableInputField( + Microsoft::WRL::ComPtr<IAccessibleText>* input_text) { + ASSERT_NE(nullptr, input_text); + LoadInitialAccessibilityTreeFromHtml(std::string( + R"HTML(<!DOCTYPE html> + <html> + <body> + <input type="text" style="width: 30px;" value=")HTML") + + net::EscapeForHTML(kInputContents) + + std::string(R"HTML("> + </body> + </html>)HTML")); + + SetUpInputFieldHelper(input_text); +} + +void AccessibilityWinBrowserTest::SetUpInputFieldHelper( + Microsoft::WRL::ComPtr<IAccessibleText>* input_text) { Microsoft::WRL::ComPtr<IAccessible> document(GetRendererAccessible()); std::vector<base::win::ScopedVariant> document_children = GetAllAccessibleChildren(document.Get()); ASSERT_EQ(1u, document_children.size()); - Microsoft::WRL::ComPtr<IAccessible2> form; + Microsoft::WRL::ComPtr<IAccessible2> div; ASSERT_HRESULT_SUCCEEDED(QueryIAccessible2( GetAccessibleFromVariant(document.Get(), document_children[0].AsInput()) .Get(), - form.GetAddressOf())); - std::vector<base::win::ScopedVariant> form_children = - GetAllAccessibleChildren(form.Get()); - ASSERT_EQ(2u, form_children.size()); + div.GetAddressOf())); + std::vector<base::win::ScopedVariant> div_children = + GetAllAccessibleChildren(div.Get()); + ASSERT_LT(0u, div_children.size()); - // Find the input text field. + // The input field is always the last child. Microsoft::WRL::ComPtr<IAccessible2> input; ASSERT_HRESULT_SUCCEEDED(QueryIAccessible2( - GetAccessibleFromVariant(form.Get(), form_children[1].AsInput()).Get(), + GetAccessibleFromVariant(div.Get(), + div_children[div_children.size() - 1].AsInput()) + .Get(), input.GetAddressOf())); LONG input_role = 0; ASSERT_HRESULT_SUCCEEDED(input->role(&input_role)); @@ -172,29 +229,32 @@ // Retrieve the IAccessibleText interface for the field. ASSERT_HRESULT_SUCCEEDED(input.CopyTo(input_text->GetAddressOf())); - // Set the caret on the last character. + // Set the caret before the last character. AccessibilityNotificationWaiter waiter( shell()->web_contents(), ui::kAXModeComplete, ax::mojom::Event::kTextSelectionChanged); - std::wstring caret_offset = base::UTF16ToWide(base::IntToString16( - static_cast<int>(CONTENTS_LENGTH - 1))); - ExecuteScript(std::wstring( - L"var textField = document.getElementById('textField');" - L"textField.focus();" - L"textField.setSelectionRange(") + - caret_offset + L"," + caret_offset + L");"); + std::wstring caret_offset = base::UTF16ToWide( + base::IntToString16(static_cast<int>(kContentsLength - 1))); + ExecuteScript(std::wstring(L"let textField = document.querySelector('input');" + L"textField.focus();" + L"textField.setSelectionRange(") + + caret_offset + L"," + caret_offset + L");"); waiter.WaitForNotification(); } // Loads a page with a textarea text field and places sample text in it. Also, -// places the caret on the last character. +// places the caret before the last character. void AccessibilityWinBrowserTest::SetUpTextareaField( Microsoft::WRL::ComPtr<IAccessibleText>* textarea_text) { ASSERT_NE(nullptr, textarea_text); - LoadInitialAccessibilityTreeFromHtml(std::string("<!DOCTYPE html><html><body>" - "<textarea id='textField' rows='3' cols='60'>") + - net::EscapeQueryParamValue(TEXTAREA_CONTENTS, false) + std::string( - "</textarea></body></html>")); + LoadInitialAccessibilityTreeFromHtml(std::string(R"HTML(<!DOCTYPE html> + <html> + <body> + <textarea rows="3" cols="60">)HTML") + + net::EscapeForHTML(kTextareaContents) + + std::string(R"HTML(</textarea> + </body> + </html>)HTML")); // Retrieve the IAccessible interface for the web page. Microsoft::WRL::ComPtr<IAccessible> document(GetRendererAccessible()); @@ -224,16 +284,16 @@ // Retrieve the IAccessibleText interface for the field. ASSERT_HRESULT_SUCCEEDED(textarea.CopyTo(textarea_text->GetAddressOf())); - // Set the caret on the last character. + // Set the caret before the last character. AccessibilityNotificationWaiter waiter( shell()->web_contents(), ui::kAXModeComplete, ax::mojom::Event::kTextSelectionChanged); - std::wstring caret_offset = base::UTF16ToWide(base::IntToString16( - static_cast<int>(CONTENTS_LENGTH - 1))); - ExecuteScript(std::wstring( - L"var textField = document.getElementById('textField');" - L"textField.focus();" - L"textField.setSelectionRange(") + + std::wstring caret_offset = base::UTF16ToWide( + base::IntToString16(static_cast<int>(kContentsLength - 1))); + ExecuteScript( + std::wstring(L"var textField = document.querySelector('textarea');" + L"textField.focus();" + L"textField.setSelectionRange(") + caret_offset + L"," + caret_offset + L");"); waiter.WaitForNotification(); } @@ -243,12 +303,16 @@ Microsoft::WRL::ComPtr<IAccessibleText>* accessible_text, ui::AXMode accessibility_mode) { LoadInitialAccessibilityTreeFromHtml( - "<!DOCTYPE html><html>" - "<body>" - "<p><b>Game theory</b> is \"the study of " - "<a href=\"#\" title=\"Mathematical model\">mathematical models</a> " - "of conflict and<br>cooperation between intelligent rational " - "decision-makers.\"</p></body></html>", + R"HTML(<!DOCTYPE html> + <html> + <body> + <p><b>Game theory</b> is "the study of + <a href="" title="Mathematical model">mathematical models</a> + of conflict and<br>cooperation between intelligent rational + decision-makers." + </p> + </body> + </html>)HTML", accessibility_mode); SetUpSampleParagraphHelper(accessible_text); @@ -256,21 +320,55 @@ // Loads a page with a paragraph of sample text which is below the // bottom of the screen. -void AccessibilityWinBrowserTest::SetUpSampleParagraphWithScroll( +void AccessibilityWinBrowserTest::SetUpSampleParagraphInScrollableDocument( Microsoft::WRL::ComPtr<IAccessibleText>* accessible_text, ui::AXMode accessibility_mode) { LoadInitialAccessibilityTreeFromHtml( - "<!DOCTYPE html><html>" - "<body style=\"overflow: scroll; margin-top: 100vh\">" - "<p><b>Game theory</b> is \"the study of " - "<a href=\"#\" title=\"Mathematical model\">mathematical models</a> " - "of conflict and<br>cooperation between intelligent rational " - "decision-makers.\"</p></body></html>", + R"HTML(<!DOCTYPE html> + <html> + <body style="overflow: scroll; margin-top: 100vh"> + <p><b>Game theory</b> is "the study of + <a href="" title="Mathematical model">mathematical models</a> + of conflict and<br>cooperation between intelligent rational + decision-makers." + </p> + </body> + </html>)HTML", accessibility_mode); SetUpSampleParagraphHelper(accessible_text); } +// Loads a page with a content editable whose text overflows its height. +// Places the caret at the beginning of the editable's last line but doesn't +// scroll the editable. +void AccessibilityWinBrowserTest::SetUpSampleParagraphInScrollableEditable( + Microsoft::WRL::ComPtr<IAccessibleText>* accessible_text, + ui::AXMode accessibility_mode) { + LoadInitialAccessibilityTreeFromHtml( + R"HTML(<p contenteditable="true" + style="height: 30px; overflow: scroll;"> + hello<br><br><br>hello + </p>)HTML", + accessibility_mode); + + AccessibilityNotificationWaiter selection_waiter( + shell()->web_contents(), ui::kAXModeComplete, + ax::mojom::Event::kTextSelectionChanged); + ExecuteScript( + L"let selection=document.getSelection();" + L"let range=document.createRange();" + L"let editable=document.querySelector('p[contenteditable=\"true\"]');" + L"editable.focus();" + L"range.setStart(editable.lastChild, 0);" + L"range.setEnd(editable.lastChild, 0);" + L"selection.removeAllRanges();" + L"selection.addRange(range);"); + selection_waiter.WaitForNotification(); + + SetUpSampleParagraphHelper(accessible_text); +} + void AccessibilityWinBrowserTest::SetUpSampleParagraphHelper( Microsoft::WRL::ComPtr<IAccessibleText>* accessible_text) { ASSERT_NE(nullptr, accessible_text); @@ -286,9 +384,11 @@ GetAccessibleFromVariant(document.Get(), document_children[0].AsInput()) .Get(), paragraph.GetAddressOf())); + LONG paragraph_role = 0; ASSERT_HRESULT_SUCCEEDED(paragraph->role(¶graph_role)); ASSERT_EQ(IA2_ROLE_PARAGRAPH, paragraph_role); + ASSERT_HRESULT_SUCCEEDED(paragraph.CopyTo(accessible_text->GetAddressOf())); } @@ -417,9 +517,9 @@ std::vector<base::win::ScopedVariant> children( static_cast<size_t>(child_count)); - for (size_t i = 0; i < children.size(); i++) { + for (size_t i = 0; i < children.size(); i++) children[i].Reset(children_array[i]); - } + return children; } @@ -1085,17 +1185,18 @@ EXPECT_EQ(-1, height); } -IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, TestCharacterExtents) { +IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, + TestCharacterExtentsInEditable) { Microsoft::WRL::ComPtr<IAccessibleText> paragraph_text; SetUpSampleParagraph(¶graph_text); - const LONG newline_offset = 46; + constexpr LONG newline_offset = 46; LONG n_characters; ASSERT_HRESULT_SUCCEEDED(paragraph_text->get_nCharacters(&n_characters)); - ASSERT_LT(0, n_characters); + ASSERT_EQ(105, n_characters); LONG x, y, width, height; - LONG previous_x, previous_y; + LONG previous_x, previous_y, previous_height; for (int coordinate = IA2_COORDTYPE_SCREEN_RELATIVE; coordinate <= IA2_COORDTYPE_PARENT_RELATIVE; ++coordinate) { auto coordinate_type = static_cast<IA2CoordinateType>(coordinate); @@ -1103,19 +1204,20 @@ 0, coordinate_type, &x, &y, &width, &height)); EXPECT_LT(0, x) << "at offset 0"; EXPECT_LT(0, y) << "at offset 0"; - EXPECT_LT(0, width) << "at offset 0"; - EXPECT_LT(0, height) << "at offset 0"; + EXPECT_LT(1, width) << "at offset 0"; + EXPECT_LT(1, height) << "at offset 0"; for (LONG offset = 1; offset < newline_offset; ++offset) { previous_x = x; previous_y = y; + previous_height = height; EXPECT_HRESULT_SUCCEEDED(paragraph_text->get_characterExtents( offset, coordinate_type, &x, &y, &width, &height)); EXPECT_LT(previous_x, x) << "at offset " << offset; EXPECT_EQ(previous_y, y) << "at offset " << offset; - EXPECT_LT(0, width) << "at offset " << offset; - EXPECT_LT(0, height) << "at offset " << offset; + EXPECT_LT(1, width) << "at offset " << offset; + EXPECT_EQ(previous_height, height) << "at offset " << offset; } EXPECT_HRESULT_SUCCEEDED(paragraph_text->get_characterExtents( @@ -1123,19 +1225,160 @@ EXPECT_LE(0, x) << "at offset " << newline_offset + 1; EXPECT_GT(previous_x, x) << "at offset " << newline_offset + 1; EXPECT_LT(previous_y, y) << "at offset " << newline_offset + 1; - EXPECT_LT(0, width) << "at offset " << newline_offset + 1; - EXPECT_LT(0, height) << "at offset " << newline_offset + 1; + EXPECT_LT(1, width) << "at offset " << newline_offset + 1; + EXPECT_EQ(previous_height, height) << "at offset " << newline_offset + 1; for (LONG offset = newline_offset + 2; offset < n_characters; ++offset) { previous_x = x; previous_y = y; + previous_height = height; EXPECT_HRESULT_SUCCEEDED(paragraph_text->get_characterExtents( offset, coordinate_type, &x, &y, &width, &height)); EXPECT_LT(previous_x, x) << "at offset " << offset; EXPECT_EQ(previous_y, y) << "at offset " << offset; - EXPECT_LT(0, width) << "at offset " << offset; - EXPECT_LT(0, height) << "at offset " << offset; + EXPECT_LT(1, width) << "at offset " << offset; + EXPECT_EQ(previous_height, height) << "at offset " << offset; + } + } +} + +IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, + TestCharacterExtentsInScrollableEditable) { + Microsoft::WRL::ComPtr<IAccessibleText> editable_container; + // By construction, only the first line of the content editable is visible. + SetUpSampleParagraphInScrollableEditable(&editable_container); + + constexpr LONG first_line_end = 5; + constexpr LONG last_line_start = 8; + LONG n_characters; + ASSERT_HRESULT_SUCCEEDED(editable_container->get_nCharacters(&n_characters)); + ASSERT_EQ(13, n_characters); + LONG caret_offset; + ASSERT_HRESULT_SUCCEEDED(editable_container->get_caretOffset(&caret_offset)); + ASSERT_EQ(last_line_start, caret_offset); + + LONG x, y, width, height; + LONG previous_x, previous_y, previous_height; + for (int coordinate = IA2_COORDTYPE_SCREEN_RELATIVE; + coordinate <= IA2_COORDTYPE_PARENT_RELATIVE; ++coordinate) { + auto coordinate_type = static_cast<IA2CoordinateType>(coordinate); + + // Test that non offscreen characters have increasing x coordinates and a + // height that is greater than 1px. + EXPECT_HRESULT_SUCCEEDED(editable_container->get_characterExtents( + 0, coordinate_type, &x, &y, &width, &height)); + EXPECT_LT(0, x) << "at offset 0"; + EXPECT_LT(0, y) << "at offset 0"; + EXPECT_LT(1, width) << "at offset 0"; + EXPECT_LT(1, height) << "at offset 0"; + + for (LONG offset = 1; offset < first_line_end; ++offset) { + previous_x = x; + previous_y = y; + previous_height = height; + + EXPECT_HRESULT_SUCCEEDED(editable_container->get_characterExtents( + offset, coordinate_type, &x, &y, &width, &height)); + EXPECT_LT(previous_x, x) << "at offset " << offset; + EXPECT_EQ(previous_y, y) << "at offset " << offset; + EXPECT_LT(1, width) << "at offset " << offset; + EXPECT_EQ(previous_height, height) << "at offset " << offset; + } + + // Vertically offscreen objects should have a height of 1px so that if an + // assistive aid ignores the offscreen state, they will still be too small + // to be visible and thus not appear outside the window. Note that a height + // of 0 is not used because it signifies an invalid size. + EXPECT_HRESULT_SUCCEEDED(editable_container->get_characterExtents( + last_line_start, coordinate_type, &x, &y, &width, &height)); + EXPECT_LT(0, x) << "at offset " << last_line_start; + EXPECT_LT(previous_y, y) << "at offset " << last_line_start; + EXPECT_LT(1, width) << "at offset " << last_line_start; + EXPECT_EQ(1, height) << "at offset " << last_line_start; + + for (LONG offset = last_line_start + 1; offset < n_characters; ++offset) { + previous_x = x; + previous_y = y; + + EXPECT_HRESULT_SUCCEEDED(editable_container->get_characterExtents( + offset, coordinate_type, &x, &y, &width, &height)); + EXPECT_LT(previous_x, x) << "at offset " << offset; + EXPECT_EQ(previous_y, y) << "at offset " << offset; + EXPECT_LT(1, width) << "at offset " << offset; + EXPECT_EQ(1, height) << "at offset " << offset; + } + } +} + +IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, + DISABLED_TestCharacterExtentsInScrollableInputField) { + Microsoft::WRL::ComPtr<IAccessibleText> input_text; + SetUpScrollableInputField(&input_text); + + constexpr LONG visible_characters_start = 20; + LONG n_characters; + ASSERT_HRESULT_SUCCEEDED(input_text->get_nCharacters(&n_characters)); + ASSERT_EQ(kContentsLength, n_characters); + LONG caret_offset; + ASSERT_HRESULT_SUCCEEDED(input_text->get_caretOffset(&caret_offset)); + ASSERT_EQ(kContentsLength - 1, caret_offset); + + LONG x, y, width, height; + LONG previous_x, previous_y, previous_height; + for (int coordinate = IA2_COORDTYPE_SCREEN_RELATIVE; + coordinate <= IA2_COORDTYPE_PARENT_RELATIVE; ++coordinate) { + auto coordinate_type = static_cast<IA2CoordinateType>(coordinate); + + // Horizontally offscreen objects should have a width of 1px so that if an + // assistive aid ignores the offscreen state, they will still be too small + // to be visible and thus not appear outside the window. Note that a width + // of 0 is not used because it signifies an invalid size. + EXPECT_HRESULT_SUCCEEDED(input_text->get_characterExtents( + 0, coordinate_type, &x, &y, &width, &height)); + EXPECT_LT(0, x) << "at offset 0"; + EXPECT_LT(0, y) << "at offset 0"; + EXPECT_EQ(1, width) << "at offset 0"; + EXPECT_LT(1, height) << "at offset 0"; + + // Test that characters at the start of the input field are offscreen by + // checking that their x coordinate is at the start of the field and their + // width is 1. + for (LONG offset = 1; offset < visible_characters_start; ++offset) { + previous_x = x; + previous_y = y; + previous_height = height; + + EXPECT_HRESULT_SUCCEEDED(input_text->get_characterExtents( + offset, coordinate_type, &x, &y, &width, &height)); + EXPECT_EQ(previous_x, x) << "at offset " << offset; + EXPECT_EQ(previous_y, y) << "at offset " << offset; + EXPECT_EQ(1, width) << "at offset " << offset; + EXPECT_LT(previous_height, height) << "at offset " << offset; + } + + // Test that non offscreen characters have increasing x coordinates and a + // width that is greater than 1px. + EXPECT_HRESULT_SUCCEEDED(input_text->get_characterExtents( + visible_characters_start, coordinate_type, &x, &y, &width, &height)); + EXPECT_EQ(previous_x, x) << "at offset " << visible_characters_start; + EXPECT_EQ(previous_y, y) << "at offset " << visible_characters_start; + EXPECT_LT(1, width) << "at offset " << visible_characters_start; + EXPECT_EQ(previous_height, height) + << "at offset " << visible_characters_start; + + for (LONG offset = visible_characters_start + 1; offset < n_characters; + ++offset) { + previous_x = x; + previous_y = y; + previous_height = height; + + EXPECT_HRESULT_SUCCEEDED(input_text->get_characterExtents( + offset, coordinate_type, &x, &y, &width, &height)); + EXPECT_LT(previous_x, x) << "at offset " << offset; + EXPECT_EQ(previous_y, y) << "at offset " << offset; + EXPECT_LT(1, width) << "at offset " << offset; + EXPECT_EQ(previous_height, height) << "at offset " << offset; } } } @@ -1148,11 +1391,11 @@ ui::AXMode::kScreenReader); LONG x, y, width, height; - AccessibilityNotificationWaiter waiter(shell()->web_contents(), - ui::AXMode::kNativeAPIs | - ui::AXMode::kWebContents | - ui::AXMode::kScreenReader, - ax::mojom::Event::kLoadComplete); + AccessibilityNotificationWaiter waiter( + shell()->web_contents(), + ui::AXMode::kNativeAPIs | ui::AXMode::kWebContents | + ui::AXMode::kScreenReader | ui::AXMode::kInlineTextBoxes, + ax::mojom::Event::kLoadComplete); EXPECT_HRESULT_SUCCEEDED(paragraph_text->get_characterExtents( 0, IA2_COORDTYPE_SCREEN_RELATIVE, &x, &y, &width, &height)); // X and y coordinates should be available without @@ -1168,13 +1411,13 @@ 0, IA2_COORDTYPE_SCREEN_RELATIVE, &x, &y, &width, &height)); EXPECT_LT(0, x); EXPECT_LT(0, y); - EXPECT_LT(0, width); - EXPECT_LT(0, height); + EXPECT_LT(1, width); + EXPECT_LT(1, height); } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, TestScrollToPoint) { Microsoft::WRL::ComPtr<IAccessibleText> accessible_text; - SetUpSampleParagraphWithScroll(&accessible_text); + SetUpSampleParagraphInScrollableDocument(&accessible_text); Microsoft::WRL::ComPtr<IAccessible2> paragraph; ASSERT_HRESULT_SUCCEEDED( accessible_text.CopyTo(IID_PPV_ARGS(¶graph))); @@ -1213,7 +1456,7 @@ LONG caret_offset = 0; HRESULT hr = input_text->get_caretOffset(&caret_offset); EXPECT_EQ(S_OK, hr); - EXPECT_EQ(CONTENTS_LENGTH - 1, caret_offset); + EXPECT_EQ(kContentsLength - 1, caret_offset); AccessibilityNotificationWaiter waiter( shell()->web_contents(), ui::kAXModeComplete, @@ -1236,7 +1479,7 @@ LONG caret_offset = 0; HRESULT hr = textarea_text->get_caretOffset(&caret_offset); EXPECT_EQ(S_OK, hr); - EXPECT_EQ(CONTENTS_LENGTH - 1, caret_offset); + EXPECT_EQ(kContentsLength - 1, caret_offset); AccessibilityNotificationWaiter waiter( shell()->web_contents(), ui::kAXModeComplete, @@ -1266,7 +1509,7 @@ shell()->web_contents(), ui::kAXModeComplete, ax::mojom::Event::kTextSelectionChanged); start_offset = 0; - end_offset = CONTENTS_LENGTH; + end_offset = kContentsLength; EXPECT_HRESULT_FAILED(input_text->setSelection(1, start_offset, end_offset)); EXPECT_HRESULT_SUCCEEDED( input_text->setSelection(0, start_offset, end_offset)); @@ -1275,9 +1518,9 @@ hr = input_text->get_selection(0, &start_offset, &end_offset); EXPECT_EQ(S_OK, hr); EXPECT_EQ(0, start_offset); - EXPECT_EQ(CONTENTS_LENGTH, end_offset); + EXPECT_EQ(kContentsLength, end_offset); - start_offset = CONTENTS_LENGTH; + start_offset = kContentsLength; end_offset = 1; EXPECT_HRESULT_SUCCEEDED( input_text->setSelection(0, start_offset, end_offset)); @@ -1287,7 +1530,7 @@ EXPECT_EQ(S_OK, hr); // Start and end offsets are always swapped to be in ascending order. EXPECT_EQ(1, start_offset); - EXPECT_EQ(CONTENTS_LENGTH, end_offset); + EXPECT_EQ(kContentsLength, end_offset); } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, TestMultiLineSetSelection) { @@ -1305,7 +1548,7 @@ shell()->web_contents(), ui::kAXModeComplete, ax::mojom::Event::kTextSelectionChanged); start_offset = 0; - end_offset = CONTENTS_LENGTH; + end_offset = kContentsLength; EXPECT_HRESULT_FAILED( textarea_text->setSelection(1, start_offset, end_offset)); EXPECT_HRESULT_SUCCEEDED( @@ -1315,9 +1558,9 @@ hr = textarea_text->get_selection(0, &start_offset, &end_offset); EXPECT_EQ(S_OK, hr); EXPECT_EQ(0, start_offset); - EXPECT_EQ(CONTENTS_LENGTH, end_offset); + EXPECT_EQ(kContentsLength, end_offset); - start_offset = CONTENTS_LENGTH - 1; + start_offset = kContentsLength - 1; end_offset = 0; EXPECT_HRESULT_SUCCEEDED( textarea_text->setSelection(0, start_offset, end_offset)); @@ -1327,7 +1570,7 @@ EXPECT_EQ(S_OK, hr); // Start and end offsets are always swapped to be in ascending order. EXPECT_EQ(0, start_offset); - EXPECT_EQ(CONTENTS_LENGTH - 1, end_offset); + EXPECT_EQ(kContentsLength - 1, end_offset); } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, @@ -1388,7 +1631,7 @@ EXPECT_EQ(0, start_offset); EXPECT_EQ(0, end_offset); EXPECT_EQ(nullptr, static_cast<BSTR>(text)); - invalid_offset = CONTENTS_LENGTH + 1; + invalid_offset = kContentsLength + 1; hr = input_text->get_textAtOffset( invalid_offset, IA2_TEXT_BOUNDARY_WORD, &start_offset, &end_offset, text.Receive()); @@ -1399,7 +1642,7 @@ // According to the IA2 Spec, only line boundaries should succeed when // the offset is one past the end of the text. - invalid_offset = CONTENTS_LENGTH; + invalid_offset = kContentsLength; hr = input_text->get_textAtOffset( invalid_offset, IA2_TEXT_BOUNDARY_CHAR, &start_offset, &end_offset, text.Receive()); @@ -1481,7 +1724,7 @@ EXPECT_EQ(0, start_offset); EXPECT_EQ(0, end_offset); EXPECT_EQ(nullptr, static_cast<BSTR>(text)); - invalid_offset = CONTENTS_LENGTH + 1; + invalid_offset = kContentsLength + 1; hr = textarea_text->get_textAtOffset( invalid_offset, IA2_TEXT_BOUNDARY_WORD, &start_offset, &end_offset, text.Receive()); @@ -1492,7 +1735,7 @@ // According to the IA2 Spec, only line boundaries should succeed when // the offset is one past the end of the text. - invalid_offset = CONTENTS_LENGTH; + invalid_offset = kContentsLength; hr = textarea_text->get_textAtOffset( invalid_offset, IA2_TEXT_BOUNDARY_CHAR, &start_offset, &end_offset, text.Receive()); @@ -1558,40 +1801,40 @@ TestTextAtOffsetWithBoundaryCharacter) { Microsoft::WRL::ComPtr<IAccessibleText> input_text; SetUpInputField(&input_text); - for (LONG offset = 0; offset < CONTENTS_LENGTH; ++offset) { - std::wstring expected_text(1, INPUT_CONTENTS[offset]); + for (LONG offset = 0; offset < kContentsLength; ++offset) { + std::wstring expected_text(1, kInputContents[offset]); LONG expected_start_offset = offset; LONG expected_end_offset = offset + 1; CheckTextAtOffset(input_text, offset, IA2_TEXT_BOUNDARY_CHAR, expected_start_offset, expected_end_offset, expected_text); } - for (LONG offset = CONTENTS_LENGTH - 1; offset >= 0; --offset) { - std::wstring expected_text(1, INPUT_CONTENTS[offset]); + for (LONG offset = kContentsLength - 1; offset >= 0; --offset) { + std::wstring expected_text(1, kInputContents[offset]); LONG expected_start_offset = offset; LONG expected_end_offset = offset + 1; CheckTextAtOffset(input_text, offset, IA2_TEXT_BOUNDARY_CHAR, expected_start_offset, expected_end_offset, expected_text); } - CheckTextAtOffset(input_text, IA2_TEXT_OFFSET_CARET, - IA2_TEXT_BOUNDARY_CHAR, CONTENTS_LENGTH - 1, CONTENTS_LENGTH, L"."); + CheckTextAtOffset(input_text, IA2_TEXT_OFFSET_CARET, IA2_TEXT_BOUNDARY_CHAR, + kContentsLength - 1, kContentsLength, L"."); } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, TestMultiLineTextAtOffsetWithBoundaryCharacter) { Microsoft::WRL::ComPtr<IAccessibleText> textarea_text; SetUpTextareaField(&textarea_text); - for (LONG offset = 0; offset < CONTENTS_LENGTH; ++offset) { - std::wstring expected_text(1, TEXTAREA_CONTENTS[offset]); + for (LONG offset = 0; offset < kContentsLength; ++offset) { + std::wstring expected_text(1, kTextareaContents[offset]); LONG expected_start_offset = offset; LONG expected_end_offset = offset + 1; CheckTextAtOffset(textarea_text, offset, IA2_TEXT_BOUNDARY_CHAR, expected_start_offset, expected_end_offset, expected_text); } - for (LONG offset = CONTENTS_LENGTH - 1; offset >= 0; --offset) { - std::wstring expected_text(1, TEXTAREA_CONTENTS[offset]); + for (LONG offset = kContentsLength - 1; offset >= 0; --offset) { + std::wstring expected_text(1, kTextareaContents[offset]); LONG expected_start_offset = offset; LONG expected_end_offset = offset + 1; CheckTextAtOffset(textarea_text, offset, IA2_TEXT_BOUNDARY_CHAR, @@ -1599,7 +1842,8 @@ } CheckTextAtOffset(textarea_text, IA2_TEXT_OFFSET_CARET, - IA2_TEXT_BOUNDARY_CHAR, CONTENTS_LENGTH - 1, CONTENTS_LENGTH, L"."); + IA2_TEXT_BOUNDARY_CHAR, kContentsLength - 1, + kContentsLength, L"."); } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, @@ -1664,14 +1908,14 @@ 33, 40, L"KHTML, "); // Trailing final punctuation should be part of the last word. - CheckTextAtOffset(input_text, 41, IA2_TEXT_BOUNDARY_WORD, - 40, CONTENTS_LENGTH, L"like\"."); - CheckTextAtOffset(input_text, 45, IA2_TEXT_BOUNDARY_WORD, - 40, CONTENTS_LENGTH, L"like\"."); + CheckTextAtOffset(input_text, 41, IA2_TEXT_BOUNDARY_WORD, 40, kContentsLength, + L"like\"."); + CheckTextAtOffset(input_text, 45, IA2_TEXT_BOUNDARY_WORD, 40, kContentsLength, + L"like\"."); // Test special offsets. - CheckTextAtOffset(input_text, IA2_TEXT_OFFSET_CARET, - IA2_TEXT_BOUNDARY_WORD, 40, CONTENTS_LENGTH, L"like\"."); + CheckTextAtOffset(input_text, IA2_TEXT_OFFSET_CARET, IA2_TEXT_BOUNDARY_WORD, + 40, kContentsLength, L"like\"."); } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, @@ -1736,14 +1980,14 @@ 33, 40, L"KHTML, "); // Trailing final punctuation should be part of the last word. - CheckTextAtOffset(textarea_text, 41, IA2_TEXT_BOUNDARY_WORD, - 40, CONTENTS_LENGTH, L"like\"."); - CheckTextAtOffset(textarea_text, 45, IA2_TEXT_BOUNDARY_WORD, - 40, CONTENTS_LENGTH, L"like\"."); + CheckTextAtOffset(textarea_text, 41, IA2_TEXT_BOUNDARY_WORD, 40, + kContentsLength, L"like\"."); + CheckTextAtOffset(textarea_text, 45, IA2_TEXT_BOUNDARY_WORD, 40, + kContentsLength, L"like\"."); // Test special offsets. CheckTextAtOffset(textarea_text, IA2_TEXT_OFFSET_CARET, - IA2_TEXT_BOUNDARY_WORD, 40, CONTENTS_LENGTH, L"like\"."); + IA2_TEXT_BOUNDARY_WORD, 40, kContentsLength, L"like\"."); } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, @@ -1822,14 +2066,14 @@ SetUpInputField(&input_text); // Single line text fields should return the whole text. - CheckTextAtOffset(input_text, 0, IA2_TEXT_BOUNDARY_LINE, - 0, CONTENTS_LENGTH, base::SysUTF8ToWide(INPUT_CONTENTS)); + CheckTextAtOffset(input_text, 0, IA2_TEXT_BOUNDARY_LINE, 0, kContentsLength, + base::SysUTF8ToWide(kInputContents)); // Test special offsets. CheckTextAtOffset(input_text, IA2_TEXT_OFFSET_LENGTH, IA2_TEXT_BOUNDARY_LINE, - 0, CONTENTS_LENGTH, base::SysUTF8ToWide(INPUT_CONTENTS)); + 0, kContentsLength, base::SysUTF8ToWide(kInputContents)); CheckTextAtOffset(input_text, IA2_TEXT_OFFSET_CARET, IA2_TEXT_BOUNDARY_LINE, - 0, CONTENTS_LENGTH, base::SysUTF8ToWide(INPUT_CONTENTS)); + 0, kContentsLength, base::SysUTF8ToWide(kInputContents)); } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, @@ -1845,18 +2089,20 @@ 24, 32, L"WebKit \n"); // Last line does not have a trailing newline. - CheckTextAtOffset(textarea_text, 32, IA2_TEXT_BOUNDARY_LINE, - 32, CONTENTS_LENGTH, L"\"KHTML, like\"."); + CheckTextAtOffset(textarea_text, 32, IA2_TEXT_BOUNDARY_LINE, 32, + kContentsLength, L"\"KHTML, like\"."); // An offset one past the last character should return the last line. - CheckTextAtOffset(textarea_text, CONTENTS_LENGTH, IA2_TEXT_BOUNDARY_LINE, - 32, CONTENTS_LENGTH, L"\"KHTML, like\"."); + CheckTextAtOffset(textarea_text, kContentsLength, IA2_TEXT_BOUNDARY_LINE, 32, + kContentsLength, L"\"KHTML, like\"."); // Test special offsets. CheckTextAtOffset(textarea_text, IA2_TEXT_OFFSET_LENGTH, - IA2_TEXT_BOUNDARY_LINE, 32, CONTENTS_LENGTH, L"\"KHTML, like\"."); + IA2_TEXT_BOUNDARY_LINE, 32, kContentsLength, + L"\"KHTML, like\"."); CheckTextAtOffset(textarea_text, IA2_TEXT_OFFSET_CARET, - IA2_TEXT_BOUNDARY_LINE, 32, CONTENTS_LENGTH, L"\"KHTML, like\"."); + IA2_TEXT_BOUNDARY_LINE, 32, kContentsLength, + L"\"KHTML, like\"."); } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, @@ -1892,8 +2138,8 @@ Microsoft::WRL::ComPtr<IAccessibleText> input_text; SetUpInputField(&input_text); - CheckTextAtOffset(input_text, 0, IA2_TEXT_BOUNDARY_ALL, - 0, CONTENTS_LENGTH, base::SysUTF8ToWide(INPUT_CONTENTS)); + CheckTextAtOffset(input_text, 0, IA2_TEXT_BOUNDARY_ALL, 0, kContentsLength, + base::SysUTF8ToWide(kInputContents)); } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, @@ -1901,16 +2147,19 @@ Microsoft::WRL::ComPtr<IAccessibleText> textarea_text; SetUpTextareaField(&textarea_text); - CheckTextAtOffset(textarea_text, CONTENTS_LENGTH - 1, IA2_TEXT_BOUNDARY_ALL, - 0, CONTENTS_LENGTH, base::SysUTF8ToWide(TEXTAREA_CONTENTS)); + CheckTextAtOffset(textarea_text, kContentsLength - 1, IA2_TEXT_BOUNDARY_ALL, + 0, kContentsLength, base::SysUTF8ToWide(kTextareaContents)); } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, TestIAccessibleAction) { LoadInitialAccessibilityTreeFromHtml( - "<!DOCTYPE html><html><body>" - "<img src=\"\" alt=\"image\" " - "onclick=\"document.querySelector('img').alt = 'image2';\">" - "</body></html>"); + R"HTML(<!DOCTYPE html> + <html> + <body> + <img src="" alt="image" + onclick="document.querySelector('img').alt = 'image2';"> + </body> + </html>)HTML"); // Retrieve the IAccessible interface for the web page. Microsoft::WRL::ComPtr<IAccessible> document(GetRendererAccessible()); @@ -2104,13 +2353,16 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, TestScrollTo) { LoadInitialAccessibilityTreeFromHtml( - "<!DOCTYPE html><html><body>" - "<div style='height: 5000px;'></div>" - "<img src='#' alt='Target1'>" - "<div style='height: 5000px;'></div>" - "<img src='#' alt='Target2'>" - "<div style='height: 5000px;'></div>" - "</body></html>"); + R"HTML(<!DOCTYPE html> + <html> + <body> + <div style="height: 5000px;"></div> + <img src="" alt="Target1"> + <div style="height: 5000px;"></div> + <img src="" alt="Target2"> + <div style="height: 5000px;"></div> + </body> + </html>)HTML"); // Retrieve the IAccessible interface for the document node. Microsoft::WRL::ComPtr<IAccessible> document(GetRendererAccessible());
diff --git a/content/browser/bad_message.h b/content/browser/bad_message.h index 80ab47d..1c8180a 100644 --- a/content/browser/bad_message.h +++ b/content/browser/bad_message.h
@@ -225,6 +225,7 @@ SYNC_COMPOSITOR_NO_FUTURE_FRAME = 198, SYNC_COMPOSITOR_NO_BEGIN_FRAME = 199, WEBUI_BAD_HOST_ACCESS = 200, + RFMF_BLOB_URL_TOKEN_FOR_NON_BLOB_URL = 201, // Please add new elements here. The naming convention is abbreviated class // name (e.g. RenderFrameHost becomes RFH) plus a unique description of the
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc index 73135a67..1ed3db2 100644 --- a/content/browser/download/download_manager_impl.cc +++ b/content/browser/download/download_manager_impl.cc
@@ -42,6 +42,7 @@ #include "content/browser/download/blob_download_url_loader_factory_getter.h" #include "content/browser/download/byte_stream_input_stream.h" #include "content/browser/download/download_resource_handler.h" +#include "content/browser/download/download_url_loader_factory_getter_impl.h" #include "content/browser/download/download_utils.h" #include "content/browser/download/network_download_url_loader_factory_getter.h" #include "content/browser/download/url_downloader.h" @@ -601,7 +602,9 @@ BrowserContext::GetStoragePartitionForSite(browser_context_, site_url)); params->set_url_request_context_getter( storage_partition->GetURLRequestContext()); - BeginDownloadInternal(std::move(params), nullptr, id, storage_partition); + BeginDownloadInternal(std::move(params), nullptr /* blob_data_handle */, + nullptr /* blob_url_loader_factory */, id, + storage_partition); } void DownloadManagerImpl::SetDownloadItemFactoryForTesting( @@ -769,12 +772,14 @@ void DownloadManagerImpl::DownloadUrl( std::unique_ptr<download::DownloadUrlParameters> params) { - DownloadUrl(std::move(params), nullptr); + DownloadUrl(std::move(params), nullptr /* blob_data_handle */, + nullptr /* blob_url_loader_factory */); } void DownloadManagerImpl::DownloadUrl( std::unique_ptr<download::DownloadUrlParameters> params, - std::unique_ptr<storage::BlobDataHandle> blob_data_handle) { + std::unique_ptr<storage::BlobDataHandle> blob_data_handle, + scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory) { if (params->post_id() >= 0) { // Check this here so that the traceback is more useful. DCHECK(params->prefer_cache()); @@ -788,6 +793,7 @@ GetStoragePartition(browser_context_, params->render_process_host_id(), params->render_frame_host_routing_id()); BeginDownloadInternal(std::move(params), std::move(blob_data_handle), + std::move(blob_url_loader_factory), download::DownloadItem::kInvalidId, storage_partition); } @@ -1016,6 +1022,7 @@ void DownloadManagerImpl::BeginDownloadInternal( std::unique_ptr<download::DownloadUrlParameters> params, std::unique_ptr<storage::BlobDataHandle> blob_data_handle, + scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory, uint32_t id, StoragePartitionImpl* storage_partition) { // Check if the renderer is permitted to request the requested URL. @@ -1044,7 +1051,12 @@ } scoped_refptr<download::DownloadURLLoaderFactoryGetter> url_loader_factory_getter; - if (params->url().SchemeIs(url::kBlobScheme)) { + if (blob_url_loader_factory) { + DCHECK(params->url().SchemeIsBlob()); + url_loader_factory_getter = + base::MakeRefCounted<DownloadURLLoaderFactoryGetterImpl>( + blob_url_loader_factory->Clone()); + } else if (params->url().SchemeIsBlob()) { url_loader_factory_getter = base::MakeRefCounted<BlobDownloadURLLoaderFactoryGetter>( params->url(), std::move(blob_data_handle));
diff --git a/content/browser/download/download_manager_impl.h b/content/browser/download/download_manager_impl.h index e7aa6ce..f79ea71 100644 --- a/content/browser/download/download_manager_impl.h +++ b/content/browser/download/download_manager_impl.h
@@ -90,9 +90,10 @@ base::Time remove_end) override; void DownloadUrl( std::unique_ptr<download::DownloadUrlParameters> parameters) override; - void DownloadUrl( - std::unique_ptr<download::DownloadUrlParameters> params, - std::unique_ptr<storage::BlobDataHandle> blob_data_handle) override; + void DownloadUrl(std::unique_ptr<download::DownloadUrlParameters> params, + std::unique_ptr<storage::BlobDataHandle> blob_data_handle, + scoped_refptr<network::SharedURLLoaderFactory> + blob_url_loader_factory) override; void AddObserver(Observer* observer) override; void RemoveObserver(Observer* observer) override; download::DownloadItem* CreateDownloadItem( @@ -245,6 +246,7 @@ void BeginDownloadInternal( std::unique_ptr<download::DownloadUrlParameters> params, std::unique_ptr<storage::BlobDataHandle> blob_data_handle, + scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory, uint32_t id, StoragePartitionImpl* storage_partition);
diff --git a/content/browser/download/download_url_loader_factory_getter_impl.cc b/content/browser/download/download_url_loader_factory_getter_impl.cc new file mode 100644 index 0000000..e26386c --- /dev/null +++ b/content/browser/download/download_url_loader_factory_getter_impl.cc
@@ -0,0 +1,25 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/download/download_url_loader_factory_getter_impl.h" + +namespace content { + +DownloadURLLoaderFactoryGetterImpl::DownloadURLLoaderFactoryGetterImpl( + std::unique_ptr<network::SharedURLLoaderFactoryInfo> url_loader_factory) + : url_loader_factory_info_(std::move(url_loader_factory)) {} + +DownloadURLLoaderFactoryGetterImpl::~DownloadURLLoaderFactoryGetterImpl() = + default; + +scoped_refptr<network::SharedURLLoaderFactory> +DownloadURLLoaderFactoryGetterImpl::GetURLLoaderFactory() { + if (!url_loader_factory_) { + url_loader_factory_ = network::SharedURLLoaderFactory::Create( + std::move(url_loader_factory_info_)); + } + return url_loader_factory_; +} + +} // namespace content
diff --git a/content/browser/download/download_url_loader_factory_getter_impl.h b/content/browser/download/download_url_loader_factory_getter_impl.h new file mode 100644 index 0000000..d002dbb --- /dev/null +++ b/content/browser/download/download_url_loader_factory_getter_impl.h
@@ -0,0 +1,39 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_URL_LOADER_FACTORY_GETTER_IMPL_H_ +#define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_URL_LOADER_FACTORY_GETTER_IMPL_H_ + +#include "components/download/public/common/download_url_loader_factory_getter.h" +#include "services/network/public/cpp/shared_url_loader_factory.h" + +namespace content { + +// Class for retrieving a fixed SharedURLLoaderFactory. +class DownloadURLLoaderFactoryGetterImpl + : public download::DownloadURLLoaderFactoryGetter { + public: + explicit DownloadURLLoaderFactoryGetterImpl( + std::unique_ptr<network::SharedURLLoaderFactoryInfo> url_loader_factory); + + // download::DownloadURLLoaderFactoryGetter implementation. + scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactory() override; + + protected: + ~DownloadURLLoaderFactoryGetterImpl() override; + + private: + // Only one of the following two members is ever set. Initially that would be + // |url_loader_factory_info_|, but after GetURLLoaderFactory is called for the + // first time instead |url_loader_factory_| will be set. This is safe because + // GetURLLoaderFactory is always called from the same thread. + std::unique_ptr<network::SharedURLLoaderFactoryInfo> url_loader_factory_info_; + scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_; + + DISALLOW_COPY_AND_ASSIGN(DownloadURLLoaderFactoryGetterImpl); +}; + +} // namespace content + +#endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_URL_LOADER_FACTORY_GETTER_IMPL_H_
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc index ad8ef2c..132e3b6 100644 --- a/content/browser/frame_host/navigation_request.cc +++ b/content/browser/frame_host/navigation_request.cc
@@ -51,7 +51,6 @@ #include "content/public/common/url_constants.h" #include "content/public/common/url_utils.h" #include "content/public/common/web_preferences.h" -#include "mojo/common/values_struct_traits.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
diff --git a/content/browser/frame_host/navigation_request_info.cc b/content/browser/frame_host/navigation_request_info.cc index 4e918bf..b6381c1 100644 --- a/content/browser/frame_host/navigation_request_info.cc +++ b/content/browser/frame_host/navigation_request_info.cc
@@ -4,7 +4,6 @@ #include "content/browser/frame_host/navigation_request_info.h" #include "content/common/service_worker/service_worker_types.h" -#include "mojo/common/values_struct_traits.h" namespace content {
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index 7863e98..0706dea 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -2203,26 +2203,6 @@ return enabled_bindings_; } -void RenderFrameHostImpl::BlockRequestsForFrame() { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - NotifyForEachFrameFromUI( - this, - base::BindRepeating(&ResourceDispatcherHostImpl::BlockRequestsForRoute)); -} - -void RenderFrameHostImpl::ResumeBlockedRequestsForFrame() { - NotifyForEachFrameFromUI( - this, base::BindRepeating( - &ResourceDispatcherHostImpl::ResumeBlockedRequestsForRoute)); -} - -void RenderFrameHostImpl::CancelBlockedRequestsForFrame() { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - NotifyForEachFrameFromUI( - this, base::BindRepeating( - &ResourceDispatcherHostImpl::CancelBlockedRequestsForRoute)); -} - void RenderFrameHostImpl::DisableBeforeUnloadHangMonitorForTesting() { beforeunload_timeout_.reset(); } @@ -4106,6 +4086,26 @@ return GetContentClient()->browser()->CanCommitURL(GetProcess(), url); } +void RenderFrameHostImpl::BlockRequestsForFrame() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + NotifyForEachFrameFromUI( + this, + base::BindRepeating(&ResourceDispatcherHostImpl::BlockRequestsForRoute)); +} + +void RenderFrameHostImpl::ResumeBlockedRequestsForFrame() { + NotifyForEachFrameFromUI( + this, base::BindRepeating( + &ResourceDispatcherHostImpl::ResumeBlockedRequestsForRoute)); +} + +void RenderFrameHostImpl::CancelBlockedRequestsForFrame() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + NotifyForEachFrameFromUI( + this, base::BindRepeating( + &ResourceDispatcherHostImpl::CancelBlockedRequestsForRoute)); +} + bool RenderFrameHostImpl::IsSameSiteInstance( RenderFrameHostImpl* other_render_frame_host) { // As a sanity check, make sure the frame belongs to the same BrowserContext.
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h index fb8a3969..0eac3e8 100644 --- a/content/browser/frame_host/render_frame_host_impl.h +++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -232,8 +232,6 @@ int max_length) override; void AllowBindings(int binding_flags) override; int GetEnabledBindings() const override; - void BlockRequestsForFrame() override; - void ResumeBlockedRequestsForFrame() override; void DisableBeforeUnloadHangMonitorForTesting() override; bool IsBeforeUnloadHangMonitorDisabledForTesting() override; bool GetSuddenTerminationDisablerState( @@ -652,6 +650,19 @@ return has_focused_editable_element_; } + // Note: The methods for blocking / resuming / cancelling requests per + // RenderFrameHost are deprecated and will not work in the network service, + // please avoid using them. + // + // Causes all new requests for the root RenderFrameHost and its children to + // be blocked (not being started) until ResumeBlockedRequestsForFrame is + // called. + void BlockRequestsForFrame(); + + // Resumes any blocked request for the specified root RenderFrameHost and + // child frame hosts. + void ResumeBlockedRequestsForFrame(); + // Cancels any blocked request for the frame and its subframes. void CancelBlockedRequestsForFrame();
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc index b6fb231..d7875ac 100644 --- a/content/browser/frame_host/render_frame_host_manager.cc +++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1262,10 +1262,9 @@ // redirect arbitary requests to those URLs using webRequest or // declarativeWebRequest API. For these cases, the content isn't controlled // by the source SiteInstance, so it need not use it. - GURL about_blank(url::kAboutBlankURL); GURL about_srcdoc(content::kAboutSrcDocURL); bool dest_is_data_or_about = dest_url == about_srcdoc || - dest_url == about_blank || + dest_url.IsAboutBlank() || dest_url.scheme() == url::kDataScheme; if (source_instance && dest_is_data_or_about && !was_server_redirect) return SiteInstanceDescriptor(source_instance);
diff --git a/content/browser/frame_host/render_frame_message_filter.cc b/content/browser/frame_host/render_frame_message_filter.cc index 80fd7cf..d6ae186 100644 --- a/content/browser/frame_host/render_frame_message_filter.cc +++ b/content/browser/frame_host/render_frame_message_filter.cc
@@ -96,9 +96,13 @@ } } +// |blob_data_handle| is only here for the legacy code path. With network +// service enabled |blob_url_token| should be provided and will be used instead +// to download the correct blob. void DownloadUrlOnUIThread( std::unique_ptr<download::DownloadUrlParameters> parameters, - std::unique_ptr<storage::BlobDataHandle> blob_data_handle) { + std::unique_ptr<storage::BlobDataHandle> blob_data_handle, + blink::mojom::BlobURLTokenPtrInfo blob_url_token) { DCHECK_CURRENTLY_ON(BrowserThread::UI); RenderProcessHost* render_process_host = @@ -107,11 +111,21 @@ return; BrowserContext* browser_context = render_process_host->GetBrowserContext(); + + scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory; + if (blob_url_token) { + blob_url_loader_factory = + ChromeBlobStorageContext::URLLoaderFactoryForToken( + browser_context, + blink::mojom::BlobURLTokenPtr(std::move(blob_url_token))); + } + DownloadManager* download_manager = BrowserContext::GetDownloadManager(browser_context); parameters->set_download_source(download::DownloadSource::FROM_RENDERER); download_manager->DownloadUrl(std::move(parameters), - std::move(blob_data_handle)); + std::move(blob_data_handle), + std::move(blob_url_loader_factory)); } // Common functionality for converting a sync renderer message to a callback @@ -296,13 +310,15 @@ BrowserThread::DeleteOnIOThread::Destruct(this); } -void RenderFrameMessageFilter::DownloadUrl(int render_view_id, - int render_frame_id, - const GURL& url, - const Referrer& referrer, - const url::Origin& initiator, - const base::string16& suggested_name, - const bool use_prompt) const { +void RenderFrameMessageFilter::DownloadUrl( + int render_view_id, + int render_frame_id, + const GURL& url, + const Referrer& referrer, + const url::Origin& initiator, + const base::string16& suggested_name, + const bool use_prompt, + blink::mojom::BlobURLTokenPtrInfo blob_url_token) const { if (!resource_context_) return; @@ -343,6 +359,10 @@ Referrer::ReferrerPolicyForUrlRequest(referrer.policy)); parameters->set_initiator(initiator); + // If network service is enabled we should always have a |blob_url_token|, + // which will be used to download the correct blob. But in the legacy + // non-network service code path we still need to look up the BlobDataHandle + // for the URL here, to make sure the correct blob ends up getting downloaded. std::unique_ptr<storage::BlobDataHandle> blob_data_handle; if (url.SchemeIsBlob()) { ChromeBlobStorageContext* blob_context = @@ -355,7 +375,7 @@ BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::BindOnce(&DownloadUrlOnUIThread, std::move(parameters), - std::move(blob_data_handle))); + std::move(blob_data_handle), std::move(blob_url_token))); } void RenderFrameMessageFilter::OnCreateChildFrame( @@ -414,9 +434,18 @@ void RenderFrameMessageFilter::OnDownloadUrl( const FrameHostMsg_DownloadUrl_Params& params) { + mojo::ScopedMessagePipeHandle blob_url_token_handle(params.blob_url_token); + blink::mojom::BlobURLTokenPtrInfo blob_url_token( + std::move(blob_url_token_handle), blink::mojom::BlobURLToken::Version_); + if (blob_url_token && !params.url.SchemeIsBlob()) { + bad_message::ReceivedBadMessage( + this, bad_message::RFMF_BLOB_URL_TOKEN_FOR_NON_BLOB_URL); + return; + } + DownloadUrl(params.render_view_id, params.render_frame_id, params.url, params.referrer, params.initiator_origin, params.suggested_name, - false); + false, std::move(blob_url_token)); } void RenderFrameMessageFilter::OnSaveImageFromDataURL( @@ -432,7 +461,7 @@ return; DownloadUrl(render_view_id, render_frame_id, data_url, Referrer(), - url::Origin(), base::string16(), true); + url::Origin(), base::string16(), true, nullptr); } void RenderFrameMessageFilter::OnAre3DAPIsBlocked(int render_frame_id,
diff --git a/content/browser/frame_host/render_frame_message_filter.h b/content/browser/frame_host/render_frame_message_filter.h index 871e11f..7f3ab224 100644 --- a/content/browser/frame_host/render_frame_message_filter.h +++ b/content/browser/frame_host/render_frame_message_filter.h
@@ -18,6 +18,7 @@ #include "net/cookies/canonical_cookie.h" #include "ppapi/buildflags/buildflags.h" #include "services/network/public/mojom/network_service.mojom.h" +#include "third_party/blink/public/mojom/blob/blob_url_store.mojom.h" #include "third_party/blink/public/web/web_tree_scope_type.h" #include "url/origin.h" @@ -76,13 +77,15 @@ friend class TestSaveImageFromDataURL; // This method will be overridden by TestSaveImageFromDataURL class for test. - virtual void DownloadUrl(int render_view_id, - int render_frame_id, - const GURL& url, - const Referrer& referrer, - const url::Origin& initiator, - const base::string16& suggested_name, - const bool use_prompt) const; + virtual void DownloadUrl( + int render_view_id, + int render_frame_id, + const GURL& url, + const Referrer& referrer, + const url::Origin& initiator, + const base::string16& suggested_name, + const bool use_prompt, + blink::mojom::BlobURLTokenPtrInfo blob_url_token) const; private: friend class BrowserThread;
diff --git a/content/browser/loader/navigation_url_loader_network_service.cc b/content/browser/loader/navigation_url_loader_network_service.cc index b4c1232..955cb24e 100644 --- a/content/browser/loader/navigation_url_loader_network_service.cc +++ b/content/browser/loader/navigation_url_loader_network_service.cc
@@ -56,7 +56,6 @@ #include "content/public/common/url_utils.h" #include "content/public/common/weak_wrapper_shared_url_loader_factory.h" #include "content/public/common/webplugininfo.h" -#include "mojo/common/values_struct_traits.h" #include "net/base/load_flags.h" #include "net/http/http_content_disposition.h" #include "net/traffic_annotation/network_traffic_annotation.h"
diff --git a/content/browser/media/encrypted_media_browsertest.cc b/content/browser/media/encrypted_media_browsertest.cc index e2892c2f..03ba85a 100644 --- a/content/browser/media/encrypted_media_browsertest.cc +++ b/content/browser/media/encrypted_media_browsertest.cc
@@ -47,12 +47,12 @@ // Supported media types. const char kWebMVorbisAudioOnly[] = "audio/webm; codecs=\"vorbis\""; const char kWebMOpusAudioOnly[] = "audio/webm; codecs=\"opus\""; -const char kWebMVP8VideoOnly[] = "video/webm; codecs=\"vp8\""; -const char kWebMVP9VideoOnly[] = "video/webm; codecs=\"vp9\""; -const char kWebMOpusAudioVP9Video[] = "video/webm; codecs=\"opus, vp9\""; -const char kWebMVorbisAudioVP8Video[] = "video/webm; codecs=\"vorbis, vp8\""; +const char kWebMVp8VideoOnly[] = "video/webm; codecs=\"vp8\""; +const char kWebMVp9VideoOnly[] = "video/webm; codecs=\"vp9\""; +const char kWebMOpusAudioVp9Video[] = "video/webm; codecs=\"opus, vp9\""; +const char kWebMVorbisAudioVp8Video[] = "video/webm; codecs=\"vorbis, vp8\""; #if BUILDFLAG(USE_PROPRIETARY_CODECS) -const char kMP4VideoOnly[] = "video/mp4; codecs=\"avc1.64001E\""; +const char kMp4Avc1VideoOnly[] = "video/mp4; codecs=\"avc1.64001E\""; #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) // EME-specific test results and errors. @@ -89,14 +89,14 @@ void TestSimplePlayback(const std::string& encrypted_media, const std::string& media_type) { - RunSimpleEncryptedMediaTest( - encrypted_media, media_type, CurrentKeySystem(), CurrentSourceType()); + RunSimpleEncryptedMediaTest(encrypted_media, media_type, CurrentKeySystem(), + CurrentSourceType()); } void TestFrameSizeChange() { RunEncryptedMediaTest("encrypted_frame_size_change.html", "frame_size_change-av_enc-v.webm", - kWebMVorbisAudioVP8Video, CurrentKeySystem(), + kWebMVorbisAudioVp8Video, CurrentKeySystem(), CurrentSourceType(), media::kEnded); } @@ -142,14 +142,15 @@ } #if BUILDFLAG(USE_PROPRIETARY_CODECS) - void TestMP4EncryptionPlayback(const std::string& media_file, + void TestMp4EncryptionPlayback(const std::string& media_file, + const std::string& media_type, const std::string& expected_title) { if (CurrentSourceType() != SrcType::MSE) { DVLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE."; return; } - RunEncryptedMediaTest(kDefaultEmePlayer, media_file, kMP4VideoOnly, + RunEncryptedMediaTest(kDefaultEmePlayer, media_file, media_type, CurrentKeySystem(), SrcType::MSE, expected_title); } #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) @@ -205,29 +206,29 @@ } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) { - TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMVorbisAudioVP8Video); + TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMVorbisAudioVp8Video); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoAudio_WebM) { - TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMVorbisAudioVP8Video); + TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMVorbisAudioVp8Video); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM) { - TestSimplePlayback("bear-320x240-v_enc-v.webm", kWebMVP8VideoOnly); + TestSimplePlayback("bear-320x240-v_enc-v.webm", kWebMVp8VideoOnly); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM_Fullsample) { TestSimplePlayback("bear-320x240-v-vp9_fullsample_enc-v.webm", - kWebMVP9VideoOnly); + kWebMVp9VideoOnly); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM_Subsample) { TestSimplePlayback("bear-320x240-v-vp9_subsample_enc-v.webm", - kWebMVP9VideoOnly); + kWebMVp9VideoOnly); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM) { - TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMVorbisAudioVP8Video); + TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMVorbisAudioVp8Video); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM_Opus) { @@ -244,7 +245,7 @@ return; #endif TestSimplePlayback("bear-320x240-opus-av_enc-av.webm", - kWebMOpusAudioVP9Video); + kWebMOpusAudioVp9Video); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM_Opus) { @@ -252,7 +253,7 @@ if (!media::PlatformHasOpusSupport()) return; #endif - TestSimplePlayback("bear-320x240-opus-av_enc-v.webm", kWebMOpusAudioVP9Video); + TestSimplePlayback("bear-320x240-opus-av_enc-v.webm", kWebMOpusAudioVp9Video); } // Strictly speaking this is not an "encrypted" media test. Keep it here for @@ -286,19 +287,23 @@ #if BUILDFLAG(USE_PROPRIETARY_CODECS) IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_Encryption_CENC) { - TestMP4EncryptionPlayback("bear-640x360-v_frag-cenc.mp4", media::kEnded); + TestMp4EncryptionPlayback("bear-640x360-v_frag-cenc.mp4", kMp4Avc1VideoOnly, + media::kEnded); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_Encryption_CBC1) { - TestMP4EncryptionPlayback("bear-640x360-v_frag-cbc1.mp4", media::kError); + TestMp4EncryptionPlayback("bear-640x360-v_frag-cbc1.mp4", kMp4Avc1VideoOnly, + media::kError); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_Encryption_CENS) { - TestMP4EncryptionPlayback("bear-640x360-v_frag-cens.mp4", media::kError); + TestMp4EncryptionPlayback("bear-640x360-v_frag-cens.mp4", kMp4Avc1VideoOnly, + media::kError); } IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_Encryption_CBCS) { - TestMP4EncryptionPlayback("bear-640x360-v_frag-cbcs.mp4", media::kError); + TestMp4EncryptionPlayback("bear-640x360-v_frag-cbcs.mp4", kMp4Avc1VideoOnly, + media::kError); } #endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
diff --git a/content/browser/renderer_host/input/mouse_wheel_event_queue.cc b/content/browser/renderer_host/input/mouse_wheel_event_queue.cc index ab56423..c8163c19 100644 --- a/content/browser/renderer_host/input/mouse_wheel_event_queue.cc +++ b/content/browser/renderer_host/input/mouse_wheel_event_queue.cc
@@ -266,12 +266,13 @@ blink::WebInputEvent::kGestureScrollBegin) { scrolling_device_ = gesture_event.event.SourceDevice(); } else if (scrolling_device_ == gesture_event.event.SourceDevice() && - (gesture_event.event.GetType() == - blink::WebInputEvent::kGestureScrollEnd || - (gesture_event.event.GetType() == - blink::WebInputEvent::kGestureFlingStart && - scrolling_device_ != blink::kWebGestureDeviceTouchpad))) { + gesture_event.event.GetType() == + blink::WebInputEvent::kGestureScrollEnd) { scrolling_device_ = blink::kWebGestureDeviceUninitialized; + } else if (gesture_event.event.GetType() == + blink::WebInputEvent::kGestureFlingStart) { + // With browser side fling we shouldn't reset scrolling_device_ on GFS since + // the fling_controller processes the GFS to generate and send GSU events. } }
diff --git a/content/browser/renderer_host/media/video_capture_host.cc b/content/browser/renderer_host/media/video_capture_host.cc index c362c36..e75c338 100644 --- a/content/browser/renderer_host/media/video_capture_host.cc +++ b/content/browser/renderer_host/media/video_capture_host.cc
@@ -13,7 +13,6 @@ #include "content/browser/renderer_host/media/video_capture_manager.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" -#include "mojo/common/values_struct_traits.h" #include "mojo/public/cpp/bindings/strong_binding.h" namespace content {
diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc index 4127d8b..28588323 100644 --- a/content/browser/renderer_host/render_view_host_unittest.cc +++ b/content/browser/renderer_host/render_view_host_unittest.cc
@@ -280,13 +280,15 @@ protected: ~TestSaveImageFromDataURL() override {} - void DownloadUrl(int render_view_id, - int render_frame_id, - const GURL& url, - const Referrer& referrer, - const url::Origin& initiator, - const base::string16& suggested_name, - const bool use_prompt) const override { + void DownloadUrl( + int render_view_id, + int render_frame_id, + const GURL& url, + const Referrer& referrer, + const url::Origin& initiator, + const base::string16& suggested_name, + const bool use_prompt, + blink::mojom::BlobURLTokenPtrInfo blob_url_token) const override { url_string_ = url.spec(); is_downloaded_ = true; }
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 31854d0..2499f98 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2228,6 +2228,7 @@ } void RenderWidgetHostImpl::OnAutoscrollStart(const gfx::PointF& position) { + GetView()->OnAutoscrollStart(); WebGestureEvent scroll_begin = SyntheticWebGestureEventBuilder::Build( WebInputEvent::kGestureScrollBegin, blink::kWebGestureDeviceSyntheticAutoscroll);
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index a00441a..a640df7 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1915,6 +1915,11 @@ CreateOverscrollControllerIfPossible(); } +MouseWheelPhaseHandler* +RenderWidgetHostViewAndroid::GetMouseWheelPhaseHandler() { + return &mouse_wheel_phase_handler_; +} + void RenderWidgetHostViewAndroid::RunAckCallbacks() { while (!ack_callbacks_.empty()) { ack_callbacks_.front().Run();
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h index c418cbc..8f87a53 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.h +++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -335,6 +335,8 @@ void LostFocus(); private: + MouseWheelPhaseHandler* GetMouseWheelPhaseHandler() override; + void RunAckCallbacks(); bool ShouldRouteEvents() const;
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index ec3c8adc..01db5db 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2466,6 +2466,10 @@ ->AllocateFrameSinkId(); } +MouseWheelPhaseHandler* RenderWidgetHostViewAura::GetMouseWheelPhaseHandler() { + return &event_handler_->mouse_wheel_phase_handler(); +} + void RenderWidgetHostViewAura::TakeFallbackContentFrom( RenderWidgetHostView* view) { DCHECK(!static_cast<RenderWidgetHostViewBase*>(view)
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index 6862ed3..f9d56d1b 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -73,6 +73,7 @@ class CursorManager; class DelegatedFrameHost; class DelegatedFrameHostClient; +class MouseWheelPhaseHandler; class RenderFrameHostImpl; class RenderWidgetHostView; class TouchSelectionControllerClientAura; @@ -436,6 +437,8 @@ // collide with FrameSinkIds used by RenderWidgetHostImpls. static viz::FrameSinkId AllocateFrameSinkIdForGuestViewHack(); + MouseWheelPhaseHandler* GetMouseWheelPhaseHandler() override; + void CreateAuraWindow(aura::client::WindowType type); void CreateDelegatedFrameHostClient();
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc index afb19d4..7461772 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -684,6 +684,7 @@ void TimerBasedLatchingBreaksWithMouseMove(); void TimerBasedLatchingBreaksWithModifiersChange(); void TimerBasedLatchingBreaksWithDirectionChange(); + void TimerBasedLatchingBreaksWithAutoscrollStart(); void TouchpadFlingStartResetsWheelPhaseState(); void GSBWithTouchSourceStopsWheelScrollSequence(); @@ -2370,6 +2371,63 @@ TimerBasedLatchingBreaksWithDirectionChange(); } +void RenderWidgetHostViewAuraTest:: + TimerBasedLatchingBreaksWithAutoscrollStart() { + // The test is valid only when wheel scroll latching is enabled. + if (wheel_scrolling_mode_ == kWheelScrollingModeNone) + return; + + // Set the mouse_wheel_phase_handler_ timer timeout to a large value to make + // sure that the timer is still running when the Autoscroll starts. + view_->event_handler()->set_mouse_wheel_wheel_phase_handler_timeout( + TestTimeouts::action_max_timeout()); + + view_->InitAsChild(nullptr); + view_->Show(); + sink_->ClearMessages(); + + ui::MouseWheelEvent event(gfx::Vector2d(0, 5), gfx::Point(2, 2), + gfx::Point(2, 2), ui::EventTimeForNow(), 0, 0); + view_->OnMouseEvent(&event); + base::RunLoop().RunUntilIdle(); + MockWidgetInputHandler::MessageVector events = + GetAndResetDispatchedMessages(); + EXPECT_EQ("MouseWheel", GetMessageNames(events)); + EXPECT_TRUE(events[0]->ToEvent()); + const WebMouseWheelEvent* wheel_event = + static_cast<const WebMouseWheelEvent*>( + events[0]->ToEvent()->Event()->web_event.get()); + EXPECT_EQ(WebMouseWheelEvent::kPhaseBegan, wheel_event->phase); + events[0]->ToEvent()->CallCallback(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); + EXPECT_TRUE(view_->GetMouseWheelPhaseHandler()->HasPendingWheelEndEvent()); + events = GetAndResetDispatchedMessages(); + + // Autoscroll start breaks wheel scroll latching sequence by sending the + // pending wheel end event, the non-blocking wheel end event will be acked + // immediately and a GSE will be sent. The next wheel event will start a new + // scrolling sequence. + view_->OnAutoscrollStart(); + EXPECT_FALSE(view_->GetMouseWheelPhaseHandler()->HasPendingWheelEndEvent()); + ui::MouseWheelEvent event2(gfx::Vector2d(0, 5), gfx::Point(2, 2), + gfx::Point(2, 2), ui::EventTimeForNow(), 0, 0); + view_->OnMouseEvent(&event2); + base::RunLoop().RunUntilIdle(); + events = GetAndResetDispatchedMessages(); + EXPECT_EQ("MouseWheel GestureScrollEnd MouseWheel", GetMessageNames(events)); + EXPECT_TRUE(events[0]->ToEvent()); + wheel_event = static_cast<const WebMouseWheelEvent*>( + events[0]->ToEvent()->Event()->web_event.get()); + EXPECT_EQ(WebMouseWheelEvent::kPhaseEnded, wheel_event->phase); + EXPECT_TRUE(events[2]->ToEvent()); + wheel_event = static_cast<const WebMouseWheelEvent*>( + events[2]->ToEvent()->Event()->web_event.get()); + EXPECT_EQ(WebMouseWheelEvent::kPhaseBegan, wheel_event->phase); +} +TEST_F(RenderWidgetHostViewAuraAsyncWheelEventsEnabledTest, + TimerBasedLatchingBreaksWithAutoscrollStart) { + TimerBasedLatchingBreaksWithAutoscrollStart(); +} + // Tests that a gesture fling start with touchpad source resets wheel phase // state. void RenderWidgetHostViewAuraTest::TouchpadFlingStartResetsWheelPhaseState() {
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc index d6e3ba6..909cbf3 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -15,6 +15,7 @@ #include "content/browser/compositor/surface_utils.h" #include "content/browser/gpu/gpu_data_manager_impl.h" #include "content/browser/renderer_host/display_util.h" +#include "content/browser/renderer_host/input/mouse_wheel_phase_handler.h" #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/renderer_host/render_widget_host_delegate.h" @@ -93,6 +94,10 @@ DCHECK(!observers_.might_have_observers()); } +MouseWheelPhaseHandler* RenderWidgetHostViewBase::GetMouseWheelPhaseHandler() { + return nullptr; +} + bool RenderWidgetHostViewBase::OnMessageReceived(const IPC::Message& msg){ return false; } @@ -385,6 +390,14 @@ NOTIMPLEMENTED_LOG_ONCE(); } +void RenderWidgetHostViewBase::OnAutoscrollStart() { + if (!GetMouseWheelPhaseHandler()) + return; + + // End the current scrolling seqeunce when autoscrolling starts. + GetMouseWheelPhaseHandler()->DispatchPendingWheelEndEvent(); +} + gfx::Size RenderWidgetHostViewBase::GetVisibleViewportSize() const { return GetViewBounds().size(); }
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index 3293d2dd5..04b50a9 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -78,6 +78,7 @@ class BrowserAccessibilityDelegate; class BrowserAccessibilityManager; class CursorManager; +class MouseWheelPhaseHandler; class RenderWidgetHostImpl; class RenderWidgetHostViewBaseObserver; class SyntheticGestureTarget; @@ -475,6 +476,8 @@ // changes. virtual void SetShowingContextMenu(bool showing) {} + virtual void OnAutoscrollStart(); + // Returns the associated RenderWidgetHostImpl. RenderWidgetHostImpl* host() const { return host_; } @@ -541,6 +544,8 @@ void NotifyObserversAboutShutdown(); + virtual MouseWheelPhaseHandler* GetMouseWheelPhaseHandler(); + #if defined(USE_AURA) virtual void ScheduleEmbed( ui::mojom::WindowTreeClientPtr client,
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h index 239e5f3..fb25ab1 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -419,6 +419,8 @@ // collide with FrameSinkIds used by RenderWidgetHostImpls. static viz::FrameSinkId AllocateFrameSinkIdForGuestViewHack(); + MouseWheelPhaseHandler* GetMouseWheelPhaseHandler() override; + // Shuts down the render_widget_host_. This is a separate function so we can // invoke it from the message loop. void ShutdownHost();
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index 3531fb2b..646a19f 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -1198,6 +1198,10 @@ ->AllocateFrameSinkId(); } +MouseWheelPhaseHandler* RenderWidgetHostViewMac::GetMouseWheelPhaseHandler() { + return &mouse_wheel_phase_handler_; +} + /////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostNSViewClient implementation:
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc index 637fae1..3bf2e9e 100644 --- a/content/browser/security_exploit_browsertest.cc +++ b/content/browser/security_exploit_browsertest.cc
@@ -211,7 +211,8 @@ void TryCreateDuplicateRequestIds(Shell* shell, bool block_loaders) { NavigateToURL(shell, GURL("http://foo.com/simple_page.html")); - RenderFrameHost* rfh = shell->web_contents()->GetMainFrame(); + RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>( + shell->web_contents()->GetMainFrame()); if (block_loaders) { // Test the case where loaders are placed into blocked_loaders_map_.
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index 4f327766d..d1bc5d1 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -2359,7 +2359,7 @@ // parent frame. RenderFrameDeletedObserver deleted_observer2( root->child_at(0)->current_frame_host()); - GURL about_blank_url("about:blank"); + GURL about_blank_url("about:blank#foo"); NavigateIframeToURL(shell()->web_contents(), "child-0", about_blank_url); EXPECT_TRUE(observer.last_navigation_succeeded()); EXPECT_EQ(about_blank_url, observer.last_navigation_url()); @@ -2394,7 +2394,7 @@ // own context. It should stay in the same SiteInstance as before, not the // parent one. TestFrameNavigationObserver frame_observer(child); - ExecuteScriptAsync(child, "window.location.href = 'about:blank';"); + ExecuteScriptAsync(child, "window.location.href = 'about:blank#foo';"); frame_observer.Wait(); EXPECT_EQ(about_blank_url, child->current_url());
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index d17d8d5..271a81a 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1870,8 +1870,12 @@ // Clear a pending contents that has been closed before being shown. for (auto iter = pending_contents_.begin(); iter != pending_contents_.end(); ++iter) { - if (iter->second != web_contents) + if (iter->second.get() != web_contents) continue; + + // Someone else has deleted the WebContents. That should never happen! + // TODO(erikchen): Fix semantics here. https://crbug.com/832879. + iter->second.release(); pending_contents_.erase(iter); return; } @@ -2409,31 +2413,33 @@ create_params.renderer_initiated_creation = main_frame_route_id != MSG_ROUTING_NONE; - WebContentsImpl* new_contents = nullptr; + std::unique_ptr<WebContents> new_contents; if (!is_guest) { create_params.context = view_->GetNativeView(); create_params.initial_size = GetContainerBounds().size(); - new_contents = static_cast<WebContentsImpl*>( - WebContents::Create(create_params)); + new_contents.reset( + static_cast<WebContentsImpl*>(WebContents::Create(create_params))); } else { - new_contents = GetBrowserPluginGuest()->CreateNewGuestWindow(create_params); + new_contents = base::WrapUnique( + GetBrowserPluginGuest()->CreateNewGuestWindow(create_params)); } - new_contents->GetController().SetSessionStorageNamespace( - partition_id, - session_storage_namespace); + WebContentsImpl* raw_new_contents = + static_cast<WebContentsImpl*>(new_contents.get()); + raw_new_contents->GetController().SetSessionStorageNamespace( + partition_id, session_storage_namespace); // If the new frame has a name, make sure any SiteInstances that can find // this named frame have proxies for it. Must be called after // SetSessionStorageNamespace, since this calls CreateRenderView, which uses // GetSessionStorageNamespace. if (!params.frame_name.empty()) - new_contents->GetRenderManager()->CreateProxiesForNewNamedFrame(); + raw_new_contents->GetRenderManager()->CreateProxiesForNewNamedFrame(); // Save the window for later if we're not suppressing the opener (since it // will be shown immediately). if (!params.opener_suppressed) { if (!is_guest) { - WebContentsView* new_view = new_contents->view_.get(); + WebContentsView* new_view = raw_new_contents->view_.get(); // TODO(brettw): It seems bogus that we have to call this function on the // newly created object and give it one of its own member variables. @@ -2443,20 +2449,21 @@ // Save the created window associated with the route so we can show it // later. DCHECK_NE(MSG_ROUTING_NONE, main_frame_widget_route_id); - pending_contents_[std::make_pair( - render_process_id, main_frame_widget_route_id)] = new_contents; - AddDestructionObserver(new_contents); + pending_contents_[std::make_pair(render_process_id, + main_frame_widget_route_id)] = + std::move(new_contents); + AddDestructionObserver(raw_new_contents); } if (delegate_) { delegate_->WebContentsCreated(this, render_process_id, opener->GetRoutingID(), params.frame_name, - params.target_url, new_contents); + params.target_url, raw_new_contents); } if (opener) { for (auto& observer : observers_) { - observer.DidOpenRequestedURL(new_contents, opener, params.target_url, + observer.DidOpenRequestedURL(raw_new_contents, opener, params.target_url, params.referrer, params.disposition, ui::PAGE_TRANSITION_LINK, false, // started_from_context_menu @@ -2473,18 +2480,19 @@ // When the opener is suppressed, the original renderer cannot access the // new window. As a result, we need to show and navigate the window here. bool was_blocked = false; + + base::WeakPtr<WebContentsImpl> weak_new_contents = + raw_new_contents->weak_factory_.GetWeakPtr(); if (delegate_) { gfx::Rect initial_rect; - base::WeakPtr<WebContentsImpl> weak_new_contents = - new_contents->weak_factory_.GetWeakPtr(); - delegate_->AddNewContents( - this, new_contents, params.disposition, initial_rect, - params.user_gesture, &was_blocked); - + delegate_->AddNewContents(this, std::move(new_contents), + params.disposition, initial_rect, + params.user_gesture, &was_blocked); if (!weak_new_contents) return; // The delegate deleted |new_contents| during AddNewContents(). } + if (!was_blocked) { OpenURLParams open_params(params.target_url, params.referrer, WindowOpenDisposition::CURRENT_TAB, @@ -2494,11 +2502,12 @@ if (delegate_ && !is_guest && !delegate_->ShouldResumeRequestsForCreatedWindow()) { + DCHECK(weak_new_contents); // We are in asynchronous add new contents path, delay opening url - new_contents->delayed_open_url_params_.reset( + weak_new_contents->delayed_open_url_params_.reset( new OpenURLParams(open_params)); } else { - new_contents->OpenURL(open_params); + weak_new_contents->OpenURL(open_params); } } } @@ -2555,24 +2564,26 @@ WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture) { - WebContentsImpl* popup = + std::unique_ptr<WebContents> popup = GetCreatedWindow(process_id, main_frame_widget_route_id); if (popup) { + WebContentsImpl* raw_popup = static_cast<WebContentsImpl*>(popup.get()); WebContentsDelegate* delegate = GetDelegate(); - popup->is_resume_pending_ = true; + raw_popup->is_resume_pending_ = true; if (!delegate || delegate->ShouldResumeRequestsForCreatedWindow()) - popup->ResumeLoadingCreatedWebContents(); + raw_popup->ResumeLoadingCreatedWebContents(); + base::WeakPtr<WebContentsImpl> weak_popup = + raw_popup->weak_factory_.GetWeakPtr(); if (delegate) { - base::WeakPtr<WebContentsImpl> weak_popup = - popup->weak_factory_.GetWeakPtr(); - delegate->AddNewContents(this, popup, disposition, initial_rect, - user_gesture, nullptr); + delegate->AddNewContents(this, std::move(popup), disposition, + initial_rect, user_gesture, nullptr); if (!weak_popup) return; // The delegate deleted |popup| during AddNewContents(). } - RenderWidgetHostImpl* rwh = popup->GetMainFrame()->GetRenderWidgetHost(); + RenderWidgetHostImpl* rwh = + weak_popup->GetMainFrame()->GetRenderWidgetHost(); DCHECK_EQ(main_frame_widget_route_id, rwh->GetRoutingID()); rwh->Send(new ViewMsg_Move_ACK(rwh->GetRoutingID())); } @@ -2633,7 +2644,7 @@ render_widget_host_impl->set_allow_privileged_mouse_lock(is_fullscreen); } -WebContentsImpl* WebContentsImpl::GetCreatedWindow( +std::unique_ptr<WebContents> WebContentsImpl::GetCreatedWindow( int process_id, int main_frame_widget_route_id) { auto key = std::make_pair(process_id, main_frame_widget_route_id); @@ -2644,17 +2655,18 @@ if (iter == pending_contents_.end()) return nullptr; - WebContentsImpl* new_contents = iter->second; + std::unique_ptr<WebContents> new_contents = std::move(iter->second); pending_contents_.erase(key); - RemoveDestructionObserver(new_contents); + WebContentsImpl* raw_new_contents = + static_cast<WebContentsImpl*>(new_contents.get()); + RemoveDestructionObserver(raw_new_contents); // Don't initialize the guest WebContents immediately. - if (BrowserPluginGuest::IsGuest(new_contents)) + if (BrowserPluginGuest::IsGuest(raw_new_contents)) return new_contents; if (!new_contents->GetMainFrame()->GetProcess()->HasConnection() || !new_contents->GetMainFrame()->GetView()) { - // TODO(nick): http://crbug.com/674318 -- Who deletes |new_contents|? return nullptr; } @@ -4120,8 +4132,8 @@ new_frame_entry->SetPageState(new_page_state); // Create a new WebContents, which is used to display the source code. - WebContentsImpl* view_source_contents = - static_cast<WebContentsImpl*>(Create(CreateParams(GetBrowserContext()))); + std::unique_ptr<WebContents> view_source_contents = + base::WrapUnique(Create(CreateParams(GetBrowserContext()))); // Restore the previously created NavigationEntry. std::vector<std::unique_ptr<NavigationEntry>> navigation_entries; @@ -4133,7 +4145,7 @@ gfx::Rect initial_rect; constexpr bool kUserGesture = true; bool ignored_was_blocked; - delegate_->AddNewContents(this, view_source_contents, + delegate_->AddNewContents(this, std::move(view_source_contents), WindowOpenDisposition::NEW_FOREGROUND_TAB, initial_rect, kUserGesture, &ignored_was_blocked); // Note that the |delegate_| could have deleted |view_source_contents| during
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index a00271b..828b877e 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h
@@ -1261,8 +1261,8 @@ // Finds the new WebContentsImpl by |main_frame_widget_route_id|, initializes // it for renderer-initiated creation, and returns it. Note that this can only // be called once as this call also removes it from the internal map. - WebContentsImpl* GetCreatedWindow(int process_id, - int main_frame_widget_route_id); + std::unique_ptr<WebContents> GetCreatedWindow(int process_id, + int main_frame_widget_route_id); // Sends a Page message IPC. void SendPageMessage(IPC::Message* msg); @@ -1381,7 +1381,8 @@ // Tracks created WebContentsImpl objects that have not been shown yet. They // are identified by the process ID and routing ID passed to CreateNewWindow. typedef std::pair<int, int> ProcessRoutingIdPair; - std::map<ProcessRoutingIdPair, WebContentsImpl*> pending_contents_; + std::map<ProcessRoutingIdPair, std::unique_ptr<WebContents>> + pending_contents_; // This map holds widgets that were created on behalf of the renderer but // haven't been shown yet.
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc index d808e44d..619bbf9 100644 --- a/content/browser/web_contents/web_contents_impl_browsertest.cc +++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -1481,12 +1481,12 @@ } void AddNewContents(WebContents* source, - WebContents* new_contents, + std::unique_ptr<WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture, bool* was_blocked) override { - popup_.reset(new_contents); + popup_ = std::move(new_contents); if (waiting_for_ == kNewContents) run_loop_->Quit();
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc index f517013..17f86a5 100644 --- a/content/browser/web_contents/web_contents_impl_unittest.cc +++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -2667,29 +2667,38 @@ // Test that if a pending contents is deleted before it is shown, we don't // crash. TEST_F(WebContentsImplTest, PendingContentsDestroyed) { - std::unique_ptr<TestWebContents> other_contents( - static_cast<TestWebContents*>(CreateTestWebContents())); - contents()->AddPendingContents(other_contents.get()); + std::unique_ptr<WebContentsImpl> other_contents( + static_cast<WebContentsImpl*>(CreateTestWebContents())); + content::TestWebContents* raw_other_contents = + static_cast<TestWebContents*>(other_contents.get()); + contents()->AddPendingContents(std::move(other_contents)); RenderWidgetHost* widget = - other_contents->GetMainFrame()->GetRenderWidgetHost(); + raw_other_contents->GetMainFrame()->GetRenderWidgetHost(); int process_id = widget->GetProcess()->GetID(); int widget_id = widget->GetRoutingID(); - other_contents.reset(); + + // TODO(erikchen): Fix ownership semantics of WebContents. Nothing should be + // able to delete it beside from the owner. https://crbug.com/832879. + delete raw_other_contents; EXPECT_EQ(nullptr, contents()->GetCreatedWindow(process_id, widget_id)); } TEST_F(WebContentsImplTest, PendingContentsShown) { - std::unique_ptr<TestWebContents> other_contents( - static_cast<TestWebContents*>(CreateTestWebContents())); - contents()->AddPendingContents(other_contents.get()); + std::unique_ptr<WebContents> other_contents( + static_cast<WebContents*>(CreateTestWebContents())); + content::WebContents* raw_other_contents = other_contents.get(); + content::TestWebContents* test_web_contents = + static_cast<content::TestWebContents*>(other_contents.get()); + contents()->AddPendingContents(std::move(other_contents)); + RenderWidgetHost* widget = - other_contents->GetMainFrame()->GetRenderWidgetHost(); + test_web_contents->GetMainFrame()->GetRenderWidgetHost(); int process_id = widget->GetProcess()->GetID(); int widget_id = widget->GetRoutingID(); // The first call to GetCreatedWindow pops it off the pending list. - EXPECT_EQ(other_contents.get(), - contents()->GetCreatedWindow(process_id, widget_id)); + EXPECT_EQ(raw_other_contents, + contents()->GetCreatedWindow(process_id, widget_id).get()); // A second call should return nullptr, verifying that it's been forgotten. EXPECT_EQ(nullptr, contents()->GetCreatedWindow(process_id, widget_id)); }
diff --git a/content/child/BUILD.gn b/content/child/BUILD.gn index fbb110d2..e7d2290 100644 --- a/content/child/BUILD.gn +++ b/content/child/BUILD.gn
@@ -106,7 +106,6 @@ "//gpu/command_buffer/client", "//media", "//media/blink", - "//mojo/common", "//mojo/edk", "//net", "//services/device/public/cpp:device_features",
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h index 43d5461..9b224606 100644 --- a/content/common/frame_messages.h +++ b/content/common/frame_messages.h
@@ -565,6 +565,7 @@ IPC_STRUCT_MEMBER(content::Referrer, referrer) IPC_STRUCT_MEMBER(url::Origin, initiator_origin) IPC_STRUCT_MEMBER(base::string16, suggested_name) + IPC_STRUCT_MEMBER(mojo::MessagePipeHandle, blob_url_token) IPC_STRUCT_END() IPC_STRUCT_BEGIN(FrameMsg_TextTrackSettings_Params)
diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc index 5f2631c..20dc0c9 100644 --- a/content/public/app/content_main_delegate.cc +++ b/content/public/app/content_main_delegate.cc
@@ -26,6 +26,10 @@ return -1; } +ui::DataPack* ContentMainDelegate::LoadServiceManifestDataPack() { + return nullptr; +} + #if defined(OS_MACOSX) bool ContentMainDelegate::ProcessRegistersWithSystemProcess(
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h index a53d40b..c3f364e 100644 --- a/content/public/app/content_main_delegate.h +++ b/content/public/app/content_main_delegate.h
@@ -23,6 +23,10 @@ class Identity; } // namespace service_manager +namespace ui { +class DataPack; +} + namespace content { class ContentBrowserClient; @@ -59,6 +63,10 @@ // Called right before the process exits. virtual void ProcessExiting(const std::string& process_type) {} + // This loads the service manifest datapack, takes its ownership and returns + // the pointer to it. + virtual ui::DataPack* LoadServiceManifestDataPack(); + #if defined(OS_MACOSX) // Returns true if the process registers with the system monitor, so that we // can allocate an IO port for it before the sandbox is initialized. Embedders
diff --git a/content/public/browser/download_manager.h b/content/public/browser/download_manager.h index 3fe3b73..0708c4157 100644 --- a/content/public/browser/download_manager.h +++ b/content/public/browser/download_manager.h
@@ -43,6 +43,7 @@ #include "components/download/public/common/input_stream.h" #include "content/common/content_export.h" #include "net/base/net_errors.h" +#include "services/network/public/cpp/shared_url_loader_factory.h" #include "storage/browser/blob/blob_data_handle.h" class GURL; @@ -149,7 +150,9 @@ // fail. virtual void DownloadUrl( std::unique_ptr<download::DownloadUrlParameters> parameters, - std::unique_ptr<storage::BlobDataHandle> blob_data_handle) = 0; + std::unique_ptr<storage::BlobDataHandle> blob_data_handle, + scoped_refptr<network::SharedURLLoaderFactory> + blob_url_loader_factory) = 0; // Allow objects to observe the download creation process. virtual void AddObserver(Observer* observer) = 0;
diff --git a/content/public/browser/render_frame_host.h b/content/public/browser/render_frame_host.h index 4a3ea81..f5dced5 100644 --- a/content/public/browser/render_frame_host.h +++ b/content/public/browser/render_frame_host.h
@@ -273,15 +273,6 @@ // RenderFrame. See BindingsPolicy for details. virtual int GetEnabledBindings() const = 0; - // Causes all new requests for the root RenderFrameHost and its children to - // be blocked (not being started) until ResumeBlockedRequestsForFrame is - // called. - virtual void BlockRequestsForFrame() = 0; - - // Resumes any blocked request for the specified root RenderFrameHost and - // child frame hosts. - virtual void ResumeBlockedRequestsForFrame() = 0; - #if defined(OS_ANDROID) // Returns an InterfaceProvider for Java-implemented interfaces that are // scoped to this RenderFrameHost. This provides access to interfaces
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h index 28cf408..0111890e 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h
@@ -18,6 +18,7 @@ #include "content/common/content_export.h" #include "content/public/browser/bluetooth_chooser.h" #include "content/public/browser/invalidate_type.h" +#include "content/public/browser/web_contents.h" #include "content/public/common/media_stream_request.h" #include "content/public/common/previews_state.h" #include "content/public/common/window_container_type.mojom.h" @@ -48,7 +49,6 @@ class RenderWidgetHost; class SessionStorageNamespace; class SiteInstance; -class WebContents; class WebContentsImpl; struct ContextMenuParams; struct DropData; @@ -121,7 +121,7 @@ // |*was_blocked| will be set to true if the popup gets blocked, and left // unchanged otherwise. virtual void AddNewContents(WebContents* source, - WebContents* new_contents, + std::unique_ptr<WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/content/public/common/BUILD.gn b/content/public/common/BUILD.gn index c007644b..ebb4d5e 100644 --- a/content/public/common/BUILD.gn +++ b/content/public/common/BUILD.gn
@@ -280,7 +280,6 @@ # needed because of allow_circular_includes_from. "//content/common:mojo_bindings", "//media", - "//mojo/common", "//ppapi/buildflags", "//ppapi/c", "//services/network/public/cpp",
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 759ed8c..d4c0d80 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -432,8 +432,7 @@ // captured from the renderer for DevTools performance timeline and eyedropper // tool. const base::Feature kUseVideoCaptureApiForDevToolsSnapshots{ - "UseVideoCaptureApiForDevToolsSnapshots", - base::FEATURE_DISABLED_BY_DEFAULT}; + "UseVideoCaptureApiForDevToolsSnapshots", base::FEATURE_ENABLED_BY_DEFAULT}; // Enables to use a snapshot file in creating V8 contexts. const base::Feature kV8ContextSnapshot{"V8ContextSnapshot", @@ -515,6 +514,11 @@ const base::Feature kWebRtcAecClockDriftSetup{ "WebRtcAecClockDriftSetup", base::FEATURE_DISABLED_BY_DEFAULT}; +// Informs the WebRTC Acoustic Echo Canceler (AEC) that the feature providing +// echo canceller transparency to render noise should be used. +const base::Feature kWebRtcAecNoiseTransparency{ + "WebRtcAecNoiseTransparency", base::FEATURE_DISABLED_BY_DEFAULT}; + // Makes WebRTC use ECDSA certs by default (i.e., when no cert type was // specified in JS). const base::Feature kWebRtcEcdsaDefault{"WebRTC-EnableWebRtcEcdsa",
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 6d4bcb9..8add9c1 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -118,6 +118,7 @@ CONTENT_EXPORT extern const base::Feature kWebPayments; CONTENT_EXPORT extern const base::Feature kWebRtcAecBoundedErlSetup; CONTENT_EXPORT extern const base::Feature kWebRtcAecClockDriftSetup; +CONTENT_EXPORT extern const base::Feature kWebRtcAecNoiseTransparency; CONTENT_EXPORT extern const base::Feature kWebRtcEcdsaDefault; CONTENT_EXPORT extern const base::Feature kWebRtcHWH264Encoding; CONTENT_EXPORT extern const base::Feature kWebRtcHWVP8Encoding;
diff --git a/content/public/test/frame_load_waiter.h b/content/public/test/frame_load_waiter.h index d7b0335..e9fcb3e2 100644 --- a/content/public/test/frame_load_waiter.h +++ b/content/public/test/frame_load_waiter.h
@@ -19,8 +19,8 @@ explicit FrameLoadWaiter(RenderFrame* frame); // Note: single-process browser tests need to enable nestable tasks by - // instantiating a base::MessageLoop::ScopedNestableTaskAllower or this method - // will never return. + // instantiating a base::MessageLoopCurrent::ScopedNestableTaskAllower or this + // method will never return. void Wait(); private:
diff --git a/content/public/test/mock_download_manager.h b/content/public/test/mock_download_manager.h index d88b6124..109c898ed 100644 --- a/content/public/test/mock_download_manager.h +++ b/content/public/test/mock_download_manager.h
@@ -117,11 +117,12 @@ MOCK_METHOD1(DownloadUrlMock, void(download::DownloadUrlParameters*)); void DownloadUrl( std::unique_ptr<download::DownloadUrlParameters> params) override { - DownloadUrl(std::move(params), nullptr); + DownloadUrl(std::move(params), nullptr, nullptr); } - void DownloadUrl( - std::unique_ptr<download::DownloadUrlParameters> params, - std::unique_ptr<storage::BlobDataHandle> blob_data_handle) override { + void DownloadUrl(std::unique_ptr<download::DownloadUrlParameters> params, + std::unique_ptr<storage::BlobDataHandle> blob_data_handle, + scoped_refptr<network::SharedURLLoaderFactory> + blob_url_loader_factory) override { DownloadUrlMock(params.get()); } MOCK_METHOD1(AddObserver, void(Observer* observer));
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn index 15ff76c..261a8928 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn
@@ -532,7 +532,6 @@ "//media/mojo/clients", "//media/mojo/interfaces", "//media/mojo/interfaces:remoting", - "//mojo/common", "//mojo/public/cpp/bindings", "//net", "//ppapi/buildflags",
diff --git a/content/renderer/accessibility/blink_ax_tree_source.cc b/content/renderer/accessibility/blink_ax_tree_source.cc index 7d36d51..5cf416ed 100644 --- a/content/renderer/accessibility/blink_ax_tree_source.cc +++ b/content/renderer/accessibility/blink_ax_tree_source.cc
@@ -937,21 +937,21 @@ } if (src.IsScrollableContainer()) { - const gfx::Point& scrollOffset = src.GetScrollOffset(); - dst->AddIntAttribute(ax::mojom::IntAttribute::kScrollX, scrollOffset.x()); - dst->AddIntAttribute(ax::mojom::IntAttribute::kScrollY, scrollOffset.y()); + const gfx::Point& scroll_offset = src.GetScrollOffset(); + dst->AddIntAttribute(ax::mojom::IntAttribute::kScrollX, scroll_offset.x()); + dst->AddIntAttribute(ax::mojom::IntAttribute::kScrollY, scroll_offset.y()); - const gfx::Point& minScrollOffset = src.MinimumScrollOffset(); + const gfx::Point& min_scroll_offset = src.MinimumScrollOffset(); dst->AddIntAttribute(ax::mojom::IntAttribute::kScrollXMin, - minScrollOffset.x()); + min_scroll_offset.x()); dst->AddIntAttribute(ax::mojom::IntAttribute::kScrollYMin, - minScrollOffset.y()); + min_scroll_offset.y()); - const gfx::Point& maxScrollOffset = src.MaximumScrollOffset(); + const gfx::Point& max_scroll_offset = src.MaximumScrollOffset(); dst->AddIntAttribute(ax::mojom::IntAttribute::kScrollXMax, - maxScrollOffset.x()); + max_scroll_offset.x()); dst->AddIntAttribute(ax::mojom::IntAttribute::kScrollYMax, - maxScrollOffset.y()); + max_scroll_offset.y()); } if (dst->id == image_data_node_id_) {
diff --git a/content/renderer/media/media_factory.cc b/content/renderer/media/media_factory.cc index 03e4eaf8..231f8aa0 100644 --- a/content/renderer/media/media_factory.cc +++ b/content/renderer/media/media_factory.cc
@@ -278,7 +278,7 @@ base::BindRepeating( &PostMediaContextProviderToCallback, RenderThreadImpl::current()->GetCompositorMainThreadTaskRunner()), - RenderThreadImpl::current()->GetGpuMemoryBufferManager(), settings); + settings); } else { video_frame_compositor_task_runner = render_thread->compositor_task_runner()
diff --git a/content/renderer/media/stream/media_stream_audio_processor.cc b/content/renderer/media/stream/media_stream_audio_processor.cc index c3d73e7..a2f6abe 100644 --- a/content/renderer/media/stream/media_stream_audio_processor.cc +++ b/content/renderer/media/stream/media_stream_audio_processor.cc
@@ -629,6 +629,8 @@ base::FeatureList::IsEnabled(features::kWebRtcAecBoundedErlSetup); aec3_config.echo_removal_control.has_clock_drift = base::FeatureList::IsEnabled(features::kWebRtcAecClockDriftSetup); + aec3_config.echo_audibility.use_stationary_properties = + base::FeatureList::IsEnabled(features::kWebRtcAecNoiseTransparency); ap_builder.SetEchoControlFactory( std::unique_ptr<webrtc::EchoControlFactory>(
diff --git a/content/renderer/mus/BUILD.gn b/content/renderer/mus/BUILD.gn index 559eae55..718ad1c 100644 --- a/content/renderer/mus/BUILD.gn +++ b/content/renderer/mus/BUILD.gn
@@ -26,7 +26,6 @@ "//content/public/child:child_sources", "//content/public/common:common_sources", "//media/mojo/interfaces:remoting", - "//mojo/common", "//services/service_manager/public/cpp", "//services/ui/public/cpp", "//services/ui/public/interfaces",
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 50c5f92..dec8b187 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -3768,7 +3768,9 @@ static_cast<int32_t>(source_line), source_name.Utf16())); } -void RenderFrameImpl::DownloadURL(const blink::WebURLRequest& request) { +void RenderFrameImpl::DownloadURL( + const blink::WebURLRequest& request, + mojo::ScopedMessagePipeHandle blob_url_token) { FrameHostMsg_DownloadUrl_Params params; params.render_view_id = render_view_->GetRoutingID(); params.render_frame_id = GetRoutingID(); @@ -3777,6 +3779,7 @@ params.initiator_origin = request.RequestorOrigin(); if (request.GetSuggestedFilename().has_value()) params.suggested_name = request.GetSuggestedFilename()->Utf16(); + params.blob_url_token = blob_url_token.release(); Send(new FrameHostMsg_DownloadUrl(params)); } @@ -6010,7 +6013,16 @@ } if (info.default_policy == blink::kWebNavigationPolicyDownload) { - DownloadURL(info.url_request); + blink::mojom::BlobURLTokenPtrInfo blob_url_token; + if (info.blob_url_token.is_valid()) { + blink::mojom::BlobURLTokenPtr token(blink::mojom::BlobURLTokenPtrInfo( + mojo::ScopedMessagePipeHandle(info.blob_url_token.get()), + blink::mojom::BlobURLToken::Version_)); + token->Clone(MakeRequest(&blob_url_token)); + ignore_result(token.PassInterface().PassHandle().release()); + } + + DownloadURL(info.url_request, blob_url_token.PassHandle()); } else { OpenURL(info, /*send_referrer=*/true, /*is_history_navigation_in_new_child=*/false);
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h index 15067e2..6d3deeb 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h
@@ -622,7 +622,8 @@ const blink::WebString& source_name, unsigned source_line, const blink::WebString& stack_trace) override; - void DownloadURL(const blink::WebURLRequest& request) override; + void DownloadURL(const blink::WebURLRequest& request, + mojo::ScopedMessagePipeHandle blob_url_token) override; void LoadErrorPage(int reason) override; blink::WebNavigationPolicy DecidePolicyForNavigation( const NavigationPolicyInfo& info) override;
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc index 4366ed9..f963e02 100644 --- a/content/shell/browser/shell.cc +++ b/content/shell/browser/shell.cc
@@ -73,9 +73,9 @@ DISALLOW_COPY_AND_ASSIGN(DevToolsWebContentsObserver); }; -Shell::Shell(WebContents* web_contents) - : WebContentsObserver(web_contents), - web_contents_(web_contents), +Shell::Shell(std::unique_ptr<WebContents> web_contents) + : WebContentsObserver(web_contents.get()), + web_contents_(std::move(web_contents)), devtools_frontend_(nullptr), is_fullscreen_(false), window_(nullptr), @@ -131,9 +131,10 @@ web_contents_->SetDelegate(nullptr); } -Shell* Shell::CreateShell(WebContents* web_contents, +Shell* Shell::CreateShell(std::unique_ptr<WebContents> web_contents, const gfx::Size& initial_size) { - Shell* shell = new Shell(web_contents); + WebContents* raw_web_contents = web_contents.get(); + Shell* shell = new Shell(std::move(web_contents)); shell->PlatformCreateWindow(initial_size.width(), initial_size.height()); shell->PlatformSetContents(); @@ -144,14 +145,14 @@ // here, because they will be forgotten after a cross-process navigation. Use // RenderFrameCreated or RenderViewCreated instead. if (switches::IsRunLayoutTestSwitchPresent()) { - web_contents->GetMutableRendererPrefs()->use_custom_colors = false; - web_contents->GetRenderViewHost()->SyncRendererPrefs(); + raw_web_contents->GetMutableRendererPrefs()->use_custom_colors = false; + raw_web_contents->GetRenderViewHost()->SyncRendererPrefs(); } #if BUILDFLAG(ENABLE_WEBRTC) base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kForceWebRtcIPHandlingPolicy)) { - web_contents->GetMutableRendererPrefs()->webrtc_ip_handling_policy = + raw_web_contents->GetMutableRendererPrefs()->webrtc_ip_handling_policy = command_line->GetSwitchValueASCII( switches::kForceWebRtcIPHandlingPolicy); } @@ -208,8 +209,10 @@ blink::kPresentationReceiverSandboxFlags; } create_params.initial_size = AdjustWindowSize(initial_size); - WebContents* web_contents = WebContents::Create(create_params); - Shell* shell = CreateShell(web_contents, create_params.initial_size); + std::unique_ptr<WebContents> web_contents = + base::WrapUnique(WebContents::Create(create_params)); + Shell* shell = + CreateShell(std::move(web_contents), create_params.initial_size); if (!url.is_empty()) shell->LoadURL(url); return shell; @@ -277,14 +280,15 @@ } void Shell::AddNewContents(WebContents* source, - WebContents* new_contents, + std::unique_ptr<WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture, bool* was_blocked) { - CreateShell(new_contents, AdjustWindowSize(initial_rect.size())); + WebContents* raw_new_contents = new_contents.get(); + CreateShell(std::move(new_contents), AdjustWindowSize(initial_rect.size())); if (switches::IsRunLayoutTestSwitchPresent()) - SecondaryTestWindowObserver::CreateForWebContents(new_contents); + SecondaryTestWindowObserver::CreateForWebContents(raw_new_contents); } void Shell::GoBackOrForward(int offset) {
diff --git a/content/shell/browser/shell.h b/content/shell/browser/shell.h index 65af9a78..2efc6bd 100644 --- a/content/shell/browser/shell.h +++ b/content/shell/browser/shell.h
@@ -124,7 +124,7 @@ WebContents* OpenURLFromTab(WebContents* source, const OpenURLParams& params) override; void AddNewContents(WebContents* source, - WebContents* new_contents, + std::unique_ptr<WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture, @@ -183,10 +183,10 @@ class DevToolsWebContentsObserver; - explicit Shell(WebContents* web_contents); + explicit Shell(std::unique_ptr<WebContents> web_contents); // Helper to create a new Shell given a newly created WebContents. - static Shell* CreateShell(WebContents* web_contents, + static Shell* CreateShell(std::unique_ptr<WebContents> web_contents, const gfx::Size& initial_size); // Helper for one time initialization of application
diff --git a/content/shell/test_runner/web_frame_test_client.cc b/content/shell/test_runner/web_frame_test_client.cc index b9001d8..28bf873 100644 --- a/content/shell/test_runner/web_frame_test_client.cc +++ b/content/shell/test_runner/web_frame_test_client.cc
@@ -367,7 +367,9 @@ ->SetContextMenuData(context_menu_data); } -void WebFrameTestClient::DownloadURL(const blink::WebURLRequest& request) { +void WebFrameTestClient::DownloadURL( + const blink::WebURLRequest& request, + mojo::ScopedMessagePipeHandle blob_url_token) { if (test_runner()->shouldWaitUntilExternalURLLoad()) { delegate_->PrintMessage(std::string("Download started\n")); delegate_->TestFinished();
diff --git a/content/shell/test_runner/web_frame_test_client.h b/content/shell/test_runner/web_frame_test_client.h index 9d2481e..608c64e 100644 --- a/content/shell/test_runner/web_frame_test_client.h +++ b/content/shell/test_runner/web_frame_test_client.h
@@ -50,7 +50,8 @@ const blink::WebString& source_name, unsigned source_line, const blink::WebString& stack_trace) override; - void DownloadURL(const blink::WebURLRequest& request) override; + void DownloadURL(const blink::WebURLRequest& request, + mojo::ScopedMessagePipeHandle blob_url_token) override; void LoadErrorPage(int reason) override; void DidStartProvisionalLoad(blink::WebDocumentLoader* loader, blink::WebURLRequest& request) override;
diff --git a/content/shell/test_runner/web_frame_test_proxy.h b/content/shell/test_runner/web_frame_test_proxy.h index 0e85a7a..3816209b 100644 --- a/content/shell/test_runner/web_frame_test_proxy.h +++ b/content/shell/test_runner/web_frame_test_proxy.h
@@ -84,9 +84,10 @@ return mime_type.Utf8().find(suffix) != std::string::npos; } - void DownloadURL(const blink::WebURLRequest& request) override { - test_client()->DownloadURL(request); - Base::DownloadURL(request); + void DownloadURL(const blink::WebURLRequest& request, + mojo::ScopedMessagePipeHandle blob_url_token) override { + test_client()->DownloadURL(request, mojo::ScopedMessagePipeHandle()); + Base::DownloadURL(request, std::move(blob_url_token)); }
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc index 594d8ab..9b60472 100644 --- a/content/test/test_web_contents.cc +++ b/content/test/test_web_contents.cc
@@ -347,12 +347,14 @@ static_cast<WebContentsImpl*>(opener)->GetFrameTree()->root()); } -void TestWebContents::AddPendingContents(TestWebContents* contents) { +void TestWebContents::AddPendingContents( + std::unique_ptr<WebContents> contents) { // This is normally only done in WebContentsImpl::CreateNewWindow. ProcessRoutingIdPair key(contents->GetRenderViewHost()->GetProcess()->GetID(), contents->GetRenderViewHost()->GetRoutingID()); - pending_contents_[key] = contents; - AddDestructionObserver(contents); + WebContentsImpl* raw_contents = static_cast<WebContentsImpl*>(contents.get()); + AddDestructionObserver(raw_contents); + pending_contents_[key] = std::move(contents); } void TestWebContents::ExpectSetHistoryOffsetAndLength(int history_offset,
diff --git a/content/test/test_web_contents.h b/content/test/test_web_contents.h index ce72d69..72eaa3a 100644 --- a/content/test/test_web_contents.h +++ b/content/test/test_web_contents.h
@@ -126,7 +126,7 @@ } // Allows us to simulate that a contents was created via CreateNewWindow. - void AddPendingContents(TestWebContents* contents); + void AddPendingContents(std::unique_ptr<WebContents> contents); // Establish expected arguments for |SetHistoryOffsetAndLength()|. When // |SetHistoryOffsetAndLength()| is called, the arguments are compared
diff --git a/content/utility/BUILD.gn b/content/utility/BUILD.gn index 33342bae..610106e 100644 --- a/content/utility/BUILD.gn +++ b/content/utility/BUILD.gn
@@ -37,7 +37,6 @@ "//content/public/child:child_sources", "//content/public/common:common_sources", "//media:media_buildflags", - "//mojo/common", "//mojo/public/cpp/bindings", "//net:net_with_v8", "//sandbox",
diff --git a/device/BUILD.gn b/device/BUILD.gn index 1ca366e..d1891695 100644 --- a/device/BUILD.gn +++ b/device/BUILD.gn
@@ -109,7 +109,6 @@ "//device/gamepad/public/mojom", "//device/gamepad/public/mojom:gamepad_mojom_traits_test", "//device/geolocation:unittests", - "//mojo/common", "//mojo/edk", "//mojo/public/cpp/bindings", "//net",
diff --git a/device/usb/mojo/BUILD.gn b/device/usb/mojo/BUILD.gn index f31975d..0a556a86 100644 --- a/device/usb/mojo/BUILD.gn +++ b/device/usb/mojo/BUILD.gn
@@ -19,7 +19,6 @@ "//device/usb", "//device/usb/public/cpp", "//device/usb/public/mojom", - "//mojo/common", "//mojo/public/cpp/bindings", "//net", ]
diff --git a/device/usb/mojo/DEPS b/device/usb/mojo/DEPS deleted file mode 100644 index 6cfa565..0000000 --- a/device/usb/mojo/DEPS +++ /dev/null
@@ -1,3 +0,0 @@ -include_rules = [ - "+mojo/common", -]
diff --git a/extensions/browser/app_window/app_delegate.h b/extensions/browser/app_window/app_delegate.h index a513cba..30c8fb38 100644 --- a/extensions/browser/app_window/app_delegate.h +++ b/extensions/browser/app_window/app_delegate.h
@@ -48,11 +48,12 @@ content::BrowserContext* context, content::WebContents* source, const content::OpenURLParams& params) = 0; - virtual void AddNewContents(content::BrowserContext* context, - content::WebContents* new_contents, - WindowOpenDisposition disposition, - const gfx::Rect& initial_rect, - bool user_gesture) = 0; + virtual void AddNewContents( + content::BrowserContext* context, + std::unique_ptr<content::WebContents> new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_rect, + bool user_gesture) = 0; // Feature support. virtual content::ColorChooser* ShowColorChooser(
diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc index 5b090151..e377ba4 100644 --- a/extensions/browser/app_window/app_window.cc +++ b/extensions/browser/app_window/app_window.cc
@@ -366,14 +366,14 @@ } void AppWindow::AddNewContents(WebContents* source, - WebContents* new_contents, + std::unique_ptr<WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture, bool* was_blocked) { DCHECK(new_contents->GetBrowserContext() == browser_context_); - app_delegate_->AddNewContents(browser_context_, new_contents, disposition, - initial_rect, user_gesture); + app_delegate_->AddNewContents(browser_context_, std::move(new_contents), + disposition, initial_rect, user_gesture); } content::KeyboardEventProcessingResult AppWindow::PreHandleKeyboardEvent(
diff --git a/extensions/browser/app_window/app_window.h b/extensions/browser/app_window/app_window.h index 84026c0..e753f89 100644 --- a/extensions/browser/app_window/app_window.h +++ b/extensions/browser/app_window/app_window.h
@@ -425,7 +425,7 @@ content::WebContents* source, const content::OpenURLParams& params) override; void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/extensions/browser/extension_host.cc b/extensions/browser/extension_host.cc index 1ef809a..0a8a8f1 100644 --- a/extensions/browser/extension_host.cc +++ b/extensions/browser/extension_host.cc
@@ -389,7 +389,7 @@ } void ExtensionHost::AddNewContents(WebContents* source, - WebContents* new_contents, + std::unique_ptr<WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture, @@ -409,18 +409,16 @@ new_contents->GetBrowserContext()) { WebContentsDelegate* delegate = associated_contents->GetDelegate(); if (delegate) { - delegate->AddNewContents( - associated_contents, new_contents, disposition, initial_rect, - user_gesture, was_blocked); + delegate->AddNewContents(associated_contents, std::move(new_contents), + disposition, initial_rect, user_gesture, + was_blocked); return; } } } - // TODO(erikchen): Refactor AddNewContents to take strong ownership semantics. - // https://crbug.com/832879. - delegate_->CreateTab(base::WrapUnique(new_contents), extension_id_, - disposition, initial_rect, user_gesture); + delegate_->CreateTab(std::move(new_contents), extension_id_, disposition, + initial_rect, user_gesture); } void ExtensionHost::RenderViewReady() {
diff --git a/extensions/browser/extension_host.h b/extensions/browser/extension_host.h index c93e3a4..8c7a96fd 100644 --- a/extensions/browser/extension_host.h +++ b/extensions/browser/extension_host.h
@@ -113,7 +113,7 @@ content::JavaScriptDialogManager* GetJavaScriptDialogManager( content::WebContents* source) override; void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.cc b/extensions/browser/guest_view/extension_options/extension_options_guest.cc index 1a74872..8ad547f 100644 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.cc +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
@@ -152,17 +152,18 @@ options.ToValue())); } -void ExtensionOptionsGuest::AddNewContents(WebContents* source, - WebContents* new_contents, - WindowOpenDisposition disposition, - const gfx::Rect& initial_rect, - bool user_gesture, - bool* was_blocked) { +void ExtensionOptionsGuest::AddNewContents( + WebContents* source, + std::unique_ptr<WebContents> new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_rect, + bool user_gesture, + bool* was_blocked) { if (!attached() || !embedder_web_contents()->GetDelegate()) return; embedder_web_contents()->GetDelegate()->AddNewContents( - source, new_contents, disposition, initial_rect, user_gesture, + source, std::move(new_contents), disposition, initial_rect, user_gesture, was_blocked); }
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.h b/extensions/browser/guest_view/extension_options/extension_options_guest.h index 12250fc1..9ff1ba65b 100644 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.h +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.h
@@ -39,7 +39,7 @@ // content::WebContentsDelegate implementation. void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc index d0561f07..d9880065 100644 --- a/extensions/browser/guest_view/web_view/web_view_guest.cc +++ b/extensions/browser/guest_view/web_view/web_view_guest.cc
@@ -1245,17 +1245,17 @@ } void WebViewGuest::AddNewContents(WebContents* source, - WebContents* new_contents, + std::unique_ptr<WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture, bool* was_blocked) { + // TODO(erikchen): Fix ownership semantics for WebContents inside this class. + // https://crbug.com/832879. if (was_blocked) *was_blocked = false; - RequestNewWindowPermission(disposition, - initial_rect, - user_gesture, - new_contents); + RequestNewWindowPermission(disposition, initial_rect, user_gesture, + new_contents.release()); } WebContents* WebViewGuest::OpenURLFromTab(
diff --git a/extensions/browser/guest_view/web_view/web_view_guest.h b/extensions/browser/guest_view/web_view/web_view_guest.h index 5c06f378..4d6730dd 100644 --- a/extensions/browser/guest_view/web_view/web_view_guest.h +++ b/extensions/browser/guest_view/web_view/web_view_guest.h
@@ -232,7 +232,7 @@ content::JavaScriptDialogManager* GetJavaScriptDialogManager( content::WebContents* source) final; void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/extensions/shell/browser/shell_app_delegate.cc b/extensions/shell/browser/shell_app_delegate.cc index 8d9afef1..ee1cf108 100644 --- a/extensions/shell/browser/shell_app_delegate.cc +++ b/extensions/shell/browser/shell_app_delegate.cc
@@ -41,11 +41,12 @@ return NULL; } -void ShellAppDelegate::AddNewContents(content::BrowserContext* context, - content::WebContents* new_contents, - WindowOpenDisposition disposition, - const gfx::Rect& initial_rect, - bool user_gesture) { +void ShellAppDelegate::AddNewContents( + content::BrowserContext* context, + std::unique_ptr<content::WebContents> new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_rect, + bool user_gesture) { NOTIMPLEMENTED(); }
diff --git a/extensions/shell/browser/shell_app_delegate.h b/extensions/shell/browser/shell_app_delegate.h index c07400ae..79cc6615 100644 --- a/extensions/shell/browser/shell_app_delegate.h +++ b/extensions/shell/browser/shell_app_delegate.h
@@ -28,7 +28,7 @@ content::WebContents* source, const content::OpenURLParams& params) override; void AddNewContents(content::BrowserContext* context, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture) override;
diff --git a/gpu/ipc/common/gpu_feature_info.typemap b/gpu/ipc/common/gpu_feature_info.typemap index 4f3076a..77309f3 100644 --- a/gpu/ipc/common/gpu_feature_info.typemap +++ b/gpu/ipc/common/gpu_feature_info.typemap
@@ -7,7 +7,6 @@ traits_headers = [ "//gpu/ipc/common/gpu_feature_info_struct_traits.h" ] public_deps = [ "//gpu/config", - "//mojo/common", "//ui/gfx/geometry/mojo", ] type_mappings = [
diff --git a/gpu/ipc/common/gpu_info.typemap b/gpu/ipc/common/gpu_info.typemap index fe21131..3e74664 100644 --- a/gpu/ipc/common/gpu_info.typemap +++ b/gpu/ipc/common/gpu_info.typemap
@@ -10,7 +10,6 @@ ] public_deps = [ "//gpu/config", - "//mojo/common", "//ui/gfx/geometry/mojo", ] type_mappings = [
diff --git a/gpu/ipc/service/direct_composition_surface_win.cc b/gpu/ipc/service/direct_composition_surface_win.cc index b87de21..5678d53 100644 --- a/gpu/ipc/service/direct_composition_surface_win.cc +++ b/gpu/ipc/service/direct_composition_surface_win.cc
@@ -9,7 +9,6 @@ #include <dxgi1_6.h> #include "base/containers/circular_deque.h" -#include "base/debug/alias.h" #include "base/feature_list.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" @@ -215,56 +214,6 @@ gfx::Transform transform; }; - // TODO(sunnyps): Remove after fixing https://crbug.com/823498 - struct VisualDebugInfo { - uintptr_t content_visual = 0; - uintptr_t clip_visual = 0; - uintptr_t swap_chain_presenter = 0; - uintptr_t swap_chain = 0; - uintptr_t surface = 0; - uint64_t dcomp_surface_serial = 0; - gfx::Rect bounds; - float swap_chain_scale_x = 0.0f; - float swap_chain_scale_y = 0.0f; - bool is_clipped = false; - gfx::Rect clip_rect; - gfx::Transform transform; - - static VisualDebugInfo FromVisualInfo(const VisualInfo& visual_info) { - VisualDebugInfo debug_info; - debug_info.clip_visual = - reinterpret_cast<uintptr_t>(visual_info.clip_visual.Get()); - debug_info.content_visual = - reinterpret_cast<uintptr_t>(visual_info.content_visual.Get()); - debug_info.swap_chain_presenter = - reinterpret_cast<uintptr_t>(visual_info.swap_chain_presenter.get()); - debug_info.swap_chain = - reinterpret_cast<uintptr_t>(visual_info.swap_chain.Get()); - debug_info.surface = - reinterpret_cast<uintptr_t>(visual_info.surface.Get()); - debug_info.dcomp_surface_serial = visual_info.dcomp_surface_serial; - debug_info.bounds = visual_info.bounds; - debug_info.swap_chain_scale_x = visual_info.swap_chain_scale_x; - debug_info.swap_chain_scale_y = visual_info.swap_chain_scale_y; - debug_info.is_clipped = visual_info.is_clipped; - debug_info.clip_rect = visual_info.clip_rect; - debug_info.transform = visual_info.transform; - return debug_info; - } - - static void CopyVisuals(VisualDebugInfo debug_visuals[], - const std::vector<VisualInfo>& visuals, - size_t n) { - for (size_t i = 0; i < n; i++) { - if (i < visuals.size()) { - debug_visuals[i] = FromVisualInfo(visuals[i]); - } else { - debug_visuals[i] = VisualDebugInfo(); - } - } - } - }; - // These functions return true if the visual tree was changed. bool InitVisual(size_t i); bool UpdateVisualForVideo(VisualInfo* visual_info, @@ -1110,12 +1059,6 @@ return a->z_order < b->z_order; }); - // TODO(sunnyps): Remove after fixing https://crbug.com/823498 - VisualDebugInfo previous_frame_visuals[5]; - base::debug::Alias(previous_frame_visuals); - VisualDebugInfo::CopyVisuals(previous_frame_visuals, visual_info_, - arraysize(previous_frame_visuals)); - bool changed = false; while (visual_info_.size() > pending_overlays_.size()) { visual_info_.back().clip_visual->RemoveAllVisuals(); @@ -1146,12 +1089,6 @@ changed |= UpdateVisualClip(visual_info, params); } - // TODO(sunnyps): Remove after fixing https://crbug.com/823498 - VisualDebugInfo current_frame_visuals[5]; - base::debug::Alias(current_frame_visuals); - VisualDebugInfo::CopyVisuals(current_frame_visuals, visual_info_, - arraysize(current_frame_visuals)); - if (changed) { HRESULT hr = dcomp_device_->Commit(); CHECK(SUCCEEDED(hr));
diff --git a/headless/lib/browser/headless_web_contents_impl.cc b/headless/lib/browser/headless_web_contents_impl.cc index 8c1cdd65..81b8e8e 100644 --- a/headless/lib/browser/headless_web_contents_impl.cc +++ b/headless/lib/browser/headless_web_contents_impl.cc
@@ -118,7 +118,7 @@ } void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture, @@ -126,8 +126,10 @@ const gfx::Rect default_rect( headless_web_contents_->browser()->options()->window_size); const gfx::Rect rect = initial_rect.IsEmpty() ? default_rect : initial_rect; + // TODO(erikchen): Refactor this class to use strong ownership semantics. + // https://crbug.com/832879. auto* const headless_contents = - HeadlessWebContentsImpl::From(browser(), new_contents); + HeadlessWebContentsImpl::From(browser(), new_contents.release()); DCHECK(headless_contents); headless_contents->SetBounds(rect); }
diff --git a/infra/config/global/cr-buildbucket.cfg b/infra/config/global/cr-buildbucket.cfg index 05ced275..47dc5fc 100644 --- a/infra/config/global/cr-buildbucket.cfg +++ b/infra/config/global/cr-buildbucket.cfg
@@ -483,6 +483,30 @@ } builders { + name: "Android Tests (trial)(dbg)" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + } + + builders { + name: "Android Tests with Tracing" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + } + + builders { + name: "Android WebView L (dbg)" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + } + + builders { + name: "Android WebView M (dbg)" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + } + + builders { name: "Android WebView N (dbg)" mixins: "android-ci" dimensions: "os:Ubuntu-14.04" @@ -518,12 +542,54 @@ } builders { + name: "Jelly Bean Tester" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + } + + builders { + name: "KitKat Phone Tester (dbg)" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + } + + builders { + name: "KitKat Tablet Tester" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + } + + builders { + name: "Lollipop Low-end Tester" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + } + + builders { + name: "Lollipop Phone Tester" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + } + + builders { + name: "Lollipop Tablet Tester" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + } + + builders { name: "Marshmallow 64 bit Tester" mixins: "android-ci" dimensions: "os:Ubuntu-14.04" } builders { + name: "Marshmallow Tablet Tester" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + } + + builders { name: "Nougat Phone Tester" mixins: "android-ci" dimensions: "os:Ubuntu-14.04" @@ -576,6 +642,11 @@ } builders { + name: "Cast Audio Linux" + mixins: "linux-ci" + } + + builders { name: "Cast Linux" mixins: "linux-ci" recipe { @@ -605,6 +676,11 @@ } builders { + name: "Leak Detection Linux" + mixins: "linux-ci" + } + + builders { name: "Linux ASan LSan Builder" mixins: "linux" mixins: "memory-ci" @@ -639,6 +715,11 @@ } builders { + name: "linux-gcc-rel" + mixins: "linux-ci" + } + + builders { name: "linux-jumbo-rel" mixins: "linux-ci" } @@ -1156,6 +1237,12 @@ builders { mixins: "chromeos-try" name: "chromeos-amd64-generic-rel" } + builders { mixins: "linux-angle-try" name: "linux_angle_compile_dbg_ng" } + builders { mixins: "linux-angle-try" name: "linux_angle_dbg_ng" } + builders { mixins: "linux-angle-try" name: "linux_angle_deqp_rel_ng" } + builders { mixins: "linux-angle-try" name: "linux_angle_ozone_rel_ng" } + builders { mixins: "linux-angle-try" name: "linux_angle_rel_ng" } + builders { mixins: "linux-try" name: "cast_shell_audio_linux" } builders { mixins: "linux-try" name: "cast_shell_linux" } builders { mixins: "linux-try" name: "chromeos_amd64-generic_chromium_compile_only_ng" } @@ -1176,18 +1263,15 @@ } builders { mixins: "linux-try" name: "closure_compilation" } builders { mixins: "linux-try" name: "fuchsia_arm64" } - builders { mixins: "linux-try" name: "fuchsia_x64" } builders { mixins: "linux-try" name: "fuchsia_arm64_cast_audio" } + builders { mixins: "linux-try" name: "fuchsia_x64" } builders { mixins: "linux-try" name: "fuchsia_x64_cast_audio" } + builders { mixins: "linux-try" name: "leak_detection_linux" } builders { mixins: "linux-try" name: "linux-blink-heap-incremental-marking" } builders { mixins: "linux-try" name: "linux-blink-heap-verification-try" } + builders { mixins: "linux-try" name: "linux-gcc-rel" } builders { mixins: "linux-try" name: "linux-jumbo-rel" } builders { mixins: "linux-try" name: "linux_android_rel_ng" } - builders { mixins: "linux-angle-try" name: "linux_angle_compile_dbg_ng" } - builders { mixins: "linux-angle-try" name: "linux_angle_dbg_ng" } - builders { mixins: "linux-angle-try" name: "linux_angle_deqp_rel_ng" } - builders { mixins: "linux-angle-try" name: "linux_angle_ozone_rel_ng" } - builders { mixins: "linux-angle-try" name: "linux_angle_rel_ng" } builders { mixins: "linux-try" name: "linux_arm" } builders { mixins: "linux-try" name: "linux_chromium_analysis" } builders { mixins: "linux-try" name: "linux_chromium_archive_rel_ng" }
diff --git a/infra/config/global/luci-milo.cfg b/infra/config/global/luci-milo.cfg index 959d23ee..aa08abbd 100644 --- a/infra/config/global/luci-milo.cfg +++ b/infra/config/global/luci-milo.cfg
@@ -400,6 +400,7 @@ } builders: { name: "buildbot/chromium.linux/linux-gcc-rel" + name: "buildbucket/luci.chromium.ci/linux-gcc-rel" category: "chromium.linux|release" short_name: "gcc" } @@ -435,6 +436,7 @@ } builders: { name: "buildbot/chromium.linux/Leak Detection Linux" + name: "buildbucket/luci.chromium.ci/Leak Detection Linux" category: "chromium.linux" short_name: "lk" } @@ -446,17 +448,16 @@ } builders: { name: "buildbot/chromium.linux/Cast Audio Linux" + name: "buildbucket/luci.chromium.ci/Cast Audio Linux" category: "chromium.linux|cast" short_name: "aud" } builders: { - name: "buildbot/chromium.linux/Fuchsia ARM64 Cast Audio" name: "buildbucket/luci.chromium.ci/Fuchsia ARM64 Cast Audio" category: "chromium.linux|fuchsia|Cast" short_name: "a64" } builders: { - name: "buildbot/chromium.linux/Fuchsia x64 Cast Audio" name: "buildbucket/luci.chromium.ci/Fuchsia x64 Cast Audio" category: "chromium.linux|fuchsia|Cast" short_name: "x64" @@ -467,7 +468,6 @@ short_name: "a64" } builders: { - name: "buildbot/chromium.linux/Fuchsia x64" name: "buildbucket/luci.chromium.ci/Fuchsia x64" category: "chromium.linux|fuchsia" short_name: "x64" @@ -877,6 +877,7 @@ } builders: { name: "buildbot/chromium.linux/linux-gcc-rel" + name: "buildbucket/luci.chromium.ci/linux-gcc-rel" category: "release" short_name: "gcc" } @@ -917,6 +918,7 @@ } builders: { name: "buildbot/chromium.linux/Leak Detection Linux" + name: "buildbucket/luci.chromium.ci/Leak Detection Linux" short_name: "lk" } builders: { @@ -927,17 +929,16 @@ } builders: { name: "buildbot/chromium.linux/Cast Audio Linux" + name: "buildbucket/luci.chromium.ci/Cast Audio Linux" category: "cast" - short_name: "vid" + short_name: "aud" } builders: { - name: "buildbot/chromium.linux/Fuchsia ARM64 Cast Audio" name: "buildbucket/luci.chromium.ci/Fuchsia ARM64 Cast Audio" category: "fuchsia|Cast" short_name: "a64" } builders: { - name: "buildbot/chromium.linux/Fuchsia x64 Cast Audio" name: "buildbucket/luci.chromium.ci/Fuchsia x64 Cast Audio" category: "fuchsia|Cast" short_name: "x64" @@ -948,13 +949,13 @@ short_name: "a64" } builders: { - name: "buildbot/chromium.linux/Fuchsia x64" name: "buildbucket/luci.chromium.ci/Fuchsia x64" category: "fuchsia" short_name: "x64" } builders: { name: "buildbot/chromium.linux/Ozone Linux" + name: "buildbucket/luci.chromium.ci/Ozone Linux" category: "ozone" short_name: "bld" } @@ -1467,36 +1468,36 @@ header_id: "chromium" include_experimental_builds: true - builders: { - name: "buildbucket/luci.chromium.ci/Fuchsia ARM64 Cast Audio" - category: "fuchsia|arm64|cast" + builders { + name: "buildbucket/luci.chromium.ci/Cast Audio Linux" + category: "linux|cast|audio" short_name: "ci" } - builders: { - name: "buildbot/chromium.linux/Fuchsia ARM64 Cast Audio" - category: "fuchsia|arm64|cast" + builders { + name: "buildbot/chromium.linux/Cast Audio Linux" + category: "linux|cast|audio" short_name: "bb" } - builders: { - name: "buildbucket/luci.chromium.ci/Fuchsia x64" - category: "fuchsia|x64" + builders { + name: "buildbucket/luci.chromium.ci/linux-gcc-rel" + category: "linux|gcc" short_name: "ci" } - builders: { - name: "buildbot/chromium.linux/Fuchsia x64" - category: "fuchsia|x64" + builders { + name: "buildbot/chromium.linux/linux-gcc-rel" + category: "linux|gcc" short_name: "bb" } - builders: { - name: "buildbucket/luci.chromium.ci/Fuchsia x64 Cast Audio" - category: "fuchsia|x64|cast" + builders { + name: "buildbucket/luci.chromium.ci/Leak Detection Linux" + category: "linux|leak" short_name: "ci" } - builders: { - name: "buildbot/chromium.linux/Fuchsia x64 Cast Audio" - category: "fuchsia|x64|cast" + builders { + name: "buildbot/chromium.linux/Leak Detection Linux" + category: "linux|leak" short_name: "bb" } @@ -1609,16 +1610,6 @@ } builders: { - name: "buildbot/chromium.android/Android Cronet Builder" - category: "chromium.android|cronet" - short_name: "bb" - } - builders: { - name: "buildbucket/luci.chromium.ci/Android Cronet Builder" - category: "chromium.android|cronet" - short_name: "ci" - } - builders: { name: "buildbot/chromium.mac/ios-simulator" category: "chromium.mac|ios-simulator" short_name: "bb" @@ -1648,6 +1639,116 @@ category: "android|builder|arm|debug|32" short_name: "bb" } + builders: { + name: "buildbucket/luci.chromium.ci/Android WebView L (dbg)" + category: "android|builder|arm|tester|32" + short_name: "ci" + } + builders: { + name: "buildbot/chromium.android/Android WebView L (dbg)" + category: "android|builder|arm|tester|32" + short_name: "bb" + } + builders: { + name: "buildbucket/luci.chromium.ci/Android WebView M (dbg)" + category: "android|builder|arm|tester|32" + short_name: "ci" + } + builders: { + name: "buildbot/chromium.android/Android WebView M (dbg)" + category: "android|builder|arm|tester|32" + short_name: "bb" + } + builders: { + name: "buildbucket/luci.chromium.ci/KitKat Phone Tester (dbg)" + category: "android|builder|arm|tester|32" + short_name: "ci" + } + builders: { + name: "buildbot/chromium.android/KitKat Phone Tester (dbg)" + category: "android|builder|arm|tester|32" + short_name: "bb" + } + builders: { + name: "buildbucket/luci.chromium.ci/KitKat Tablet Tester" + category: "android|builder|arm|tester|32" + short_name: "ci" + } + builders: { + name: "buildbot/chromium.android/KitKat Tablet Tester" + category: "android|builder|arm|tester|32" + short_name: "bb" + } + builders: { + name: "buildbucket/luci.chromium.ci/Lollipop Phone Tester" + category: "android|builder|arm|tester|32" + short_name: "ci" + } + builders: { + name: "buildbot/chromium.android/Lollipop Phone Tester" + category: "android|builder|arm|tester|32" + short_name: "bb" + } + builders: { + name: "buildbucket/luci.chromium.ci/Lollipop Tablet Tester" + category: "android|builder|arm|tester|32" + short_name: "ci" + } + builders: { + name: "buildbot/chromium.android/Lollipop Tablet Tester" + category: "android|builder|arm|tester|32" + short_name: "bb" + } + builders: { + name: "buildbucket/luci.chromium.ci/Marshmallow Tablet Tester" + category: "android|builder|arm|tester|32" + short_name: "ci" + } + builders: { + name: "buildbot/chromium.android/Marshmallow Tablet Tester" + category: "android|builder|arm|tester|32" + short_name: "bb" + } + builders: { + name: "buildbucket/luci.chromium.ci/Android Tests (trial)(dbg)" + category: "android|builder|arm|tester|32" + short_name: "ci" + } + builders: { + name: "buildbot/chromium.android/Android Tests (trial)(dbg)" + category: "android|builder|arm|tester|32" + short_name: "bb" + } + builders: { + name: "buildbucket/luci.chromium.ci/Android Tests with Tracing" + category: "android|builder|arm|tester|32" + short_name: "ci" + } + builders: { + name: "buildbot/chromium.android/Android Tests with Tracing" + category: "android|builder|arm|tester|32" + short_name: "bb" + } + builders: { + name: "buildbucket/luci.chromium.ci/Jelly Bean Tester" + category: "android|builder|arm|tester|32" + short_name: "ci" + } + builders: { + name: "buildbot/chromium.android/Jelly Bean Tester" + category: "android|builder|arm|tester|32" + short_name: "bb" + } + builders: { + name: "buildbucket/luci.chromium.ci/Lollipop Low-end Tester" + category: "android|builder|arm|tester|32" + short_name: "ci" + } + builders: { + name: "buildbot/chromium.android/Lollipop Low-end Tester" + category: "android|builder|arm|tester|32" + short_name: "bb" + } } # Everything below was generated from buildermap.json. @@ -1692,7 +1793,6 @@ header_id: "chromium" builders: { - name: "buildbot/chromium.android/Android Cronet Builder" name: "buildbucket/luci.chromium.ci/Android Cronet Builder" category: "cronet" short_name: "rel" @@ -1782,11 +1882,13 @@ } builders: { name: "buildbot/chromium.android/KitKat Phone Tester (dbg)" + name: "buildbucket/luci.chromium.ci/KitKat Phone Tester (dbg)" category: "tester|phone" short_name: "K" } builders: { name: "buildbot/chromium.android/Lollipop Phone Tester" + name: "buildbucket/luci.chromium.ci/Lollipop Phone Tester" category: "tester|phone" short_name: "L" } @@ -1802,26 +1904,31 @@ } builders: { name: "buildbot/chromium.android/KitKat Tablet Tester" + name: "buildbucket/luci.chromium.ci/KitKat Tablet Tester" category: "tester|tablet" short_name: "K" } builders: { name: "buildbot/chromium.android/Lollipop Tablet Tester" + name: "buildbucket/luci.chromium.ci/Lollipop Tablet Tester" category: "tester|tablet" short_name: "L" } builders: { name: "buildbot/chromium.android/Marshmallow Tablet Tester" + name: "buildbucket/luci.chromium.ci/Marshmallow Tablet Tester" category: "tester|tablet" short_name: "M" } builders: { name: "buildbot/chromium.android/Android WebView L (dbg)" + name: "buildbucket/luci.chromium.ci/Android WebView L (dbg)" category: "webview" short_name: "L" } builders: { name: "buildbot/chromium.android/Android WebView M (dbg)" + name: "buildbucket/luci.chromium.ci/Android WebView M (dbg)" category: "webview" short_name: "M" } @@ -1862,16 +1969,19 @@ builders: { name: "buildbot/chromium.android.fyi/Android Tests (trial)(dbg)" + name: "buildbucket/luci.chromium.ci/Android Tests (trial)(dbg)" category: "Testers" short_name: "tri" } builders: { name: "buildbot/chromium.android.fyi/Android Tests with Tracing" + name: "buildbucket/luci.chromium.ci/Android Tests with Tracing" category: "Testers" short_name: "trc" } builders: { name: "buildbot/chromium.android.fyi/Jelly Bean Tester" + name: "buildbucket/luci.chromium.ci/Jelly Bean Tester" category: "Testers" short_name: "JB" } @@ -1882,6 +1992,7 @@ } builders: { name: "buildbot/chromium.android.fyi/Lollipop Low-end Tester" + name: "buildbucket/luci.chromium.ci/Lollipop Low-end Tester" category: "Testers" short_name: "low" } @@ -3761,7 +3872,6 @@ name: "buildbot/tryserver.chromium.android/android_coverage" } builders: { - name: "buildbot/tryserver.chromium.android/android_cronet" name: "buildbucket/luci.chromium.try/android_cronet" } builders: { @@ -3830,6 +3940,7 @@ builders: { name: "buildbot/tryserver.chromium.linux/cast_shell_audio_linux" + name: "buildbucket/luci.chromium.try/cast_shell_audio_linux" } builders: { name: "buildbot/tryserver.chromium.linux/cast_shell_linux" @@ -3844,16 +3955,17 @@ name: "buildbucket/luci.chromium.try/fuchsia_arm64" } builders: { - name: "buildbot/tryserver.chromium.linux/fuchsia_arm64_cast_audio" + name: "buildbucket/luci.chromium.try/fuchsia_arm64_cast_audio" } builders: { - name: "buildbot/tryserver.chromium.linux/fuchsia_x64" + name: "buildbucket/luci.chromium.try/fuchsia_x64" } builders: { - name: "buildbot/tryserver.chromium.linux/fuchsia_x64_cast_audio" + name: "buildbucket/luci.chromium.try/fuchsia_x64_cast_audio" } builders: { name: "buildbot/tryserver.chromium.linux/leak_detection_linux" + name: "buildbucket/luci.chromium.try/leak_detection_linux" } builders: { name: "buildbot/tryserver.chromium.linux/linux_arm" @@ -3912,6 +4024,7 @@ } builders: { name: "buildbot/tryserver.chromium.linux/linux-gcc-rel" + name: "buildbucket/luci.chromium.try/linux-gcc-rel" } builders: { name: "buildbot/tryserver.chromium.linux/layout_test_leak_detection"
diff --git a/infra/config/global/luci-scheduler.cfg b/infra/config/global/luci-scheduler.cfg index 43ffcf16..755a7503 100644 --- a/infra/config/global/luci-scheduler.cfg +++ b/infra/config/global/luci-scheduler.cfg
@@ -78,6 +78,7 @@ triggers: "ios-simulator" # Linux. Sorted alphabetically. + triggers: "Cast Audio Linux" triggers: "Cast Linux" triggers: "Deterministic Linux" triggers: "Deterministic Linux (dbg)" @@ -91,11 +92,13 @@ triggers: "GPU FYI Linux Ozone Builder" triggers: "GPU Linux Builder" triggers: "Headless Linux (dbg)" + triggers: "Leak Detection Linux" triggers: "linux-blink-heap-incremental-marking" triggers: "linux-blink-heap-verification" + triggers: "linux-gcc-rel" + triggers: "linux-jumbo-rel" triggers: "Linux ASan LSan Builder" triggers: "Linux Builder" - triggers: "linux-jumbo-rel" triggers: "Linux Builder (dbg)" triggers: "Linux Builder (dbg)(32)" triggers: "Linux FYI GPU TSAN Release" @@ -255,6 +258,50 @@ } job { + id: "Android Tests (trial)(dbg)" + # triggered by "Android arm Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Android Tests (trial)(dbg)" + } +} + +job { + id: "Android Tests with Tracing" + # triggered by "Android arm Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Android Tests with Tracing" + } +} + +job { + id: "Android WebView L (dbg)" + # triggered by "Android arm Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Android WebView L (dbg)" + } +} + +job { + id: "Android WebView M (dbg)" + # triggered by "Android arm Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Android WebView M (dbg)" + } +} + +job { id: "Android WebView N (dbg)" # triggered by "Android arm64 Builder (dbg)" acl_sets: "triggered-by-parent-builders" @@ -306,24 +353,36 @@ } job { - id: "Marshmallow 64 bit Tester" - # triggered by "Android arm64 Builder (dbg)" + id: "Jelly Bean Tester" + # triggered by "Android arm Builder (dbg)" acl_sets: "triggered-by-parent-builders" buildbucket: { - server: "cr-buildbucket.appspot.com" - bucket: "luci.chromium.ci" - builder: "Marshmallow 64 bit Tester" + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Jelly Bean Tester" + } +} + + +job { + id: "KitKat Phone Tester (dbg)" + # triggered by "Android arm Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "KitKat Phone Tester (dbg)" } } job { - id: "Nougat Phone Tester" - # triggered by "Android arm64 Builder (dbg)" + id: "KitKat Tablet Tester" + # triggered by "Android arm Builder (dbg)" acl_sets: "triggered-by-parent-builders" buildbucket: { - server: "cr-buildbucket.appspot.com" - bucket: "luci.chromium.ci" - builder: "Nougat Phone Tester" + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "KitKat Tablet Tester" } } @@ -341,6 +400,72 @@ } job { + id: "Lollipop Low-end Tester" + # triggered by "Android arm Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Lollipop Low-end Tester" + } +} + +job { + id: "Lollipop Phone Tester" + # triggered by "Android arm Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Lollipop Phone Tester" + } +} + +job { + id: "Lollipop Tablet Tester" + # triggered by "Android arm Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Lollipop Tablet Tester" + } +} + +job { + id: "Marshmallow 64 bit Tester" + # triggered by "Android arm64 Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Marshmallow 64 bit Tester" + } +} + +job { + id: "Marshmallow Tablet Tester" + # triggered by "Android arm Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Marshmallow Tablet Tester" + } +} + +job { + id: "Nougat Phone Tester" + # triggered by "Android arm64 Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Nougat Phone Tester" + } +} + +job { id: "Nougat Phone Tester" # triggered by "Android arm64 Builder (dbg)" acl_sets: "triggered-by-parent-builders" @@ -417,6 +542,16 @@ ################################################################################ job { + id: "Cast Audio Linux" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Cast Audio Linux" + } +} + +job { id: "Cast Linux" acl_sets: "default" buildbucket: { @@ -640,6 +775,16 @@ } job { + id: "Leak Detection Linux" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Leak Detection Linux" + } +} + +job { id: "linux-blink-heap-incremental-marking" acl_sets: "default" buildbucket: { @@ -660,6 +805,26 @@ } job { + id: "linux-gcc-rel" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "linux-gcc-rel" + } +} + +job { + id: "linux-jumbo-rel" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "linux-jumbo-rel" + } +} + +job { id: "Linux ASan LSan Builder" acl_sets: "default" buildbucket: { @@ -702,17 +867,6 @@ } job { - id: "linux-jumbo-rel" - acl_sets: "default" - buildbucket: { - server: "cr-buildbucket.appspot.com" - bucket: "luci.chromium.ci" - builder: "linux-jumbo-rel" - } -} - - -job { id: "Linux Tests (dbg)(1)" # Triggered by "Linux Builder (dbg)". acl_sets: "triggered-by-parent-builders"
diff --git a/ios/build/bots/chromium.clang/clang_tot_device.json b/ios/build/bots/chromium.clang/clang_tot_device.json index 2ed44d7..ee05ba0 100644 --- a/ios/build/bots/chromium.clang/clang_tot_device.json +++ b/ios/build/bots/chromium.clang/clang_tot_device.json
@@ -121,5 +121,6 @@ "device type": "iPhone 6s", "os": "10.2" } - ] + ], + "expiration_time": 10800 }
diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm index c59a357..34b60a7 100644 --- a/ios/chrome/app/main_controller.mm +++ b/ios/chrome/app/main_controller.mm
@@ -1126,24 +1126,19 @@ - (void)initializeMailtoHandling { if (base::FeatureList::IsEnabled(kMailtoHandledWithGoogleUI)) { + __weak __typeof(self) weakSelf = self; [[DeferredInitializationRunner sharedInstance] enqueueBlockNamed:kMailtoHandlingInitialization block:^{ + __strong __typeof(weakSelf) strongSelf = weakSelf; + if (!strongSelf) { + return; + } MailtoHandlerProvider* provider = ios::GetChromeBrowserProvider() ->GetMailtoHandlerProvider(); - ios::ChromeIdentityService* identityService = - ios::GetChromeBrowserProvider() - ->GetChromeIdentityService(); provider->PrepareMailtoHandling( - ^ChromeIdentity* { - // TODO:(crbug.com/810904) Replace with currently - // signed-in user. - return nil; - }, - ^NSArray<ChromeIdentity*>* { - return identityService->GetAllIdentities(); - }); + strongSelf->_mainBrowserState); }]; } }
diff --git a/ios/chrome/browser/web/BUILD.gn b/ios/chrome/browser/web/BUILD.gn index 13318245..a95e03c 100644 --- a/ios/chrome/browser/web/BUILD.gn +++ b/ios/chrome/browser/web/BUILD.gn
@@ -256,6 +256,7 @@ "//ios/chrome/browser/infobars", "//ios/chrome/browser/passwords", "//ios/chrome/browser/ui", + "//ios/chrome/browser/web", "//ios/web", "//ios/web/public/test", "//ios/web/public/test/fakes",
diff --git a/ios/chrome/browser/web/chrome_web_client.h b/ios/chrome/browser/web/chrome_web_client.h index ebb79c8..7ee4731 100644 --- a/ios/chrome/browser/web/chrome_web_client.h +++ b/ios/chrome/browser/web/chrome_web_client.h
@@ -10,7 +10,7 @@ #include <vector> #include "base/macros.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" // Chrome implementation of WebClient. class ChromeWebClient : public web::WebClient { @@ -49,6 +49,10 @@ const GURL& request_url, bool overridable, const base::Callback<void(bool)>& callback) override; + void PrepareErrorPage(NSError* error, + bool is_post, + bool is_off_the_record, + NSString** error_html) override; void RegisterServices(StaticServiceMap* services) override; private:
diff --git a/ios/chrome/browser/web/chrome_web_client.mm b/ios/chrome/browser/web/chrome_web_client.mm index ef0d6d8a..ed2b1d578 100644 --- a/ios/chrome/browser/web/chrome_web_client.mm +++ b/ios/chrome/browser/web/chrome_web_client.mm
@@ -25,6 +25,7 @@ #include "ios/chrome/browser/ssl/ios_ssl_error_handler.h" #import "ios/chrome/browser/ui/chrome_web_view_factory.h" #include "ios/chrome/browser/unzip/unzip_service_creator.h" +#import "ios/chrome/browser/web/error_page_util.h" #include "ios/chrome/grit/ios_resources.h" #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" #include "ios/public/provider/chrome/browser/voice/audio_session_controller.h" @@ -208,6 +209,14 @@ overridable, callback); } +void ChromeWebClient::PrepareErrorPage(NSError* error, + bool is_post, + bool is_off_the_record, + NSString** error_html) { + DCHECK(error); + *error_html = GetErrorPage(error, is_post, is_off_the_record); +} + void ChromeWebClient::RegisterServices(StaticServiceMap* services) { // The Unzip service is used by the component updater. RegisterUnzipService(services);
diff --git a/ios/chrome/browser/web/chrome_web_client_unittest.mm b/ios/chrome/browser/web/chrome_web_client_unittest.mm index 9088bd95..2a838444 100644 --- a/ios/chrome/browser/web/chrome_web_client_unittest.mm +++ b/ios/chrome/browser/web/chrome_web_client_unittest.mm
@@ -16,6 +16,8 @@ #include "components/payments/core/features.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #include "ios/chrome/browser/passwords/credential_manager_features.h" +#import "ios/chrome/browser/web/error_page_util.h" +#import "ios/web/public/test/error_test_util.h" #import "ios/web/public/test/js_test_util.h" #include "ios/web/public/test/scoped_testing_web_client.h" #import "ios/web/public/web_view_creation_util.h" @@ -28,6 +30,14 @@ #endif namespace { +// Error used to test PrepareErrorPage method. +NSError* CreateTestError() { + return web::testing::CreateTestNetError([NSError + errorWithDomain:NSURLErrorDomain + code:NSURLErrorNetworkConnectionLost + userInfo:nil]); +} +} // namespace class ChromeWebClientTest : public PlatformTest { public: @@ -173,4 +183,47 @@ web_view, @"typeof window.PaymentRequest")); } -} // namespace +// Tests PrepareErrorPage wth non-post, not Off The Record error. +TEST_F(ChromeWebClientTest, PrepareErrorPageNonPostNonOtr) { + ChromeWebClient web_client; + NSError* error = CreateTestError(); + NSString* page = nil; + web_client.PrepareErrorPage(error, /*is_post=*/false, + /*is_off_the_record=*/false, &page); + EXPECT_NSEQ( + GetErrorPage(error, /*is_post=*/false, /*is_off_the_record=*/false), + page); +} + +// Tests PrepareErrorPage with post, not Off The Record error. +TEST_F(ChromeWebClientTest, PrepareErrorPagePostNonOtr) { + ChromeWebClient web_client; + NSError* error = CreateTestError(); + NSString* page = nil; + web_client.PrepareErrorPage(error, /*is_post=*/true, + /*is_off_the_record=*/false, &page); + EXPECT_NSEQ( + GetErrorPage(error, /*is_post=*/true, /*is_off_the_record=*/false), page); +} + +// Tests PrepareErrorPage with non-post, Off The Record error. +TEST_F(ChromeWebClientTest, PrepareErrorPageNonPostOtr) { + ChromeWebClient web_client; + NSError* error = CreateTestError(); + NSString* page = nil; + web_client.PrepareErrorPage(error, /*is_post=*/false, + /*is_off_the_record=*/true, &page); + EXPECT_NSEQ( + GetErrorPage(error, /*is_post=*/false, /*is_off_the_record=*/true), page); +} + +// Tests PrepareErrorPage with post, Off The Record error. +TEST_F(ChromeWebClientTest, PrepareErrorPagePostOtr) { + ChromeWebClient web_client; + NSError* error = CreateTestError(); + NSString* page = nil; + web_client.PrepareErrorPage(error, /*is_post=*/true, + /*is_off_the_record=*/true, &page); + EXPECT_NSEQ(GetErrorPage(error, /*is_post=*/true, /*is_off_the_record=*/true), + page); +}
diff --git a/ios/web/web_client.mm b/ios/web/web_client.mm index 0896b11..adf0e13b 100644 --- a/ios/web/web_client.mm +++ b/ios/web/web_client.mm
@@ -104,9 +104,7 @@ bool is_off_the_record, NSString** error_html) { DCHECK(error); - if (error_html) { - *error_html = error.localizedDescription; - } + *error_html = error.localizedDescription; } } // namespace web
diff --git a/mash/DEPS b/mash/DEPS index 7304867..1da21f86 100644 --- a/mash/DEPS +++ b/mash/DEPS
@@ -2,7 +2,6 @@ "+ash/public", "+components/prefs", "+components/viz/common", - "+mojo/common", "+mojo/converters", "+mojo/public", "+services/catalog/public",
diff --git a/mash/session/BUILD.gn b/mash/session/BUILD.gn index 93d7bd9..42f408fd 100644 --- a/mash/session/BUILD.gn +++ b/mash/session/BUILD.gn
@@ -17,7 +17,6 @@ deps = [ "//base", "//mash/common", - "//mojo/common", "//mojo/public/cpp/bindings", "//services/service_manager/public/cpp", ] @@ -42,7 +41,6 @@ deps = [ ":lib", "//base", - "//mojo/common", "//mojo/public/cpp/bindings", "//services/service_manager/public/cpp", ]
diff --git a/media/cdm/BUILD.gn b/media/cdm/BUILD.gn index eb542b2..7179a9a 100644 --- a/media/cdm/BUILD.gn +++ b/media/cdm/BUILD.gn
@@ -160,7 +160,6 @@ data_deps = [] - # If ExternalClearKey is built, we can test CdmAdapter. if (enable_library_cdms) { sources += [ "cdm_adapter_unittest.cc", @@ -179,6 +178,8 @@ deps += [ ":cdm_api", ":cdm_paths", + "//media/cdm/library_cdm:cdm_host_proxy", + "//media/cdm/library_cdm:test_support", ] }
diff --git a/media/cdm/aes_decryptor_unittest.cc b/media/cdm/aes_decryptor_unittest.cc index 46240c63..cb06e06 100644 --- a/media/cdm/aes_decryptor_unittest.cc +++ b/media/cdm/aes_decryptor_unittest.cc
@@ -51,7 +51,9 @@ using ::testing::StrNe; using ::testing::Unused; -MATCHER(IsEmpty, "") { return arg.empty(); } +MATCHER(IsEmpty, "") { + return arg.empty(); +} MATCHER(NotEmpty, "") { return !arg.empty(); } @@ -178,35 +180,21 @@ // all entries must be equal to kOriginalDataSize to make the subsample entries // valid. -const SubsampleEntry kSubsampleEntriesNormal[] = { - { 2, 7 }, - { 3, 11 }, - { 1, 0 } -}; +const SubsampleEntry kSubsampleEntriesNormal[] = {{2, 7}, {3, 11}, {1, 0}}; const SubsampleEntry kSubsampleEntriesWrongSize[] = { - { 3, 6 }, // This entry doesn't match the correct entry. - { 3, 11 }, - { 1, 0 } -}; + {3, 6}, // This entry doesn't match the correct entry. + {3, 11}, + {1, 0}}; const SubsampleEntry kSubsampleEntriesInvalidTotalSize[] = { - { 1, 1000 }, // This entry is too large. - { 3, 11 }, - { 1, 0 } -}; + {1, 1000}, // This entry is too large. + {3, 11}, + {1, 0}}; -const SubsampleEntry kSubsampleEntriesClearOnly[] = { - { 7, 0 }, - { 8, 0 }, - { 9, 0 } -}; +const SubsampleEntry kSubsampleEntriesClearOnly[] = {{7, 0}, {8, 0}, {9, 0}}; -const SubsampleEntry kSubsampleEntriesCypherOnly[] = { - { 0, 6 }, - { 0, 8 }, - { 0, 10 } -}; +const SubsampleEntry kSubsampleEntriesCypherOnly[] = {{0, 6}, {0, 8}, {0, 10}}; scoped_refptr<DecoderBuffer> CreateEncryptedBuffer( const std::vector<uint8_t>& data, @@ -288,12 +276,15 @@ CdmModule::GetInstance()->Initialize(helper_->LibraryPath()); #endif // BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) + CdmAdapter::CreateCdmFunc create_cdm_func = + CdmModule::GetInstance()->GetCreateCdmFunc(); + std::unique_ptr<CdmAllocator> allocator(new SimpleCdmAllocator()); std::unique_ptr<CdmAuxiliaryHelper> cdm_helper( new MockCdmAuxiliaryHelper(std::move(allocator))); CdmAdapter::Create( helper_->KeySystemName(), url::Origin::Create(GURL("http://foo.com")), - cdm_config, std::move(cdm_helper), + cdm_config, create_cdm_func, std::move(cdm_helper), base::Bind(&MockCdmClient::OnSessionMessage, base::Unretained(&cdm_client_)), base::Bind(&MockCdmClient::OnSessionClosed, @@ -478,8 +469,8 @@ std::vector<uint8_t> decrypted_text; if (decrypted.get() && decrypted->data_size()) { - decrypted_text.assign( - decrypted->data(), decrypted->data() + decrypted->data_size()); + decrypted_text.assign(decrypted->data(), + decrypted->data() + decrypted->data_size()); } switch (result) { @@ -651,8 +642,8 @@ encrypted_data_, key_id_, iv_, no_subsample_entries_); UpdateSessionAndExpect(session_id, kWrongKeyAsJWK, RESOLVED, true); - ASSERT_NO_FATAL_FAILURE(DecryptAndExpect( - encrypted_buffer, original_data_, DATA_MISMATCH)); + ASSERT_NO_FATAL_FAILURE( + DecryptAndExpect(encrypted_buffer, original_data_, DATA_MISMATCH)); UpdateSessionAndExpect(session_id, kKeyAsJWK, RESOLVED, false); ASSERT_NO_FATAL_FAILURE( @@ -712,8 +703,8 @@ std::vector<uint8_t> bad_data = encrypted_data_; bad_data[1]++; - scoped_refptr<DecoderBuffer> encrypted_buffer = CreateEncryptedBuffer( - bad_data, key_id_, iv_, no_subsample_entries_); + scoped_refptr<DecoderBuffer> encrypted_buffer = + CreateEncryptedBuffer(bad_data, key_id_, iv_, no_subsample_entries_); DecryptAndExpect(encrypted_buffer, original_data_, DATA_MISMATCH); } @@ -766,9 +757,9 @@ kSubsampleEntriesInvalidTotalSize + arraysize(kSubsampleEntriesInvalidTotalSize)); - scoped_refptr<DecoderBuffer> encrypted_buffer = CreateEncryptedBuffer( - subsample_encrypted_data_, key_id_, iv_, - subsample_entries_invalid_total_size); + scoped_refptr<DecoderBuffer> encrypted_buffer = + CreateEncryptedBuffer(subsample_encrypted_data_, key_id_, iv_, + subsample_entries_invalid_total_size); DecryptAndExpect(encrypted_buffer, original_data_, DECRYPT_ERROR); }
diff --git a/media/cdm/cdm_adapter.cc b/media/cdm/cdm_adapter.cc index efbb648..e2e11cde 100644 --- a/media/cdm/cdm_adapter.cc +++ b/media/cdm/cdm_adapter.cc
@@ -34,7 +34,6 @@ #include "media/base/video_types.h" #include "media/cdm/cdm_auxiliary_helper.h" #include "media/cdm/cdm_helpers.h" -#include "media/cdm/cdm_module.h" #include "media/cdm/cdm_wrapper.h" #include "ui/gfx/geometry/rect.h" #include "url/origin.h" @@ -471,6 +470,7 @@ const std::string& key_system, const url::Origin& security_origin, const CdmConfig& cdm_config, + CreateCdmFunc create_cdm_func, std::unique_ptr<CdmAuxiliaryHelper> helper, const SessionMessageCB& session_message_cb, const SessionClosedCB& session_closed_cb, @@ -484,8 +484,8 @@ DCHECK(!session_expiration_update_cb.is_null()); scoped_refptr<CdmAdapter> cdm = - new CdmAdapter(key_system, security_origin, cdm_config, std::move(helper), - session_message_cb, session_closed_cb, + new CdmAdapter(key_system, security_origin, cdm_config, create_cdm_func, + std::move(helper), session_message_cb, session_closed_cb, session_keys_change_cb, session_expiration_update_cb); // |cdm| ownership passed to the promise. @@ -496,6 +496,7 @@ const std::string& key_system, const url::Origin& security_origin, const CdmConfig& cdm_config, + CreateCdmFunc create_cdm_func, std::unique_ptr<CdmAuxiliaryHelper> helper, const SessionMessageCB& session_message_cb, const SessionClosedCB& session_closed_cb, @@ -504,26 +505,32 @@ : key_system_(key_system), origin_string_(security_origin.Serialize()), cdm_config_(cdm_config), + create_cdm_func_(create_cdm_func), + helper_(std::move(helper)), session_message_cb_(session_message_cb), session_closed_cb_(session_closed_cb), session_keys_change_cb_(session_keys_change_cb), session_expiration_update_cb_(session_expiration_update_cb), - helper_(std::move(helper)), task_runner_(base::ThreadTaskRunnerHandle::Get()), pool_(new AudioBufferMemoryPool()), weak_factory_(this) { + DVLOG(1) << __func__; + DCHECK(!key_system_.empty()); - DCHECK(!session_message_cb_.is_null()); - DCHECK(!session_closed_cb_.is_null()); - DCHECK(!session_keys_change_cb_.is_null()); - DCHECK(!session_expiration_update_cb_.is_null()); + DCHECK(create_cdm_func_); DCHECK(helper_); + DCHECK(session_message_cb_); + DCHECK(session_closed_cb_); + DCHECK(session_keys_change_cb_); + DCHECK(session_expiration_update_cb_); helper_->SetFileReadCB( base::Bind(&CdmAdapter::OnFileRead, weak_factory_.GetWeakPtr())); } CdmAdapter::~CdmAdapter() { + DVLOG(1) << __func__; + // Reject any outstanding promises and close all the existing sessions. cdm_promise_adapter_.Clear(); @@ -536,13 +543,7 @@ CdmWrapper* CdmAdapter::CreateCdmInstance(const std::string& key_system) { DCHECK(task_runner_->BelongsToCurrentThread()); - CreateCdmFunc create_cdm_func = CdmModule::GetInstance()->GetCreateCdmFunc(); - if (!create_cdm_func) { - LOG(ERROR) << "Failed to get CreateCdmFunc!"; - return nullptr; - } - - CdmWrapper* cdm = CdmWrapper::Create(create_cdm_func, key_system.data(), + CdmWrapper* cdm = CdmWrapper::Create(create_cdm_func_, key_system.data(), key_system.size(), GetCdmHost, this); DVLOG(1) << "CDM instance for " + key_system + (cdm ? "" : " could not be") + " created."; @@ -560,6 +561,8 @@ } void CdmAdapter::Initialize(std::unique_ptr<media::SimpleCdmPromise> promise) { + DVLOG(1) << __func__; + cdm_.reset(CreateCdmInstance(key_system_)); if (!cdm_) { promise->reject(CdmPromise::Exception::INVALID_STATE_ERROR, 0,
diff --git a/media/cdm/cdm_adapter.h b/media/cdm/cdm_adapter.h index 7d915e0..e00ea349 100644 --- a/media/cdm/cdm_adapter.h +++ b/media/cdm/cdm_adapter.h
@@ -43,6 +43,12 @@ public cdm::Host_10, public cdm::Host_11 { public: + using CreateCdmFunc = void* (*)(int cdm_interface_version, + const char* key_system, + uint32_t key_system_size, + GetCdmHostFunc get_cdm_host_func, + void* user_data); + // Creates the CDM and initialize it using |key_system| and |cdm_config|. // |allocator| is to be used whenever the CDM needs memory and to create // VideoFrames. |file_io_provider| is to be used whenever the CDM needs access @@ -52,6 +58,7 @@ const std::string& key_system, const url::Origin& security_origin, const CdmConfig& cdm_config, + CreateCdmFunc create_cdm_func, std::unique_ptr<CdmAuxiliaryHelper> helper, const SessionMessageCB& session_message_cb, const SessionClosedCB& session_closed_cb, @@ -160,6 +167,7 @@ CdmAdapter(const std::string& key_system, const url::Origin& security_origin, const CdmConfig& cdm_config, + CreateCdmFunc create_cdm_func, std::unique_ptr<CdmAuxiliaryHelper> helper, const SessionMessageCB& session_message_cb, const SessionClosedCB& session_closed_cb, @@ -212,15 +220,17 @@ const std::string origin_string_; const CdmConfig cdm_config_; + CreateCdmFunc create_cdm_func_; + + // Helper that provides additional functionality for the CDM. + std::unique_ptr<CdmAuxiliaryHelper> helper_; + // Callbacks for firing session events. SessionMessageCB session_message_cb_; SessionClosedCB session_closed_cb_; SessionKeysChangeCB session_keys_change_cb_; SessionExpirationUpdateCB session_expiration_update_cb_; - // Helper that provides additional functionality for the CDM. - std::unique_ptr<CdmAuxiliaryHelper> helper_; - scoped_refptr<base::SingleThreadTaskRunner> task_runner_; scoped_refptr<AudioBufferMemoryPool> pool_;
diff --git a/media/cdm/cdm_adapter_factory.cc b/media/cdm/cdm_adapter_factory.cc index 379576e..38e5a6d 100644 --- a/media/cdm/cdm_adapter_factory.cc +++ b/media/cdm/cdm_adapter_factory.cc
@@ -8,6 +8,7 @@ #include "base/threading/thread_task_runner_handle.h" #include "media/base/cdm_factory.h" #include "media/cdm/cdm_adapter.h" +#include "media/cdm/cdm_module.h" #include "url/origin.h" namespace media { @@ -37,6 +38,15 @@ return; } + CdmAdapter::CreateCdmFunc create_cdm_func = + CdmModule::GetInstance()->GetCreateCdmFunc(); + if (!create_cdm_func) { + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::Bind(cdm_created_cb, nullptr, "CreateCdmFunc not available.")); + return; + } + std::unique_ptr<CdmAuxiliaryHelper> cdm_helper = helper_creation_cb_.Run(); if (!cdm_helper) { base::ThreadTaskRunnerHandle::Get()->PostTask( @@ -45,7 +55,7 @@ return; } - CdmAdapter::Create(key_system, security_origin, cdm_config, + CdmAdapter::Create(key_system, security_origin, cdm_config, create_cdm_func, std::move(cdm_helper), session_message_cb, session_closed_cb, session_keys_change_cb, session_expiration_update_cb, cdm_created_cb);
diff --git a/media/cdm/cdm_adapter_unittest.cc b/media/cdm/cdm_adapter_unittest.cc index 4122dbf..79290642 100644 --- a/media/cdm/cdm_adapter_unittest.cc +++ b/media/cdm/cdm_adapter_unittest.cc
@@ -22,12 +22,18 @@ #include "media/cdm/api/content_decryption_module.h" #include "media/cdm/cdm_module.h" #include "media/cdm/external_clear_key_test_helper.h" +#include "media/cdm/library_cdm/cdm_host_proxy.h" +#include "media/cdm/library_cdm/mock_library_cdm.h" #include "media/cdm/mock_helpers.h" #include "media/cdm/simple_cdm_allocator.h" #include "media/media_buildflags.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +using ::testing::Invoke; +using ::testing::IsNull; +using ::testing::NotNull; +using ::testing::Return; using ::testing::Values; using ::testing::SaveArg; using ::testing::StrictMock; @@ -41,6 +47,11 @@ return arg.is_null(); } +MATCHER(IsNullPlatformChallengeResponse, "") { + // Only check the |signed_data| for simplicity. + return !arg.signed_data; +} + // TODO(jrummell): These tests are a subset of those in aes_decryptor_unittest. // Refactor aes_decryptor_unittest.cc to handle AesDecryptor directly and // via CdmAdapter once CdmAdapter supports decrypting functionality. There @@ -49,6 +60,8 @@ namespace media { +namespace { + // Random key ID used to create a session. const uint8_t kKeyId[] = { // base64 equivalent is AQIDBAUGBwgJCgsMDQ4PEA @@ -86,40 +99,50 @@ " \"type\": \"temporary\"" "}"; +class MockFileIOClient : public cdm::FileIOClient { + public: + MockFileIOClient() = default; + ~MockFileIOClient() override = default; + + MOCK_METHOD1(OnOpenComplete, void(Status)); + MOCK_METHOD3(OnReadComplete, void(Status, const uint8_t*, uint32_t)); + MOCK_METHOD1(OnWriteComplete, void(Status)); +}; + +} // namespace + // Tests CdmAdapter with the following parameter: // - int: CDM interface version to test. -class CdmAdapterTest : public testing::Test, - public testing::WithParamInterface<int> { +class CdmAdapterTestBase : public testing::Test, + public testing::WithParamInterface<int> { public: enum ExpectedResult { SUCCESS, FAILURE }; - CdmAdapterTest() { + CdmAdapterTestBase() { base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kOverrideEnabledCdmInterfaceVersion, base::IntToString(GetCdmInterfaceVersion())); - -#if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) - CdmModule::GetInstance()->Initialize(helper_.LibraryPath(), {}); -#else - CdmModule::GetInstance()->Initialize(helper_.LibraryPath()); -#endif // BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) } - ~CdmAdapterTest() override { CdmModule::ResetInstanceForTesting(); } + ~CdmAdapterTestBase() override { CdmModule::ResetInstanceForTesting(); } protected: + virtual std::string GetKeySystemName() = 0; + virtual CdmAdapter::CreateCdmFunc GetCreateCdmFunc() = 0; + int GetCdmInterfaceVersion() { return GetParam(); } // Initializes the adapter. |expected_result| tests that the call succeeds // or generates an error. - void InitializeAndExpect(ExpectedResult expected_result) { - CdmConfig cdm_config; // default settings of false are sufficient. + void InitializeWithCdmConfigAndExpect(const CdmConfig& cdm_config, + ExpectedResult expected_result) { std::unique_ptr<CdmAllocator> allocator(new SimpleCdmAllocator()); - std::unique_ptr<CdmAuxiliaryHelper> cdm_helper( - new MockCdmAuxiliaryHelper(std::move(allocator))); - CdmAdapter::Create(helper_.KeySystemName(), + std::unique_ptr<StrictMock<MockCdmAuxiliaryHelper>> cdm_helper( + new StrictMock<MockCdmAuxiliaryHelper>(std::move(allocator))); + cdm_helper_ = cdm_helper.get(); + CdmAdapter::Create(GetKeySystemName(), url::Origin::Create(GURL("http://foo.com")), cdm_config, - std::move(cdm_helper), + GetCreateCdmFunc(), std::move(cdm_helper), base::Bind(&MockCdmClient::OnSessionMessage, base::Unretained(&cdm_client_)), base::Bind(&MockCdmClient::OnSessionClosed, @@ -128,11 +151,71 @@ base::Unretained(&cdm_client_)), base::Bind(&MockCdmClient::OnSessionExpirationUpdate, base::Unretained(&cdm_client_)), - base::Bind(&CdmAdapterTest::OnCdmCreated, + base::Bind(&CdmAdapterTestBase::OnCdmCreated, base::Unretained(this), expected_result)); RunUntilIdle(); + ASSERT_EQ(expected_result == SUCCESS, !!cdm_); + } + + void InitializeAndExpect(ExpectedResult expected_result) { + // Default settings of false are sufficient for most tests. + CdmConfig cdm_config; + InitializeWithCdmConfigAndExpect(cdm_config, expected_result); + } + + void OnCdmCreated(ExpectedResult expected_result, + const scoped_refptr<ContentDecryptionModule>& cdm, + const std::string& error_message) { + if (cdm) { + ASSERT_EQ(expected_result, SUCCESS) + << "CDM creation succeeded unexpectedly."; + CdmAdapter* cdm_adapter = static_cast<CdmAdapter*>(cdm.get()); + ASSERT_EQ(GetCdmInterfaceVersion(), cdm_adapter->GetInterfaceVersion()); + cdm_ = cdm; + } else { + ASSERT_EQ(expected_result, FAILURE) << error_message; + } + } + + void RunUntilIdle() { scoped_task_environment_.RunUntilIdle(); } + + StrictMock<MockCdmClient> cdm_client_; + StrictMock<MockCdmAuxiliaryHelper>* cdm_helper_ = nullptr; + + // Keep track of the loaded CDM. + scoped_refptr<ContentDecryptionModule> cdm_; + + base::test::ScopedTaskEnvironment scoped_task_environment_; + + private: + DISALLOW_COPY_AND_ASSIGN(CdmAdapterTestBase); +}; + +class CdmAdapterTestWithClearKeyCdm : public CdmAdapterTestBase { + public: + ~CdmAdapterTestWithClearKeyCdm() { + // Clear |cdm_| before we destroy |helper_|. + cdm_ = nullptr; + RunUntilIdle(); } + void SetUp() override { + CdmAdapterTestBase::SetUp(); + +#if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) + CdmModule::GetInstance()->Initialize(helper_.LibraryPath(), {}); +#else + CdmModule::GetInstance()->Initialize(helper_.LibraryPath()); +#endif // BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) + } + + // CdmAdapterTestBase implementation. + std::string GetKeySystemName() override { return helper_.KeySystemName(); } + CdmAdapter::CreateCdmFunc GetCreateCdmFunc() override { + return CdmModule::GetInstance()->GetCreateCdmFunc(); + } + + protected: // Creates a new session using |key_id|. |session_id_| will be set // when the promise is resolved. |expected_result| tests that // CreateSessionAndGenerateRequest() succeeds or generates an error. @@ -191,19 +274,13 @@ std::string SessionId() { return session_id_; } private: - void OnCdmCreated(ExpectedResult expected_result, - const scoped_refptr<ContentDecryptionModule>& cdm, - const std::string& error_message) { - if (cdm) { - ASSERT_EQ(expected_result, SUCCESS) - << "CDM creation succeeded unexpectedly."; - CdmAdapter* cdm_adapter = static_cast<CdmAdapter*>(cdm.get()); - ASSERT_EQ(GetCdmInterfaceVersion(), cdm_adapter->GetInterfaceVersion()); - cdm_ = cdm; - } else { - ASSERT_EQ(expected_result, FAILURE) << error_message; - } - } + // Methods used for promise resolved/rejected. + MOCK_METHOD0(OnResolve, void()); + MOCK_METHOD1(OnResolveWithSession, void(const std::string& session_id)); + MOCK_METHOD3(OnReject, + void(CdmPromise::Exception exception_code, + uint32_t system_code, + const std::string& error_message)); // Create a promise. |expected_result| is used to indicate how the promise // should be fulfilled. @@ -216,8 +293,10 @@ } std::unique_ptr<SimpleCdmPromise> promise(new CdmCallbackPromise<>( - base::Bind(&CdmAdapterTest::OnResolve, base::Unretained(this)), - base::Bind(&CdmAdapterTest::OnReject, base::Unretained(this)))); + base::Bind(&CdmAdapterTestWithClearKeyCdm::OnResolve, + base::Unretained(this)), + base::Bind(&CdmAdapterTestWithClearKeyCdm::OnReject, + base::Unretained(this)))); return promise; } @@ -234,46 +313,69 @@ std::unique_ptr<NewSessionCdmPromise> promise( new CdmCallbackPromise<std::string>( - base::Bind(&CdmAdapterTest::OnResolveWithSession, + base::Bind(&CdmAdapterTestWithClearKeyCdm::OnResolveWithSession, base::Unretained(this)), - base::Bind(&CdmAdapterTest::OnReject, base::Unretained(this)))); + base::Bind(&CdmAdapterTestWithClearKeyCdm::OnReject, + base::Unretained(this)))); return promise; } - void RunUntilIdle() { base::RunLoop().RunUntilIdle(); } - - // Methods used for promise resolved/rejected. - MOCK_METHOD0(OnResolve, void()); - MOCK_METHOD1(OnResolveWithSession, void(const std::string& session_id)); - MOCK_METHOD3(OnReject, - void(CdmPromise::Exception exception_code, - uint32_t system_code, - const std::string& error_message)); - - StrictMock<MockCdmClient> cdm_client_; - - // Helper class to load/unload External Clear Key Library. + // Helper class to load/unload Clear Key CDM Library. + // TODO(xhwang): CdmModule does CDM loading/unloading by itself. So it seems + // we don't need to use ExternalClearKeyTestHelper. Simplify this if possible. ExternalClearKeyTestHelper helper_; - // Keep track of the loaded CDM. - scoped_refptr<ContentDecryptionModule> cdm_; - // |session_id_| is the latest result of calling CreateSession(). std::string session_id_; - - base::test::ScopedTaskEnvironment scoped_task_environment_; - - DISALLOW_COPY_AND_ASSIGN(CdmAdapterTest); }; -INSTANTIATE_TEST_CASE_P(CDM_9, CdmAdapterTest, Values(9)); -INSTANTIATE_TEST_CASE_P(CDM_10, CdmAdapterTest, Values(10)); +class CdmAdapterTestWithMockCdm : public CdmAdapterTestBase { + public: + ~CdmAdapterTestWithMockCdm() override { + // Makes sure Destroy() is called on CdmAdapter destruction. + EXPECT_CALL(*mock_library_cdm_, DestroyCalled()); + cdm_ = nullptr; + RunUntilIdle(); + } -TEST_P(CdmAdapterTest, Initialize) { + // CdmAdapterTestBase implementation. + std::string GetKeySystemName() override { return "x-com.mock"; } + CdmAdapter::CreateCdmFunc GetCreateCdmFunc() override { + return CreateMockLibraryCdm; + } + + protected: + void InitializeWithCdmConfig(const CdmConfig& cdm_config) { + // TODO(xhwang): Add tests for failure cases. + InitializeWithCdmConfigAndExpect(cdm_config, SUCCESS); + mock_library_cdm_ = MockLibraryCdm::GetInstance(); + ASSERT_TRUE(mock_library_cdm_); + cdm_host_proxy_ = mock_library_cdm_->GetCdmHostProxy(); + ASSERT_TRUE(cdm_host_proxy_); + } + + MockLibraryCdm* mock_library_cdm_ = nullptr; + CdmHostProxy* cdm_host_proxy_ = nullptr; +}; + +// Instantiate test cases + +INSTANTIATE_TEST_CASE_P(CDM_9, CdmAdapterTestWithClearKeyCdm, Values(9)); +INSTANTIATE_TEST_CASE_P(CDM_10, CdmAdapterTestWithClearKeyCdm, Values(10)); +INSTANTIATE_TEST_CASE_P(CDM_11, CdmAdapterTestWithClearKeyCdm, Values(11)); + +INSTANTIATE_TEST_CASE_P(CDM_9, CdmAdapterTestWithMockCdm, Values(9)); +INSTANTIATE_TEST_CASE_P(CDM_10, CdmAdapterTestWithMockCdm, Values(10)); +INSTANTIATE_TEST_CASE_P(CDM_11, CdmAdapterTestWithMockCdm, Values(11)); + +// CdmAdapterTestWithClearKeyCdm Tests + +TEST_P(CdmAdapterTestWithClearKeyCdm, Initialize) { InitializeAndExpect(SUCCESS); } -TEST_P(CdmAdapterTest, BadLibraryPath) { +// TODO(xhwang): This belongs to CdmModuleTest. +TEST_P(CdmAdapterTestWithClearKeyCdm, BadLibraryPath) { CdmModule::ResetInstanceForTesting(); #if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) @@ -284,17 +386,17 @@ base::FilePath(FILE_PATH_LITERAL("no_library_here"))); #endif // BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) - InitializeAndExpect(FAILURE); + ASSERT_FALSE(GetCreateCdmFunc()); } -TEST_P(CdmAdapterTest, CreateWebmSession) { +TEST_P(CdmAdapterTestWithClearKeyCdm, CreateWebmSession) { InitializeAndExpect(SUCCESS); std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId)); CreateSessionAndExpect(EmeInitDataType::WEBM, key_id, SUCCESS); } -TEST_P(CdmAdapterTest, CreateKeyIdsSession) { +TEST_P(CdmAdapterTestWithClearKeyCdm, CreateKeyIdsSession) { InitializeAndExpect(SUCCESS); // Don't include the trailing /0 from the string in the data passed in. @@ -303,7 +405,7 @@ CreateSessionAndExpect(EmeInitDataType::KEYIDS, key_id, SUCCESS); } -TEST_P(CdmAdapterTest, CreateCencSession) { +TEST_P(CdmAdapterTestWithClearKeyCdm, CreateCencSession) { InitializeAndExpect(SUCCESS); std::vector<uint8_t> key_id(kKeyIdAsPssh, @@ -311,7 +413,7 @@ CreateSessionAndExpect(EmeInitDataType::CENC, key_id, SUCCESS); } -TEST_P(CdmAdapterTest, CreateSessionWithBadData) { +TEST_P(CdmAdapterTestWithClearKeyCdm, CreateSessionWithBadData) { InitializeAndExpect(SUCCESS); // Use |kKeyId| but specify KEYIDS format. @@ -319,7 +421,7 @@ CreateSessionAndExpect(EmeInitDataType::KEYIDS, key_id, FAILURE); } -TEST_P(CdmAdapterTest, LoadSession) { +TEST_P(CdmAdapterTestWithClearKeyCdm, LoadSession) { InitializeAndExpect(SUCCESS); // LoadSession() is not supported by AesDecryptor. @@ -327,7 +429,7 @@ CreateSessionAndExpect(EmeInitDataType::KEYIDS, key_id, FAILURE); } -TEST_P(CdmAdapterTest, UpdateSession) { +TEST_P(CdmAdapterTestWithClearKeyCdm, UpdateSession) { InitializeAndExpect(SUCCESS); std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId)); @@ -336,7 +438,7 @@ UpdateSessionAndExpect(SessionId(), kKeyAsJWK, SUCCESS, true); } -TEST_P(CdmAdapterTest, UpdateSessionWithBadData) { +TEST_P(CdmAdapterTestWithClearKeyCdm, UpdateSessionWithBadData) { InitializeAndExpect(SUCCESS); std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId)); @@ -345,4 +447,109 @@ UpdateSessionAndExpect(SessionId(), "random data", FAILURE, true); } +// CdmAdapterTestWithMockCdm Tests + +// ChallengePlatform() will ask the helper to send platform challenge. +TEST_P(CdmAdapterTestWithMockCdm, ChallengePlatform) { + CdmConfig cdm_config; + cdm_config.allow_distinctive_identifier = true; + InitializeWithCdmConfig(cdm_config); + + std::string service_id = "service_id"; + std::string challenge = "challenge"; + EXPECT_CALL(*cdm_helper_, ChallengePlatformCalled(service_id, challenge)) + .WillOnce(Return(true)); + EXPECT_CALL(*mock_library_cdm_, OnPlatformChallengeResponse(_)); + cdm_host_proxy_->SendPlatformChallenge(service_id.data(), service_id.size(), + challenge.data(), challenge.size()); + RunUntilIdle(); +} + +// ChallengePlatform() will always fail if |allow_distinctive_identifier| is +// false. +TEST_P(CdmAdapterTestWithMockCdm, + ChallengePlatform_DistinctiveIdentifierNotAllowed) { + CdmConfig cdm_config; + InitializeWithCdmConfig(cdm_config); + + EXPECT_CALL(*mock_library_cdm_, + OnPlatformChallengeResponse(IsNullPlatformChallengeResponse())); + std::string service_id = "service_id"; + std::string challenge = "challenge"; + cdm_host_proxy_->SendPlatformChallenge(service_id.data(), service_id.size(), + challenge.data(), challenge.size()); + RunUntilIdle(); +} + +// CreateFileIO() will ask helper to create FileIO. +TEST_P(CdmAdapterTestWithMockCdm, CreateFileIO) { + CdmConfig cdm_config; + cdm_config.allow_persistent_state = true; + InitializeWithCdmConfig(cdm_config); + + MockFileIOClient file_io_client; + EXPECT_CALL(*cdm_helper_, CreateCdmFileIO(_)); + cdm_host_proxy_->CreateFileIO(&file_io_client); + RunUntilIdle(); +} + +// CreateFileIO() will always fail if |allow_persistent_state| is false. +TEST_P(CdmAdapterTestWithMockCdm, CreateFileIO_PersistentStateNotAllowed) { + CdmConfig cdm_config; + InitializeWithCdmConfig(cdm_config); + + // When |allow_persistent_state| is false, should return null immediately + // without asking helper to create FileIO. + MockFileIOClient file_io_client; + ASSERT_FALSE(cdm_host_proxy_->CreateFileIO(&file_io_client)); + RunUntilIdle(); +} + +// RequestStorageId() with version 0 (latest) is supported. +TEST_P(CdmAdapterTestWithMockCdm, RequestStorageId_Version_0) { + CdmConfig cdm_config; + cdm_config.allow_persistent_state = true; + InitializeWithCdmConfig(cdm_config); + + std::vector<uint8_t> storage_id = {1, 2, 3}; + EXPECT_CALL(*cdm_helper_, GetStorageIdCalled(0)).WillOnce(Return(storage_id)); + EXPECT_CALL(*mock_library_cdm_, OnStorageId(0, NotNull(), 3)); + cdm_host_proxy_->RequestStorageId(0); + RunUntilIdle(); +} + +// RequestStorageId() with version 1 is supported. +TEST_P(CdmAdapterTestWithMockCdm, RequestStorageId_Version_1) { + CdmConfig cdm_config; + cdm_config.allow_persistent_state = true; + InitializeWithCdmConfig(cdm_config); + + std::vector<uint8_t> storage_id = {1, 2, 3}; + EXPECT_CALL(*cdm_helper_, GetStorageIdCalled(1)).WillOnce(Return(storage_id)); + EXPECT_CALL(*mock_library_cdm_, OnStorageId(1, NotNull(), 3)); + cdm_host_proxy_->RequestStorageId(1); + RunUntilIdle(); +} + +// RequestStorageId() with version 2 is not supported. +TEST_P(CdmAdapterTestWithMockCdm, RequestStorageId_Version_2) { + CdmConfig cdm_config; + cdm_config.allow_persistent_state = true; + InitializeWithCdmConfig(cdm_config); + + EXPECT_CALL(*mock_library_cdm_, OnStorageId(2, IsNull(), 0)); + cdm_host_proxy_->RequestStorageId(2); + RunUntilIdle(); +} + +// RequestStorageId() will always fail if |allow_persistent_state| is false. +TEST_P(CdmAdapterTestWithMockCdm, RequestStorageId_PersistentStateNotAllowed) { + CdmConfig cdm_config; + InitializeWithCdmConfig(cdm_config); + + EXPECT_CALL(*mock_library_cdm_, OnStorageId(1, IsNull(), 0)); + cdm_host_proxy_->RequestStorageId(1); + RunUntilIdle(); +} + } // namespace media
diff --git a/media/cdm/library_cdm/BUILD.gn b/media/cdm/library_cdm/BUILD.gn index a3a4237b..2512ca9f 100644 --- a/media/cdm/library_cdm/BUILD.gn +++ b/media/cdm/library_cdm/BUILD.gn
@@ -5,6 +5,24 @@ import("//media/media_options.gni") if (enable_library_cdms) { + source_set("test_support") { + testonly = true + + visibility = [ "//media/cdm:unit_tests" ] + + sources = [ + "mock_library_cdm.cc", + "mock_library_cdm.h", + ] + + deps = [ + ":cdm_host_proxy", + "//base", + "//media/cdm:cdm_api", + "//testing/gmock", + ] + } + source_set("cdm_host_proxy") { sources = [ "cdm_host_proxy.h",
diff --git a/media/cdm/library_cdm/mock_library_cdm.cc b/media/cdm/library_cdm/mock_library_cdm.cc new file mode 100644 index 0000000..c5803b5 --- /dev/null +++ b/media/cdm/library_cdm/mock_library_cdm.cc
@@ -0,0 +1,100 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "media/cdm/library_cdm/mock_library_cdm.h" + +#include <string> + +#include "base/logging.h" +#include "media/cdm/library_cdm/cdm_host_proxy.h" +#include "media/cdm/library_cdm/cdm_host_proxy_impl.h" + +namespace media { + +namespace { +static MockLibraryCdm* g_mock_library_cdm = nullptr; +} // namespace + +// static +MockLibraryCdm* MockLibraryCdm::GetInstance() { + return g_mock_library_cdm; +} + +template <typename HostInterface> +MockLibraryCdm::MockLibraryCdm(HostInterface* host, + const std::string& key_system) + : cdm_host_proxy_(new CdmHostProxyImpl<HostInterface>(host)) {} + +MockLibraryCdm::~MockLibraryCdm() { + DCHECK(g_mock_library_cdm); + g_mock_library_cdm = nullptr; +} + +CdmHostProxy* MockLibraryCdm::GetCdmHostProxy() { + return cdm_host_proxy_.get(); +} + +void MockLibraryCdm::Initialize(bool allow_distinctive_identifier, + bool allow_persistent_state) { + cdm_host_proxy_->OnInitialized(true); +} + +void MockLibraryCdm::Initialize(bool allow_distinctive_identifier, + bool allow_persistent_state, + bool use_hw_secure_codecs) { + cdm_host_proxy_->OnInitialized(true); +} + +void* CreateMockLibraryCdm(int cdm_interface_version, + const char* key_system, + uint32_t key_system_size, + GetCdmHostFunc get_cdm_host_func, + void* user_data) { + DVLOG(1) << __func__; + DCHECK(!g_mock_library_cdm); + + std::string key_system_string(key_system, key_system_size); + + // We support CDM_9, CDM_10 and CDM_11. + using CDM_9 = cdm::ContentDecryptionModule_9; + using CDM_10 = cdm::ContentDecryptionModule_10; + using CDM_11 = cdm::ContentDecryptionModule_11; + + if (cdm_interface_version == CDM_9::kVersion) { + CDM_9::Host* host = static_cast<CDM_9::Host*>( + get_cdm_host_func(CDM_9::Host::kVersion, user_data)); + if (!host) + return nullptr; + + DVLOG(1) << __func__ << ": Create ClearKeyCdm with CDM_9::Host."; + g_mock_library_cdm = new MockLibraryCdm(host, key_system_string); + return static_cast<CDM_9*>(g_mock_library_cdm); + } + + if (cdm_interface_version == CDM_10::kVersion) { + CDM_10::Host* host = static_cast<CDM_10::Host*>( + get_cdm_host_func(CDM_10::Host::kVersion, user_data)); + if (!host) + return nullptr; + + DVLOG(1) << __func__ << ": Create ClearKeyCdm with CDM_10::Host."; + g_mock_library_cdm = new MockLibraryCdm(host, key_system_string); + return static_cast<CDM_10*>(g_mock_library_cdm); + } + + if (cdm_interface_version == CDM_11::kVersion) { + CDM_11::Host* host = static_cast<CDM_11::Host*>( + get_cdm_host_func(CDM_11::Host::kVersion, user_data)); + if (!host) + return nullptr; + + DVLOG(1) << __func__ << ": Create ClearKeyCdm with CDM_11::Host."; + g_mock_library_cdm = new MockLibraryCdm(host, key_system_string); + return static_cast<CDM_11*>(g_mock_library_cdm); + } + + return nullptr; +} + +} // namespace media
diff --git a/media/cdm/library_cdm/mock_library_cdm.h b/media/cdm/library_cdm/mock_library_cdm.h new file mode 100644 index 0000000..029e9ba --- /dev/null +++ b/media/cdm/library_cdm/mock_library_cdm.h
@@ -0,0 +1,148 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MEDIA_CDM_LIBRARY_CDM_MOCK_LIBRARY_CDM_H_ +#define MEDIA_CDM_LIBRARY_CDM_MOCK_LIBRARY_CDM_H_ + +#include <stdint.h> + +#include <memory> +#include <string> + +#include "media/cdm/api/content_decryption_module.h" +#include "testing/gmock/include/gmock/gmock.h" + +namespace media { + +class CdmHostProxy; + +// Mock implementation of the cdm::ContentDecryptionModule interfaces. +class MockLibraryCdm : public cdm::ContentDecryptionModule_9, + public cdm::ContentDecryptionModule_10, + public cdm::ContentDecryptionModule_11 { + public: + // Provides easy access to the MockLibraryCdm instance for testing to avoid + // going through multiple layers to get it (e.g. CdmAdapter -> CdmWrapper -> + // CdmWrapperImpl). It does impose a limitation that we cannot have more than + // one MockLibraryCdm instances at the same time, which is fine in most + // testing cases. + static MockLibraryCdm* GetInstance(); + + template <typename HostInterface> + MockLibraryCdm(HostInterface* host, const std::string& key_system); + + CdmHostProxy* GetCdmHostProxy(); + + // cdm::ContentDecryptionModule_9 implementation. + void Initialize(bool allow_distinctive_identifier, + bool allow_persistent_state) override; + MOCK_METHOD1( + InitializeAudioDecoder, + cdm::Status(const cdm::AudioDecoderConfig_1& audio_decoder_config)); + MOCK_METHOD1( + InitializeVideoDecoder, + cdm::Status(const cdm::VideoDecoderConfig_1& video_decoder_config)); + MOCK_METHOD2(Decrypt, + cdm::Status(const cdm::InputBuffer_1& encrypted_buffer, + cdm::DecryptedBlock* decrypted_block)); + MOCK_METHOD2(DecryptAndDecodeFrame, + cdm::Status(const cdm::InputBuffer_1& encrypted_buffer, + cdm::VideoFrame* video_frame)); + MOCK_METHOD2(DecryptAndDecodeSamples, + cdm::Status(const cdm::InputBuffer_1& encrypted_buffer, + cdm::AudioFrames* audio_frames)); + + // cdm::ContentDecryptionModule_10/11 implementation. + void Initialize(bool allow_distinctive_identifier, + bool allow_persistent_state, + bool use_hw_secure_codecs) override; + MOCK_METHOD1( + InitializeAudioDecoder, + cdm::Status(const cdm::AudioDecoderConfig_2& audio_decoder_config)); + MOCK_METHOD1( + InitializeVideoDecoder, + cdm::Status(const cdm::VideoDecoderConfig_2& video_decoder_config)); + MOCK_METHOD2(Decrypt, + cdm::Status(const cdm::InputBuffer_2& encrypted_buffer, + cdm::DecryptedBlock* decrypted_block)); + MOCK_METHOD2(DecryptAndDecodeFrame, + cdm::Status(const cdm::InputBuffer_2& encrypted_buffer, + cdm::VideoFrame* video_frame)); + MOCK_METHOD2(DecryptAndDecodeSamples, + cdm::Status(const cdm::InputBuffer_2& encrypted_buffer, + cdm::AudioFrames* audio_frames)); + + // Common cdm::ContentDecryptionModule_* implementation. + MOCK_METHOD2(GetStatusForPolicy, + void(uint32_t promise_id, const cdm::Policy& policy)); + MOCK_METHOD5(CreateSessionAndGenerateRequest, + void(uint32_t promise_id, + cdm::SessionType session_type, + cdm::InitDataType init_data_type, + const uint8_t* init_data, + uint32_t init_data_size)); + MOCK_METHOD4(LoadSession, + void(uint32_t promise_id, + cdm::SessionType session_type, + const char* session_id, + uint32_t session_id_length)); + MOCK_METHOD5(UpdateSession, + void(uint32_t promise_id, + const char* session_id, + uint32_t session_id_length, + const uint8_t* response, + uint32_t response_size)); + MOCK_METHOD3(CloseSession, + void(uint32_t promise_id, + const char* session_id, + uint32_t session_id_length)); + MOCK_METHOD3(RemoveSession, + void(uint32_t promise_id, + const char* session_id, + uint32_t session_id_length)); + MOCK_METHOD3(SetServerCertificate, + void(uint32_t promise_id, + const uint8_t* server_certificate_data, + uint32_t server_certificate_data_size)); + MOCK_METHOD1(TimerExpired, void(void* context)); + MOCK_METHOD1(DeinitializeDecoder, void(cdm::StreamType decoder_type)); + MOCK_METHOD1(ResetDecoder, void(cdm::StreamType decoder_type)); + MOCK_METHOD1(OnPlatformChallengeResponse, + void(const cdm::PlatformChallengeResponse& response)); + MOCK_METHOD3(OnQueryOutputProtectionStatus, + void(cdm::QueryResult result, + uint32_t link_mask, + uint32_t output_protection_mask)); + MOCK_METHOD3(OnStorageId, + void(uint32_t version, + const uint8_t* storage_id, + uint32_t storage_id_size)); + + // It could be tricky to expect Destroy() to be called and then delete + // MockLibraryCdm directly in the test. So call "delete this" in this class, + // same as a normal CDM implementation would do, but also add DestroyCalled() + // so that it's easy to ensure Destroy() is actually called. + MOCK_METHOD0(DestroyCalled, void()); + void Destroy() override { + DestroyCalled(); + delete this; + } + + private: + // Can only be destructed through Destroy(). + ~MockLibraryCdm() override; + + std::unique_ptr<CdmHostProxy> cdm_host_proxy_; +}; + +// Helper function to create MockLibraryCdm. +void* CreateMockLibraryCdm(int cdm_interface_version, + const char* key_system, + uint32_t key_system_size, + GetCdmHostFunc get_cdm_host_func, + void* user_data); + +} // namespace media + +#endif // MEDIA_CDM_LIBRARY_CDM_MOCK_LIBRARY_CDM_H_
diff --git a/media/cdm/mock_helpers.cc b/media/cdm/mock_helpers.cc index fcd85efe..0e8b68e 100644 --- a/media/cdm/mock_helpers.cc +++ b/media/cdm/mock_helpers.cc
@@ -14,12 +14,6 @@ void MockCdmAuxiliaryHelper::SetFileReadCB(FileReadCB file_read_cb) {} -cdm::FileIO* MockCdmAuxiliaryHelper::CreateCdmFileIO( - cdm::FileIOClient* client) { - NOTREACHED(); - return nullptr; -} - cdm::Buffer* MockCdmAuxiliaryHelper::CreateCdmBuffer(size_t capacity) { return allocator_->CreateCdmBuffer(capacity); }
diff --git a/media/cdm/mock_helpers.h b/media/cdm/mock_helpers.h index abf3587a..5c81211 100644 --- a/media/cdm/mock_helpers.h +++ b/media/cdm/mock_helpers.h
@@ -26,7 +26,7 @@ // CdmAuxiliaryHelper implementation. void SetFileReadCB(FileReadCB file_read_cb) override; - cdm::FileIO* CreateCdmFileIO(cdm::FileIOClient* client) override; + MOCK_METHOD1(CreateCdmFileIO, cdm::FileIO*(cdm::FileIOClient* client)); cdm::Buffer* CreateCdmBuffer(size_t capacity) override; std::unique_ptr<VideoFrameImpl> CreateCdmVideoFrame() override;
diff --git a/media/filters/BUILD.gn b/media/filters/BUILD.gn index 60ea2f8..30eb8ec 100644 --- a/media/filters/BUILD.gn +++ b/media/filters/BUILD.gn
@@ -126,6 +126,8 @@ sources += [ "audio_file_reader.cc", "audio_file_reader.h", + "audio_video_metadata_extractor.cc", + "audio_video_metadata_extractor.h", "blocking_url_protocol.cc", "blocking_url_protocol.h", "ffmpeg_audio_decoder.cc", @@ -137,15 +139,9 @@ "ffmpeg_glue.h", "in_memory_url_protocol.cc", "in_memory_url_protocol.h", + "media_file_checker.cc", + "media_file_checker.h", ] - if (!is_android) { - sources += [ - "audio_video_metadata_extractor.cc", - "audio_video_metadata_extractor.h", - "media_file_checker.cc", - "media_file_checker.h", - ] - } } if (media_use_libvpx) {
diff --git a/media/mojo/DEPS b/media/mojo/DEPS index 285448d..7216ea6 100644 --- a/media/mojo/DEPS +++ b/media/mojo/DEPS
@@ -1,7 +1,5 @@ include_rules = [ "+components/ukm/test_ukm_recorder.h", - - "+mojo/common", "+mojo/converters", "+mojo/logging", "+mojo/public",
diff --git a/media/mojo/clients/BUILD.gn b/media/mojo/clients/BUILD.gn index 92cdfd0..5100e5c 100644 --- a/media/mojo/clients/BUILD.gn +++ b/media/mojo/clients/BUILD.gn
@@ -67,7 +67,6 @@ "//media/gpu", "//media/mojo/common", "//media/mojo/common:mojo_shared_buffer_video_frame", - "//mojo/common", "//services/service_manager/public/cpp", ] @@ -90,7 +89,6 @@ deps = [ "//base", "//media/mojo/interfaces", - "//mojo/common", ] }
diff --git a/media/mojo/common/BUILD.gn b/media/mojo/common/BUILD.gn index 72d6a25d..23dfe6c1 100644 --- a/media/mojo/common/BUILD.gn +++ b/media/mojo/common/BUILD.gn
@@ -18,7 +18,6 @@ "//gpu/ipc/common:struct_traits", "//media", "//media/mojo/interfaces", - "//mojo/common", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//ui/gfx/geometry",
diff --git a/media/mojo/services/BUILD.gn b/media/mojo/services/BUILD.gn index 4d87502..6f45d8f 100644 --- a/media/mojo/services/BUILD.gn +++ b/media/mojo/services/BUILD.gn
@@ -103,7 +103,6 @@ "//media/gpu/ipc/service", "//media/mojo/common", "//media/mojo/common:mojo_shared_buffer_video_frame", - "//mojo/common", "//services/metrics/public/cpp:metrics_cpp", "//services/metrics/public/cpp:ukm_builders", "//services/service_manager/public/mojom",
diff --git a/mojo/BUILD.gn b/mojo/BUILD.gn index cfac752..77386629 100644 --- a/mojo/BUILD.gn +++ b/mojo/BUILD.gn
@@ -10,7 +10,6 @@ testonly = true deps = [ ":tests", - "//mojo/common", ] if (!(is_linux && current_cpu == "x86")) {
diff --git a/mojo/common/BUILD.gn b/mojo/common/BUILD.gn deleted file mode 100644 index d404237..0000000 --- a/mojo/common/BUILD.gn +++ /dev/null
@@ -1,63 +0,0 @@ -# Copyright 2014 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("//mojo/public/tools/bindings/mojom.gni") -import("//testing/test.gni") - -group("common") { - public_deps = [ - ":common_custom_types", - ] -} - -mojom("common_custom_types") { - sources = [ - "values.mojom", - ] - - public_deps = [ - "//mojo/public/mojom/base", - ] -} - -mojom("test_common_custom_types") { - sources = [ - "test_common_custom_types.mojom", - ] - public_deps = [ - ":common_custom_types", - ] -} - -test("mojo_common_unittests") { - deps = [ - ":common", - ":common_custom_types", - ":test_common_custom_types", - "//base", - "//base/test:test_support", - "//mojo/edk/test:run_all_unittests", - "//mojo/edk/test:test_support", - "//mojo/public/cpp/bindings", - "//mojo/public/cpp/test_support:test_utils", - "//testing/gtest", - "//url", - ] - - sources = [ - "common_custom_types_unittest.cc", - ] -} - -source_set("values_struct_traits") { - sources = [ - "values_struct_traits.cc", - "values_struct_traits.h", - ] - public_deps = [ - ":common_custom_types_shared_cpp_sources", - "//base", - "//mojo/public/cpp/bindings:bindings", - ] -}
diff --git a/mojo/common/DEPS b/mojo/common/DEPS deleted file mode 100644 index e8ac4288..0000000 --- a/mojo/common/DEPS +++ /dev/null
@@ -1,6 +0,0 @@ -include_rules = [ - # common must not depend on embedder. - "-mojo", - "+mojo/common", - "+mojo/public", -]
diff --git a/mojo/common/OWNERS b/mojo/common/OWNERS deleted file mode 100644 index 2c44a46..0000000 --- a/mojo/common/OWNERS +++ /dev/null
@@ -1,6 +0,0 @@ -per-file *.mojom=set noparent -per-file *.mojom=file://ipc/SECURITY_OWNERS -per-file *_struct_traits*.*=set noparent -per-file *_struct_traits*.*=file://ipc/SECURITY_OWNERS -per-file *.typemap=set noparent -per-file *.typemap=file://ipc/SECURITY_OWNERS
diff --git a/mojo/common/common_custom_types_unittest.cc b/mojo/common/common_custom_types_unittest.cc deleted file mode 100644 index ba9af35..0000000 --- a/mojo/common/common_custom_types_unittest.cc +++ /dev/null
@@ -1,179 +0,0 @@ -// Copyright 2016 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/memory/ptr_util.h" -#include "base/message_loop/message_loop.h" -#include "base/numerics/safe_math.h" -#include "base/run_loop.h" -#include "base/values.h" -#include "mojo/common/test_common_custom_types.mojom.h" -#include "mojo/public/cpp/bindings/binding.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace mojo { -namespace common { -namespace test { -namespace { - -template <typename T> -struct BounceTestTraits { - static void ExpectEquality(const T& a, const T& b) { - EXPECT_EQ(a, b); - } -}; - -template <typename T> -struct PassTraits { - using Type = const T&; -}; - -template <> -struct PassTraits<base::Time> { - using Type = base::Time; -}; - -template <> -struct PassTraits<base::TimeDelta> { - using Type = base::TimeDelta; -}; - -template <> -struct PassTraits<base::TimeTicks> { - using Type = base::TimeTicks; -}; - -template <typename T> -void DoExpectResponse(T* expected_value, - const base::Closure& closure, - typename PassTraits<T>::Type value) { - BounceTestTraits<T>::ExpectEquality(*expected_value, value); - closure.Run(); -} - -template <typename T> -base::Callback<void(typename PassTraits<T>::Type)> ExpectResponse( - T* expected_value, - const base::Closure& closure) { - return base::Bind(&DoExpectResponse<T>, expected_value, closure); -} - -class TestValueImpl : public TestValue { - public: - explicit TestValueImpl(TestValueRequest request) - : binding_(this, std::move(request)) {} - - // TestValue implementation: - void BounceDictionaryValue(std::unique_ptr<base::DictionaryValue> in, - BounceDictionaryValueCallback callback) override { - std::move(callback).Run(std::move(in)); - } - - void BounceListValue(std::unique_ptr<base::ListValue> in, - BounceListValueCallback callback) override { - std::move(callback).Run(std::move(in)); - } - - void BounceValue(std::unique_ptr<base::Value> in, - BounceValueCallback callback) override { - std::move(callback).Run(std::move(in)); - } - - private: - mojo::Binding<TestValue> binding_; -}; - -class CommonCustomTypesTest : public testing::Test { - protected: - CommonCustomTypesTest() {} - ~CommonCustomTypesTest() override {} - - private: - base::MessageLoop message_loop_; - - DISALLOW_COPY_AND_ASSIGN(CommonCustomTypesTest); -}; - -} // namespace - -TEST_F(CommonCustomTypesTest, Value) { - TestValuePtr ptr; - TestValueImpl impl(MakeRequest(&ptr)); - - std::unique_ptr<base::Value> output; - - ASSERT_TRUE(ptr->BounceValue(nullptr, &output)); - EXPECT_FALSE(output); - - auto input = std::make_unique<base::Value>(); - ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); - EXPECT_EQ(*input, *output); - - input = std::make_unique<base::Value>(123); - ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); - EXPECT_EQ(*input, *output); - - input = std::make_unique<base::Value>(1.23); - ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); - EXPECT_EQ(*input, *output); - - input = std::make_unique<base::Value>(false); - ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); - EXPECT_EQ(*input, *output); - - input = std::make_unique<base::Value>("test string"); - ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); - EXPECT_EQ(*input, *output); - - input = base::Value::CreateWithCopiedBuffer("mojo", 4); - ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); - EXPECT_EQ(*input, *output); - - auto dict = std::make_unique<base::DictionaryValue>(); - dict->SetBoolean("bool", false); - dict->SetInteger("int", 2); - dict->SetString("string", "some string"); - dict->SetBoolean("nested.bool", true); - dict->SetInteger("nested.int", 9); - dict->Set("some_binary", base::Value::CreateWithCopiedBuffer("mojo", 4)); - dict->Set("null_value", std::make_unique<base::Value>()); - dict->SetKey("non_nested.int", base::Value(10)); - { - std::unique_ptr<base::ListValue> dict_list(new base::ListValue()); - dict_list->AppendString("string"); - dict_list->AppendBoolean(true); - dict->Set("list", std::move(dict_list)); - } - - std::unique_ptr<base::DictionaryValue> dict_output; - ASSERT_TRUE(ptr->BounceDictionaryValue(dict->CreateDeepCopy(), &dict_output)); - EXPECT_EQ(*dict, *dict_output); - - input = std::move(dict); - ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); - EXPECT_EQ(*input, *output); - - auto list = std::make_unique<base::ListValue>(); - list->AppendString("string"); - list->AppendDouble(42.1); - list->AppendBoolean(true); - list->Append(base::Value::CreateWithCopiedBuffer("mojo", 4)); - list->Append(std::make_unique<base::Value>()); - { - std::unique_ptr<base::DictionaryValue> list_dict( - new base::DictionaryValue()); - list_dict->SetString("string", "str"); - list->Append(std::move(list_dict)); - } - std::unique_ptr<base::ListValue> list_output; - ASSERT_TRUE(ptr->BounceListValue(list->CreateDeepCopy(), &list_output)); - EXPECT_EQ(*list, *list_output); - - input = std::move(list); - ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); - ASSERT_EQ(*input, *output); -} - -} // namespace test -} // namespace common -} // namespace mojo
diff --git a/mojo/common/mojo_common_export.h b/mojo/common/mojo_common_export.h deleted file mode 100644 index 48d21d0..0000000 --- a/mojo/common/mojo_common_export.h +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright 2013 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 MOJO_COMMON_MOJO_COMMON_EXPORT_H_ -#define MOJO_COMMON_MOJO_COMMON_EXPORT_H_ - -#if defined(COMPONENT_BUILD) - -#if defined(WIN32) - -#if defined(MOJO_COMMON_IMPLEMENTATION) -#define MOJO_COMMON_EXPORT __declspec(dllexport) -#else -#define MOJO_COMMON_EXPORT __declspec(dllimport) -#endif - -#else // !defined(WIN32) - -#if defined(MOJO_COMMON_IMPLEMENTATION) -#define MOJO_COMMON_EXPORT __attribute__((visibility("default"))) -#else -#define MOJO_COMMON_EXPORT -#endif - -#endif // defined(WIN32) - -#else // !defined(COMPONENT_BUILD) -#define MOJO_COMMON_EXPORT -#endif - -#endif // MOJO_COMMON_MOJO_COMMON_EXPORT_H_
diff --git a/mojo/common/test_common_custom_types.mojom b/mojo/common/test_common_custom_types.mojom deleted file mode 100644 index e23a94ae..0000000 --- a/mojo/common/test_common_custom_types.mojom +++ /dev/null
@@ -1,19 +0,0 @@ -// Copyright 2016 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 mojo.common.test; - -import "mojo/common/values.mojom"; - -interface TestValue { - [Sync] - BounceDictionaryValue(mojo.common.mojom.DictionaryValue in) - => (mojo.common.mojom.DictionaryValue out); - [Sync] - BounceListValue(mojo.common.mojom.ListValue in) - => (mojo.common.mojom.ListValue out); - [Sync] - BounceValue(mojo.common.mojom.Value? in) - => (mojo.common.mojom.Value? out); -};
diff --git a/mojo/common/typemaps.gni b/mojo/common/typemaps.gni deleted file mode 100644 index f58f112..0000000 --- a/mojo/common/typemaps.gni +++ /dev/null
@@ -1,5 +0,0 @@ -# Copyright 2016 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. - -typemaps = [ "//mojo/common/values.typemap" ]
diff --git a/mojo/common/values.mojom b/mojo/common/values.mojom deleted file mode 100644 index 722198c..0000000 --- a/mojo/common/values.mojom +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright 2016 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 mojo.common.mojom; - -union Value { - NullValue? null_value; - bool bool_value; - int32 int_value; - double double_value; - string string_value; - array<uint8> binary_value; - DictionaryValue dictionary_value; - ListValue list_value; -}; - -struct ListValue { - array<Value> values; -}; - -struct DictionaryValue { - map<string, Value> values; -}; - -// An empty struct representing a null base::Value. -struct NullValue { -}; - -// To avoid versioning problems for arc. TODO(sammc): Remove ASAP. -[Native] -struct LegacyListValue;
diff --git a/mojo/common/values.typemap b/mojo/common/values.typemap deleted file mode 100644 index 3bc75e7..0000000 --- a/mojo/common/values.typemap +++ /dev/null
@@ -1,26 +0,0 @@ -# Copyright 2016 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. - -mojom = "//mojo/common/values.mojom" -public_headers = [ "//base/values.h" ] -traits_headers = [ - "//ipc/ipc_message_utils.h", - "//mojo/common/values_struct_traits.h", -] - -public_deps = [ - "//base", - "//ipc", -] - -deps = [ - "//mojo/common:values_struct_traits", -] - -type_mappings = [ - "mojo.common.mojom.DictionaryValue=std::unique_ptr<base::DictionaryValue>[move_only,nullable_is_same_type]", - "mojo.common.mojom.LegacyListValue=base::ListValue[non_copyable_non_movable]", - "mojo.common.mojom.ListValue=std::unique_ptr<base::ListValue>[move_only,nullable_is_same_type]", - "mojo.common.mojom.Value=std::unique_ptr<base::Value>[move_only,nullable_is_same_type]", -]
diff --git a/mojo/common/values_struct_traits.cc b/mojo/common/values_struct_traits.cc deleted file mode 100644 index cb0bcc9..0000000 --- a/mojo/common/values_struct_traits.cc +++ /dev/null
@@ -1,128 +0,0 @@ -// Copyright 2016 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 "mojo/common/values_struct_traits.h" - -#include <memory> -#include <utility> -#include <vector> - -#include "base/containers/flat_map.h" -#include "base/memory/ptr_util.h" - -namespace mojo { - -bool StructTraits<common::mojom::ListValueDataView, - std::unique_ptr<base::ListValue>>:: - Read(common::mojom::ListValueDataView data, - std::unique_ptr<base::ListValue>* value_out) { - mojo::ArrayDataView<common::mojom::ValueDataView> view; - data.GetValuesDataView(&view); - - auto list_value = std::make_unique<base::ListValue>(); - for (size_t i = 0; i < view.size(); ++i) { - std::unique_ptr<base::Value> value; - if (!view.Read(i, &value)) - return false; - - list_value->Append(std::move(value)); - } - *value_out = std::move(list_value); - return true; -} - -std::unique_ptr<base::ListValue> -CloneTraits<std::unique_ptr<base::ListValue>, false>::Clone( - const std::unique_ptr<base::ListValue>& input) { - return input ? input->CreateDeepCopy() : nullptr; -} - -bool StructTraits<common::mojom::DictionaryValueDataView, - std::unique_ptr<base::DictionaryValue>>:: - Read(common::mojom::DictionaryValueDataView data, - std::unique_ptr<base::DictionaryValue>* value_out) { - mojo::MapDataView<mojo::StringDataView, common::mojom::ValueDataView> view; - data.GetValuesDataView(&view); - std::vector<base::Value::DictStorage::value_type> dict_storage; - dict_storage.reserve(view.size()); - for (size_t i = 0; i < view.size(); ++i) { - base::StringPiece key; - std::unique_ptr<base::Value> value; - if (!view.keys().Read(i, &key) || !view.values().Read(i, &value)) - return false; - - dict_storage.emplace_back(key.as_string(), std::move(value)); - } - *value_out = base::DictionaryValue::From( - std::make_unique<base::Value>(base::Value::DictStorage( - std::move(dict_storage), base::KEEP_LAST_OF_DUPES))); - return true; -} - -std::unique_ptr<base::DictionaryValue> -CloneTraits<std::unique_ptr<base::DictionaryValue>, false>::Clone( - const std::unique_ptr<base::DictionaryValue>& input) { - return input ? input->CreateDeepCopy() : nullptr; -} - -bool UnionTraits<common::mojom::ValueDataView, std::unique_ptr<base::Value>>:: - Read(common::mojom::ValueDataView data, - std::unique_ptr<base::Value>* value_out) { - switch (data.tag()) { - case common::mojom::ValueDataView::Tag::NULL_VALUE: { - *value_out = std::make_unique<base::Value>(); - return true; - } - case common::mojom::ValueDataView::Tag::BOOL_VALUE: { - *value_out = std::make_unique<base::Value>(data.bool_value()); - return true; - } - case common::mojom::ValueDataView::Tag::INT_VALUE: { - *value_out = std::make_unique<base::Value>(data.int_value()); - return true; - } - case common::mojom::ValueDataView::Tag::DOUBLE_VALUE: { - *value_out = std::make_unique<base::Value>(data.double_value()); - return true; - } - case common::mojom::ValueDataView::Tag::STRING_VALUE: { - base::StringPiece string_value; - if (!data.ReadStringValue(&string_value)) - return false; - *value_out = std::make_unique<base::Value>(string_value); - return true; - } - case common::mojom::ValueDataView::Tag::BINARY_VALUE: { - mojo::ArrayDataView<uint8_t> binary_data; - data.GetBinaryValueDataView(&binary_data); - *value_out = base::Value::CreateWithCopiedBuffer( - reinterpret_cast<const char*>(binary_data.data()), - binary_data.size()); - return true; - } - case common::mojom::ValueDataView::Tag::DICTIONARY_VALUE: { - std::unique_ptr<base::DictionaryValue> dictionary_value; - if (!data.ReadDictionaryValue(&dictionary_value)) - return false; - *value_out = std::move(dictionary_value); - return true; - } - case common::mojom::ValueDataView::Tag::LIST_VALUE: { - std::unique_ptr<base::ListValue> list_value; - if (!data.ReadListValue(&list_value)) - return false; - *value_out = std::move(list_value); - return true; - } - } - return false; -} - -std::unique_ptr<base::Value> -CloneTraits<std::unique_ptr<base::Value>, false>::Clone( - const std::unique_ptr<base::Value>& input) { - return input ? input->CreateDeepCopy() : nullptr; -} - -} // namespace mojo
diff --git a/mojo/common/values_struct_traits.h b/mojo/common/values_struct_traits.h deleted file mode 100644 index 2a218c4..0000000 --- a/mojo/common/values_struct_traits.h +++ /dev/null
@@ -1,275 +0,0 @@ -// Copyright 2016 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 MOJO_COMMON_VALUES_STRUCT_TRAITS_H_ -#define MOJO_COMMON_VALUES_STRUCT_TRAITS_H_ - -#include "base/containers/span.h" -#include "base/values.h" -#include "mojo/common/values.mojom-shared.h" -#include "mojo/public/cpp/bindings/array_traits.h" -#include "mojo/public/cpp/bindings/clone_traits.h" -#include "mojo/public/cpp/bindings/map_traits.h" -#include "mojo/public/cpp/bindings/struct_traits.h" -#include "mojo/public/cpp/bindings/union_traits.h" - -namespace mojo { - -template <> -struct ArrayTraits<base::ListValue> { - using Element = base::Value; - using ConstIterator = base::ListValue::const_iterator; - - static size_t GetSize(const base::ListValue& input) { - return input.GetSize(); - } - - static ConstIterator GetBegin(const base::ListValue& input) { - return input.begin(); - } - - static void AdvanceIterator(ConstIterator& iterator) { ++iterator; } - - static const Element& GetValue(ConstIterator& iterator) { return *iterator; } -}; - -template <> -struct StructTraits<common::mojom::ListValueDataView, base::ListValue> { - static const base::ListValue& values(const base::ListValue& value) { - return value; - } -}; - -template <> -struct StructTraits<common::mojom::ListValueDataView, - std::unique_ptr<base::ListValue>> { - static bool IsNull(const std::unique_ptr<base::ListValue>& value) { - return !value; - } - - static void SetToNull(std::unique_ptr<base::ListValue>* value) { - value->reset(); - } - - static const base::ListValue& values( - const std::unique_ptr<base::ListValue>& value) { - return *value; - } - - static bool Read(common::mojom::ListValueDataView data, - std::unique_ptr<base::ListValue>* value); -}; - -template <> -struct CloneTraits<std::unique_ptr<base::ListValue>, false> { - static std::unique_ptr<base::ListValue> Clone( - const std::unique_ptr<base::ListValue>& input); -}; - -template <> -struct MapTraits<base::DictionaryValue> { - using Key = std::string; - using Value = base::Value; - using Iterator = base::DictionaryValue::Iterator; - - static size_t GetSize(const base::DictionaryValue& input) { - return input.size(); - } - - static Iterator GetBegin(const base::DictionaryValue& input) { - return Iterator(input); - } - - static void AdvanceIterator(Iterator& iterator) { iterator.Advance(); } - - static const Key& GetKey(Iterator& iterator) { return iterator.key(); } - - static const Value& GetValue(Iterator& iterator) { return iterator.value(); } -}; - -template <> -struct StructTraits<common::mojom::DictionaryValueDataView, - base::DictionaryValue> { - static const base::DictionaryValue& values( - const base::DictionaryValue& value) { - return value; - } -}; - -template <> -struct StructTraits<common::mojom::DictionaryValueDataView, - std::unique_ptr<base::DictionaryValue>> { - static bool IsNull(const std::unique_ptr<base::DictionaryValue>& value) { - return !value; - } - - static void SetToNull(std::unique_ptr<base::DictionaryValue>* value) { - value->reset(); - } - - static const base::DictionaryValue& values( - const std::unique_ptr<base::DictionaryValue>& value) { - return *value; - } - static bool Read(common::mojom::DictionaryValueDataView data, - std::unique_ptr<base::DictionaryValue>* value); -}; - -template <> -struct CloneTraits<std::unique_ptr<base::DictionaryValue>, false> { - static std::unique_ptr<base::DictionaryValue> Clone( - const std::unique_ptr<base::DictionaryValue>& input); -}; - -template <> -struct StructTraits<common::mojom::NullValueDataView, void*> { - static bool IsNull(const void* value) { return true; } - static void SetToNull(void** value) {} - static bool Read(common::mojom::NullValueDataView data, void** value) { - return true; - } -}; - -template <> -struct UnionTraits<common::mojom::ValueDataView, base::Value> { - static common::mojom::ValueDataView::Tag GetTag(const base::Value& data) { - switch (data.type()) { - case base::Value::Type::NONE: - return common::mojom::ValueDataView::Tag::NULL_VALUE; - case base::Value::Type::BOOLEAN: - return common::mojom::ValueDataView::Tag::BOOL_VALUE; - case base::Value::Type::INTEGER: - return common::mojom::ValueDataView::Tag::INT_VALUE; - case base::Value::Type::DOUBLE: - return common::mojom::ValueDataView::Tag::DOUBLE_VALUE; - case base::Value::Type::STRING: - return common::mojom::ValueDataView::Tag::STRING_VALUE; - case base::Value::Type::BINARY: - return common::mojom::ValueDataView::Tag::BINARY_VALUE; - case base::Value::Type::DICTIONARY: - return common::mojom::ValueDataView::Tag::DICTIONARY_VALUE; - case base::Value::Type::LIST: - return common::mojom::ValueDataView::Tag::LIST_VALUE; - } - NOTREACHED(); - return common::mojom::ValueDataView::Tag::NULL_VALUE; - } - - static void* null_value(const base::Value& value) { return nullptr; } - - static bool bool_value(const base::Value& value) { - bool bool_value{}; - if (!value.GetAsBoolean(&bool_value)) - NOTREACHED(); - return bool_value; - } - - static int32_t int_value(const base::Value& value) { - int int_value{}; - if (!value.GetAsInteger(&int_value)) - NOTREACHED(); - return int_value; - } - - static double double_value(const base::Value& value) { - double double_value{}; - if (!value.GetAsDouble(&double_value)) - NOTREACHED(); - return double_value; - } - - static base::StringPiece string_value(const base::Value& value) { - base::StringPiece string_piece; - if (!value.GetAsString(&string_piece)) - NOTREACHED(); - return string_piece; - } - - static base::span<const uint8_t> binary_value(const base::Value& value) { - if (!value.is_blob()) - NOTREACHED(); - return base::make_span( - reinterpret_cast<const uint8_t*>(value.GetBlob().data()), - value.GetBlob().size()); - } - - static const base::ListValue& list_value(const base::Value& value) { - const base::ListValue* list_value = nullptr; - if (!value.GetAsList(&list_value)) - NOTREACHED(); - return *list_value; - } - static const base::DictionaryValue& dictionary_value( - const base::Value& value) { - const base::DictionaryValue* dictionary_value = nullptr; - if (!value.GetAsDictionary(&dictionary_value)) - NOTREACHED(); - return *dictionary_value; - } -}; - -template <> -struct UnionTraits<common::mojom::ValueDataView, std::unique_ptr<base::Value>> { - static bool IsNull(const std::unique_ptr<base::Value>& value) { - return !value; - } - - static void SetToNull(std::unique_ptr<base::Value>* value) { value->reset(); } - - static common::mojom::ValueDataView::Tag GetTag( - const std::unique_ptr<base::Value>& value) { - return UnionTraits<common::mojom::ValueDataView, base::Value>::GetTag( - *value); - } - - static void* null_value(const std::unique_ptr<base::Value>& value) { - return UnionTraits<common::mojom::ValueDataView, base::Value>::null_value( - *value); - } - static bool bool_value(const std::unique_ptr<base::Value>& value) { - return UnionTraits<common::mojom::ValueDataView, base::Value>::bool_value( - *value); - } - static int32_t int_value(const std::unique_ptr<base::Value>& value) { - return UnionTraits<common::mojom::ValueDataView, base::Value>::int_value( - *value); - } - static double double_value(const std::unique_ptr<base::Value>& value) { - return UnionTraits<common::mojom::ValueDataView, base::Value>::double_value( - *value); - } - static base::StringPiece string_value( - const std::unique_ptr<base::Value>& value) { - return UnionTraits<common::mojom::ValueDataView, base::Value>::string_value( - *value); - } - static base::span<const uint8_t> binary_value( - const std::unique_ptr<base::Value>& value) { - return UnionTraits<common::mojom::ValueDataView, base::Value>::binary_value( - *value); - } - static const base::ListValue& list_value( - const std::unique_ptr<base::Value>& value) { - return UnionTraits<common::mojom::ValueDataView, base::Value>::list_value( - *value); - } - static const base::DictionaryValue& dictionary_value( - const std::unique_ptr<base::Value>& value) { - return UnionTraits<common::mojom::ValueDataView, - base::Value>::dictionary_value(*value); - } - - static bool Read(common::mojom::ValueDataView data, - std::unique_ptr<base::Value>* value); -}; - -template <> -struct CloneTraits<std::unique_ptr<base::Value>, false> { - static std::unique_ptr<base::Value> Clone( - const std::unique_ptr<base::Value>& input); -}; - -} // namespace mojo - -#endif // MOJO_COMMON_VALUES_STRUCT_TRAITS_H_
diff --git a/mojo/public/tools/bindings/chromium_bindings_configuration.gni b/mojo/public/tools/bindings/chromium_bindings_configuration.gni index 19804b4d..c1ff6e2 100644 --- a/mojo/public/tools/bindings/chromium_bindings_configuration.gni +++ b/mojo/public/tools/bindings/chromium_bindings_configuration.gni
@@ -24,7 +24,6 @@ "//gpu/ipc/common/typemaps.gni", "//media/capture/mojom/typemaps.gni", "//media/mojo/interfaces/typemaps.gni", - "//mojo/common/typemaps.gni", "//mojo/public/cpp/base/typemaps.gni", "//mojo/public/cpp/bindings/tests/chromium_typemaps.gni", "//net/interfaces/typemaps.gni",
diff --git a/net/BUILD.gn b/net/BUILD.gn index 80ecf7f..eb07bb7 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -1135,6 +1135,8 @@ "quic/core/crypto/transport_parameters.h", "quic/core/frames/quic_ack_frame.cc", "quic/core/frames/quic_ack_frame.h", + "quic/core/frames/quic_application_close_frame.cc", + "quic/core/frames/quic_application_close_frame.h", "quic/core/frames/quic_blocked_frame.cc", "quic/core/frames/quic_blocked_frame.h", "quic/core/frames/quic_connection_close_frame.cc", @@ -1144,13 +1146,11 @@ "quic/core/frames/quic_frame.h", "quic/core/frames/quic_goaway_frame.cc", "quic/core/frames/quic_goaway_frame.h", - "quic/core/frames/quic_ietf_blocked_frame.cc", - "quic/core/frames/quic_ietf_blocked_frame.h", - "quic/core/frames/quic_ietf_max_stream_id_frame.cc", - "quic/core/frames/quic_ietf_max_stream_id_frame.h", - "quic/core/frames/quic_ietf_stream_id_blocked_frame.cc", - "quic/core/frames/quic_ietf_stream_id_blocked_frame.h", + "quic/core/frames/quic_max_stream_id_frame.cc", + "quic/core/frames/quic_max_stream_id_frame.h", "quic/core/frames/quic_mtu_discovery_frame.h", + "quic/core/frames/quic_new_connection_id_frame.cc", + "quic/core/frames/quic_new_connection_id_frame.h", "quic/core/frames/quic_padding_frame.cc", "quic/core/frames/quic_padding_frame.h", "quic/core/frames/quic_path_challenge_frame.cc", @@ -1167,6 +1167,8 @@ "quic/core/frames/quic_stop_waiting_frame.h", "quic/core/frames/quic_stream_frame.cc", "quic/core/frames/quic_stream_frame.h", + "quic/core/frames/quic_stream_id_blocked_frame.cc", + "quic/core/frames/quic_stream_id_blocked_frame.h", "quic/core/frames/quic_window_update_frame.cc", "quic/core/frames/quic_window_update_frame.h", "quic/core/packet_number_indexed_queue.h",
diff --git a/net/cookies/cookie_store.h b/net/cookies/cookie_store.h index e24858d..92d7734 100644 --- a/net/cookies/cookie_store.h +++ b/net/cookies/cookie_store.h
@@ -146,7 +146,7 @@ CookieOptions cookie_options; // If this is not empty then any cookie with a domain/ip contained in this - // set will be deleted (assuming other fields match). + // will be deleted (assuming other fields match). // Domains must not have a leading period. e.g "example.com" and not // ".example.com". // @@ -156,7 +156,7 @@ std::set<std::string> domains_and_ips_to_delete; // If this is not empty then any cookie with a domain/ip contained in this - // set will be ignored (and not deleted). + // will be ignored (and not deleted). // Domains must not have a leading period. e.g "example.com" and not // ".example.com". //
diff --git a/net/cookies/cookie_store_unittest.h b/net/cookies/cookie_store_unittest.h index 71c2bdc4..f97b50979 100644 --- a/net/cookies/cookie_store_unittest.h +++ b/net/cookies/cookie_store_unittest.h
@@ -1938,14 +1938,14 @@ // With two empty lists (default) should match any domain. EXPECT_TRUE(delete_info.Matches(create_cookie("anything.com"))); - // With only an inclusion list. + // With only an "to_delete" list. delete_info.domains_and_ips_to_delete = std::set<std::string>({"includea.com", "includeb.com"}); EXPECT_TRUE(delete_info.Matches(create_cookie("includea.com"))); EXPECT_TRUE(delete_info.Matches(create_cookie("includeb.com"))); EXPECT_FALSE(delete_info.Matches(create_cookie("anything.com"))); - // With only an exclusion list. + // With only an "to_ignore" list. delete_info.domains_and_ips_to_delete.clear(); delete_info.domains_and_ips_to_ignore.insert("exclude.com"); EXPECT_TRUE(delete_info.Matches(create_cookie("anything.com"))); @@ -1954,10 +1954,10 @@ // Now with both lists populated. // // +----------------------+ - // | inclusion | outside.com + // | to_delete | outside.com // | | // | left.com +---------------------+ - // | | mid.com | exclusion | + // | | mid.com | to_ignore | // | | | | // +------------|---------+ | // | right.com |
diff --git a/net/http/transport_security_state_static.json b/net/http/transport_security_state_static.json index 8c817ca..44ba3ab 100644 --- a/net/http/transport_security_state_static.json +++ b/net/http/transport_security_state_static.json
@@ -44062,9 +44062,6 @@ { "name": "xuan-li88.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "xxxlbox.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "yacineboumaza.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, - { "name": "yakaz.cl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, - { "name": "yakaz.com.ar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, - { "name": "yakaz.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "yannick.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "yao-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "yao-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
diff --git a/net/quic/core/congestion_control/bbr_sender_test.cc b/net/quic/core/congestion_control/bbr_sender_test.cc index 38fee56..6c12d58 100644 --- a/net/quic/core/congestion_control/bbr_sender_test.cc +++ b/net/quic/core/congestion_control/bbr_sender_test.cc
@@ -260,6 +260,9 @@ TEST_F(BbrSenderTest, SimpleTransfer) { // Adding TSO CWND causes packet loss before exiting startup. SetQuicReloadableFlag(quic_bbr_add_tso_cwnd, false); + // Disable Ack Decimation on the receiver, because it can increase srtt. + QuicConnectionPeer::SetAckMode(receiver_.connection(), + QuicConnection::AckMode::TCP_ACKING); CreateDefaultSetup(); // At startup make sure we are at the default. @@ -367,7 +370,9 @@ // Test a simple long data transfer with 2 rtts of aggregation. TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationBytes4) { SetQuicReloadableFlag(quic_bbr_add_tso_cwnd, false); - + // Disable Ack Decimation on the receiver, because it can increase srtt. + QuicConnectionPeer::SetAckMode(receiver_.connection(), + QuicConnection::AckMode::TCP_ACKING); CreateDefaultSetup(); // Enable ack aggregation that forces the queue to be drained. SetConnectionOption(kBBR1); @@ -433,6 +438,9 @@ // Test a simple long data transfer with 2 rtts of aggregation. TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationBytes20RTTWindow) { SetQuicReloadableFlag(quic_bbr_add_tso_cwnd, false); + // Disable Ack Decimation on the receiver, because it can increase srtt. + QuicConnectionPeer::SetAckMode(receiver_.connection(), + QuicConnection::AckMode::TCP_ACKING); CreateDefaultSetup(); SetConnectionOption(kBBR4); // 2 RTTs of aggregation, with a max of 10kb. @@ -459,6 +467,9 @@ // Test a simple long data transfer with 2 rtts of aggregation. TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationBytes40RTTWindow) { SetQuicReloadableFlag(quic_bbr_add_tso_cwnd, false); + // Disable Ack Decimation on the receiver, because it can increase srtt. + QuicConnectionPeer::SetAckMode(receiver_.connection(), + QuicConnection::AckMode::TCP_ACKING); CreateDefaultSetup(); SetConnectionOption(kBBR5); // 2 RTTs of aggregation, with a max of 10kb. @@ -663,6 +674,9 @@ // Verify that the DRAIN phase works correctly. TEST_F(BbrSenderTest, Drain) { + // Disable Ack Decimation on the receiver, because it can increase srtt. + QuicConnectionPeer::SetAckMode(receiver_.connection(), + QuicConnection::AckMode::TCP_ACKING); CreateDefaultSetup(); const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(10); // Get the queue at the bottleneck, which is the outgoing queue at the port to @@ -821,6 +835,9 @@ // bandwidth will not exit high gain phase, and similarly ensure that the // connection will exit low gain early if the number of bytes in flight is low. TEST_F(BbrSenderTest, InFlightAwareGainCycling) { + // Disable Ack Decimation on the receiver, because it can increase srtt. + QuicConnectionPeer::SetAckMode(receiver_.connection(), + QuicConnection::AckMode::TCP_ACKING); CreateDefaultSetup(); DriveOutOfStartup();
diff --git a/net/quic/core/congestion_control/general_loss_algorithm.cc b/net/quic/core/congestion_control/general_loss_algorithm.cc index b6f54e92..22459f0 100644 --- a/net/quic/core/congestion_control/general_loss_algorithm.cc +++ b/net/quic/core/congestion_control/general_loss_algorithm.cc
@@ -32,7 +32,8 @@ largest_sent_on_spurious_retransmit_(0), loss_type_(kNack), reordering_shift_(kDefaultLossDelayShift), - largest_previously_acked_(0) {} + largest_previously_acked_(0), + largest_lost_(0) {} GeneralLossAlgorithm::GeneralLossAlgorithm(LossDetectionType loss_type) : loss_detection_timeout_(QuicTime::Zero()), @@ -41,7 +42,8 @@ reordering_shift_(loss_type == kAdaptiveTime ? kDefaultAdaptiveLossDelayShift : kDefaultLossDelayShift), - largest_previously_acked_(0) {} + largest_previously_acked_(0), + largest_lost_(0) {} LossDetectionType GeneralLossAlgorithm::GetLossDetectionType() const { return loss_type_; @@ -71,8 +73,20 @@ std::max(QuicTime::Delta::FromMilliseconds(kMinLossDelayMs), max_rtt + (max_rtt >> reordering_shift_)); QuicPacketNumber packet_number = unacked_packets.GetLeastUnacked(); - for (QuicUnackedPacketMap::const_iterator it = unacked_packets.begin(); - it != unacked_packets.end() && packet_number <= largest_newly_acked; + QuicUnackedPacketMap::const_iterator it = unacked_packets.begin(); + if (GetQuicReloadableFlag(quic_incremental_loss_detection) && + largest_lost_ >= packet_number) { + QUIC_FLAG_COUNT(quic_reloadable_flag_quic_incremental_loss_detection); + if (largest_lost_ > unacked_packets.largest_sent_packet()) { + QUIC_BUG << "largest_lost: " << largest_lost_ + << " is greater than largest_sent_packet: " + << unacked_packets.largest_sent_packet(); + } else { + it += (largest_lost_ - packet_number + 1); + packet_number = largest_lost_ + 1; + } + } + for (; it != unacked_packets.end() && packet_number <= largest_newly_acked; ++it, ++packet_number) { if (!it->in_flight) { continue; @@ -121,6 +135,10 @@ } } largest_previously_acked_ = largest_newly_acked; + if (!packets_lost->empty()) { + DCHECK_LT(largest_lost_, packets_lost->back().packet_number); + largest_lost_ = packets_lost->back().packet_number; + } } QuicTime GeneralLossAlgorithm::GetLossTimeout() const {
diff --git a/net/quic/core/congestion_control/general_loss_algorithm.h b/net/quic/core/congestion_control/general_loss_algorithm.h index bb46b54..4b16fc4 100644 --- a/net/quic/core/congestion_control/general_loss_algorithm.h +++ b/net/quic/core/congestion_control/general_loss_algorithm.h
@@ -68,6 +68,8 @@ int reordering_shift_; // The largest newly acked from the previous call to DetectLosses. QuicPacketNumber largest_previously_acked_; + // The largest lost packet. + QuicPacketNumber largest_lost_; DISALLOW_COPY_AND_ASSIGN(GeneralLossAlgorithm); };
diff --git a/net/quic/core/congestion_control/general_loss_algorithm_test.cc b/net/quic/core/congestion_control/general_loss_algorithm_test.cc index b3d0e717..58a71a8 100644 --- a/net/quic/core/congestion_control/general_loss_algorithm_test.cc +++ b/net/quic/core/congestion_control/general_loss_algorithm_test.cc
@@ -156,11 +156,19 @@ loss_algorithm_.GetLossTimeout()); clock_.AdvanceTime(rtt_stats_.smoothed_rtt()); - VerifyLosses(kNumSentPackets, {1, 2, 3}); + if (GetQuicReloadableFlag(quic_incremental_loss_detection)) { + VerifyLosses(kNumSentPackets, {3}); + } else { + VerifyLosses(kNumSentPackets, {1, 2, 3}); + } EXPECT_EQ(clock_.Now() + 0.25 * rtt_stats_.smoothed_rtt(), loss_algorithm_.GetLossTimeout()); clock_.AdvanceTime(0.25 * rtt_stats_.smoothed_rtt()); - VerifyLosses(kNumSentPackets, {1, 2, 3, 4}); + if (GetQuicReloadableFlag(quic_incremental_loss_detection)) { + VerifyLosses(kNumSentPackets, {4}); + } else { + VerifyLosses(kNumSentPackets, {1, 2, 3, 4}); + } EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout()); }
diff --git a/net/quic/core/congestion_control/pacing_sender.cc b/net/quic/core/congestion_control/pacing_sender.cc index 16751917..fff4905 100644 --- a/net/quic/core/congestion_control/pacing_sender.cc +++ b/net/quic/core/congestion_control/pacing_sender.cc
@@ -28,6 +28,7 @@ ideal_next_packet_send_time_(QuicTime::Zero()), was_last_send_delayed_(false), initial_burst_size_(kInitialUnpacedBurst), + lumpy_tokens_(0), pacing_limited_(false), is_simplified_pacing_( GetQuicReloadableFlag(quic_simplify_pacing_sender)) {} @@ -88,6 +89,19 @@ PacingRate(bytes_in_flight + bytes).TransferTime(bytes); if (is_simplified_pacing_) { QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_simplify_pacing_sender, 1, 2); + if (!pacing_limited_ || lumpy_tokens_ == 0) { + // Reset lumpy_tokens_ if either application or cwnd throttles sending or + // token runs out. + lumpy_tokens_ = std::max( + 1u, + std::min( + static_cast<uint32_t>(GetQuicFlag(FLAGS_quic_lumpy_pacing_size)), + static_cast<uint32_t>( + (sender_->GetCongestionWindow() * + GetQuicFlag(FLAGS_quic_lumpy_pacing_cwnd_fraction)) / + kDefaultTCPMSS))); + } + --lumpy_tokens_; if (pacing_limited_) { // Make up for lost time since pacing throttles the sending. ideal_next_packet_send_time_ = ideal_next_packet_send_time_ + delay; @@ -140,7 +154,7 @@ return QuicTime::Delta::Infinite(); } - if (burst_tokens_ > 0 || bytes_in_flight == 0) { + if (burst_tokens_ > 0 || bytes_in_flight == 0 || lumpy_tokens_ > 0) { // Don't pace if we have burst tokens available or leaving quiescence. return QuicTime::Delta::Zero(); }
diff --git a/net/quic/core/congestion_control/pacing_sender.h b/net/quic/core/congestion_control/pacing_sender.h index ce64bdd..1106fb1 100644 --- a/net/quic/core/congestion_control/pacing_sender.h +++ b/net/quic/core/congestion_control/pacing_sender.h
@@ -86,6 +86,10 @@ bool was_last_send_delayed_; // True when the last send was delayed. uint32_t initial_burst_size_; + // Number of unpaced packets to be sent before packets are delayed. This token + // is consumed after burst_tokens_ ran out. + uint32_t lumpy_tokens_; + // Indicates whether pacing throttles the sending. If true, make up for lost // time. bool pacing_limited_;
diff --git a/net/quic/core/congestion_control/pacing_sender_test.cc b/net/quic/core/congestion_control/pacing_sender_test.cc index 8ee1f8b8..b467206 100644 --- a/net/quic/core/congestion_control/pacing_sender_test.cc +++ b/net/quic/core/congestion_control/pacing_sender_test.cc
@@ -7,6 +7,8 @@ #include <memory> #include "net/quic/core/quic_packets.h" +#include "net/quic/platform/api/quic_flag_utils.h" +#include "net/quic/platform/api/quic_flags.h" #include "net/quic/platform/api/quic_logging.h" #include "net/quic/platform/api/quic_ptr_util.h" #include "net/quic/platform/api/quic_test.h" @@ -63,7 +65,8 @@ void CheckPacketIsSentImmediately(HasRetransmittableData retransmittable_data, QuicByteCount bytes_in_flight, bool in_recovery, - bool cwnd_limited) { + bool cwnd_limited, + QuicPacketCount cwnd) { // In order for the packet to be sendable, the underlying sender must // permit it to be sent immediately. for (int i = 0; i < 2; ++i) { @@ -82,6 +85,9 @@ OnPacketSent(clock_.Now(), bytes_in_flight, packet_number_, kMaxPacketSize, retransmittable_data)); if (pacing_sender_->is_simplified_pacing()) { + EXPECT_CALL(*mock_sender_, GetCongestionWindow()) + .Times(AtMost(1)) + .WillRepeatedly(Return(cwnd * kDefaultTCPMSS)); EXPECT_CALL(*mock_sender_, CanSend(bytes_in_flight + kMaxPacketSize)) .Times(AtMost(1)) .WillRepeatedly(Return(!cwnd_limited)); @@ -93,7 +99,7 @@ void CheckPacketIsSentImmediately() { CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, kBytesInFlight, - false, false); + false, false, 10); } void CheckPacketIsDelayed(QuicTime::Delta delay) { @@ -221,8 +227,10 @@ InitPacingRate(10, QuicBandwidth::FromBytesAndTimeDelta( kMaxPacketSize, QuicTime::Delta::FromMilliseconds(1))); - EXPECT_CALL(*mock_sender_, GetCongestionWindow()) - .WillOnce(Return(10 * kDefaultTCPMSS)); + if (!pacing_sender_->is_simplified_pacing()) { + EXPECT_CALL(*mock_sender_, GetCongestionWindow()) + .WillOnce(Return(10 * kDefaultTCPMSS)); + } // Update the RTT and verify that the first 10 packets aren't paced. UpdateRtt(); @@ -242,7 +250,7 @@ // Next time TimeUntilSend is called with no bytes in flight, pacing should // allow a packet to be sent, and when it's sent, the tokens are refilled. - CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, 0, false, false); + CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, 0, false, false, 10); for (int i = 0; i < kInitialBurstPackets - 1; ++i) { CheckPacketIsSentImmediately(); } @@ -259,8 +267,10 @@ InitPacingRate(10, QuicBandwidth::FromBytesAndTimeDelta( kMaxPacketSize, QuicTime::Delta::FromMilliseconds(1))); - EXPECT_CALL(*mock_sender_, GetCongestionWindow()) - .WillOnce(Return(10 * kDefaultTCPMSS)); + if (!pacing_sender_->is_simplified_pacing()) { + EXPECT_CALL(*mock_sender_, GetCongestionWindow()) + .WillOnce(Return(10 * kDefaultTCPMSS)); + } // Send 10 packets, and verify that they are not paced. for (int i = 0; i < kInitialBurstPackets; ++i) { CheckPacketIsSentImmediately(); @@ -277,7 +287,7 @@ // Next time TimeUntilSend is called with no bytes in flight, the tokens // should be refilled and there should be no delay. - CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, 0, false, false); + CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, 0, false, false, 10); // Send 10 packets, and verify that they are not paced. for (int i = 0; i < kInitialBurstPackets - 1; ++i) { CheckPacketIsSentImmediately(); @@ -296,9 +306,10 @@ InitPacingRate(10, QuicBandwidth::FromBytesAndTimeDelta( 2 * kMaxPacketSize, QuicTime::Delta::FromMilliseconds(1))); - - EXPECT_CALL(*mock_sender_, GetCongestionWindow()) - .WillOnce(Return(10 * kDefaultTCPMSS)); + if (!pacing_sender_->is_simplified_pacing()) { + EXPECT_CALL(*mock_sender_, GetCongestionWindow()) + .WillOnce(Return(10 * kDefaultTCPMSS)); + } // Update the RTT and verify that the first 10 packets aren't paced. UpdateRtt(); @@ -319,7 +330,7 @@ // Next time TimeUntilSend is called with no bytes in flight, the tokens // should be refilled and there should be no delay. - CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, 0, false, false); + CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, 0, false, false, 10); for (int i = 0; i < kInitialBurstPackets - 1; ++i) { CheckPacketIsSentImmediately(); } @@ -365,7 +376,7 @@ UpdateRtt(); // Ensure only one packet is sent immediately and the rest are paced. - CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, 0, true, false); + CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, 0, true, false, 10); CheckPacketIsSentImmediately(); CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2)); } @@ -386,7 +397,7 @@ clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(2)); // After sending packet 3, cwnd is limited. CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, kBytesInFlight, false, - true); + true, 10); clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(100)); // Verify pacing sender stops making up for lost time after sending packet 3. @@ -396,5 +407,59 @@ CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2)); } +TEST_F(PacingSenderTest, LumpyPacingWithInitialBurstToken) { + SetQuicReloadableFlag(quic_simplify_pacing_sender, true); + // Set lumpy size to be 3, and cwnd faction to 0.5 + SetQuicFlag(&FLAGS_quic_lumpy_pacing_size, 3); + SetQuicFlag(&FLAGS_quic_lumpy_pacing_cwnd_fraction, 0.5f); + // Configure pacing rate of 1 packet per 1 ms. + InitPacingRate(10, QuicBandwidth::FromBytesAndTimeDelta( + kMaxPacketSize, QuicTime::Delta::FromMilliseconds(1))); + UpdateRtt(); + + // Send 10 packets, and verify that they are not paced. + for (int i = 0; i < kInitialBurstPackets; ++i) { + CheckPacketIsSentImmediately(); + } + + CheckPacketIsSentImmediately(); + CheckPacketIsSentImmediately(); + CheckPacketIsSentImmediately(); + // Packet 14 will be delayed 3ms. + CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(3)); + + // Wake up on time. + clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(3)); + CheckPacketIsSentImmediately(); + CheckPacketIsSentImmediately(); + CheckPacketIsSentImmediately(); + // Packet 17 will be delayed 3ms. + CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(3)); + + // Application throttles sending. + OnApplicationLimited(); + clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(100)); + CheckPacketIsSentImmediately(); + CheckPacketIsSentImmediately(); + CheckPacketIsSentImmediately(); + // Packet 20 will be delayed 3ms. + CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(3)); + + // Wake up on time. + clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(3)); + CheckPacketIsSentImmediately(); + // After sending packet 21, cwnd is limited. + CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, kBytesInFlight, false, + true, 10); + + clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(100)); + // Suppose cwnd size is 5, so that lumpy size becomes 2. + CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, kBytesInFlight, false, + false, 5); + CheckPacketIsSentImmediately(); + // Packet 24 will be delayed 2ms. + CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2)); +} + } // namespace test } // namespace net
diff --git a/net/quic/core/crypto/crypto_protocol.h b/net/quic/core/crypto/crypto_protocol.h index fa1acee..1b2d647 100644 --- a/net/quic/core/crypto/crypto_protocol.h +++ b/net/quic/core/crypto/crypto_protocol.h
@@ -126,6 +126,7 @@ const QuicTag kMAD3 = TAG('M', 'A', 'D', '3'); // No min RTO const QuicTag kMAD4 = TAG('M', 'A', 'D', '4'); // IETF style TLP const QuicTag kMAD5 = TAG('M', 'A', 'D', '5'); // IETF style TLP with 2x mult +const QuicTag kACD0 = TAG('A', 'D', 'D', '0'); // Disable ack decimation const QuicTag kACKD = TAG('A', 'C', 'K', 'D'); // Ack decimation style acking. const QuicTag kAKD2 = TAG('A', 'K', 'D', '2'); // Ack decimation tolerating // out of order packets.
diff --git a/net/quic/core/frames/quic_application_close_frame.cc b/net/quic/core/frames/quic_application_close_frame.cc new file mode 100644 index 0000000..26daca3 --- /dev/null +++ b/net/quic/core/frames/quic_application_close_frame.cc
@@ -0,0 +1,19 @@ +// Copyright (c) 2016 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 "net/quic/core/frames/quic_application_close_frame.h" + +namespace net { + +QuicApplicationCloseFrame::QuicApplicationCloseFrame() + : error_code(QUIC_NO_ERROR) {} + +std::ostream& operator<<(std::ostream& os, + const QuicApplicationCloseFrame& frame) { + os << "{ error_code: " << frame.error_code << ", error_details: '" + << frame.error_details << "' }\n"; + return os; +} + +} // namespace net
diff --git a/net/quic/core/frames/quic_application_close_frame.h b/net/quic/core/frames/quic_application_close_frame.h new file mode 100644 index 0000000..622ba9e9 --- /dev/null +++ b/net/quic/core/frames/quic_application_close_frame.h
@@ -0,0 +1,29 @@ +// Copyright (c) 2016 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 NET_QUIC_CORE_FRAMES_QUIC_APPLICATION_CLOSE_FRAME_H_ +#define NET_QUIC_CORE_FRAMES_QUIC_APPLICATION_CLOSE_FRAME_H_ + +#include <ostream> + +#include "net/quic/core/quic_error_codes.h" +#include "net/quic/platform/api/quic_export.h" +#include "net/quic/platform/api/quic_string.h" + +namespace net { + +struct QUIC_EXPORT_PRIVATE QuicApplicationCloseFrame { + QuicApplicationCloseFrame(); + + friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( + std::ostream& os, + const QuicApplicationCloseFrame& frame); + + QuicErrorCode error_code; + QuicString error_details; +}; + +} // namespace net + +#endif // NET_QUIC_CORE_FRAMES_QUIC_APPLICATION_CLOSE_FRAME_H_
diff --git a/net/quic/core/frames/quic_blocked_frame.cc b/net/quic/core/frames/quic_blocked_frame.cc index 2c4a250..2fbcbb3 100644 --- a/net/quic/core/frames/quic_blocked_frame.cc +++ b/net/quic/core/frames/quic_blocked_frame.cc
@@ -6,11 +6,18 @@ namespace net { -QuicBlockedFrame::QuicBlockedFrame() {} +QuicBlockedFrame::QuicBlockedFrame() : stream_id(0), offset(0) {} QuicBlockedFrame::QuicBlockedFrame(QuicControlFrameId control_frame_id, QuicStreamId stream_id) - : QuicControlFrame(control_frame_id), stream_id(stream_id) {} + : QuicControlFrame(control_frame_id), stream_id(stream_id), offset(0) {} + +QuicBlockedFrame::QuicBlockedFrame(QuicControlFrameId control_frame_id, + QuicStreamId stream_id, + QuicStreamOffset offset) + : QuicControlFrame(control_frame_id), + stream_id(stream_id), + offset(offset) {} std::ostream& operator<<(std::ostream& os, const QuicBlockedFrame& blocked_frame) {
diff --git a/net/quic/core/frames/quic_blocked_frame.h b/net/quic/core/frames/quic_blocked_frame.h index 37e6c23f..90fc52f 100644 --- a/net/quic/core/frames/quic_blocked_frame.h +++ b/net/quic/core/frames/quic_blocked_frame.h
@@ -18,6 +18,9 @@ struct QUIC_EXPORT_PRIVATE QuicBlockedFrame : public QuicControlFrame { QuicBlockedFrame(); QuicBlockedFrame(QuicControlFrameId control_frame_id, QuicStreamId stream_id); + QuicBlockedFrame(QuicControlFrameId control_frame_id, + QuicStreamId stream_id, + QuicStreamOffset offset); friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( std::ostream& os, @@ -25,7 +28,15 @@ // The stream this frame applies to. 0 is a special case meaning the overall // connection rather than a specific stream. + // + // For IETF QUIC, the stream_id controls whether an IETF QUIC + // BLOCKED or STREAM_BLOCKED frame is generated. + // If stream_id is 0 then a BLOCKED frame is generated and transmitted, + // if non-0, a STREAM_BLOCKED. QuicStreamId stream_id; + + // For Google QUIC, the offset is ignored. + QuicStreamOffset offset; }; } // namespace net
diff --git a/net/quic/core/frames/quic_frame.cc b/net/quic/core/frames/quic_frame.cc index 0a724ee..ddc1378 100644 --- a/net/quic/core/frames/quic_frame.cc +++ b/net/quic/core/frames/quic_frame.cc
@@ -45,6 +45,18 @@ QuicFrame::QuicFrame(QuicBlockedFrame* frame) : type(BLOCKED_FRAME), blocked_frame(frame) {} +QuicFrame::QuicFrame(QuicApplicationCloseFrame* frame) + : type(APPLICATION_CLOSE_FRAME), application_close_frame(frame) {} + +QuicFrame::QuicFrame(QuicNewConnectionIdFrame* frame) + : type(NEW_CONNECTION_ID_FRAME), new_connection_id_frame(frame) {} + +QuicFrame::QuicFrame(QuicMaxStreamIdFrame frame) + : type(MAX_STREAM_ID_FRAME), max_stream_id_frame(frame) {} + +QuicFrame::QuicFrame(QuicStreamIdBlockedFrame frame) + : type(STREAM_ID_BLOCKED_FRAME), stream_id_blocked_frame(frame) {} + void DeleteFrames(QuicFrames* frames) { for (QuicFrame& frame : *frames) { DeleteFrame(&frame); @@ -58,6 +70,8 @@ case PADDING_FRAME: case MTU_DISCOVERY_FRAME: case PING_FRAME: + case MAX_STREAM_ID_FRAME: + case STREAM_ID_BLOCKED_FRAME: break; case STREAM_FRAME: delete frame->stream_frame; @@ -83,6 +97,13 @@ case WINDOW_UPDATE_FRAME: delete frame->window_update_frame; break; + case APPLICATION_CLOSE_FRAME: + delete frame->application_close_frame; + break; + case NEW_CONNECTION_ID_FRAME: + delete frame->new_connection_id_frame; + break; + case NUM_FRAME_TYPES: DCHECK(false) << "Cannot delete type: " << frame->type; } @@ -106,6 +127,8 @@ case GOAWAY_FRAME: case WINDOW_UPDATE_FRAME: case BLOCKED_FRAME: + case STREAM_ID_BLOCKED_FRAME: + case MAX_STREAM_ID_FRAME: case PING_FRAME: return true; default: @@ -123,6 +146,10 @@ return frame.window_update_frame->control_frame_id; case BLOCKED_FRAME: return frame.blocked_frame->control_frame_id; + case STREAM_ID_BLOCKED_FRAME: + return frame.stream_id_blocked_frame.control_frame_id; + case MAX_STREAM_ID_FRAME: + return frame.max_stream_id_frame.control_frame_id; case PING_FRAME: return frame.ping_frame.control_frame_id; default: @@ -147,6 +174,12 @@ case PING_FRAME: frame->ping_frame.control_frame_id = control_frame_id; return; + case STREAM_ID_BLOCKED_FRAME: + frame->stream_id_blocked_frame.control_frame_id = control_frame_id; + return; + case MAX_STREAM_ID_FRAME: + frame->max_stream_id_frame.control_frame_id = control_frame_id; + return; default: QUIC_BUG << "Try to set control frame id of a frame without control frame id"; @@ -226,6 +259,18 @@ os << "type { MTU_DISCOVERY_FRAME } "; break; } + case APPLICATION_CLOSE_FRAME: + os << "type { APPLICATION_CLOSE } " << *(frame.connection_close_frame); + break; + case NEW_CONNECTION_ID_FRAME: + os << "type { NEW_CONNECTION_ID } " << *(frame.new_connection_id_frame); + break; + case MAX_STREAM_ID_FRAME: + os << "type { MAX_STREAM_ID } " << frame.max_stream_id_frame; + break; + case STREAM_ID_BLOCKED_FRAME: + os << "type { STREAM_ID_BLOCKED } " << frame.stream_id_blocked_frame; + break; default: { QUIC_LOG(ERROR) << "Unknown frame type: " << frame.type; break;
diff --git a/net/quic/core/frames/quic_frame.h b/net/quic/core/frames/quic_frame.h index 244fe3f..c27ee43 100644 --- a/net/quic/core/frames/quic_frame.h +++ b/net/quic/core/frames/quic_frame.h
@@ -9,13 +9,13 @@ #include <vector> #include "net/quic/core/frames/quic_ack_frame.h" +#include "net/quic/core/frames/quic_application_close_frame.h" #include "net/quic/core/frames/quic_blocked_frame.h" #include "net/quic/core/frames/quic_connection_close_frame.h" #include "net/quic/core/frames/quic_goaway_frame.h" -#include "net/quic/core/frames/quic_ietf_blocked_frame.h" -#include "net/quic/core/frames/quic_ietf_max_stream_id_frame.h" -#include "net/quic/core/frames/quic_ietf_stream_id_blocked_frame.h" +#include "net/quic/core/frames/quic_max_stream_id_frame.h" #include "net/quic/core/frames/quic_mtu_discovery_frame.h" +#include "net/quic/core/frames/quic_new_connection_id_frame.h" #include "net/quic/core/frames/quic_padding_frame.h" #include "net/quic/core/frames/quic_path_challenge_frame.h" #include "net/quic/core/frames/quic_path_response_frame.h" @@ -24,6 +24,7 @@ #include "net/quic/core/frames/quic_stop_sending_frame.h" #include "net/quic/core/frames/quic_stop_waiting_frame.h" #include "net/quic/core/frames/quic_stream_frame.h" +#include "net/quic/core/frames/quic_stream_id_blocked_frame.h" #include "net/quic/core/frames/quic_window_update_frame.h" #include "net/quic/core/quic_types.h" #include "net/quic/platform/api/quic_export.h" @@ -44,6 +45,10 @@ explicit QuicFrame(QuicGoAwayFrame* frame); explicit QuicFrame(QuicWindowUpdateFrame* frame); explicit QuicFrame(QuicBlockedFrame* frame); + explicit QuicFrame(QuicApplicationCloseFrame* frame); + explicit QuicFrame(QuicNewConnectionIdFrame* frame); + explicit QuicFrame(QuicMaxStreamIdFrame frame); + explicit QuicFrame(QuicStreamIdBlockedFrame frame); QUIC_EXPORT_PRIVATE friend std::ostream& operator<<(std::ostream& os, const QuicFrame& frame); @@ -54,6 +59,8 @@ QuicPaddingFrame padding_frame; QuicMtuDiscoveryFrame mtu_discovery_frame; QuicPingFrame ping_frame; + QuicMaxStreamIdFrame max_stream_id_frame; + QuicStreamIdBlockedFrame stream_id_blocked_frame; // Frames larger than a pointer. QuicStreamFrame* stream_frame; @@ -64,6 +71,8 @@ QuicGoAwayFrame* goaway_frame; QuicWindowUpdateFrame* window_update_frame; QuicBlockedFrame* blocked_frame; + QuicApplicationCloseFrame* application_close_frame; + QuicNewConnectionIdFrame* new_connection_id_frame; }; }; // QuicFrameType consumes 8 bytes with padding.
diff --git a/net/quic/core/frames/quic_ietf_max_stream_id_frame.cc b/net/quic/core/frames/quic_ietf_max_stream_id_frame.cc deleted file mode 100644 index bd7ef723..0000000 --- a/net/quic/core/frames/quic_ietf_max_stream_id_frame.cc +++ /dev/null
@@ -1,23 +0,0 @@ -// Copyright (c) 2016 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 "net/quic/core/frames/quic_ietf_max_stream_id_frame.h" - -namespace net { - -QuicIetfMaxStreamIdFrame::QuicIetfMaxStreamIdFrame() {} - -QuicIetfMaxStreamIdFrame::QuicIetfMaxStreamIdFrame( - QuicControlFrameId control_frame_id, - QuicStreamId max_stream_id) - : QuicControlFrame(control_frame_id), max_stream_id(max_stream_id) {} - -std::ostream& operator<<(std::ostream& os, - const QuicIetfMaxStreamIdFrame& frame) { - os << "{ control_frame_id: " << frame.control_frame_id - << ", stream_id: " << frame.max_stream_id << " }\n"; - return os; -} - -} // namespace net
diff --git a/net/quic/core/frames/quic_ietf_max_stream_id_frame.h b/net/quic/core/frames/quic_ietf_max_stream_id_frame.h deleted file mode 100644 index bfb1a97..0000000 --- a/net/quic/core/frames/quic_ietf_max_stream_id_frame.h +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright (c) 2016 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 NET_QUIC_CORE_FRAMES_QUIC_IETF_MAX_STREAM_ID_FRAME_H_ -#define NET_QUIC_CORE_FRAMES_QUIC_IETF_MAX_STREAM_ID_FRAME_H_ - -#include <ostream> - -#include "net/quic/core/frames/quic_control_frame.h" - -namespace net { - -// IETF format max-stream id frame. -// This frame is used by the sender to inform the peer of the largest -// stream id that the peer may open and that the sender will accept. -struct QUIC_EXPORT_PRIVATE QuicIetfMaxStreamIdFrame : public QuicControlFrame { - QuicIetfMaxStreamIdFrame(); - QuicIetfMaxStreamIdFrame(QuicControlFrameId control_frame_id, - QuicStreamId max_stream_id); - - friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( - std::ostream& os, - const QuicIetfMaxStreamIdFrame& frame); - - // The maximum stream id to support. - QuicStreamId max_stream_id; -}; - -} // namespace net - -#endif // NET_QUIC_CORE_FRAMES_QUIC_IETF_MAX_STREAM_ID_FRAME_H_
diff --git a/net/quic/core/frames/quic_ietf_stream_id_blocked_frame.h b/net/quic/core/frames/quic_ietf_stream_id_blocked_frame.h deleted file mode 100644 index 91ad6f0..0000000 --- a/net/quic/core/frames/quic_ietf_stream_id_blocked_frame.h +++ /dev/null
@@ -1,33 +0,0 @@ -// Copyright (c) 2016 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 NET_QUIC_CORE_FRAMES_QUIC_IETF_STREAM_ID_BLOCKED_FRAME_H_ -#define NET_QUIC_CORE_FRAMES_QUIC_IETF_STREAM_ID_BLOCKED_FRAME_H_ - -#include <ostream> - -#include "net/quic/core/frames/quic_control_frame.h" - -namespace net { - -// IETF format STREAM ID BLOCKED frame. -// The sender uses this to inform the peer that the sender wished to -// open a new stream but was blocked from doing so due due to the -// maximum stream ID limit set by the peer (via a MAX_STREAM_ID frame) -struct QUIC_EXPORT_PRIVATE QuicIetfStreamIdBlockedFrame - : public QuicControlFrame { - QuicIetfStreamIdBlockedFrame(); - QuicIetfStreamIdBlockedFrame(QuicControlFrameId control_frame_id, - QuicStreamId stream_id); - - friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( - std::ostream& os, - const QuicIetfStreamIdBlockedFrame& frame); - - QuicStreamId stream_id; -}; - -} // namespace net - -#endif // NET_QUIC_CORE_FRAMES_QUIC_IETF_STREAM_ID_BLOCKED_FRAME_H_
diff --git a/net/quic/core/frames/quic_max_stream_id_frame.cc b/net/quic/core/frames/quic_max_stream_id_frame.cc new file mode 100644 index 0000000..49dca84 --- /dev/null +++ b/net/quic/core/frames/quic_max_stream_id_frame.cc
@@ -0,0 +1,21 @@ +// Copyright (c) 2016 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 "net/quic/core/frames/quic_max_stream_id_frame.h" + +namespace net { + +QuicMaxStreamIdFrame::QuicMaxStreamIdFrame() {} + +QuicMaxStreamIdFrame::QuicMaxStreamIdFrame(QuicControlFrameId control_frame_id, + QuicStreamId max_stream_id) + : QuicControlFrame(control_frame_id), max_stream_id(max_stream_id) {} + +std::ostream& operator<<(std::ostream& os, const QuicMaxStreamIdFrame& frame) { + os << "{ control_frame_id: " << frame.control_frame_id + << ", stream_id: " << frame.max_stream_id << " }\n"; + return os; +} + +} // namespace net
diff --git a/net/quic/core/frames/quic_max_stream_id_frame.h b/net/quic/core/frames/quic_max_stream_id_frame.h new file mode 100644 index 0000000..990cbad --- /dev/null +++ b/net/quic/core/frames/quic_max_stream_id_frame.h
@@ -0,0 +1,32 @@ +// Copyright (c) 2016 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 NET_QUIC_CORE_FRAMES_QUIC_MAX_STREAM_ID_FRAME_H_ +#define NET_QUIC_CORE_FRAMES_QUIC_MAX_STREAM_ID_FRAME_H_ + +#include <ostream> + +#include "net/quic/core/frames/quic_control_frame.h" + +namespace net { + +// IETF format MAX_STREAM_ID frame. +// This frame is used by the sender to inform the peer of the largest +// stream id that the peer may open and that the sender will accept. +struct QUIC_EXPORT_PRIVATE QuicMaxStreamIdFrame : public QuicControlFrame { + QuicMaxStreamIdFrame(); + QuicMaxStreamIdFrame(QuicControlFrameId control_frame_id, + QuicStreamId max_stream_id); + + friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( + std::ostream& os, + const QuicMaxStreamIdFrame& frame); + + // The maximum stream id to support. + QuicStreamId max_stream_id; +}; + +} // namespace net + +#endif // NET_QUIC_CORE_FRAMES_QUIC_MAX_STREAM_ID_FRAME_H_
diff --git a/net/quic/core/frames/quic_new_connection_id_frame.cc b/net/quic/core/frames/quic_new_connection_id_frame.cc new file mode 100644 index 0000000..00834cbd --- /dev/null +++ b/net/quic/core/frames/quic_new_connection_id_frame.cc
@@ -0,0 +1,30 @@ +// Copyright (c) 2016 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 "net/quic/core/frames/quic_new_connection_id_frame.h" + +namespace net { + +QuicNewConnectionIdFrame::QuicNewConnectionIdFrame() + : QuicControlFrame(0), connection_id(0), sequence_number(0) {} + +QuicNewConnectionIdFrame::QuicNewConnectionIdFrame( + QuicControlFrameId control_frame_id, + QuicConnectionId connection_id, + QuicConnectionIdSequenceNumber sequence_number, + const QuicUint128 stateless_reset_token) + : QuicControlFrame(control_frame_id), + connection_id(connection_id), + sequence_number(sequence_number), + stateless_reset_token(stateless_reset_token) {} + +std::ostream& operator<<(std::ostream& os, + const QuicNewConnectionIdFrame& frame) { + os << "{ control_frame_id: " << frame.control_frame_id + << ", connection_id: " << frame.connection_id + << ", sequence_number: " << frame.sequence_number << " }\n"; + return os; +} + +} // namespace net
diff --git a/net/quic/core/frames/quic_new_connection_id_frame.h b/net/quic/core/frames/quic_new_connection_id_frame.h new file mode 100644 index 0000000..1ec02f34 --- /dev/null +++ b/net/quic/core/frames/quic_new_connection_id_frame.h
@@ -0,0 +1,34 @@ +// Copyright (c) 2016 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 NET_QUIC_CORE_FRAMES_QUIC_NEW_CONNECTION_ID_FRAME_H_ +#define NET_QUIC_CORE_FRAMES_QUIC_NEW_CONNECTION_ID_FRAME_H_ + +#include <ostream> + +#include "net/quic/core/frames/quic_control_frame.h" +#include "net/quic/core/quic_error_codes.h" +#include "net/quic/platform/api/quic_uint128.h" + +namespace net { + +struct QUIC_EXPORT_PRIVATE QuicNewConnectionIdFrame : public QuicControlFrame { + QuicNewConnectionIdFrame(); + QuicNewConnectionIdFrame(QuicControlFrameId control_frame_id, + QuicConnectionId connection_id, + QuicConnectionIdSequenceNumber sequence_number, + const QuicUint128 stateless_reset_token); + + friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( + std::ostream& os, + const QuicNewConnectionIdFrame& frame); + + QuicConnectionId connection_id; + QuicConnectionIdSequenceNumber sequence_number; + QuicUint128 stateless_reset_token; +}; + +} // namespace net + +#endif // NET_QUIC_CORE_FRAMES_QUIC_NEW_CONNECTION_ID_FRAME_H_
diff --git a/net/quic/core/frames/quic_ietf_stream_id_blocked_frame.cc b/net/quic/core/frames/quic_stream_id_blocked_frame.cc similarity index 66% rename from net/quic/core/frames/quic_ietf_stream_id_blocked_frame.cc rename to net/quic/core/frames/quic_stream_id_blocked_frame.cc index 7cbc06e..ffbb236 100644 --- a/net/quic/core/frames/quic_ietf_stream_id_blocked_frame.cc +++ b/net/quic/core/frames/quic_stream_id_blocked_frame.cc
@@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "net/quic/core/frames/quic_ietf_stream_id_blocked_frame.h" +#include "net/quic/core/frames/quic_stream_id_blocked_frame.h" namespace net { -QuicIetfStreamIdBlockedFrame::QuicIetfStreamIdBlockedFrame() {} +QuicStreamIdBlockedFrame::QuicStreamIdBlockedFrame() {} -QuicIetfStreamIdBlockedFrame::QuicIetfStreamIdBlockedFrame( +QuicStreamIdBlockedFrame::QuicStreamIdBlockedFrame( QuicControlFrameId control_frame_id, QuicStreamId stream_id) : QuicControlFrame(control_frame_id), stream_id(stream_id) {} std::ostream& operator<<(std::ostream& os, - const QuicIetfStreamIdBlockedFrame& frame) { + const QuicStreamIdBlockedFrame& frame) { os << "{ control_frame_id: " << frame.control_frame_id << ", stream id: " << frame.stream_id << " }\n"; return os;
diff --git a/net/quic/core/frames/quic_stream_id_blocked_frame.h b/net/quic/core/frames/quic_stream_id_blocked_frame.h new file mode 100644 index 0000000..d4efff0 --- /dev/null +++ b/net/quic/core/frames/quic_stream_id_blocked_frame.h
@@ -0,0 +1,32 @@ +// Copyright (c) 2016 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 NET_QUIC_CORE_FRAMES_QUIC_STREAM_ID_BLOCKED_FRAME_H_ +#define NET_QUIC_CORE_FRAMES_QUIC_STREAM_ID_BLOCKED_FRAME_H_ + +#include <ostream> + +#include "net/quic/core/frames/quic_control_frame.h" + +namespace net { + +// IETF format STREAM_ID_BLOCKED frame. +// The sender uses this to inform the peer that the sender wished to +// open a new stream but was blocked from doing so due due to the +// maximum stream ID limit set by the peer (via a MAX_STREAM_ID frame) +struct QUIC_EXPORT_PRIVATE QuicStreamIdBlockedFrame : public QuicControlFrame { + QuicStreamIdBlockedFrame(); + QuicStreamIdBlockedFrame(QuicControlFrameId control_frame_id, + QuicStreamId stream_id); + + friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( + std::ostream& os, + const QuicStreamIdBlockedFrame& frame); + + QuicStreamId stream_id; +}; + +} // namespace net + +#endif // NET_QUIC_CORE_FRAMES_QUIC_STREAM_ID_BLOCKED_FRAME_H_
diff --git a/net/quic/core/quic_connection.cc b/net/quic/core/quic_connection.cc index c41d6bc5..b86d9cd 100644 --- a/net/quic/core/quic_connection.cc +++ b/net/quic/core/quic_connection.cc
@@ -248,7 +248,9 @@ last_ack_had_missing_packets_(false), num_packets_received_since_last_ack_sent_(0), stop_waiting_count_(0), - ack_mode_(TCP_ACKING), + ack_mode_(GetQuicReloadableFlag(quic_enable_ack_decimation) + ? ACK_DECIMATION + : TCP_ACKING), ack_decimation_delay_(kAckDecimationDelay), unlimited_ack_decimation_(false), delay_setting_retransmission_alarm_(false), @@ -322,7 +324,10 @@ quic_handle_write_results_for_connectivity_probe)), use_path_degrading_alarm_( GetQuicReloadableFlag(quic_path_degrading_alarm2)), - enable_server_proxy_(GetQuicReloadableFlag(quic_enable_server_proxy)) { + enable_server_proxy_(GetQuicReloadableFlag(quic_enable_server_proxy2)) { + if (ack_mode_ == ACK_DECIMATION) { + QUIC_FLAG_COUNT(quic_reloadable_flag_quic_enable_ack_decimation); + } QUIC_DLOG(INFO) << ENDPOINT << "Created connection with connection_id: " << connection_id << " and version: " @@ -390,17 +395,23 @@ if (debug_visitor_ != nullptr) { debug_visitor_->OnSetFromConfig(config); } + if (GetQuicReloadableFlag(quic_enable_ack_decimation) && + config.HasClientSentConnectionOption(kACD0, perspective_)) { + ack_mode_ = TCP_ACKING; + } if (config.HasClientSentConnectionOption(kACKD, perspective_)) { ack_mode_ = ACK_DECIMATION; } - if (config.HasClientSentConnectionOption(kAKD2, perspective_)) { + if (!GetQuicReloadableFlag(quic_enable_ack_decimation) && + config.HasClientSentConnectionOption(kAKD2, perspective_)) { ack_mode_ = ACK_DECIMATION_WITH_REORDERING; } if (config.HasClientSentConnectionOption(kAKD3, perspective_)) { ack_mode_ = ACK_DECIMATION; ack_decimation_delay_ = kShortAckDecimationDelay; } - if (config.HasClientSentConnectionOption(kAKD4, perspective_)) { + if (!GetQuicReloadableFlag(quic_enable_ack_decimation) && + config.HasClientSentConnectionOption(kAKD4, perspective_)) { ack_mode_ = ACK_DECIMATION_WITH_REORDERING; ack_decimation_delay_ = kShortAckDecimationDelay; } @@ -553,13 +564,8 @@ DCHECK(false); } - const bool set_version_early = - GetQuicReloadableFlag(quic_store_version_before_signalling); - if (set_version_early) { - QUIC_FLAG_COUNT(quic_reloadable_flag_quic_store_version_before_signalling); - // Store the new version. - framer_.set_version(received_version); - } + // Store the new version. + framer_.set_version(received_version); version_negotiation_state_ = NEGOTIATED_VERSION; visitor_->OnSuccessfulVersionNegotiation(received_version); @@ -569,11 +575,6 @@ QUIC_DLOG(INFO) << ENDPOINT << "version negotiated " << ParsedQuicVersionToString(received_version); - if (!set_version_early) { - // Store the new version. - framer_.set_version(received_version); - } - MaybeEnableSessionDecidesWhatToWrite(); // TODO(satyamshekhar): Store the packet number of this packet and close the @@ -806,14 +807,12 @@ << GetEffectivePeerAddressFromCurrentPacket().ToString() << ", active_effective_peer_migration_type is " << active_effective_peer_migration_type_; - if (active_effective_peer_migration_type_ == NO_CHANGE) { - // Only migrate connection to a new effective peer address if there - // is no pending change underway. Cache the current migration change - // type, which will start effective peer migration immediately if - // this packet is not a connectivity probing packet. - current_effective_peer_migration_type_ = - effective_peer_migration_type; - } + // Migrate connection to a new effective peer address even if there is + // a pending change underway. Cache the current migration change type, + // which will start effective peer migration immediately if this + // packet is not a connectivity probing packet. + current_effective_peer_migration_type_ = + effective_peer_migration_type; } } } @@ -1281,7 +1280,7 @@ CloseIfTooManyOutstandingSentPackets(); } -bool QuicConnection::IsValidStatelessResetToken(uint128 token) const { +bool QuicConnection::IsValidStatelessResetToken(QuicUint128 token) const { return stateless_reset_token_received_ && token == received_stateless_reset_token_; } @@ -1346,6 +1345,7 @@ // If there are new missing packets to report, send an ack immediately. if (received_packet_manager_.HasNewMissingPackets()) { if (ack_mode_ == ACK_DECIMATION_WITH_REORDERING) { + DCHECK(!GetQuicReloadableFlag(quic_enable_ack_decimation)); // Wait the minimum of an eighth min_rtt and the existing ack time. QuicTime ack_time = clock_->ApproximateNow() + @@ -1563,7 +1563,7 @@ } if (!effective_peer_address_.IsInitialized()) { - QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_enable_server_proxy, 1, 3); + QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_enable_server_proxy2, 1, 3); const QuicSocketAddress effective_peer_addr = GetEffectivePeerAddressFromCurrentPacket(); @@ -1674,6 +1674,7 @@ } if (GetQuicReloadableFlag(quic_unified_send_alarm)) { + QUIC_FLAG_COUNT(quic_reloadable_flag_quic_unified_send_alarm); // After the visitor writes, it may have caused the socket to become write // blocked or the congestion manager to prohibit sending, so check again. if (visitor_->WillingAndAbleToWrite() && !send_alarm_->IsSet() && @@ -1842,42 +1843,30 @@ UMA_HISTOGRAM_COUNTS_1000("Net.QuicSession.NumQueuedPacketsBeforeWrite", queued_packets_.size()); - if (GetQuicReloadableFlag(quic_fix_write_out_of_order_queued_packet_crash)) { - while (!queued_packets_.empty()) { - QUIC_FLAG_COUNT( - quic_reloadable_flag_quic_fix_write_out_of_order_queued_packet_crash); - // WritePacket() can potentially clear all queued packets, so we need to - // save the first queued packet to a local variable before calling it. - SerializedPacket packet(std::move(queued_packets_.front())); - queued_packets_.pop_front(); + while (!queued_packets_.empty()) { + // WritePacket() can potentially clear all queued packets, so we need to + // save the first queued packet to a local variable before calling it. + SerializedPacket packet(std::move(queued_packets_.front())); + queued_packets_.pop_front(); - const bool write_result = WritePacket(&packet); + const bool write_result = WritePacket(&packet); - if (connected_ && !write_result) { - // Write failed but connection is open, re-insert |packet| into the - // front of the queue, it will be retried later. - queued_packets_.emplace_front(std::move(packet)); - break; - } - - delete[] packet.encrypted_buffer; - ClearSerializedPacket(&packet); - if (!connected_) { - DCHECK(queued_packets_.empty()) << "Queued packets should have been " - "cleared while closing connection"; - break; - } - - // Continue to send the next packet in queue. + if (connected_ && !write_result) { + // Write failed but connection is open, re-insert |packet| into the + // front of the queue, it will be retried later. + queued_packets_.emplace_front(std::move(packet)); + break; } - } else { - QueuedPacketList::iterator packet_iterator = queued_packets_.begin(); - while (packet_iterator != queued_packets_.end() && - WritePacket(&(*packet_iterator))) { - delete[] packet_iterator->encrypted_buffer; - ClearSerializedPacket(&(*packet_iterator)); - packet_iterator = queued_packets_.erase(packet_iterator); + + delete[] packet.encrypted_buffer; + ClearSerializedPacket(&packet); + if (!connected_) { + DCHECK(queued_packets_.empty()) << "Queued packets should have been " + "cleared while closing connection"; + break; } + + // Continue to send the next packet in queue. } } @@ -2900,8 +2889,7 @@ return true; } - if (GetQuicReloadableFlag(quic_fix_write_out_of_order_queued_packet_crash) && - GetQuicReloadableFlag( + if (GetQuicReloadableFlag( quic_clear_queued_packets_before_sending_connectivity_probing)) { QUIC_FLAG_COUNT( quic_reloadable_flag_quic_clear_queued_packets_before_sending_connectivity_probing); // NOLINT @@ -3027,7 +3015,7 @@ void QuicConnection::OnEffectivePeerMigrationValidated() { DCHECK(enable_server_proxy_); - QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_enable_server_proxy, 3, 3); + QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_enable_server_proxy2, 3, 3); if (active_effective_peer_migration_type_ == NO_CHANGE) { QUIC_BUG << "No migration underway."; return; @@ -3042,17 +3030,18 @@ // most recent migration is the one that we should pay attention to. void QuicConnection::StartEffectivePeerMigration(AddressChangeType type) { DCHECK(enable_server_proxy_); - QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_enable_server_proxy, 2, 3); + QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_enable_server_proxy2, 2, 3); // TODO(fayang): Currently, all peer address change type are allowed. Need to // add a method ShouldAllowPeerAddressChange(PeerAddressChangeType type) to // determine whether |type| is allowed. - if (active_effective_peer_migration_type_ != NO_CHANGE || type == NO_CHANGE) { - QUIC_BUG << "Migration underway or no new migration started."; + if (type == NO_CHANGE) { + QUIC_BUG << "EffectivePeerMigration started without address change."; return; } QUIC_DLOG(INFO) << ENDPOINT << "Effective peer's ip:port changed from " << effective_peer_address_.ToString() << " to " << GetEffectivePeerAddressFromCurrentPacket().ToString() + << ", address change type is " << type << ", migrating connection."; highest_packet_sent_before_effective_peer_migration_ =
diff --git a/net/quic/core/quic_connection.h b/net/quic/core/quic_connection.h index b876f99..b670be5 100644 --- a/net/quic/core/quic_connection.h +++ b/net/quic/core/quic_connection.h
@@ -474,7 +474,7 @@ bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override; bool OnBlockedFrame(const QuicBlockedFrame& frame) override; void OnPacketComplete() override; - bool IsValidStatelessResetToken(uint128 token) const override; + bool IsValidStatelessResetToken(QuicUint128 token) const override; void OnAuthenticatedIetfStatelessResetPacket( const QuicIetfStatelessResetPacket& packet) override; @@ -1009,7 +1009,7 @@ // Caches the current peer migration type if a peer migration might be // initiated. As soon as the current packet is confirmed not a connectivity // probe, peer migration will start. - // TODO(wub): Remove once quic_reloadable_flag_quic_enable_server_proxy is + // TODO(wub): Remove once quic_reloadable_flag_quic_enable_server_proxy2 is // deprecated. AddressChangeType current_peer_migration_type_; // Caches the current effective peer migration type if a effective peer @@ -1044,12 +1044,12 @@ // Records change type when the peer initiates migration to a new peer // address. Reset to NO_CHANGE after peer migration is validated. - // TODO(wub): Remove once quic_reloadable_flag_quic_enable_server_proxy is + // TODO(wub): Remove once quic_reloadable_flag_quic_enable_server_proxy2 is // deprecated. AddressChangeType active_peer_migration_type_; // Records highest sent packet number when peer migration is started. - // TODO(wub): Remove once quic_reloadable_flag_quic_enable_server_proxy is + // TODO(wub): Remove once quic_reloadable_flag_quic_enable_server_proxy2 is // deprecated. QuicPacketNumber highest_packet_sent_before_peer_migration_; @@ -1301,7 +1301,7 @@ bool stateless_reset_token_received_; // Stores received stateless reset token from peer. Used to verify whether a // packet is a stateless reset packet. - uint128 received_stateless_reset_token_; + QuicUint128 received_stateless_reset_token_; // Id of latest sent control frame. 0 if no control frame has been sent. QuicControlFrameId last_control_frame_id_; @@ -1324,7 +1324,7 @@ // quic_reloadable_flag_quic_path_degrading_alarm2. const bool use_path_degrading_alarm_; - // Latched value of quic_reloadable_flag_quic_enable_server_proxy. + // Latched value of quic_reloadable_flag_quic_enable_server_proxy2. const bool enable_server_proxy_; DISALLOW_COPY_AND_ASSIGN(QuicConnection);
diff --git a/net/quic/core/quic_connection_test.cc b/net/quic/core/quic_connection_test.cc index 3d860a95..39fed05 100644 --- a/net/quic/core/quic_connection_test.cc +++ b/net/quic/core/quic_connection_test.cc
@@ -74,7 +74,7 @@ const int kDefaultRetransmissionTimeMs = 500; -const uint128 kTestStatelessResetToken = 1010101; // 0x0F69B5 +const QuicUint128 kTestStatelessResetToken = 1010101; // 0x0F69B5 const QuicSocketAddress kPeerAddress = QuicSocketAddress(QuicIpAddress::Loopback6(), @@ -686,6 +686,7 @@ next_effective_peer_addr_ = QuicMakeUnique<QuicSocketAddress>(addr); } + using QuicConnection::active_effective_peer_migration_type; using QuicConnection::IsCurrentPacketConnectivityProbing; using QuicConnection::SelectMutualVersion; using QuicConnection::SendProbingRetransmissions; @@ -791,6 +792,7 @@ use_path_degrading_alarm_( GetQuicReloadableFlag(quic_path_degrading_alarm2)) { SetQuicFlag(&FLAGS_quic_supports_tls_handshake, true); + SetQuicReloadableFlag(quic_respect_ietf_header, true); connection_.set_defer_send_in_response_to_packets(GetParam().ack_response == AckResponse::kDefer); QuicConnectionPeer::SetNoStopWaitingFrames(&connection_, @@ -1298,7 +1300,7 @@ EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); set_perspective(Perspective::IS_SERVER); QuicPacketCreatorPeer::SetSendVersionInPacket(creator_, false); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { // Clear direct_peer_address. QuicConnectionPeer::SetDirectPeerAddress(&connection_, QuicSocketAddress()); // Clear effective_peer_address, it is the same as direct_peer_address for @@ -1319,7 +1321,7 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kNewPeerAddress); EXPECT_EQ(kNewPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kNewPeerAddress, connection_.effective_peer_address()); } @@ -1330,7 +1332,7 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kPeerAddress); EXPECT_EQ(kNewPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kNewPeerAddress, connection_.effective_peer_address()); } } @@ -1341,7 +1343,7 @@ QuicPacketCreatorPeer::SetSendVersionInPacket(creator_, false); EXPECT_EQ(Perspective::IS_SERVER, connection_.perspective()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { // Clear direct_peer_address. QuicConnectionPeer::SetDirectPeerAddress(&connection_, QuicSocketAddress()); // Clear effective_peer_address, it is the same as direct_peer_address for @@ -1360,7 +1362,7 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kPeerAddress); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } @@ -1372,13 +1374,13 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kNewPeerAddress); EXPECT_EQ(kNewPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kNewPeerAddress, connection_.effective_peer_address()); } } TEST_P(QuicConnectionTest, EffectivePeerAddressChangeAtServer) { - if (!GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (!GetQuicReloadableFlag(quic_enable_server_proxy2)) { return; } @@ -1421,9 +1423,9 @@ QuicSocketAddress(QuicIpAddress::Loopback6(), /*port=*/23456); connection_.ReturnEffectivePeerAddressForNextPacket(kNewEffectivePeerAddress); EXPECT_CALL(visitor_, OnConnectionMigration(PORT_CHANGE)).Times(0); - // ack_frame is used to complete the migration started by the last packet, it - // is required to complete the last migration such that the next migration can - // start. + // ack_frame is used to complete the migration started by the last packet, we + // need to make sure a new migration does not start after the previous one is + // completed. QuicAckFrame ack_frame = InitAckFrame(1); EXPECT_CALL(*send_algorithm_, OnCongestionEvent(_, _, _, _, _)); ProcessFramePacketWithAddresses(QuicFrame(&ack_frame), kSelfAddress, @@ -1433,17 +1435,34 @@ // Process another packet with different direct peer address and different // effective peer address on server side will start connection migration. - const QuicSocketAddress kFinalEffectivePeerAddress = + const QuicSocketAddress kNewerEffectivePeerAddress = QuicSocketAddress(QuicIpAddress::Loopback6(), /*port=*/65432); const QuicSocketAddress kFinalPeerAddress = QuicSocketAddress(QuicIpAddress::Loopback6(), /*port=*/34567); connection_.ReturnEffectivePeerAddressForNextPacket( - kFinalEffectivePeerAddress); + kNewerEffectivePeerAddress); EXPECT_CALL(visitor_, OnConnectionMigration(PORT_CHANGE)).Times(1); ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kFinalPeerAddress); EXPECT_EQ(kFinalPeerAddress, connection_.peer_address()); - EXPECT_EQ(kFinalEffectivePeerAddress, connection_.effective_peer_address()); + EXPECT_EQ(kNewerEffectivePeerAddress, connection_.effective_peer_address()); + EXPECT_EQ(PORT_CHANGE, connection_.active_effective_peer_migration_type()); + + // While the previous migration is ongoing, process another packet with the + // same direct peer address and different effective peer address on server + // side will start a new connection migration. + const QuicSocketAddress kNewestEffectivePeerAddress = + QuicSocketAddress(QuicIpAddress::Loopback4(), /*port=*/65430); + connection_.ReturnEffectivePeerAddressForNextPacket( + kNewestEffectivePeerAddress); + EXPECT_CALL(visitor_, OnConnectionMigration(IPV6_TO_IPV4_CHANGE)).Times(1); + EXPECT_CALL(*send_algorithm_, OnConnectionMigration()).Times(1); + ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, + kFinalPeerAddress); + EXPECT_EQ(kFinalPeerAddress, connection_.peer_address()); + EXPECT_EQ(kNewestEffectivePeerAddress, connection_.effective_peer_address()); + EXPECT_EQ(IPV6_TO_IPV4_CHANGE, + connection_.active_effective_peer_migration_type()); } TEST_P(QuicConnectionTest, ReceivePaddedPingAtServer) { @@ -1452,7 +1471,7 @@ QuicPacketCreatorPeer::SetSendVersionInPacket(creator_, false); EXPECT_EQ(Perspective::IS_SERVER, connection_.perspective()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { // Clear direct_peer_address. QuicConnectionPeer::SetDirectPeerAddress(&connection_, QuicSocketAddress()); // Clear effective_peer_address, it is the same as direct_peer_address for @@ -1471,7 +1490,7 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kPeerAddress); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } @@ -1492,15 +1511,12 @@ EXPECT_FALSE(connection_.IsCurrentPacketConnectivityProbing()); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } } TEST_P(QuicConnectionTest, WriteOutOfOrderQueuedPackets) { - // When the flag is false, this test will trigger a use-after-free, which - // often means crashes, but not always, i.e. it can't be reliably tested. - SetQuicReloadableFlag(quic_fix_write_out_of_order_queued_packet_crash, true); set_perspective(Perspective::IS_CLIENT); BlockOnNextWrite(); @@ -1531,9 +1547,6 @@ TEST_P(QuicConnectionTest, DiscardQueuedPacketsAfterConnectionClose) { // Regression test for b/74073386. - // When the flag is false, this test will trigger a use-after-free, which - // often means crashes, but not always, i.e. it can't be reliably tested. - SetQuicReloadableFlag(quic_fix_write_out_of_order_queued_packet_crash, true); { InSequence seq; EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1); @@ -1568,7 +1581,7 @@ QuicPacketCreatorPeer::SetSendVersionInPacket(creator_, false); EXPECT_EQ(Perspective::IS_SERVER, connection_.perspective()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { // Clear direct_peer_address. QuicConnectionPeer::SetDirectPeerAddress(&connection_, QuicSocketAddress()); // Clear effective_peer_address, it is the same as direct_peer_address for @@ -1587,7 +1600,7 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kPeerAddress); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } @@ -1611,7 +1624,7 @@ EXPECT_TRUE(connection_.IsCurrentPacketConnectivityProbing()); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } @@ -1621,7 +1634,7 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kPeerAddress); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } } @@ -1632,7 +1645,7 @@ QuicPacketCreatorPeer::SetSendVersionInPacket(creator_, false); EXPECT_EQ(Perspective::IS_SERVER, connection_.perspective()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { // Clear direct_peer_address. QuicConnectionPeer::SetDirectPeerAddress(&connection_, QuicSocketAddress()); // Clear effective_peer_address, it is the same as direct_peer_address for @@ -1651,7 +1664,7 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kPeerAddress); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } @@ -1672,7 +1685,7 @@ clock_.Now())); ProcessReceivedPacket(kSelfAddress, kNewPeerAddress, *received); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } @@ -1683,7 +1696,7 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kNewPeerAddress); EXPECT_EQ(kNewPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kNewPeerAddress, connection_.effective_peer_address()); } } @@ -1693,7 +1706,7 @@ set_perspective(Perspective::IS_CLIENT); EXPECT_EQ(Perspective::IS_CLIENT, connection_.perspective()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { // Clear direct_peer_address. QuicConnectionPeer::SetDirectPeerAddress(&connection_, QuicSocketAddress()); // Clear effective_peer_address, it is the same as direct_peer_address for @@ -1712,7 +1725,7 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kPeerAddress); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } @@ -1732,7 +1745,7 @@ EXPECT_FALSE(connection_.IsCurrentPacketConnectivityProbing()); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } } @@ -1742,7 +1755,7 @@ set_perspective(Perspective::IS_CLIENT); EXPECT_EQ(Perspective::IS_CLIENT, connection_.perspective()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { // Clear direct_peer_address. QuicConnectionPeer::SetDirectPeerAddress(&connection_, QuicSocketAddress()); // Clear effective_peer_address, it is the same as direct_peer_address for @@ -1761,7 +1774,7 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kPeerAddress); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } @@ -1784,7 +1797,7 @@ EXPECT_TRUE(connection_.IsCurrentPacketConnectivityProbing()); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } } @@ -1794,7 +1807,7 @@ set_perspective(Perspective::IS_CLIENT); EXPECT_EQ(Perspective::IS_CLIENT, connection_.perspective()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { // Clear direct_peer_address. QuicConnectionPeer::SetDirectPeerAddress(&connection_, QuicSocketAddress()); // Clear effective_peer_address, it is the same as direct_peer_address for @@ -1813,7 +1826,7 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kPeerAddress); EXPECT_EQ(kPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kPeerAddress, connection_.effective_peer_address()); } @@ -1825,7 +1838,7 @@ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), kSelfAddress, kNewPeerAddress); EXPECT_EQ(kNewPeerAddress, connection_.peer_address()); - if (GetQuicReloadableFlag(quic_enable_server_proxy)) { + if (GetQuicReloadableFlag(quic_enable_server_proxy2)) { EXPECT_EQ(kNewPeerAddress, connection_.effective_peer_address()); } } @@ -4770,6 +4783,9 @@ } TEST_P(QuicConnectionTest, SendDelayedAckDecimationWithReordering) { + if (GetQuicReloadableFlag(quic_enable_ack_decimation)) { + return; + } EXPECT_CALL(visitor_, OnAckNeedsRetransmittableFrame()).Times(AnyNumber()); QuicConnectionPeer::SetAckMode( &connection_, QuicConnection::ACK_DECIMATION_WITH_REORDERING); @@ -4837,6 +4853,9 @@ } TEST_P(QuicConnectionTest, SendDelayedAckDecimationWithLargeReordering) { + if (GetQuicReloadableFlag(quic_enable_ack_decimation)) { + return; + } EXPECT_CALL(visitor_, OnAckNeedsRetransmittableFrame()).Times(AnyNumber()); QuicConnectionPeer::SetAckMode( &connection_, QuicConnection::ACK_DECIMATION_WITH_REORDERING); @@ -4921,6 +4940,9 @@ } TEST_P(QuicConnectionTest, SendDelayedAckDecimationWithReorderingEighthRtt) { + if (GetQuicReloadableFlag(quic_enable_ack_decimation)) { + return; + } EXPECT_CALL(visitor_, OnAckNeedsRetransmittableFrame()).Times(AnyNumber()); QuicConnectionPeer::SetAckMode( &connection_, QuicConnection::ACK_DECIMATION_WITH_REORDERING); @@ -4990,6 +5012,9 @@ TEST_P(QuicConnectionTest, SendDelayedAckDecimationWithLargeReorderingEighthRtt) { + if (GetQuicReloadableFlag(quic_enable_ack_decimation)) { + return; + } EXPECT_CALL(visitor_, OnAckNeedsRetransmittableFrame()).Times(AnyNumber()); QuicConnectionPeer::SetAckMode( &connection_, QuicConnection::ACK_DECIMATION_WITH_REORDERING); @@ -6726,8 +6751,8 @@ } TEST_P(QuicConnectionTest, ValidStatelessResetToken) { - const uint128 kTestToken = 1010101; - const uint128 kWrongTestToken = 1010100; + const QuicUint128 kTestToken = 1010101; + const QuicUint128 kWrongTestToken = 1010100; QuicConfig config; // No token has been received. EXPECT_FALSE(connection_.IsValidStatelessResetToken(kTestToken));
diff --git a/net/quic/core/quic_control_frame_manager.h b/net/quic/core/quic_control_frame_manager.h index 775e00c..a70ce0e6 100644 --- a/net/quic/core/quic_control_frame_manager.h +++ b/net/quic/core/quic_control_frame_manager.h
@@ -20,7 +20,8 @@ // Control frame manager contains a list of sent control frames with valid // control frame IDs. Control frames without valid control frame IDs include: // (1) non-retransmittable frames (e.g., ACK_FRAME, PADDING_FRAME, -// STOP_WAITING_FRAME, etc.), (2) CONNECTION_CLOSE frame. +// STOP_WAITING_FRAME, etc.), (2) CONNECTION_CLOSE and IETF Quic +// APPLICATION_CLOSE frames. // New control frames are added to the tail of the list when they are added to // the generator. Control frames are removed from the head of the list when they // get acked. Control frame manager also keeps track of lost control frames
diff --git a/net/quic/core/quic_crypto_client_stream_test.cc b/net/quic/core/quic_crypto_client_stream_test.cc index 5ee1997..7ef81c5 100644 --- a/net/quic/core/quic_crypto_client_stream_test.cc +++ b/net/quic/core/quic_crypto_client_stream_test.cc
@@ -42,6 +42,7 @@ server_id_(kServerHostname, kServerPort, PRIVACY_MODE_DISABLED), crypto_config_(crypto_test_utils::ProofVerifierForTesting(), TlsClientHandshaker::CreateSslCtx()) { + SetQuicReloadableFlag(quic_respect_ietf_header, true); CreateConnection(); } @@ -98,7 +99,6 @@ TEST_F(QuicCryptoClientStreamTest, ConnectedAfterTlsHandshake) { FLAGS_quic_supports_tls_handshake = true; - SetQuicReloadableFlag(delay_quic_server_handshaker_construction, true); supported_versions_.clear(); for (QuicTransportVersion transport_version : AllSupportedTransportVersions()) { @@ -391,6 +391,7 @@ server_compressed_certs_cache_( QuicCompressedCertsCache::kQuicCompressedCertsCacheSize), server_id_(kServerHostname, kServerPort, PRIVACY_MODE_DISABLED) { + SetQuicReloadableFlag(quic_respect_ietf_header, true); TestQuicSpdyClientSession* client_session = nullptr; CreateClientSessionForTest(server_id_, /* supports_stateless_rejects= */ true,
diff --git a/net/quic/core/quic_crypto_server_stream.cc b/net/quic/core/quic_crypto_server_stream.cc index c0d8fee..ec9b8b7 100644 --- a/net/quic/core/quic_crypto_server_stream.cc +++ b/net/quic/core/quic_crypto_server_stream.cc
@@ -57,28 +57,10 @@ use_stateless_rejects_if_peer_supported_( use_stateless_rejects_if_peer_supported), peer_supports_stateless_rejects_(false), - delay_handshaker_construction_( - GetQuicReloadableFlag(delay_quic_server_handshaker_construction)), crypto_config_(crypto_config), compressed_certs_cache_(compressed_certs_cache), helper_(helper) { DCHECK_EQ(Perspective::IS_SERVER, session->connection()->perspective()); - if (!delay_handshaker_construction_) { - switch (session->connection()->version().handshake_protocol) { - case PROTOCOL_QUIC_CRYPTO: - handshaker_ = QuicMakeUnique<QuicCryptoServerHandshaker>( - crypto_config_, this, compressed_certs_cache_, session, helper_); - break; - case PROTOCOL_TLS1_3: - handshaker_ = QuicMakeUnique<TlsServerHandshaker>( - this, session, crypto_config_->ssl_ctx(), - crypto_config_->proof_source()); - break; - case PROTOCOL_UNSUPPORTED: - QUIC_BUG << "Attempting to create QuicCryptoServerStream for unknown " - "handshake protocol"; - } - } } QuicCryptoServerStream::~QuicCryptoServerStream() {} @@ -170,15 +152,7 @@ void QuicCryptoServerStream::OnSuccessfulVersionNegotiation( const ParsedQuicVersion& version) { - // TODO(nharper): Uncomment this DCHECK once - // quic_reloadable_flag_quic_store_version_before_signalling has been flipped - // and removed. - // DCHECK_EQ(version, session()->connection()->version()); - if (!delay_handshaker_construction_) { - return; - } - QUIC_FLAG_COUNT( - quic_reloadable_flag_delay_quic_server_handshaker_construction); + DCHECK_EQ(version, session()->connection()->version()); CHECK(!handshaker_); switch (session()->connection()->version().handshake_protocol) { case PROTOCOL_QUIC_CRYPTO:
diff --git a/net/quic/core/quic_crypto_server_stream.h b/net/quic/core/quic_crypto_server_stream.h index e9f1cbf..98d7d34 100644 --- a/net/quic/core/quic_crypto_server_stream.h +++ b/net/quic/core/quic_crypto_server_stream.h
@@ -213,11 +213,6 @@ // becomes the default. bool peer_supports_stateless_rejects_; - // Signifies whether |handshaker_| should be constructed in the - // QuicCryptoServerStream constructor, or whether it should be delayed until - // OnSuccessfulVersionNegotiation is called. - bool delay_handshaker_construction_; - // Arguments from QuicCryptoServerStream constructor that might need to be // passed to the HandshakerDelegate constructor in its late construction. const QuicCryptoServerConfig* crypto_config_;
diff --git a/net/quic/core/quic_crypto_server_stream_test.cc b/net/quic/core/quic_crypto_server_stream_test.cc index 2d217d9..103b57b 100644 --- a/net/quic/core/quic_crypto_server_stream_test.cc +++ b/net/quic/core/quic_crypto_server_stream_test.cc
@@ -92,6 +92,7 @@ // Initializes the crypto server stream state for testing. May be // called multiple times. void InitializeServer() { + SetQuicReloadableFlag(quic_respect_ietf_header, true); TestQuicSpdyServerSession* server_session = nullptr; helpers_.push_back(QuicMakeUnique<NiceMock<MockQuicConnectionHelper>>()); alarm_factories_.push_back(QuicMakeUnique<MockAlarmFactory>());
diff --git a/net/quic/core/quic_flags_list.h b/net/quic/core/quic_flags_list.h index edc9ede..b7d23d32 100644 --- a/net/quic/core/quic_flags_list.h +++ b/net/quic/core/quic_flags_list.h
@@ -128,18 +128,6 @@ QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_disable_version_38, true) QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_disable_version_41, false) -// Delays construction of QuicCryptoServerStream::HandshakerDelegate -// until QuicCryptoServerStream::OnSuccessfulVersionNegotiation is called -QUIC_FLAG(bool, - FLAGS_quic_reloadable_flag_delay_quic_server_handshaker_construction, - true) -// Controls whether QuicConnection::OnProtocolVersionMismatch calls -// QuicFramer::set_version before or after calling -// OnSuccessfulVersionNegotiation. -QUIC_FLAG(bool, - FLAGS_quic_reloadable_flag_quic_store_version_before_signalling, - true) - // When true, enable connection options to have no min TLP and RTO, // and also allow IETF style TLP. QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_max_ack_delay2, false) @@ -154,23 +142,11 @@ FLAGS_quic_reloadable_flag_quic_use_incremental_ack_processing3, false) -// If true, Http2FrameDecoderAdapter will pass decoded HTTP/2 SETTINGS through -// the SpdyFramerVisitorInterface callback OnSetting(), which will also accept -// unknown SETTINGS IDs. -QUIC_FLAG(bool, FLAGS_quic_restart_flag_http2_propagate_unknown_settings, true) - // If true, enable fast path in QuicStream::OnStreamDataAcked. QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_fast_path_on_stream_data_acked, false) -// If true, fix a use-after-free bug caused by writing an out-of-order queued -// packet. -QUIC_FLAG( - bool, - FLAGS_quic_reloadable_flag_quic_fix_write_out_of_order_queued_packet_crash, - true) - // If true, QUIC streams are registered in the QuicStream constructor instead // of in the QuicSpdyStream constructor. QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_register_streams_early2, true) @@ -228,7 +204,7 @@ true) // If true, enable server proxy support in QUIC. -QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_enable_server_proxy, false) +QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_enable_server_proxy2, false) // If true, compare offset with last byte acked to determine whether it is // disjoint before calling IntervalSet::IsDisjoint. @@ -254,3 +230,27 @@ // If true, simplify pacing sender logic. QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_simplify_pacing_sender, false) + +// Number of packets that the pacing sender allows in bursts during pacing. +QUIC_FLAG(int32_t, FLAGS_quic_lumpy_pacing_size, 1) + +// Congestion window fraction that the pacing sender allows in bursts during +// pacing. +QUIC_FLAG(double, FLAGS_quic_lumpy_pacing_cwnd_fraction, 0.25f) + +// If true, respect IETF QUIC header format. +QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_respect_ietf_header, false) + +// If true, detect losses from last largest lost packet number. + +// If true, enable fast path in QuicStreamSendBuffer::FreeMemSlices. +QUIC_FLAG(bool, + FLAGS_quic_reloadable_flag_quic_incremental_loss_detection, + false); + +// If true, enable fast path in QuicStreamSendBuffer::FreeMemSlices. +QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_fast_free_mem_slice, false) + +// Default enables QUIC ack decimation and adds a connection option to disable +// it. +QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_enable_ack_decimation, false)
diff --git a/net/quic/core/quic_framer.cc b/net/quic/core/quic_framer.cc index 7a2dba9..f8dce9c5 100644 --- a/net/quic/core/quic_framer.cc +++ b/net/quic/core/quic_framer.cc
@@ -592,7 +592,7 @@ // static std::unique_ptr<QuicEncryptedPacket> QuicFramer::BuildIetfStatelessResetPacket( QuicConnectionId connection_id, - uint128 stateless_reset_token) { + QuicUint128 stateless_reset_token) { QUIC_DVLOG(1) << "Building IETF stateless reset packet."; size_t len = kPacketHeaderTypeSize + PACKET_8BYTE_CONNECTION_ID + sizeof(stateless_reset_token); @@ -705,11 +705,13 @@ last_packet_is_ietf_quic_ = false; if (perspective_ == Perspective::IS_CLIENT) { last_packet_is_ietf_quic_ = version_.transport_version == QUIC_VERSION_99; - } else if (!reader.IsDoneReading()) { + } else if (GetQuicReloadableFlag(quic_respect_ietf_header) && + !reader.IsDoneReading()) { uint8_t type = reader.PeekByte(); last_packet_is_ietf_quic_ = QuicUtils::IsIetfPacketHeader(type); } if (last_packet_is_ietf_quic_) { + QUIC_FLAG_COUNT(quic_reloadable_flag_quic_respect_ietf_header); QUIC_DVLOG(1) << ENDPOINT << "Processing IETF QUIC packet."; reader.set_endianness(NETWORK_BYTE_ORDER); } @@ -2494,6 +2496,14 @@ case PADDING_FRAME: DCHECK(false); return 0; + case APPLICATION_CLOSE_FRAME: + QUIC_FALLTHROUGH_INTENDED; + case NEW_CONNECTION_ID_FRAME: + QUIC_FALLTHROUGH_INTENDED; + case MAX_STREAM_ID_FRAME: + QUIC_FALLTHROUGH_INTENDED; + case STREAM_ID_BLOCKED_FRAME: + QUIC_FALLTHROUGH_INTENDED; case NUM_FRAME_TYPES: DCHECK(false); return 0; @@ -3354,31 +3364,6 @@ return true; } -// IETF-format Padding frames. -// Padding is just N bytes of 0x00. There is no varint62/etc -// encoding required. -bool QuicFramer::AppendIetfPaddingFrame(const QuicPaddingFrame& frame, - QuicDataWriter* writer) { - DCHECK_GT(version_.transport_version, QUIC_VERSION_37); - // The base AppendPaddingFrame assumes that the type byte has - // been written. It will actually write num_padding_bytes-1 - // bytes. This takes care of that issue. - if (!writer->WriteUInt8(0)) { - set_detailed_error("Can not write close frame type byte"); - return false; - } - return AppendPaddingFrame(frame, writer); -} - -// Read the padding. Has to do it one byte at a time, stopping -// when we either A) reach the end of the buffer or B) reach a -// non-0x00 byte. -void QuicFramer::ProcessIetfPaddingFrame(QuicDataReader* reader, - QuicPaddingFrame* frame) { - DCHECK_GT(version_.transport_version, QUIC_VERSION_37); - ProcessPaddingFrame(reader, frame); -} - // IETF Quic Path Challenge/Response frames. bool QuicFramer::ProcessIetfPathChallengeFrame(QuicDataReader* reader, QuicPathChallengeFrame* frame) { @@ -3570,30 +3555,29 @@ return true; } -bool QuicFramer::AppendIetfMaxStreamIdFrame( - const QuicIetfMaxStreamIdFrame& frame, - QuicDataWriter* writer) { +bool QuicFramer::AppendMaxStreamIdFrame(const QuicMaxStreamIdFrame& frame, + QuicDataWriter* writer) { if (!writer->WriteUInt8(IETF_MAX_STREAM_ID)) { - set_detailed_error("Can not write IETF_MAX_STREAM_ID frame type byte"); + set_detailed_error("Can not write MAX_STREAM_ID frame type byte"); return false; } if (!writer->WriteVarInt62(frame.max_stream_id)) { - set_detailed_error("Can not write IETF_MAX_STREAM_ID stream id"); + set_detailed_error("Can not write MAX_STREAM_ID stream id"); return false; } return true; } -bool QuicFramer::ProcessIetfMaxStreamIdFrame(QuicDataReader* reader, - QuicIetfMaxStreamIdFrame* frame) { +bool QuicFramer::ProcessMaxStreamIdFrame(QuicDataReader* reader, + QuicMaxStreamIdFrame* frame) { if (!reader->ReadVarIntStreamId(&frame->max_stream_id)) { - set_detailed_error("Can not read IETF_MAX_STREAM_ID stream id"); + set_detailed_error("Can not read MAX_STREAM_ID stream id"); return false; } return true; } -bool QuicFramer::AppendIetfBlockedFrame(const QuicIetfBlockedFrame& frame, +bool QuicFramer::AppendIetfBlockedFrame(const QuicBlockedFrame& frame, QuicDataWriter* writer) { if (!writer->WriteUInt8(IETF_BLOCKED)) { set_detailed_error("Can not write IETF_BLOCKED frame type byte"); @@ -3607,7 +3591,7 @@ } bool QuicFramer::ProcessIetfBlockedFrame(QuicDataReader* reader, - QuicIetfBlockedFrame* frame) { + QuicBlockedFrame* frame) { if (!reader->ReadVarInt62(&frame->offset)) { set_detailed_error("Can not read IETF_BLOCKED offset"); return false; @@ -3615,9 +3599,8 @@ return true; } -bool QuicFramer::AppendIetfStreamBlockedFrame( - const QuicWindowUpdateFrame& frame, - QuicDataWriter* writer) { +bool QuicFramer::AppendIetfStreamBlockedFrame(const QuicBlockedFrame& frame, + QuicDataWriter* writer) { if (!writer->WriteUInt8(IETF_STREAM_BLOCKED)) { set_detailed_error("Can not write IETF_STREAM_BLOCKED frame type byte"); return false; @@ -3626,7 +3609,7 @@ set_detailed_error("Can not write IETF_STREAM_BLOCKED stream id"); return false; } - if (!writer->WriteVarInt62(frame.byte_offset)) { + if (!writer->WriteVarInt62(frame.offset)) { set_detailed_error("Can not write IETF_STREAM_BLOCKED offset"); return false; } @@ -3634,37 +3617,36 @@ } bool QuicFramer::ProcessIetfStreamBlockedFrame(QuicDataReader* reader, - QuicWindowUpdateFrame* frame) { + QuicBlockedFrame* frame) { if (!reader->ReadVarIntStreamId(&frame->stream_id)) { set_detailed_error("Can not read IETF_STREAM_BLOCKED stream id"); return false; } - if (!reader->ReadVarInt62(&frame->byte_offset)) { + if (!reader->ReadVarInt62(&frame->offset)) { set_detailed_error("Can not read IETF_STREAM_BLOCKED offset"); return false; } return true; } -bool QuicFramer::AppendIetfStreamIdBlockedFrame( - const QuicIetfStreamIdBlockedFrame& frame, +bool QuicFramer::AppendStreamIdBlockedFrame( + const QuicStreamIdBlockedFrame& frame, QuicDataWriter* writer) { if (!writer->WriteUInt8(IETF_STREAM_ID_BLOCKED)) { - set_detailed_error("Can not write IETF_STREAM_ID_BLOCKED frame type byte"); + set_detailed_error("Can not write STREAM_ID_BLOCKED frame type byte"); return false; } if (!writer->WriteVarInt62(frame.stream_id)) { - set_detailed_error("Can not write IETF_STREAM_ID_BLOCKED stream id"); + set_detailed_error("Can not write STREAM_ID_BLOCKED stream id"); return false; } return true; } -bool QuicFramer::ProcessIetfStreamIdBlockedFrame( - QuicDataReader* reader, - QuicIetfStreamIdBlockedFrame* frame) { +bool QuicFramer::ProcessStreamIdBlockedFrame(QuicDataReader* reader, + QuicStreamIdBlockedFrame* frame) { if (!reader->ReadVarIntStreamId(&frame->stream_id)) { - set_detailed_error("Can not read IETF_STREAM_ID_BLOCKED stream id"); + set_detailed_error("Can not read STREAM_ID_BLOCKED stream id"); return false; } return true;
diff --git a/net/quic/core/quic_framer.h b/net/quic/core/quic_framer.h index 28d9e5e..b0e1056 100644 --- a/net/quic/core/quic_framer.h +++ b/net/quic/core/quic_framer.h
@@ -151,7 +151,7 @@ virtual void OnPacketComplete() = 0; // Called to check whether |token| is a valid stateless reset token. - virtual bool IsValidStatelessResetToken(uint128 token) const = 0; + virtual bool IsValidStatelessResetToken(QuicUint128 token) const = 0; // Called when an IETF stateless reset packet has been parsed and validated // with the stateless reset token. @@ -289,7 +289,7 @@ // Returns a new IETF stateless reset packet. static std::unique_ptr<QuicEncryptedPacket> BuildIetfStatelessResetPacket( QuicConnectionId connection_id, - uint128 stateless_reset_token); + QuicUint128 stateless_reset_token); // Returns a new version negotiation packet. static std::unique_ptr<QuicEncryptedPacket> BuildVersionNegotiationPacket( @@ -565,7 +565,6 @@ bool ProcessIetfAckFrame(QuicDataReader* reader, uint8_t frame_type, QuicAckFrame* ack_frame); - void ProcessIetfPaddingFrame(QuicDataReader* reader, QuicPaddingFrame* frame); bool ProcessIetfPathChallengeFrame(QuicDataReader* reader, QuicPathChallengeFrame* frame); bool ProcessIetfPathResponseFrame(QuicDataReader* reader, @@ -588,8 +587,6 @@ const QuicString& phrase, QuicDataWriter* writer); bool AppendIetfAckFrame(const QuicAckFrame& frame, QuicDataWriter* writer); - bool AppendIetfPaddingFrame(const QuicPaddingFrame& frame, - QuicDataWriter* writer); bool AppendIetfPathChallengeFrame(const QuicPathChallengeFrame& frame, QuicDataWriter* writer); bool AppendIetfPathResponseFrame(const QuicPathResponseFrame& frame, @@ -610,25 +607,24 @@ bool ProcessIetfMaxStreamDataFrame(QuicDataReader* reader, QuicWindowUpdateFrame* frame); - bool AppendIetfMaxStreamIdFrame(const QuicIetfMaxStreamIdFrame& frame, - QuicDataWriter* writer); - bool ProcessIetfMaxStreamIdFrame(QuicDataReader* reader, - QuicIetfMaxStreamIdFrame* frame); - - bool AppendIetfBlockedFrame(const QuicIetfBlockedFrame& frame, + bool AppendMaxStreamIdFrame(const QuicMaxStreamIdFrame& frame, QuicDataWriter* writer); - bool ProcessIetfBlockedFrame(QuicDataReader* reader, - QuicIetfBlockedFrame* frame); + bool ProcessMaxStreamIdFrame(QuicDataReader* reader, + QuicMaxStreamIdFrame* frame); - bool AppendIetfStreamBlockedFrame(const QuicWindowUpdateFrame& frame, + bool AppendIetfBlockedFrame(const QuicBlockedFrame& frame, + QuicDataWriter* writer); + bool ProcessIetfBlockedFrame(QuicDataReader* reader, QuicBlockedFrame* frame); + + bool AppendIetfStreamBlockedFrame(const QuicBlockedFrame& frame, QuicDataWriter* writer); bool ProcessIetfStreamBlockedFrame(QuicDataReader* reader, - QuicWindowUpdateFrame* frame); + QuicBlockedFrame* frame); - bool AppendIetfStreamIdBlockedFrame(const QuicIetfStreamIdBlockedFrame& frame, - QuicDataWriter* writer); - bool ProcessIetfStreamIdBlockedFrame(QuicDataReader* reader, - QuicIetfStreamIdBlockedFrame* frame); + bool AppendStreamIdBlockedFrame(const QuicStreamIdBlockedFrame& frame, + QuicDataWriter* writer); + bool ProcessStreamIdBlockedFrame(QuicDataReader* reader, + QuicStreamIdBlockedFrame* frame); bool RaiseError(QuicErrorCode error);
diff --git a/net/quic/core/quic_framer_test.cc b/net/quic/core/quic_framer_test.cc index e72c852..09fabe7 100644 --- a/net/quic/core/quic_framer_test.cc +++ b/net/quic/core/quic_framer_test.cc
@@ -38,7 +38,7 @@ const QuicPacketNumber kEpoch = UINT64_C(1) << 32; const QuicPacketNumber kMask = kEpoch - 1; -const uint128 kTestStatelessResetToken = 1010101; // 0x0F69B5 +const QuicUint128 kTestStatelessResetToken = 1010101; // 0x0F69B5 // Use fields in which each byte is distinct to ensure that every byte is // framed correctly. The values are otherwise arbitrary. @@ -264,7 +264,7 @@ return true; } - bool IsValidStatelessResetToken(uint128 token) const override { + bool IsValidStatelessResetToken(QuicUint128 token) const override { return token == kTestStatelessResetToken; } @@ -326,6 +326,7 @@ start_, Perspective::IS_SERVER) { SetQuicFlag(&FLAGS_quic_supports_tls_handshake, true); + SetQuicReloadableFlag(quic_respect_ietf_header, true); framer_.set_version(version_); framer_.SetDecrypter(ENCRYPTION_NONE, std::unique_ptr<QuicDecrypter>(decrypter_));
diff --git a/net/quic/core/quic_ietf_framer_test.cc b/net/quic/core/quic_ietf_framer_test.cc index daed5d0..2ade1e06 100644 --- a/net/quic/core/quic_ietf_framer_test.cc +++ b/net/quic/core/quic_ietf_framer_test.cc
@@ -584,131 +584,6 @@ TryAckFrame(packet_buffer, sizeof(packet_buffer), &ack_frame_variant)); } } - -TEST_F(QuicIetfFramerTest, PaddingEntirePacket) { - char packet_buffer[kNormalPacketBufferSize]; - - // ensure that buffer is not all 0 prior to the test. - memset(packet_buffer, 0xff, sizeof(packet_buffer)); - - // Set up the writer and transmit QuicPaddingFrame - QuicDataWriter writer(sizeof(packet_buffer), packet_buffer, - NETWORK_BYTE_ORDER); - QuicPaddingFrame transmit_frame(sizeof(packet_buffer)); - - // Fill buffer with padding. - EXPECT_TRUE(QuicFramerPeer::AppendIetfPaddingFrame(&framer_, transmit_frame, - &writer)); - - // better have written to the entire packet buffer. - EXPECT_EQ(kNormalPacketBufferSize, writer.length()); - - // see if entire buffer is 0 - for (auto i = 0; i != sizeof(packet_buffer); i++) { - EXPECT_EQ(0, packet_buffer[i]) - << "Packet_buffer[" << i << "] is " << packet_buffer[i] << " not 0x00"; - } - - // set up reader and empty receive QuicPaddingFrame. - QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); - QuicPaddingFrame receive_frame; - - // read in the frame type - uint8_t received_frame_type; - EXPECT_TRUE(reader.ReadUInt8(&received_frame_type)); - EXPECT_EQ(received_frame_type, 0u); - - // deframe it - QuicFramerPeer::ProcessIetfPaddingFrame(&framer_, &reader, &receive_frame); - - // Now check that received == sent - EXPECT_EQ(transmit_frame.num_padding_bytes, receive_frame.num_padding_bytes); - int packet_buffer_size = static_cast<int>(sizeof(packet_buffer)); - EXPECT_EQ(packet_buffer_size, receive_frame.num_padding_bytes); - EXPECT_EQ(packet_buffer_size, transmit_frame.num_padding_bytes); -} - -// Place a padding frame between two non-padding frames: -// app_close -// padding -// connection_close -// we do a loop, with different amounts of padding in each. -TEST_F(QuicIetfFramerTest, PaddingSandwich) { - int pad_lengths[] = {1, 2, 5, 10, 20, 50, 100, 200, 500, 0}; - int* pad_length = pad_lengths; - while (*pad_length) { - char packet_buffer[kNormalPacketBufferSize]; - - // ensure that buffer is not all 0 prior to the test. - memset(packet_buffer, 0xff, sizeof(packet_buffer)); - - // Set up the writer and transmit Quic...Frames - QuicDataWriter writer(sizeof(packet_buffer), packet_buffer, - NETWORK_BYTE_ORDER); - QuicPaddingFrame transmit_pad_frame(*pad_length); - QuicString app_close_test_string = "Ich Bin Ein Jelly Donut?"; - QuicConnectionCloseFrame transmit_app_close_frame; - transmit_app_close_frame.error_code = static_cast<QuicErrorCode>(0); - transmit_app_close_frame.error_details = app_close_test_string; - - QuicString conn_close_test_string = "I am a Berliner?"; - QuicConnectionCloseFrame transmit_conn_close_frame; - transmit_conn_close_frame.error_code = static_cast<QuicErrorCode>(0); - transmit_conn_close_frame.error_details = conn_close_test_string; - - // Put in the frames. App close first. - EXPECT_TRUE(QuicFramerPeer::AppendIetfApplicationCloseFrame( - &framer_, transmit_app_close_frame, &writer)); - - size_t pre_padding_len = writer.length(); - // padding next. - EXPECT_TRUE(QuicFramerPeer::AppendIetfPaddingFrame( - &framer_, transmit_pad_frame, &writer)); - size_t post_padding_len = writer.length(); - EXPECT_EQ(static_cast<int>(post_padding_len - pre_padding_len), - *pad_length); - - // finally, connection close - EXPECT_TRUE(QuicFramerPeer::AppendIetfConnectionCloseFrame( - &framer_, transmit_conn_close_frame, &writer)); - - // see if buffer from offset pre_padding_len, for *pad_len, is 0 - for (auto i = pre_padding_len; i != pre_padding_len + (*pad_length); i++) { - EXPECT_EQ(0, packet_buffer[i]) << "Packet_buffer[" << i << "] is " - << packet_buffer[i] << " not 0x00"; - } - - // set up reader and empty receive QuicFrames. - QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); - QuicPaddingFrame receive_pad_frame; - QuicConnectionCloseFrame receive_app_close_frame; - QuicConnectionCloseFrame receive_conn_close_frame; - - // read in the frame type and data for the app-close frame - uint8_t received_frame_type; - EXPECT_TRUE(reader.ReadUInt8(&received_frame_type)); - EXPECT_EQ(received_frame_type, IETF_APPLICATION_CLOSE); - EXPECT_TRUE(QuicFramerPeer::ProcessIetfApplicationCloseFrame( - &framer_, &reader, received_frame_type, &receive_app_close_frame)); - - // Now the padding. - EXPECT_TRUE(reader.ReadUInt8(&received_frame_type)); - EXPECT_EQ(received_frame_type, IETF_PADDING); - QuicFramerPeer::ProcessIetfPaddingFrame(&framer_, &reader, - &receive_pad_frame); - // check that pad size is correct - EXPECT_EQ(receive_pad_frame.num_padding_bytes, *pad_length); - - // Now get the connection close frame. - EXPECT_TRUE(reader.ReadUInt8(&received_frame_type)); - EXPECT_EQ(received_frame_type, IETF_CONNECTION_CLOSE); - EXPECT_TRUE(QuicFramerPeer::ProcessIetfConnectionCloseFrame( - &framer_, &reader, received_frame_type, &receive_conn_close_frame)); - - pad_length++; - } -} - TEST_F(QuicIetfFramerTest, PathChallengeFrame) { // Double-braces needed on some platforms due to // https://bugs.llvm.org/show_bug.cgi?id=21629 @@ -887,14 +762,14 @@ for (QuicIetfStreamId stream_id : stream_ids) { memset(packet_buffer, 0, sizeof(packet_buffer)); - // Set up the writer and transmit QuicIetfMaxStreamIdFrame + // Set up the writer and transmit QuicMaxStreamIdFrame QuicDataWriter writer(sizeof(packet_buffer), packet_buffer, NETWORK_BYTE_ORDER); - QuicIetfMaxStreamIdFrame transmit_frame(0, stream_id); + QuicMaxStreamIdFrame transmit_frame(0, stream_id); // Add the frame. - EXPECT_TRUE(QuicFramerPeer::AppendIetfMaxStreamIdFrame( - &framer_, transmit_frame, &writer)); + EXPECT_TRUE(QuicFramerPeer::AppendMaxStreamIdFrame(&framer_, transmit_frame, + &writer)); // Check that buffer length is in the expected range EXPECT_LE(2u, writer.length()); @@ -902,7 +777,7 @@ // Set up reader and empty receive QuicPaddingFrame. QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); - QuicIetfMaxStreamIdFrame receive_frame; + QuicMaxStreamIdFrame receive_frame; // Read in the frame type uint8_t received_frame_type; @@ -910,8 +785,8 @@ EXPECT_EQ(received_frame_type, IETF_MAX_STREAM_ID); // Deframe it - EXPECT_TRUE(QuicFramerPeer::ProcessIetfMaxStreamIdFrame(&framer_, &reader, - &receive_frame)); + EXPECT_TRUE(QuicFramerPeer::ProcessMaxStreamIdFrame(&framer_, &reader, + &receive_frame)); // Now check that received and sent data are equivalent EXPECT_EQ(stream_id, receive_frame.max_stream_id); @@ -927,10 +802,10 @@ for (QuicStreamOffset offset : offsets) { memset(packet_buffer, 0, sizeof(packet_buffer)); - // Set up the writer and transmit QuicIetfBlockedFrame + // Set up the writer and transmit QuicBlockedFrame QuicDataWriter writer(sizeof(packet_buffer), packet_buffer, NETWORK_BYTE_ORDER); - QuicIetfBlockedFrame transmit_frame(0, offset); + QuicBlockedFrame transmit_frame(0, 0, offset); // Add the frame. EXPECT_TRUE(QuicFramerPeer::AppendIetfBlockedFrame(&framer_, transmit_frame, @@ -942,7 +817,7 @@ // Set up reader and empty receive QuicFrame. QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); - QuicIetfBlockedFrame receive_frame; + QuicBlockedFrame receive_frame; // Read in the frame type uint8_t received_frame_type; @@ -974,7 +849,7 @@ // Set up the writer and transmit QuicWindowUpdateFrame QuicDataWriter writer(sizeof(packet_buffer), packet_buffer, NETWORK_BYTE_ORDER); - QuicWindowUpdateFrame transmit_frame(0, stream_id, offset); + QuicBlockedFrame transmit_frame(0, stream_id, offset); // Add the frame. EXPECT_TRUE(QuicFramerPeer::AppendIetfStreamBlockedFrame( @@ -986,7 +861,7 @@ // Set up reader and empty receive QuicPaddingFrame. QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); - QuicWindowUpdateFrame receive_frame; + QuicBlockedFrame receive_frame; // Read in the frame type uint8_t received_frame_type; @@ -998,8 +873,8 @@ &framer_, &reader, &receive_frame)); // Now check that received == sent - EXPECT_EQ(transmit_frame.byte_offset, offset); - EXPECT_EQ(transmit_frame.byte_offset, receive_frame.byte_offset); + EXPECT_EQ(transmit_frame.offset, offset); + EXPECT_EQ(transmit_frame.offset, receive_frame.offset); EXPECT_EQ(stream_id, receive_frame.stream_id); EXPECT_EQ(transmit_frame.stream_id, receive_frame.stream_id); } @@ -1014,13 +889,13 @@ for (QuicIetfStreamId stream_id : stream_ids) { memset(packet_buffer, 0, sizeof(packet_buffer)); - // Set up the writer and transmit QuicIetfStreamIdBlockedFrame + // Set up the writer and transmit QuicStreamIdBlockedFrame QuicDataWriter writer(sizeof(packet_buffer), packet_buffer, NETWORK_BYTE_ORDER); - QuicIetfStreamIdBlockedFrame transmit_frame(0, stream_id); + QuicStreamIdBlockedFrame transmit_frame(0, stream_id); // Add the frame. - EXPECT_TRUE(QuicFramerPeer::AppendIetfStreamIdBlockedFrame( + EXPECT_TRUE(QuicFramerPeer::AppendStreamIdBlockedFrame( &framer_, transmit_frame, &writer)); // Check that buffer length is in the expected range @@ -1029,7 +904,7 @@ // Set up reader and empty receive QuicPaddingFrame. QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); - QuicIetfStreamIdBlockedFrame receive_frame; + QuicStreamIdBlockedFrame receive_frame; // Read in the frame type uint8_t received_frame_type; @@ -1037,8 +912,8 @@ EXPECT_EQ(received_frame_type, IETF_STREAM_ID_BLOCKED); // Deframe it - EXPECT_TRUE(QuicFramerPeer::ProcessIetfStreamIdBlockedFrame( - &framer_, &reader, &receive_frame)); + EXPECT_TRUE(QuicFramerPeer::ProcessStreamIdBlockedFrame(&framer_, &reader, + &receive_frame)); // Now check that received == sent EXPECT_EQ(stream_id, receive_frame.stream_id);
diff --git a/net/quic/core/quic_packet_creator_test.cc b/net/quic/core/quic_packet_creator_test.cc index 644911af..eee8e583 100644 --- a/net/quic/core/quic_packet_creator_test.cc +++ b/net/quic/core/quic_packet_creator_test.cc
@@ -145,6 +145,7 @@ data_("foo"), creator_(connection_id_, &client_framer_, &delegate_, &producer_), serialized_packet_(creator_.NoPacket()) { + SetQuicReloadableFlag(quic_respect_ietf_header, true); creator_.SetEncrypter(ENCRYPTION_INITIAL, QuicMakeUnique<NullEncrypter>( Perspective::IS_CLIENT)); creator_.SetEncrypter(
diff --git a/net/quic/core/quic_packet_generator_test.cc b/net/quic/core/quic_packet_generator_test.cc index b2e4905f..38053c75 100644 --- a/net/quic/core/quic_packet_generator_test.cc +++ b/net/quic/core/quic_packet_generator_test.cc
@@ -151,6 +151,7 @@ Perspective::IS_CLIENT), generator_(42, &framer_, &random_generator_, &delegate_, &producer_), creator_(QuicPacketGeneratorPeer::GetPacketCreator(&generator_)) { + SetQuicReloadableFlag(quic_respect_ietf_header, true); creator_->SetEncrypter( ENCRYPTION_FORWARD_SECURE, QuicMakeUnique<NullEncrypter>(Perspective::IS_CLIENT));
diff --git a/net/quic/core/quic_packets.cc b/net/quic/core/quic_packets.cc index 99b01ea..28e0103 100644 --- a/net/quic/core/quic_packets.cc +++ b/net/quic/core/quic_packets.cc
@@ -99,7 +99,7 @@ QuicIetfStatelessResetPacket::QuicIetfStatelessResetPacket( const QuicPacketHeader& header, - uint128 token) + QuicUint128 token) : header(header), stateless_reset_token(token) {} QuicIetfStatelessResetPacket::QuicIetfStatelessResetPacket(
diff --git a/net/quic/core/quic_packets.h b/net/quic/core/quic_packets.h index a75a1eb..e42449e2 100644 --- a/net/quic/core/quic_packets.h +++ b/net/quic/core/quic_packets.h
@@ -86,7 +86,7 @@ QuicLongHeaderType long_packet_type; // Stores last 16 bytes of a this packet, used to check whether this packet is // a stateless reset packet on decryption failure. - uint128 possible_stateless_reset_token; + QuicUint128 possible_stateless_reset_token; }; struct QUIC_EXPORT_PRIVATE QuicPublicResetPacket {
diff --git a/net/quic/core/quic_sent_packet_manager_test.cc b/net/quic/core/quic_sent_packet_manager_test.cc index 364b12d0..04330445 100644 --- a/net/quic/core/quic_sent_packet_manager_test.cc +++ b/net/quic/core/quic_sent_packet_manager_test.cc
@@ -1501,7 +1501,7 @@ EXPECT_CALL(*send_algorithm_, PacingRate(_)) .WillRepeatedly(Return(QuicBandwidth::Zero())); EXPECT_CALL(*send_algorithm_, GetCongestionWindow()) - .WillOnce(Return(10 * kDefaultTCPMSS)); + .WillRepeatedly(Return(10 * kDefaultTCPMSS)); manager_.SetFromConfig(client_config); EXPECT_TRUE(QuicSentPacketManagerPeer::GetUseNewRto(&manager_)); EXPECT_CALL(*send_algorithm_, CanSend(_)).WillRepeatedly(Return(true));
diff --git a/net/quic/core/quic_stream_send_buffer.cc b/net/quic/core/quic_stream_send_buffer.cc index ac1ab6e..e1a5426 100644 --- a/net/quic/core/quic_stream_send_buffer.cc +++ b/net/quic/core/quic_stream_send_buffer.cc
@@ -276,13 +276,31 @@ bool QuicStreamSendBuffer::FreeMemSlices(QuicStreamOffset start, QuicStreamOffset end) { DCHECK(free_mem_slice_out_of_order_); + auto it = buffered_slices_.begin(); // Find it, such that buffered_slices_[it - 1].end < start <= // buffered_slices_[it].end. - auto it = std::lower_bound(buffered_slices_.begin(), buffered_slices_.end(), - start, CompareOffset()); + bool found = false; + if (GetQuicReloadableFlag(quic_fast_free_mem_slice)) { + if (it == buffered_slices_.end() || it->slice.empty()) { + QUIC_BUG << "Trying to ack stream data [" << start << ", " << end << "), " + << (it == buffered_slices_.end() + ? "and there is no outstanding data." + : "and the first slice is empty."); + return false; + } + // Fast path that the earliest outstanding data gets acked. + found = start >= it->offset && start < it->offset + it->slice.length(); + if (found) { + QUIC_FLAG_COUNT(quic_reloadable_flag_quic_fast_free_mem_slice); + } + } + if (!found) { + it = std::lower_bound(buffered_slices_.begin(), buffered_slices_.end(), + start, CompareOffset()); + } if (it == buffered_slices_.end() || it->slice.empty()) { - QUIC_DLOG(ERROR) << "Offset " << start - << " does not exist or it has already been acked."; + QUIC_BUG << "Offset " << start + << " does not exist or it has already been acked."; return false; } for (; it != buffered_slices_.end(); ++it) {
diff --git a/net/quic/core/quic_types.h b/net/quic/core/quic_types.h index 4ead355..40b2436 100644 --- a/net/quic/core/quic_types.h +++ b/net/quic/core/quic_types.h
@@ -39,6 +39,10 @@ // Application error code used in the QUIC Stop Sending frame. typedef uint16_t QuicApplicationErrorCode; +// The connection id sequence number specifies the order that connection +// ids must be used in. +typedef uint64_t QuicConnectionIdSequenceNumber; + // A struct for functions which consume data payloads and fins. struct QUIC_EXPORT_PRIVATE QuicConsumedData { QuicConsumedData(size_t bytes_consumed, bool fin_consumed); @@ -148,6 +152,16 @@ ACK_FRAME, // The path MTU discovery frame is encoded as a PING frame on the wire. MTU_DISCOVERY_FRAME, + + // These are for IETF-specific frames for which there is no mapping + // from Google QUIC frames. These are valid/allowed if and only if IETF- + // QUIC has been negotiated. Values are not important, they are not + // the values that are in the packets (see QuicIetfFrameType, below). + APPLICATION_CLOSE_FRAME, + NEW_CONNECTION_ID_FRAME, + MAX_STREAM_ID_FRAME, + STREAM_ID_BLOCKED_FRAME, + NUM_FRAME_TYPES };
diff --git a/net/quic/core/quic_utils.cc b/net/quic/core/quic_utils.cc index 5a89c33..c8a2c3b 100644 --- a/net/quic/core/quic_utils.cc +++ b/net/quic/core/quic_utils.cc
@@ -36,18 +36,16 @@ // 2. Because there are so fewer instructions (around 13), the hot loop fits // nicely in the instruction queue of many Intel CPUs. // kPrime = 309485009821345068724781371 - static const __uint128_t kPrime = - (static_cast<__uint128_t>(16777216) << 64) + 315; + static const QuicUint128 kPrime = + (static_cast<QuicUint128>(16777216) << 64) + 315; auto hi = QuicUint128High64(uhash); auto lo = QuicUint128Low64(uhash); - __uint128_t xhash = (static_cast<__uint128_t>(hi) << 64) + lo; + QuicUint128 xhash = (static_cast<QuicUint128>(hi) << 64) + lo; const uint8_t* octets = reinterpret_cast<const uint8_t*>(data.data()); for (size_t i = 0; i < data.length(); ++i) { - xhash = (xhash ^ octets[i]) * kPrime; + xhash = (xhash ^ static_cast<uint32_t>(octets[i])) * kPrime; } - return MakeQuicUint128( - static_cast<uint64_t>(xhash >> 64), - static_cast<uint64_t>(xhash & UINT64_C(0xFFFFFFFFFFFFFFFF))); + return MakeQuicUint128(QuicUint128High64(xhash), QuicUint128Low64(xhash)); } #endif @@ -55,7 +53,7 @@ // Slow implementation of IncrementalHash. In practice, only used by Chromium. QuicUint128 IncrementalHashSlow(QuicUint128 hash, QuicStringPiece data) { // kPrime = 309485009821345068724781371 - static const uint128 kPrime = MakeQuicUint128(16777216, 315); + static const QuicUint128 kPrime = MakeQuicUint128(16777216, 315); const uint8_t* octets = reinterpret_cast<const uint8_t*>(data.data()); for (size_t i = 0; i < data.length(); ++i) { hash = hash ^ MakeQuicUint128(0, octets[i]);
diff --git a/net/quic/core/tls_client_handshaker.cc b/net/quic/core/tls_client_handshaker.cc index e18d1e7..2a05c554 100644 --- a/net/quic/core/tls_client_handshaker.cc +++ b/net/quic/core/tls_client_handshaker.cc
@@ -237,7 +237,7 @@ verify_result_ = ssl_verify_retry; return result; } - STACK_OF(CRYPTO_BUFFER)* cert_chain = SSL_get0_peer_certificates(ssl()); + const STACK_OF(CRYPTO_BUFFER)* cert_chain = SSL_get0_peer_certificates(ssl()); if (cert_chain == nullptr) { *out_alert = SSL_AD_INTERNAL_ERROR; return ssl_verify_invalid;
diff --git a/net/quic/platform/api/quic_uint128.h b/net/quic/platform/api/quic_uint128.h index afe252c3..97de786a 100644 --- a/net/quic/platform/api/quic_uint128.h +++ b/net/quic/platform/api/quic_uint128.h
@@ -10,9 +10,9 @@ namespace net { using QuicUint128 = QuicUint128Impl; -#define MakeQuicUint128(hi, lo) MakeQuicUint128Impl(hi, lo); -#define QuicUint128Low64(x) QuicUint128Low64Impl(x); -#define QuicUint128High64(x) QuicUint128High64Impl(x); +#define MakeQuicUint128(hi, lo) MakeQuicUint128Impl(hi, lo) +#define QuicUint128Low64(x) QuicUint128Low64Impl(x) +#define QuicUint128High64(x) QuicUint128High64Impl(x) } // namespace net
diff --git a/net/quic/platform/impl/quic_uint128_impl.h b/net/quic/platform/impl/quic_uint128_impl.h index cad9a6ee..4d473a7 100644 --- a/net/quic/platform/impl/quic_uint128_impl.h +++ b/net/quic/platform/impl/quic_uint128_impl.h
@@ -11,8 +11,8 @@ using QuicUint128Impl = uint128; #define MakeQuicUint128Impl(hi, lo) MakeUint128(hi, lo) -#define QuicUint128Low64Impl(x) Uint128Low64(x); -#define QuicUint128High64Impl(x) Uint128High64(x); +#define QuicUint128Low64Impl(x) Uint128Low64(x) +#define QuicUint128High64Impl(x) Uint128High64(x) } // namespace net
diff --git a/net/quic/quartc/quartc_factory.cc b/net/quic/quartc/quartc_factory.cc index 68912ac..41063ec9a 100644 --- a/net/quic/quartc/quartc_factory.cc +++ b/net/quic/quartc/quartc_factory.cc
@@ -198,7 +198,7 @@ return std::unique_ptr<QuicConnection>(new QuicConnection( dummy_id, dummy_address, this, /*QuicConnectionHelperInterface*/ this /*QuicAlarmFactory*/, writer.release(), true /*own the writer*/, - perspective, AllSupportedVersions())); + perspective, CurrentSupportedVersions())); } QuicAlarm* QuartcFactory::CreateAlarm(QuicAlarm::Delegate* delegate) {
diff --git a/net/quic/quartc/quartc_session_test.cc b/net/quic/quartc/quartc_session_test.cc index 2511b79..60056daa 100644 --- a/net/quic/quartc/quartc_session_test.cc +++ b/net/quic/quartc/quartc_session_test.cc
@@ -408,6 +408,7 @@ ~QuartcSessionTest() override {} void Init() { + SetQuicReloadableFlag(quic_respect_ietf_header, true); // Quic crashes if packets are sent at time 0, and the clock defaults to 0. clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1000)); client_channel_ = @@ -490,7 +491,7 @@ return std::unique_ptr<QuicConnection>(new QuicConnection( 0, QuicSocketAddress(ip, 0), this /*QuicConnectionHelperInterface*/, alarm_factory_.get(), writer, owns_writer, perspective, - AllSupportedVersions())); + CurrentSupportedVersions())); } // Runs all tasks scheduled in the next 200 ms.
diff --git a/net/quic/quartc/quartc_stream_test.cc b/net/quic/quartc/quartc_stream_test.cc index 5ab681be..5fe8e769 100644 --- a/net/quic/quartc/quartc_stream_test.cc +++ b/net/quic/quartc/quartc_stream_test.cc
@@ -172,7 +172,7 @@ connection_ = QuicMakeUnique<QuicConnection>( 0, QuicSocketAddress(ip, 0), this /*QuicConnectionHelperInterface*/, alarm_factory_.get(), new DummyPacketWriter(), owns_writer, perspective, - AllSupportedVersions()); + CurrentSupportedVersions()); session_ = QuicMakeUnique<MockQuicSession>(connection_.get(), QuicConfig(), &write_buffer_);
diff --git a/net/quic/test_tools/quic_config_peer.cc b/net/quic/test_tools/quic_config_peer.cc index 749efbb..4d2c3c7 100644 --- a/net/quic/test_tools/quic_config_peer.cc +++ b/net/quic/test_tools/quic_config_peer.cc
@@ -59,7 +59,7 @@ // static void QuicConfigPeer::SetReceivedStatelessResetToken(QuicConfig* config, - uint128 token) { + QuicUint128 token) { config->stateless_reset_token_.SetReceivedValue(token); }
diff --git a/net/quic/test_tools/quic_config_peer.h b/net/quic/test_tools/quic_config_peer.h index ece91bf7..0f5900d 100644 --- a/net/quic/test_tools/quic_config_peer.h +++ b/net/quic/test_tools/quic_config_peer.h
@@ -38,7 +38,8 @@ static void SetConnectionOptionsToSend(QuicConfig* config, const QuicTagVector& options); - static void SetReceivedStatelessResetToken(QuicConfig* config, uint128 token); + static void SetReceivedStatelessResetToken(QuicConfig* config, + QuicUint128 token); private: DISALLOW_COPY_AND_ASSIGN(QuicConfigPeer);
diff --git a/net/quic/test_tools/quic_framer_peer.cc b/net/quic/test_tools/quic_framer_peer.cc index 51c1964..bafae5b 100644 --- a/net/quic/test_tools/quic_framer_peer.cc +++ b/net/quic/test_tools/quic_framer_peer.cc
@@ -108,20 +108,6 @@ } // static -bool QuicFramerPeer::AppendIetfPaddingFrame(QuicFramer* framer, - const QuicPaddingFrame& frame, - QuicDataWriter* writer) { - return framer->AppendIetfPaddingFrame(frame, writer); -} - -// static -void QuicFramerPeer::ProcessIetfPaddingFrame(QuicFramer* framer, - QuicDataReader* reader, - QuicPaddingFrame* frame) { - framer->ProcessIetfPaddingFrame(reader, frame); -} - -// static bool QuicFramerPeer::ProcessIetfPathChallengeFrame( QuicFramer* framer, QuicDataReader* reader, @@ -216,24 +202,22 @@ } // static -bool QuicFramerPeer::AppendIetfMaxStreamIdFrame( - QuicFramer* framer, - const QuicIetfMaxStreamIdFrame& frame, - QuicDataWriter* writer) { - return framer->AppendIetfMaxStreamIdFrame(frame, writer); +bool QuicFramerPeer::AppendMaxStreamIdFrame(QuicFramer* framer, + const QuicMaxStreamIdFrame& frame, + QuicDataWriter* writer) { + return framer->AppendMaxStreamIdFrame(frame, writer); } // static -bool QuicFramerPeer::ProcessIetfMaxStreamIdFrame( - QuicFramer* framer, - QuicDataReader* reader, - QuicIetfMaxStreamIdFrame* frame) { - return framer->ProcessIetfMaxStreamIdFrame(reader, frame); +bool QuicFramerPeer::ProcessMaxStreamIdFrame(QuicFramer* framer, + QuicDataReader* reader, + QuicMaxStreamIdFrame* frame) { + return framer->ProcessMaxStreamIdFrame(reader, frame); } // static bool QuicFramerPeer::AppendIetfBlockedFrame(QuicFramer* framer, - const QuicIetfBlockedFrame& frame, + const QuicBlockedFrame& frame, QuicDataWriter* writer) { return framer->AppendIetfBlockedFrame(frame, writer); } @@ -241,40 +225,38 @@ // static bool QuicFramerPeer::ProcessIetfBlockedFrame(QuicFramer* framer, QuicDataReader* reader, - QuicIetfBlockedFrame* frame) { + QuicBlockedFrame* frame) { return framer->ProcessIetfBlockedFrame(reader, frame); } // static -bool QuicFramerPeer::AppendIetfStreamBlockedFrame( - QuicFramer* framer, - const QuicWindowUpdateFrame& frame, - QuicDataWriter* writer) { +bool QuicFramerPeer::AppendIetfStreamBlockedFrame(QuicFramer* framer, + const QuicBlockedFrame& frame, + QuicDataWriter* writer) { return framer->AppendIetfStreamBlockedFrame(frame, writer); } // static -bool QuicFramerPeer::ProcessIetfStreamBlockedFrame( - QuicFramer* framer, - QuicDataReader* reader, - QuicWindowUpdateFrame* frame) { +bool QuicFramerPeer::ProcessIetfStreamBlockedFrame(QuicFramer* framer, + QuicDataReader* reader, + QuicBlockedFrame* frame) { return framer->ProcessIetfStreamBlockedFrame(reader, frame); } // static -bool QuicFramerPeer::AppendIetfStreamIdBlockedFrame( +bool QuicFramerPeer::AppendStreamIdBlockedFrame( QuicFramer* framer, - const QuicIetfStreamIdBlockedFrame& frame, + const QuicStreamIdBlockedFrame& frame, QuicDataWriter* writer) { - return framer->AppendIetfStreamIdBlockedFrame(frame, writer); + return framer->AppendStreamIdBlockedFrame(frame, writer); } // static -bool QuicFramerPeer::ProcessIetfStreamIdBlockedFrame( +bool QuicFramerPeer::ProcessStreamIdBlockedFrame( QuicFramer* framer, QuicDataReader* reader, - QuicIetfStreamIdBlockedFrame* frame) { - return framer->ProcessIetfStreamIdBlockedFrame(reader, frame); + QuicStreamIdBlockedFrame* frame) { + return framer->ProcessStreamIdBlockedFrame(reader, frame); } // static
diff --git a/net/quic/test_tools/quic_framer_peer.h b/net/quic/test_tools/quic_framer_peer.h index f9a50b8..041960b 100644 --- a/net/quic/test_tools/quic_framer_peer.h +++ b/net/quic/test_tools/quic_framer_peer.h
@@ -76,14 +76,6 @@ QuicDataReader* reader, QuicRstStreamFrame* frame); - // Add/remove IETF-Format padding. - static bool AppendIetfPaddingFrame(QuicFramer* framer, - const QuicPaddingFrame& frame, - QuicDataWriter* writer); - static void ProcessIetfPaddingFrame(QuicFramer* framer, - QuicDataReader* reader, - QuicPaddingFrame* frame); - static bool ProcessIetfPathChallengeFrame(QuicFramer* framer, QuicDataReader* reader, QuicPathChallengeFrame* frame); @@ -120,34 +112,32 @@ static bool ProcessIetfMaxStreamDataFrame(QuicFramer* framer, QuicDataReader* reader, QuicWindowUpdateFrame* frame); - static bool AppendIetfMaxStreamIdFrame(QuicFramer* framer, - const QuicIetfMaxStreamIdFrame& frame, - QuicDataWriter* writer); - static bool ProcessIetfMaxStreamIdFrame(QuicFramer* framer, - QuicDataReader* reader, - QuicIetfMaxStreamIdFrame* frame); + static bool AppendMaxStreamIdFrame(QuicFramer* framer, + const QuicMaxStreamIdFrame& frame, + QuicDataWriter* writer); + static bool ProcessMaxStreamIdFrame(QuicFramer* framer, + QuicDataReader* reader, + QuicMaxStreamIdFrame* frame); static bool AppendIetfBlockedFrame(QuicFramer* framer, - const QuicIetfBlockedFrame& frame, + const QuicBlockedFrame& frame, QuicDataWriter* writer); static bool ProcessIetfBlockedFrame(QuicFramer* framer, QuicDataReader* reader, - QuicIetfBlockedFrame* frame); + QuicBlockedFrame* frame); static bool AppendIetfStreamBlockedFrame(QuicFramer* framer, - const QuicWindowUpdateFrame& frame, + const QuicBlockedFrame& frame, QuicDataWriter* writer); static bool ProcessIetfStreamBlockedFrame(QuicFramer* framer, QuicDataReader* reader, - QuicWindowUpdateFrame* frame); + QuicBlockedFrame* frame); - static bool AppendIetfStreamIdBlockedFrame( - QuicFramer* framer, - const QuicIetfStreamIdBlockedFrame& frame, - QuicDataWriter* writer); - static bool ProcessIetfStreamIdBlockedFrame( - QuicFramer* framer, - QuicDataReader* reader, - QuicIetfStreamIdBlockedFrame* frame); + static bool AppendStreamIdBlockedFrame(QuicFramer* framer, + const QuicStreamIdBlockedFrame& frame, + QuicDataWriter* writer); + static bool ProcessStreamIdBlockedFrame(QuicFramer* framer, + QuicDataReader* reader, + QuicStreamIdBlockedFrame* frame); private: DISALLOW_COPY_AND_ASSIGN(QuicFramerPeer);
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc index af4eb22..c9cb457 100644 --- a/net/quic/test_tools/quic_test_utils.cc +++ b/net/quic/test_tools/quic_test_utils.cc
@@ -234,7 +234,7 @@ return true; } -bool NoOpFramerVisitor::IsValidStatelessResetToken(uint128 token) const { +bool NoOpFramerVisitor::IsValidStatelessResetToken(QuicUint128 token) const { return false; }
diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h index 0e8c6e9..5803da37 100644 --- a/net/quic/test_tools/quic_test_utils.h +++ b/net/quic/test_tools/quic_test_utils.h
@@ -260,7 +260,7 @@ MOCK_METHOD1(OnWindowUpdateFrame, bool(const QuicWindowUpdateFrame& frame)); MOCK_METHOD1(OnBlockedFrame, bool(const QuicBlockedFrame& frame)); MOCK_METHOD0(OnPacketComplete, void()); - MOCK_CONST_METHOD1(IsValidStatelessResetToken, bool(uint128)); + MOCK_CONST_METHOD1(IsValidStatelessResetToken, bool(QuicUint128)); MOCK_METHOD1(OnAuthenticatedIetfStatelessResetPacket, void(const QuicIetfStatelessResetPacket&)); @@ -298,7 +298,7 @@ bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override; bool OnBlockedFrame(const QuicBlockedFrame& frame) override; void OnPacketComplete() override {} - bool IsValidStatelessResetToken(uint128 token) const override; + bool IsValidStatelessResetToken(QuicUint128 token) const override; void OnAuthenticatedIetfStatelessResetPacket( const QuicIetfStatelessResetPacket& packet) override {}
diff --git a/net/quic/test_tools/simple_quic_framer.cc b/net/quic/test_tools/simple_quic_framer.cc index 405cfde0..54c4acc4 100644 --- a/net/quic/test_tools/simple_quic_framer.cc +++ b/net/quic/test_tools/simple_quic_framer.cc
@@ -127,7 +127,7 @@ void OnPacketComplete() override {} - bool IsValidStatelessResetToken(uint128 token) const override { + bool IsValidStatelessResetToken(QuicUint128 token) const override { return false; }
diff --git a/net/tools/quic/chlo_extractor.cc b/net/tools/quic/chlo_extractor.cc index 7ef853a..120981c 100644 --- a/net/tools/quic/chlo_extractor.cc +++ b/net/tools/quic/chlo_extractor.cc
@@ -53,7 +53,7 @@ bool OnBlockedFrame(const QuicBlockedFrame& frame) override; bool OnPaddingFrame(const QuicPaddingFrame& frame) override; void OnPacketComplete() override {} - bool IsValidStatelessResetToken(uint128 token) const override; + bool IsValidStatelessResetToken(QuicUint128 token) const override; void OnAuthenticatedIetfStatelessResetPacket( const QuicIetfStatelessResetPacket& packet) override {} @@ -182,7 +182,7 @@ return true; } -bool ChloFramerVisitor::IsValidStatelessResetToken(uint128 token) const { +bool ChloFramerVisitor::IsValidStatelessResetToken(QuicUint128 token) const { return false; }
diff --git a/net/tools/quic/chlo_extractor_test.cc b/net/tools/quic/chlo_extractor_test.cc index f02b5d1..9966a1d 100644 --- a/net/tools/quic/chlo_extractor_test.cc +++ b/net/tools/quic/chlo_extractor_test.cc
@@ -47,6 +47,7 @@ class ChloExtractorTest : public QuicTest { public: ChloExtractorTest() { + SetQuicReloadableFlag(quic_respect_ietf_header, true); header_.connection_id = 42; header_.connection_id_length = PACKET_8BYTE_CONNECTION_ID; header_.version_flag = true;
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc index 14add13c..7036d6c 100644 --- a/net/tools/quic/end_to_end_test.cc +++ b/net/tools/quic/end_to_end_test.cc
@@ -281,7 +281,6 @@ stream_factory_(nullptr), support_server_push_(false) { FLAGS_quic_supports_tls_handshake = true; - FLAGS_quic_reloadable_flag_quic_store_version_before_signalling = true; client_supported_versions_ = GetParam().client_supported_versions; server_supported_versions_ = GetParam().server_supported_versions; negotiated_version_ = GetParam().negotiated_version; @@ -434,6 +433,7 @@ void StartServer() { SetQuicReloadableFlag(quic_use_cheap_stateless_rejects, GetParam().use_cheap_stateless_reject); + SetQuicReloadableFlag(quic_respect_ietf_header, true); auto* test_server = new QuicTestServer( crypto_test_utils::ProofSourceForTesting(), server_config_, @@ -610,7 +610,6 @@ class EndToEndTestWithTls : public EndToEndTest { protected: EndToEndTestWithTls() : EndToEndTest() { - FLAGS_quic_reloadable_flag_delay_quic_server_handshaker_construction = true; SetQuicReloadableFlag(quic_server_early_version_negotiation, true); } };
diff --git a/net/tools/quic/quic_client_bin.cc b/net/tools/quic/quic_client_bin.cc index 9902898..039bc0653 100644 --- a/net/tools/quic/quic_client_bin.cc +++ b/net/tools/quic/quic_client_bin.cc
@@ -256,7 +256,7 @@ net::EpollServer epoll_server; net::QuicServerId server_id(url.host(), url.port(), net::PRIVACY_MODE_DISABLED); - net::ParsedQuicVersionVector versions = net::AllSupportedVersions(); + net::ParsedQuicVersionVector versions = net::CurrentSupportedVersions(); if (FLAGS_quic_version != -1) { versions.clear(); versions.push_back(net::ParsedQuicVersion(
diff --git a/net/tools/quic/quic_dispatcher.cc b/net/tools/quic/quic_dispatcher.cc index 9a39a77..5e167368 100644 --- a/net/tools/quic/quic_dispatcher.cc +++ b/net/tools/quic/quic_dispatcher.cc
@@ -527,6 +527,11 @@ return writer_->IsWriteBlocked(); } +std::unique_ptr<QuicDispatcher::PerPacketContext> +QuicDispatcher::GetPerPacketContext() const { + return nullptr; +} + void QuicDispatcher::DeleteSessions() { closed_session_list_.clear(); } @@ -729,7 +734,7 @@ DCHECK(false); } -bool QuicDispatcher::IsValidStatelessResetToken(uint128 token) const { +bool QuicDispatcher::IsValidStatelessResetToken(QuicUint128 token) const { DCHECK(false); return false; } @@ -912,11 +917,15 @@ current_client_address_(dispatcher->current_client_address_), current_peer_address_(dispatcher->current_peer_address_), current_self_address_(dispatcher->current_self_address_), + additional_context_(dispatcher->GetPerPacketContext()), current_packet_( dispatcher->current_packet_->Clone()), // Note: copies the packet first_version_(first_version) {} void Run(std::unique_ptr<StatelessRejector> rejector) override { + if (additional_context_ != nullptr) { + dispatcher_->RestorePerPacketContext(std::move(additional_context_)); + } dispatcher_->OnStatelessRejectorProcessDone( std::move(rejector), current_client_address_, current_peer_address_, current_self_address_, std::move(current_packet_), first_version_); @@ -927,6 +936,9 @@ QuicSocketAddress current_client_address_; QuicSocketAddress current_peer_address_; QuicSocketAddress current_self_address_; + // TODO(wub): Wrap all current_* variables into PerPacketContext. And rename + // |additional_context_| to |context_|. + std::unique_ptr<QuicDispatcher::PerPacketContext> additional_context_; std::unique_ptr<QuicReceivedPacket> current_packet_; ParsedQuicVersion first_version_; };
diff --git a/net/tools/quic/quic_dispatcher.h b/net/tools/quic/quic_dispatcher.h index 27c7c8c..36a4d2ec 100644 --- a/net/tools/quic/quic_dispatcher.h +++ b/net/tools/quic/quic_dispatcher.h
@@ -150,7 +150,7 @@ bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override; bool OnBlockedFrame(const QuicBlockedFrame& frame) override; void OnPacketComplete() override; - bool IsValidStatelessResetToken(uint128 token) const override; + bool IsValidStatelessResetToken(QuicUint128 token) const override; void OnAuthenticatedIetfStatelessResetPacket( const QuicIetfStatelessResetPacket& packet) override; @@ -165,6 +165,11 @@ // Return true if there is CHLO buffered. virtual bool HasChlosBuffered() const; + // Used by subclass of QuicDispatcher, to track its per packet context. + struct PerPacketContext { + virtual ~PerPacketContext() {} + }; + protected: virtual QuicSession* CreateQuicSession(QuicConnectionId connection_id, const QuicSocketAddress& peer_address, @@ -313,6 +318,11 @@ // Return true if the blocked writer should be added to blocked list. virtual bool ShouldAddToBlockedList(); + // Save/Restore per packet context. Used by async stateless rejector. + virtual std::unique_ptr<PerPacketContext> GetPerPacketContext() const; + virtual void RestorePerPacketContext( + std::unique_ptr<PerPacketContext> /*context*/) {} + private: friend class test::QuicDispatcherPeer; friend class StatelessRejectorProcessDoneCallback;
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc index 5db2606..ab58849 100644 --- a/net/tools/quic/quic_dispatcher_test.cc +++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -140,6 +140,25 @@ MOCK_METHOD1(ShouldCreateOrBufferPacketForConnection, bool(QuicConnectionId connection_id)); + struct TestQuicPerPacketContext : public PerPacketContext { + string custom_packet_context; + }; + + std::unique_ptr<PerPacketContext> GetPerPacketContext() const override { + auto test_context = QuicMakeUnique<TestQuicPerPacketContext>(); + test_context->custom_packet_context = custom_packet_context_; + return std::move(test_context); + } + + void RestorePerPacketContext( + std::unique_ptr<PerPacketContext> context) override { + TestQuicPerPacketContext* test_context = + static_cast<TestQuicPerPacketContext*>(context.get()); + custom_packet_context_ = test_context->custom_packet_context; + } + + string custom_packet_context_; + using QuicDispatcher::current_client_address; using QuicDispatcher::current_peer_address; using QuicDispatcher::current_self_address; @@ -196,7 +215,9 @@ time_wait_list_manager_(nullptr), session1_(nullptr), session2_(nullptr), - store_(nullptr) {} + store_(nullptr) { + SetQuicReloadableFlag(quic_respect_ietf_header, true); + } void SetUp() override { dispatcher_->InitializeWithWriter(new QuicDefaultPacketWriter(1)); @@ -1988,10 +2009,12 @@ } // Send a CHLO that the StatelessRejector will accept. + dispatcher_->custom_packet_context_ = "connection 1"; ProcessPacket(client_addr_, conn_id_1, true, SerializeFullCHLO()); ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 1); // Send another CHLO that the StatelessRejector will accept. + dispatcher_->custom_packet_context_ = "connection 2"; ProcessPacket(client_addr_2_, conn_id_2, true, SerializeFullCHLOForClient2()); ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 2); @@ -2001,12 +2024,14 @@ EXPECT_EQ(client_addr_2_, dispatcher_->current_client_address()); EXPECT_EQ(client_addr_2_, dispatcher_->current_peer_address()); + EXPECT_EQ("connection 2", dispatcher_->custom_packet_context_); // Runs the async proof callback for conn_id_1 from client_addr_. GetFakeProofSource()->InvokePendingCallback(0); EXPECT_EQ(client_addr_, dispatcher_->current_client_address()); EXPECT_EQ(client_addr_, dispatcher_->current_peer_address()); + EXPECT_EQ("connection 1", dispatcher_->custom_packet_context_); ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 1); @@ -2016,12 +2041,14 @@ EXPECT_EQ(client_addr_, dispatcher_->current_client_address()); EXPECT_EQ(client_addr_, dispatcher_->current_peer_address()); + EXPECT_EQ("connection 1", dispatcher_->custom_packet_context_); // Runs the async proof callback for conn_id_2 from client_addr_2_. GetFakeProofSource()->InvokePendingCallback(0); EXPECT_EQ(client_addr_2_, dispatcher_->current_client_address()); EXPECT_EQ(client_addr_2_, dispatcher_->current_peer_address()); + EXPECT_EQ("connection 2", dispatcher_->custom_packet_context_); ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 0); }
diff --git a/net/tools/quic/quic_packet_printer_bin.cc b/net/tools/quic/quic_packet_printer_bin.cc index 59750bb..0b1713b2 100644 --- a/net/tools/quic/quic_packet_printer_bin.cc +++ b/net/tools/quic/quic_packet_printer_bin.cc
@@ -154,7 +154,7 @@ return true; } void OnPacketComplete() override { std::cerr << "OnPacketComplete\n"; } - bool IsValidStatelessResetToken(uint128 token) const override { + bool IsValidStatelessResetToken(QuicUint128 token) const override { std::cerr << "IsValidStatelessResetToken\n"; return false; }
diff --git a/net/tools/quic/quic_packet_writer_wrapper.cc b/net/tools/quic/quic_packet_writer_wrapper.cc index 42f7d0a..53a50f5 100644 --- a/net/tools/quic/quic_packet_writer_wrapper.cc +++ b/net/tools/quic/quic_packet_writer_wrapper.cc
@@ -10,7 +10,9 @@ QuicPacketWriterWrapper::QuicPacketWriterWrapper() = default; -QuicPacketWriterWrapper::~QuicPacketWriterWrapper() = default; +QuicPacketWriterWrapper::~QuicPacketWriterWrapper() { + unset_writer(); +} WriteResult QuicPacketWriterWrapper::WritePacket( const char* buffer, @@ -40,7 +42,24 @@ } void QuicPacketWriterWrapper::set_writer(QuicPacketWriter* writer) { - writer_.reset(writer); + unset_writer(); + writer_ = writer; + owns_writer_ = true; +} + +void QuicPacketWriterWrapper::set_non_owning_writer(QuicPacketWriter* writer) { + unset_writer(); + writer_ = writer; + owns_writer_ = false; +} + +void QuicPacketWriterWrapper::unset_writer() { + if (owns_writer_) { + delete writer_; + } + + owns_writer_ = false; + writer_ = nullptr; } } // namespace net
diff --git a/net/tools/quic/quic_packet_writer_wrapper.h b/net/tools/quic/quic_packet_writer_wrapper.h index 7227318..985a6c4 100644 --- a/net/tools/quic/quic_packet_writer_wrapper.h +++ b/net/tools/quic/quic_packet_writer_wrapper.h
@@ -38,12 +38,18 @@ // Takes ownership of |writer|. void set_writer(QuicPacketWriter* writer); + // Does not take ownership of |writer|. + void set_non_owning_writer(QuicPacketWriter* writer); + virtual void set_peer_address(const QuicSocketAddress& peer_address) {} - QuicPacketWriter* writer() { return writer_.get(); } + QuicPacketWriter* writer() { return writer_; } private: - std::unique_ptr<QuicPacketWriter> writer_; + void unset_writer(); + + QuicPacketWriter* writer_ = nullptr; + bool owns_writer_ = false; DISALLOW_COPY_AND_ASSIGN(QuicPacketWriterWrapper); };
diff --git a/net/tools/quic/quic_spdy_client_session_test.cc b/net/tools/quic/quic_spdy_client_session_test.cc index 68cbb27..eb16b3f 100644 --- a/net/tools/quic/quic_spdy_client_session_test.cc +++ b/net/tools/quic/quic_spdy_client_session_test.cc
@@ -82,6 +82,7 @@ } void Initialize() { + SetQuicReloadableFlag(quic_respect_ietf_header, true); session_.reset(); connection_ = new PacketSavingConnection(&helper_, &alarm_factory_, Perspective::IS_CLIENT,
diff --git a/net/tools/quic/quic_time_wait_list_manager.cc b/net/tools/quic/quic_time_wait_list_manager.cc index 52a5e382..8de4aa52 100644 --- a/net/tools/quic/quic_time_wait_list_manager.cc +++ b/net/tools/quic/quic_time_wait_list_manager.cc
@@ -28,7 +28,7 @@ // Stateless reset token used in IETF public reset packet. // TODO(fayang): use a real stateless reset token instead of a hard code one. -const uint128 kStatelessResetToken = 1010101; +const QuicUint128 kStatelessResetToken = 1010101; } // namespace @@ -349,7 +349,7 @@ QuicTimeWaitListManager::ConnectionIdData::~ConnectionIdData() = default; -uint128 QuicTimeWaitListManager::GetStatelessResetToken( +QuicUint128 QuicTimeWaitListManager::GetStatelessResetToken( QuicConnectionId connection_id) const { return kStatelessResetToken; }
diff --git a/net/tools/quic/quic_time_wait_list_manager.h b/net/tools/quic/quic_time_wait_list_manager.h index 5d8a2fb..9ae3c2c 100644 --- a/net/tools/quic/quic_time_wait_list_manager.h +++ b/net/tools/quic/quic_time_wait_list_manager.h
@@ -129,7 +129,8 @@ // Returns a stateless reset token which will be included in the public reset // packet. - virtual uint128 GetStatelessResetToken(QuicConnectionId connection_id) const; + virtual QuicUint128 GetStatelessResetToken( + QuicConnectionId connection_id) const; private: friend class test::QuicDispatcherPeer;
diff --git a/net/tools/quic/quic_time_wait_list_manager_test.cc b/net/tools/quic/quic_time_wait_list_manager_test.cc index 315f59d..5e8726fe 100644 --- a/net/tools/quic/quic_time_wait_list_manager_test.cc +++ b/net/tools/quic/quic_time_wait_list_manager_test.cc
@@ -41,7 +41,7 @@ namespace test { namespace { -const uint128 kTestStatelessResetToken = 1010101; +const QuicUint128 kTestStatelessResetToken = 1010101; class FramerVisitorCapturingPublicReset : public NoOpFramerVisitor { public: @@ -56,7 +56,7 @@ return public_reset_packet_; } - bool IsValidStatelessResetToken(uint128 token) const override { + bool IsValidStatelessResetToken(QuicUint128 token) const override { return token == kTestStatelessResetToken; }
diff --git a/net/tools/quic/test_tools/quic_dispatcher_peer.cc b/net/tools/quic/test_tools/quic_dispatcher_peer.cc index 3d7429d..69d9f186 100644 --- a/net/tools/quic/test_tools/quic_dispatcher_peer.cc +++ b/net/tools/quic/test_tools/quic_dispatcher_peer.cc
@@ -92,5 +92,18 @@ dispatcher->framer_.last_packet_is_ietf_quic()); } +// static +std::unique_ptr<QuicDispatcher::PerPacketContext> +QuicDispatcherPeer::GetPerPacketContext(QuicDispatcher* dispatcher) { + return dispatcher->GetPerPacketContext(); +} + +// static +void QuicDispatcherPeer::RestorePerPacketContext( + QuicDispatcher* dispatcher, + std::unique_ptr<QuicDispatcher::PerPacketContext> context) { + dispatcher->RestorePerPacketContext(std::move(context)); +} + } // namespace test } // namespace net
diff --git a/net/tools/quic/test_tools/quic_dispatcher_peer.h b/net/tools/quic/test_tools/quic_dispatcher_peer.h index 9353a60..e711cb6 100644 --- a/net/tools/quic/test_tools/quic_dispatcher_peer.h +++ b/net/tools/quic/test_tools/quic_dispatcher_peer.h
@@ -54,6 +54,13 @@ const QuicSocketAddress& client_address, QuicConnectionId connection_id); + static std::unique_ptr<QuicDispatcher::PerPacketContext> GetPerPacketContext( + QuicDispatcher* dispatcher); + + static void RestorePerPacketContext( + QuicDispatcher* dispatcher, + std::unique_ptr<QuicDispatcher::PerPacketContext>); + private: DISALLOW_COPY_AND_ASSIGN(QuicDispatcherPeer); };
diff --git a/services/data_decoder/public/mojom/BUILD.gn b/services/data_decoder/public/mojom/BUILD.gn index edfd075..916eb682 100644 --- a/services/data_decoder/public/mojom/BUILD.gn +++ b/services/data_decoder/public/mojom/BUILD.gn
@@ -13,7 +13,6 @@ public_deps = [ ":constants", - "//mojo/common:common_custom_types", "//mojo/public/mojom/base", "//skia/public/interfaces", "//ui/gfx/geometry/mojo",
diff --git a/services/file/BUILD.gn b/services/file/BUILD.gn index 70718c8..2fe2ea2 100644 --- a/services/file/BUILD.gn +++ b/services/file/BUILD.gn
@@ -21,7 +21,6 @@ "//components/services/filesystem/public/interfaces", "//components/services/leveldb:lib", "//components/services/leveldb/public/interfaces", - "//mojo/common", "//mojo/public/cpp/system", "//services/file/public/mojom", "//services/service_manager/public/cpp",
diff --git a/services/network/cookie_manager_unittest.cc b/services/network/cookie_manager_unittest.cc index 1f5175b..e1ae283 100644 --- a/services/network/cookie_manager_unittest.cc +++ b/services/network/cookie_manager_unittest.cc
@@ -1424,7 +1424,7 @@ net::COOKIE_PRIORITY_MEDIUM), true, true)); - // Not in including_domains. + // Not in domains_and_ips_to_delete. EXPECT_TRUE(SetCanonicalCookie( net::CanonicalCookie( "A4", "val3", "other.com", "/path", @@ -1434,7 +1434,7 @@ net::COOKIE_PRIORITY_MEDIUM), true, true)); - // In excluding_domains. + // In domains_and_ips_to_ignore. EXPECT_TRUE(SetCanonicalCookie( net::CanonicalCookie( "A5", "val4", "no.com", "/path", now - base::TimeDelta::FromDays(3),
diff --git a/services/network/cors/cors_url_loader.cc b/services/network/cors/cors_url_loader.cc index 9438d52..62f996ab 100644 --- a/services/network/cors/cors_url_loader.cc +++ b/services/network/cors/cors_url_loader.cc
@@ -5,6 +5,7 @@ #include "services/network/cors/cors_url_loader.h" #include "base/stl_util.h" +#include "services/network/cors/preflight_controller.h" #include "services/network/public/cpp/cors/cors.h" #include "services/network/public/cpp/cors/cors_legacy.h" #include "url/url_util.h" @@ -24,7 +25,7 @@ if (base::ContainsValue(url::GetNoAccessSchemes(), origin.scheme())) return false; - return base::ContainsValue(cors::legacy::GetSecureOrigins(), origin); + return base::ContainsValue(legacy::GetSecureOrigins(), origin); } bool CalculateCORSFlag(const ResourceRequest& request) { @@ -48,11 +49,31 @@ return header_value; } +bool NeedsPreflight(const ResourceRequest& request) { + if (request.is_external_request) + return true; + + if (request.fetch_request_mode == + mojom::FetchRequestMode::kCORSWithForcedPreflight) { + return true; + } + + if (!IsCORSSafelistedMethod(request.method)) + return true; + + for (const auto& header : request.headers.GetHeaderVector()) { + if (!IsCORSSafelistedHeader(header.key, header.value) && + !IsForbiddenHeader(header.key)) { + return true; + } + } + return false; +} + } // namespace -// TODO(toyoshim): At the moment this class simply forwards all calls to the -// underlying network loader. Part of the effort to move CORS handling out of -// Blink: http://crbug/736308. +// TODO(toyoshim): This class still lacks right CORS checks in redirects. +// See http://crbug/736308 to track the progress. CORSURLLoader::CORSURLLoader( int32_t routing_id, int32_t request_id, @@ -65,16 +86,17 @@ network_client_binding_(this), request_(resource_request), forwarding_client_(std::move(client)), - security_origin_( - resource_request.request_initiator.value_or(url::Origin())), last_response_url_(resource_request.url), - fetch_cors_flag_(CalculateCORSFlag(resource_request)) { + fetch_cors_flag_(CalculateCORSFlag(resource_request)), + weak_factory_(this) { DCHECK(network_loader_factory_); + DCHECK(resource_request.request_initiator); if (fetch_cors_flag_ && request_.fetch_request_mode == mojom::FetchRequestMode::kSameOrigin) { forwarding_client_->OnComplete(URLLoaderCompletionStatus( CORSErrorStatus(mojom::CORSError::kDisallowedByMode))); + forwarding_client_.reset(); return; } @@ -90,18 +112,24 @@ } } - // TODO(toyoshim): Needs some checks if the calculated fetch_cors_flag_ is - // allowed in this request or not. + if (fetch_cors_flag_) { + request_.headers.SetHeader(net::HttpRequestHeaders::kOrigin, + request_.request_initiator->Serialize()); + } - mojom::URLLoaderClientPtr network_client; - network_client_binding_.Bind(mojo::MakeRequest(&network_client)); - // Binding |this| as an unretained pointer is safe because - // |network_client_binding_| shares this object's lifetime. - network_client_binding_.set_connection_error_handler(base::BindOnce( - &CORSURLLoader::OnUpstreamConnectionError, base::Unretained(this))); - network_loader_factory_->CreateLoaderAndStart( - mojo::MakeRequest(&network_loader_), routing_id, request_id, options, - request_, std::move(network_client), traffic_annotation); + if (!fetch_cors_flag_ || !NeedsPreflight(request_)) { + StartNetworkRequest(routing_id, request_id, options, traffic_annotation, + base::nullopt); + return; + } + + PreflightController::GetDefaultController()->PerformPreflightCheck( + base::BindOnce(&CORSURLLoader::StartNetworkRequest, + weak_factory_.GetWeakPtr(), routing_id, request_id, + options, traffic_annotation), + request_id, request_, + net::NetworkTrafficAnnotationTag(traffic_annotation), + network_loader_factory); } CORSURLLoader::~CORSURLLoader() {} @@ -119,9 +147,6 @@ void CORSURLLoader::SetPriority(net::RequestPriority priority, int32_t intra_priority_value) { - // TODO(toyoshim): Should not be called during the redirect decisions, but - // Blink calls actually. - // DCHECK(!is_waiting_follow_redirect_call_); if (network_loader_) network_loader_->SetPriority(priority, intra_priority_value); } @@ -145,15 +170,15 @@ DCHECK(forwarding_client_); DCHECK(!is_waiting_follow_redirect_call_); if (fetch_cors_flag_ && - cors::IsCORSEnabledRequestMode(request_.fetch_request_mode)) { + IsCORSEnabledRequestMode(request_.fetch_request_mode)) { // TODO(toyoshim): Reflect --allow-file-access-from-files flag. - base::Optional<mojom::CORSError> cors_error = cors::CheckAccess( + base::Optional<mojom::CORSError> cors_error = CheckAccess( last_response_url_, response_head.headers->response_code(), GetHeaderString(response_head.headers, - cors::header_names::kAccessControlAllowOrigin), + header_names::kAccessControlAllowOrigin), GetHeaderString(response_head.headers, - cors::header_names::kAccessControlAllowCredentials), - request_.fetch_credentials_mode, security_origin_); + header_names::kAccessControlAllowCredentials), + request_.fetch_credentials_mode, *request_.request_initiator); if (cors_error) { // TODO(toyoshim): Generate related_response_headers here. CORSErrorStatus cors_error_status(*cors_error); @@ -229,6 +254,29 @@ HandleComplete(status); } +void CORSURLLoader::StartNetworkRequest( + int32_t routing_id, + int32_t request_id, + uint32_t options, + const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, + base::Optional<CORSErrorStatus> status) { + if (status) { + forwarding_client_->OnComplete(URLLoaderCompletionStatus(*status)); + forwarding_client_.reset(); + return; + } + + mojom::URLLoaderClientPtr network_client; + network_client_binding_.Bind(mojo::MakeRequest(&network_client)); + // Binding |this| as an unretained pointer is safe because + // |network_client_binding_| shares this object's lifetime. + network_client_binding_.set_connection_error_handler(base::BindOnce( + &CORSURLLoader::OnUpstreamConnectionError, base::Unretained(this))); + network_loader_factory_->CreateLoaderAndStart( + mojo::MakeRequest(&network_loader_), routing_id, request_id, options, + request_, std::move(network_client), traffic_annotation); +} + void CORSURLLoader::OnUpstreamConnectionError() { // |network_client_binding_| has experienced a connection error and will no // longer call any of the mojom::URLLoaderClient methods above. The client
diff --git a/services/network/cors/cors_url_loader.h b/services/network/cors/cors_url_loader.h index d82a9b0..a3eee10f 100644 --- a/services/network/cors/cors_url_loader.h +++ b/services/network/cors/cors_url_loader.h
@@ -5,8 +5,11 @@ #ifndef SERVICES_NETWORK_CORS_CORS_URL_LOADER_H_ #define SERVICES_NETWORK_CORS_CORS_URL_LOADER_H_ +#include "base/memory/weak_ptr.h" +#include "base/optional.h" #include "mojo/public/cpp/bindings/binding.h" #include "net/traffic_annotation/network_traffic_annotation.h" +#include "services/network/public/cpp/cors/cors_error_status.h" #include "services/network/public/mojom/fetch_api.mojom.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" #include "url/gurl.h" @@ -61,6 +64,13 @@ void OnComplete(const URLLoaderCompletionStatus& status) override; private: + void StartNetworkRequest( + int32_t routing_id, + int32_t request_id, + uint32_t options, + const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, + base::Optional<CORSErrorStatus> status); + // Called when there is a connection error on the upstream pipe used for the // actual request. void OnUpstreamConnectionError(); @@ -80,9 +90,6 @@ // To be a URLLoader for the client. mojom::URLLoaderClientPtr forwarding_client_; - // Request initiator's origin. - url::Origin security_origin_; - // The last response URL, that is usually the requested URL, but can be // different if redirects happen. GURL last_response_url_; @@ -94,6 +101,9 @@ // Corresponds to the Fetch spec, https://fetch.spec.whatwg.org/. bool fetch_cors_flag_; + // Used to run asynchronous class instance bound callbacks safely. + base::WeakPtrFactory<CORSURLLoader> weak_factory_; + DISALLOW_COPY_AND_ASSIGN(CORSURLLoader); };
diff --git a/services/network/cors/preflight_controller.cc b/services/network/cors/preflight_controller.cc index 4f162fdc..5ede5fd 100644 --- a/services/network/cors/preflight_controller.cc +++ b/services/network/cors/preflight_controller.cc
@@ -97,6 +97,7 @@ } DCHECK(request.request_initiator); + preflight_request->request_initiator = request.request_initiator; preflight_request->headers.SetHeader(net::HttpRequestHeaders::kOrigin, request.request_initiator->Serialize()); @@ -104,6 +105,10 @@ // enabled by default. preflight_request->skip_service_worker = true; + // TODO(toyoshim): Should not matter, but at this moment, it hits a sanity + // check in ResourceDispatcherHostImpl if |resource_type| isn't set. + preflight_request->resource_type = request.resource_type; + return preflight_request; } @@ -115,7 +120,7 @@ DCHECK(detected_error); // TODO(toyoshim): Reflect --allow-file-access-from-files flag. - *detected_error = CheckAccess( + *detected_error = CheckPreflightAccess( final_url, head.headers->response_code(), GetHeaderString(head.headers, cors::header_names::kAccessControlAllowOrigin), @@ -177,6 +182,57 @@ return base::nullopt; } +// TODO(toyoshim): Remove this class once the Network Service is enabled. +// This wrapper class is used to tell the actual request's |request_id| to call +// CreateLoaderAndStart() for the legacy implementation that requires the ID +// to be unique while SimpleURLLoader always set it to 0. +class WrappedLegacyURLLoaderFactory final : public mojom::URLLoaderFactory { + public: + static WrappedLegacyURLLoaderFactory* GetSharedInstance() { + static WrappedLegacyURLLoaderFactory factory; + return &factory; + } + + ~WrappedLegacyURLLoaderFactory() override = default; + + void SetFactoryAndRequestId(mojom::URLLoaderFactory* factory, + int32_t request_id) { + factory_ = factory; + request_id_ = request_id; + } + + void CheckIdle() { + DCHECK(!factory_); + DCHECK_EQ(0, request_id_); + } + + // mojom::URLLoaderFactory: + void CreateLoaderAndStart(::network::mojom::URLLoaderRequest loader, + int32_t routing_id, + int32_t request_id, + uint32_t options, + const network::ResourceRequest& request, + ::network::mojom::URLLoaderClientPtr client, + const net::MutableNetworkTrafficAnnotationTag& + traffic_annotation) override { + factory_->CreateLoaderAndStart(std::move(loader), routing_id, request_id_, + options, request, std::move(client), + traffic_annotation); + factory_ = nullptr; + request_id_ = 0; + } + + void Clone(mojom::URLLoaderFactoryRequest factory) override { + // Should not be called because retry logic is disabled to use + // SimpleURLLoader. Could not work correctly by design. + NOTREACHED(); + } + + private: + mojom::URLLoaderFactory* factory_ = nullptr; + int32_t request_id_ = 0; +}; + } // namespace class PreflightController::PreflightLoader final { @@ -192,18 +248,25 @@ annotation_tag); } - void Request(mojom::URLLoaderFactory* loader_factory) { + void Request(mojom::URLLoaderFactory* loader_factory, int32_t request_id) { DCHECK(loader_); loader_->SetOnRedirectCallback(base::BindRepeating( &PreflightLoader::HandleRedirect, base::Unretained(this))); loader_->SetOnResponseStartedCallback(base::BindRepeating( &PreflightLoader::HandleResponseHeader, base::Unretained(this))); + + // TODO(toyoshim): Stop using WrappedLegacyURLLoaderFactory once the Network + // Service is enabled by default. This is a workaround to use an allowed + // request_id in the legacy URLLoaderFactory. + WrappedLegacyURLLoaderFactory::GetSharedInstance()->SetFactoryAndRequestId( + loader_factory, request_id); loader_->DownloadToString( - loader_factory, + WrappedLegacyURLLoaderFactory::GetSharedInstance(), base::BindOnce(&PreflightLoader::HandleResponseBody, base::Unretained(this)), 0); + WrappedLegacyURLLoaderFactory::GetSharedInstance()->CheckIdle(); } private: @@ -255,7 +318,11 @@ } void HandleResponseBody(std::unique_ptr<std::string> response_body) { - NOTREACHED(); + // Reached only when the request fails without receiving headers. + DCHECK(!response_body); + + // TODO(toyoshim): FinalizeLoader() and RemoveFromController() need to be + // called in this case. Try in the follow-up change. } void FinalizeLoader() { @@ -287,18 +354,26 @@ return CreatePreflightRequest(request); } +// static +PreflightController* PreflightController::GetDefaultController() { + static PreflightController controller; + return &controller; +} + PreflightController::PreflightController() = default; PreflightController::~PreflightController() = default; void PreflightController::PerformPreflightCheck( CompletionCallback callback, + int32_t request_id, const ResourceRequest& request, const net::NetworkTrafficAnnotationTag& annotation_tag, mojom::URLLoaderFactory* loader_factory) { DCHECK(request.request_initiator); - if (cache_.CheckIfRequestCanSkipPreflight( + if (!request.is_external_request && + cache_.CheckIfRequestCanSkipPreflight( request.request_initiator->Serialize(), request.url, request.fetch_credentials_mode, request.method, request.headers)) { std::move(callback).Run(base::nullopt); @@ -307,7 +382,7 @@ auto emplaced_pair = loaders_.emplace(std::make_unique<PreflightLoader>( this, std::move(callback), request, annotation_tag)); - (*emplaced_pair.first)->Request(loader_factory); + (*emplaced_pair.first)->Request(loader_factory, request_id); } void PreflightController::RemoveLoader(PreflightLoader* loader) {
diff --git a/services/network/cors/preflight_controller.h b/services/network/cors/preflight_controller.h index 7d2bbd7..b280625 100644 --- a/services/network/cors/preflight_controller.h +++ b/services/network/cors/preflight_controller.h
@@ -39,14 +39,20 @@ static std::unique_ptr<ResourceRequest> CreatePreflightRequestForTesting( const ResourceRequest& request); + // Obtains the shared default controller instance. + // TODO(toyoshim): Find a right owner rather than a single design. + static PreflightController* GetDefaultController(); + PreflightController(); ~PreflightController(); // Determines if a CORS-preflight request is needed, and checks the cache, or // makes a preflight request if it is needed. A result will be notified // synchronously or asynchronously. + // TODO(toyoshim): Remove |request_id| once the Network Service is enabled. void PerformPreflightCheck( CompletionCallback callback, + int32_t request_id, const ResourceRequest& resource_request, const net::NetworkTrafficAnnotationTag& traffic_annotation, mojom::URLLoaderFactory* loader_factory);
diff --git a/services/network/cors/preflight_controller_unittest.cc b/services/network/cors/preflight_controller_unittest.cc index 6360d32c..777cf9f 100644 --- a/services/network/cors/preflight_controller_unittest.cc +++ b/services/network/cors/preflight_controller_unittest.cc
@@ -162,7 +162,8 @@ preflight_controller_->PerformPreflightCheck( base::BindOnce(&PreflightControllerTest::HandleRequestCompletion, base::Unretained(this)), - request, TRAFFIC_ANNOTATION_FOR_TESTS, url_loader_factory_ptr_.get()); + 0 /* request_id */, request, TRAFFIC_ANNOTATION_FOR_TESTS, + url_loader_factory_ptr_.get()); run_loop_->Run(); }
diff --git a/services/network/public/cpp/BUILD.gn b/services/network/public/cpp/BUILD.gn index 7f12ea0..3fd0ef42e 100644 --- a/services/network/public/cpp/BUILD.gn +++ b/services/network/public/cpp/BUILD.gn
@@ -57,7 +57,6 @@ "//base", "//components/prefs", "//ipc", - "//mojo/common", "//services/proxy_resolver/public/mojom", ]
diff --git a/services/network/public/cpp/cors/cors.cc b/services/network/public/cpp/cors/cors.cc index ec66ab8..bc83c8e 100644 --- a/services/network/public/cpp/cors/cors.cc +++ b/services/network/public/cpp/cors/cors.cc
@@ -83,6 +83,8 @@ mojom::FetchCredentialsMode credentials_mode, const url::Origin& origin, bool allow_file_origin) { + // TODO(toyoshim): This response status code check should not be needed. We + // have another status code check after a CheckAccess() call if it is needed. if (!response_status_code) return mojom::CORSError::kInvalidResponse; @@ -92,6 +94,7 @@ // See https://fetch.spec.whatwg.org/#cors-protocol-and-credentials. if (credentials_mode != mojom::FetchCredentialsMode::kInclude) return base::nullopt; + // Since the credential is a concept for network schemes, we perform the // wildcard check only for HTTP and HTTPS. This is a quick hack to allow // data URL (see https://crbug.com/315152). @@ -140,11 +143,50 @@ // This check should be case sensitive. // See also https://fetch.spec.whatwg.org/#http-new-header-syntax. if (allow_credentials_header != kLowerCaseTrue) - return mojom::CORSError::kDisallowCredentialsNotSetToTrue; + return mojom::CORSError::kInvalidAllowCredentials; } return base::nullopt; } +base::Optional<mojom::CORSError> CheckPreflightAccess( + const GURL& response_url, + const int response_status_code, + const base::Optional<std::string>& allow_origin_header, + const base::Optional<std::string>& allow_credentials_header, + mojom::FetchCredentialsMode actual_credentials_mode, + const url::Origin& origin, + bool allow_file_origin) { + base::Optional<mojom::CORSError> error = + CheckAccess(response_url, response_status_code, allow_origin_header, + allow_credentials_header, actual_credentials_mode, origin, + allow_file_origin); + if (!error) + return base::nullopt; + + // TODO(toyoshim): Remove following two lines when the status code check is + // removed from CheckAccess(). + if (*error == mojom::CORSError::kInvalidResponse) + return error; + + switch (*error) { + case mojom::CORSError::kWildcardOriginNotAllowed: + return mojom::CORSError::kPreflightWildcardOriginNotAllowed; + case mojom::CORSError::kMissingAllowOriginHeader: + return mojom::CORSError::kPreflightMissingAllowOriginHeader; + case mojom::CORSError::kMultipleAllowOriginValues: + return mojom::CORSError::kPreflightMultipleAllowOriginValues; + case mojom::CORSError::kInvalidAllowOriginValue: + return mojom::CORSError::kPreflightInvalidAllowOriginValue; + case mojom::CORSError::kAllowOriginMismatch: + return mojom::CORSError::kPreflightAllowOriginMismatch; + case mojom::CORSError::kInvalidAllowCredentials: + return mojom::CORSError::kPreflightInvalidAllowCredentials; + default: + NOTREACHED(); + } + return error; +} + base::Optional<mojom::CORSError> CheckRedirectLocation(const GURL& redirect_url, bool skip_scheme_check) { if (!skip_scheme_check) { @@ -239,6 +281,14 @@ return false; } +bool IsForbiddenMethod(const std::string& method) { + static const std::vector<std::string> forbidden_methods = {"trace", "track", + "connect"}; + const std::string lower_method = base::ToLowerASCII(method); + return std::find(forbidden_methods.begin(), forbidden_methods.end(), + lower_method) != forbidden_methods.end(); +} + bool IsForbiddenHeader(const std::string& name) { // http://fetch.spec.whatwg.org/#forbidden-header-name // "A forbidden header name is a header name that is one of:
diff --git a/services/network/public/cpp/cors/cors.h b/services/network/public/cpp/cors/cors.h index dac73c3..45f67efa 100644 --- a/services/network/public/cpp/cors/cors.h +++ b/services/network/public/cpp/cors/cors.h
@@ -45,6 +45,7 @@ } // namespace header_names // Performs a CORS access check on the response parameters. +// This implements https://fetch.spec.whatwg.org/#concept-cors-check COMPONENT_EXPORT(NETWORK_CPP) base::Optional<mojom::CORSError> CheckAccess( const GURL& response_url, @@ -55,6 +56,20 @@ const url::Origin& origin, bool allow_file_origin = false); +// Performs a CORS access check on the CORS-preflight response parameters. +// According to the note at https://fetch.spec.whatwg.org/#cors-preflight-fetch +// step 6, even for a preflight check, |credentials_mode| should be checked on +// the actual request rather than preflight one. +COMPONENT_EXPORT(NETWORK_CPP) +base::Optional<mojom::CORSError> CheckPreflightAccess( + const GURL& response_url, + const int response_status_code, + const base::Optional<std::string>& allow_origin_header, + const base::Optional<std::string>& allow_credentials_header, + network::mojom::FetchCredentialsMode actual_credentials_mode, + const url::Origin& origin, + bool allow_file_origin = false); + // Given a redirected-to URL, checks if the location is allowed // according to CORS. That is: // - the URL has a CORS supported scheme and @@ -90,6 +105,12 @@ COMPONENT_EXPORT(NETWORK_CPP) bool IsCORSSafelistedHeader(const std::string& name, const std::string& value); +// Checks forbidden method in the fetch spec. +// See https://fetch.spec.whatwg.org/#forbidden-method. +// TODO(toyoshim): Move Blink FetchUtils::IsForbiddenMethod to CORS:: and use +// this implementation internally. +COMPONENT_EXPORT(NETWORK_CPP) bool IsForbiddenMethod(const std::string& name); + // Checks forbidden header in the fetch spec. // See https://fetch.spec.whatwg.org/#forbidden-header-name. COMPONENT_EXPORT(NETWORK_CPP) bool IsForbiddenHeader(const std::string& name);
diff --git a/services/network/public/cpp/cors/cors_unittest.cc b/services/network/public/cpp/cors/cors_unittest.cc index 14fafab5..8a3d25a 100644 --- a/services/network/public/cpp/cors/cors_unittest.cc +++ b/services/network/public/cpp/cors/cors_unittest.cc
@@ -142,9 +142,8 @@ EXPECT_FALSE(error3); } -// Tests if cors::CheckAccess detects kDisallowCredentialsNotSetToTrue error -// correctly. -TEST_F(CORSTest, CheckAccessDetectsDisallowCredentialsNotSetToTrue) { +// Tests if cors::CheckAccess detects kInvalidAllowCredentials error correctly. +TEST_F(CORSTest, CheckAccessDetectsInvalidAllowCredential) { const GURL response_url("http://example.com/data"); const url::Origin origin = url::Origin::Create(GURL("http://google.com")); const int response_status_code = 200; @@ -162,7 +161,7 @@ base::nullopt /* allow_credentials_header */, network::mojom::FetchCredentialsMode::kInclude, origin); ASSERT_TRUE(error2); - EXPECT_EQ(mojom::CORSError::kDisallowCredentialsNotSetToTrue, *error2); + EXPECT_EQ(mojom::CORSError::kInvalidAllowCredentials, *error2); } // Tests if cors::CheckRedirectLocation detects kRedirectDisallowedScheme and
diff --git a/services/network/public/cpp/cors/preflight_cache.h b/services/network/public/cpp/cors/preflight_cache.h index 26873dd..0a1d6a78 100644 --- a/services/network/public/cpp/cors/preflight_cache.h +++ b/services/network/public/cpp/cors/preflight_cache.h
@@ -23,6 +23,9 @@ // A class to implement CORS-preflight cache that is defined in the fetch spec, // https://fetch.spec.whatwg.org/#concept-cache. +// TODO(toyoshim): Consider to replace the oldest entry with the new one when +// we have too much cached entries. Also, we want to clear all cached entries +// when users' network configuration is changed. class COMPONENT_EXPORT(NETWORK_CPP) PreflightCache final { public: PreflightCache();
diff --git a/services/network/public/mojom/cors.mojom b/services/network/public/mojom/cors.mojom index e3730ecf..9de6bae 100644 --- a/services/network/public/mojom/cors.mojom +++ b/services/network/public/mojom/cors.mojom
@@ -15,17 +15,55 @@ // Access control kDisallowedByMode, kInvalidResponse, - kAllowOriginMismatch, + + // Not allowed wildcard origin was found in Access-Control-Allow-Origin + // response header when the credentials mode is 'include'. kWildcardOriginNotAllowed, + + // Access-Control-Allow-Origin response header was not found. kMissingAllowOriginHeader, + + // Not allowed multiple origin values was found in Access-Control-Allow-Origin + // response header. kMultipleAllowOriginValues, + + // Invalid origin was found in Access-Control-Allow-Origin response header. kInvalidAllowOriginValue, - kDisallowCredentialsNotSetToTrue, + + // Not allowed by Access-Control-Allow-Origin response header. + kAllowOriginMismatch, + + // Invalid value was found in Access-Control-Allow-Credentials response + // header. + kInvalidAllowCredentials, // Preflight - // Failed to check HTTP response ok status in CORS-preflight response. + // Failed to check HTTP response ok status in a CORS-preflight response. kPreflightInvalidStatus, + // Not allowed wildcard origin was found in Access-Control-Allow-Origin + // CORS-preflight response header when the credentials mode is 'include'. + kPreflightWildcardOriginNotAllowed, + + // Access-Control-Allow-Origin response header was not found in a + // CORS-preflight response. + kPreflightMissingAllowOriginHeader, + + // Not allowed multiple origin values was found in Access-Control-Allow-Origin + // CORS-preflight response header. + kPreflightMultipleAllowOriginValues, + + // Invalid origin was found in Access-Control-Allow-Origin CORS-preflight + // response header. + kPreflightInvalidAllowOriginValue, + + // Not allowed by Access-Control-Allow-Origin CORS-preflight response header. + kPreflightAllowOriginMismatch, + + // Invalid value was found in Access-Control-Allow-Credentials CORS-preflight + // response header. + kPreflightInvalidAllowCredentials, + // "Access-Control-Allow-External:" // ( https://wicg.github.io/cors-rfc1918/#headers ) specific error // conditions:
diff --git a/services/preferences/BUILD.gn b/services/preferences/BUILD.gn index 0681fef..9e6abf395 100644 --- a/services/preferences/BUILD.gn +++ b/services/preferences/BUILD.gn
@@ -23,7 +23,6 @@ ] deps = [ "//components/prefs", - "//mojo/common:values_struct_traits", "//services/preferences/public/cpp", "//services/preferences/public/cpp/lib", "//services/preferences/public/mojom",
diff --git a/services/preferences/persistent_pref_store_impl.cc b/services/preferences/persistent_pref_store_impl.cc index d291ee8..68f9b1a 100644 --- a/services/preferences/persistent_pref_store_impl.cc +++ b/services/preferences/persistent_pref_store_impl.cc
@@ -10,7 +10,6 @@ #include "base/stl_util.h" #include "base/values.h" #include "components/prefs/persistent_pref_store.h" -#include "mojo/common/values_struct_traits.h" #include "mojo/public/cpp/bindings/binding.h" #include "services/preferences/public/cpp/lib/util.h"
diff --git a/services/preferences/public/cpp/BUILD.gn b/services/preferences/public/cpp/BUILD.gn index 1c27292c..307dd8f 100644 --- a/services/preferences/public/cpp/BUILD.gn +++ b/services/preferences/public/cpp/BUILD.gn
@@ -28,7 +28,6 @@ ] deps = [ - "//mojo/common:values_struct_traits", "//mojo/public/cpp/bindings", "//services/preferences/public/cpp/lib", ]
diff --git a/services/preferences/public/cpp/persistent_pref_store_client.cc b/services/preferences/public/cpp/persistent_pref_store_client.cc index 0df6d62..8c83478 100644 --- a/services/preferences/public/cpp/persistent_pref_store_client.cc +++ b/services/preferences/public/cpp/persistent_pref_store_client.cc
@@ -6,8 +6,6 @@ #include "base/values.h" #include "components/prefs/pref_registry.h" -#include "mojo/common/values.mojom.h" -#include "mojo/common/values_struct_traits.h" #include "mojo/public/cpp/bindings/sync_call_restrictions.h" #include "services/preferences/public/cpp/pref_registry_serializer.h"
diff --git a/services/preferences/public/mojom/BUILD.gn b/services/preferences/public/mojom/BUILD.gn index d512a9e..8c6fcd0 100644 --- a/services/preferences/public/mojom/BUILD.gn +++ b/services/preferences/public/mojom/BUILD.gn
@@ -10,7 +10,6 @@ "tracked_preference_validation_delegate.mojom", ] public_deps = [ - "//mojo/common:common_custom_types", "//mojo/public/mojom/base", ] }
diff --git a/services/service_manager/embedder/main.cc b/services/service_manager/embedder/main.cc index a2208da..a79ba40 100644 --- a/services/service_manager/embedder/main.cc +++ b/services/service_manager/embedder/main.cc
@@ -300,6 +300,12 @@ return exit_code; } +bool IsRootProcess() { + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + return command_line.GetSwitchValueASCII(switches::kProcessType).empty(); +} + } // namespace MainParams::MainParams(MainDelegate* delegate) : delegate(delegate) {} @@ -404,6 +410,14 @@ ui::RegisterPathProvider(); + // ServiceManager needs to load service manifests from resources.pak, so load + // the file now. + if (IsRootProcess()) { + ui::DataPack* data_pack = delegate->LoadServiceManifestDataPack(); + // TODO(ranj): Read manifest from this data pack. + ignore_result(data_pack); + } + base::debug::GlobalActivityTracker* tracker = base::debug::GlobalActivityTracker::Get(); int exit_code = delegate->Initialize(init_params);
diff --git a/services/service_manager/embedder/main_delegate.h b/services/service_manager/embedder/main_delegate.h index 0c6d11a..80ffb9b7 100644 --- a/services/service_manager/embedder/main_delegate.h +++ b/services/service_manager/embedder/main_delegate.h
@@ -8,6 +8,7 @@ #include <memory> #include "base/callback_forward.h" +#include "build/build_config.h" #include "mojo/edk/embedder/configuration.h" #include "services/service_manager/background/background_service_manager.h" #include "services/service_manager/embedder/process_type.h" @@ -23,6 +24,10 @@ } } +namespace ui { +class DataPack; +} + namespace service_manager { // An interface which must be implemented by Service Manager embedders to @@ -42,6 +47,10 @@ MainDelegate(); virtual ~MainDelegate(); + // Load the "resources.pak" data pack and return the pointer to it. The return + // pointer is not owned by the caller. + virtual ui::DataPack* LoadServiceManifestDataPack() = 0; + // Perform early process initialization. Returns -1 if successful, or the exit // code with which the process should be terminated due to initialization // failure.
diff --git a/services/tracing/BUILD.gn b/services/tracing/BUILD.gn index 1cf95aa..cf4cf131 100644 --- a/services/tracing/BUILD.gn +++ b/services/tracing/BUILD.gn
@@ -24,7 +24,6 @@ public_deps = [ "//base", - "//mojo/common", "//mojo/public/cpp/bindings", "//services/tracing/public/cpp", ]
diff --git a/services/ui/DEPS b/services/ui/DEPS index 5ccd8a2..c1d47ca 100644 --- a/services/ui/DEPS +++ b/services/ui/DEPS
@@ -5,7 +5,6 @@ "+components/discardable_memory/public", "+components/viz/common", "+ipc", - "+mojo/common", "+mojo/converters", "+mojo/public", "+services/catalog/public",
diff --git a/services/ui/clipboard/BUILD.gn b/services/ui/clipboard/BUILD.gn index 0eabe33..112f44c 100644 --- a/services/ui/clipboard/BUILD.gn +++ b/services/ui/clipboard/BUILD.gn
@@ -16,7 +16,6 @@ deps = [ "//base", - "//mojo/common", "//mojo/public/cpp/bindings", "//services/service_manager/public/cpp", "//services/ui/public/interfaces", @@ -32,7 +31,6 @@ deps = [ "//base", - "//mojo/common", "//services/service_manager/public/cpp", "//services/service_manager/public/cpp:service_test_support", "//services/ui/public/interfaces",
diff --git a/services/ui/ime/BUILD.gn b/services/ui/ime/BUILD.gn index 27a7464..bc5c843 100644 --- a/services/ui/ime/BUILD.gn +++ b/services/ui/ime/BUILD.gn
@@ -18,7 +18,6 @@ deps = [ "//base", - "//mojo/common", "//mojo/public/cpp/bindings", "//services/service_manager/public/cpp", "//services/ui/public/interfaces", @@ -34,7 +33,6 @@ deps = [ "//base", - "//mojo/common", "//services/service_manager/public/cpp", "//services/service_manager/public/cpp:service_test_support", "//services/ui/public/interfaces",
diff --git a/services/ui/ws/BUILD.gn b/services/ui/ws/BUILD.gn index 6be10f9..1ec50e9 100644 --- a/services/ui/ws/BUILD.gn +++ b/services/ui/ws/BUILD.gn
@@ -229,7 +229,6 @@ "//base/test:test_config", "//base/test:test_support", "//components/viz/test:test_support", - "//mojo/common", "//mojo/public/cpp/bindings:bindings", "//services/service_manager/public/cpp", "//services/service_manager/public/cpp:service_test_support",
diff --git a/services/ui/ws2/BUILD.gn b/services/ui/ws2/BUILD.gn index 64f60841..5eb6356 100644 --- a/services/ui/ws2/BUILD.gn +++ b/services/ui/ws2/BUILD.gn
@@ -68,7 +68,6 @@ "//base", "//base/test:test_config", "//components/viz/test:test_support", - "//mojo/common", "//mojo/public/cpp/bindings:bindings", "//services/service_manager/public/cpp", "//services/service_manager/public/cpp:service_test_support",
diff --git a/storage/browser/BUILD.gn b/storage/browser/BUILD.gn index dab39aa2..80bd20e 100644 --- a/storage/browser/BUILD.gn +++ b/storage/browser/BUILD.gn
@@ -304,7 +304,6 @@ ":test_support", "//base/test:test_support", "//components/services/filesystem/public/interfaces", - "//mojo/common", "//mojo/edk", "//net:test_support", "//services/network/public/cpp", @@ -357,7 +356,6 @@ deps = [ ":browser", "//base/test:test_support", - "//mojo/common", "//net:test_support", "//testing/gtest", "//third_party/leveldatabase",
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index f96b686..d52d9ac5 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -2809,8 +2809,7 @@ "gtest_tests": [ { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/fuchsia.base_unittests.filter", - "--use-new-test-runner" + "--test-launcher-filter-file=../../testing/buildbot/filters/fuchsia.base_unittests.filter" ], "swarming": { "can_use_on_swarming_builders": true, @@ -2859,9 +2858,6 @@ "test": "cronet_unittests" }, { - "args": [ - "--use-new-test-runner" - ], "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2874,8 +2870,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/fuchsia.ipc_tests.filter", - "--use-new-test-runner" + "--test-launcher-filter-file=../../testing/buildbot/filters/fuchsia.ipc_tests.filter" ], "swarming": { "can_use_on_swarming_builders": true, @@ -2900,8 +2895,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/fuchsia.mojo_unittests.filter", - "--use-new-test-runner" + "--test-launcher-filter-file=../../testing/buildbot/filters/fuchsia.mojo_unittests.filter" ], "swarming": { "can_use_on_swarming_builders": true, @@ -2930,8 +2924,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/fuchsia.service_manager_unittests.filter", - "--use-new-test-runner" + "--test-launcher-filter-file=../../testing/buildbot/filters/fuchsia.service_manager_unittests.filter" ], "swarming": { "can_use_on_swarming_builders": true, @@ -2944,10 +2937,6 @@ "test": "service_manager_unittests" }, { - "args": [ - "--use-new-test-runner", - "-v" - ], "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2959,10 +2948,6 @@ "test": "skia_unittests" }, { - "args": [ - "--use-new-test-runner", - "-v" - ], "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index 87b3e38..90e2344 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json
@@ -2441,6 +2441,26 @@ } }, { + "args": [ + "--zero-tests-executed-ok" + ], + "experiment_percentage": 100, + "isolate_name": "webkit_layout_tests_exparchive", + "merge": { + "args": [ + "--verbose" + ], + "script": "//third_party/blink/tools/merge_web_test_results.py" + }, + "name": "webkit_layout_tests", + "only_retry_failed_tests": true, + "results_handler": "layout tests", + "swarming": { + "can_use_on_swarming_builders": true, + "shards": 12 + } + }, + { "isolate_name": "webkit_python_tests", "name": "webkit_python_tests", "swarming": {
diff --git a/testing/buildbot/filters/fuchsia.base_unittests.filter b/testing/buildbot/filters/fuchsia.base_unittests.filter index 9e5c84624..f771e49 100644 --- a/testing/buildbot/filters/fuchsia.base_unittests.filter +++ b/testing/buildbot/filters/fuchsia.base_unittests.filter
@@ -54,11 +54,6 @@ -ObserverListThreadSafeTest.CrossThreadObserver -TraceCategoryTest.ThreadRaces -# This test expects a task to complete no later than 250ms after it's expected -# to, but that's easily a poor assumption when running on QEMU without hardware -# virtualization. --*TaskSchedulerWorkerPoolImplTest.PostDelayedTask* - # https://crbug.com/751894 -ConditionVariableTest.LargeFastTaskTest
diff --git a/testing/buildbot/filters/mash.browser_tests.filter b/testing/buildbot/filters/mash.browser_tests.filter index 5aa593a6..cb3426e 100644 --- a/testing/buildbot/filters/mash.browser_tests.filter +++ b/testing/buildbot/filters/mash.browser_tests.filter
@@ -246,12 +246,9 @@ -VirtualKeyboardStateTest.* -VirtualKeyboardWebContentTest.* -# Also fails with mus. http://crbug.com/755318. --WebViewScrollBubbling/WebViewGuestScrollTouchTest.* - -# Also fails with mus. http://crbug.com/755328 --WebViewFocusBrowserPluginSpecificTest.* --WebViewSizeTest.* +# Timeouts in content::WaitForChildFrameSurfaceReady() +# Crashes in viz::HostFrameSinkManager::RegisterFrameSinkId() +# http://crbug.com/755328 -WebViewTest.* # Sending invalid FrameSinkIds crbug.com/796999 @@ -287,7 +284,9 @@ -PresentationReceiverWindowViewBrowserTest.ChromeOSHardwareFullscreenButton # RenderFrameMetadata observation not supported: https://crbug.com/820974 +-WebViewFocusBrowserPluginSpecificTest.* -WebViewGuestScrollLatchingTest.ScrollLatchingPreservedInGuests +-WebViewScrollBubbling/WebViewGuestScrollTouchTest.* -WebViewScrollGuestContentBrowserPluginSpecificTest.OverscrollControllerSeesConsumedScrollsInGuest -WebViewScrollBubbling/WebViewGuestScrollTest.TestGuestWheelScrollsBubble/*
diff --git a/testing/buildbot/filters/mojo.fyi.network_content_browsertests.filter b/testing/buildbot/filters/mojo.fyi.network_content_browsertests.filter index 86e49271..5e6d98ce 100644 --- a/testing/buildbot/filters/mojo.fyi.network_content_browsertests.filter +++ b/testing/buildbot/filters/mojo.fyi.network_content_browsertests.filter
@@ -69,7 +69,4 @@ # http://crbug.com/819663. -WebContentsImplBrowserTest.UpdateLoadState -# https://crbug.com/808759 --DownloadContentTest.DownloadAttributeBlobURL - -# NOTE: before adding new exclusions, please reach out to network-service-dev@. +# NOTE: before adding new exclusions, please reach out to network-service-dev@. \ No newline at end of file
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index 374d5ace..6109e05 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -117,11 +117,6 @@ }, }, # chromium.fyi - 'Fuchsia': { - 'args': [ - '--use-new-test-runner', - ], - }, 'Out of Process Profiling Mac': { 'swarming': { 'shards': 5, @@ -1291,14 +1286,6 @@ # Audio Linux" at all, since they're supposed to be compiled out for # Chromecast. ], - 'modifications': { - # chromium.fyi - 'Fuchsia': { - 'args': [ - '--use-new-test-runner', - ], - }, - }, }, 'dbus_unittests': { 'remove_from': [ @@ -1829,12 +1816,6 @@ '600', ], }, - # chromium.fyi - 'Fuchsia': { - 'args': [ - '--use-new-test-runner', - ], - }, }, }, 'jingle_unittests': { @@ -2112,16 +2093,6 @@ }, }, }, - 'mojo_unittests': { - 'modifications': { - # chromium.fyi - 'Fuchsia': { - 'args': [ - '--use-new-test-runner', - ], - }, - }, - }, 'nacl_helper_nonsfi_unittests': { 'remove_from': [ # chromium.clang @@ -2483,14 +2454,6 @@ 'Win7 Tests (dbg)(1)', 'Win10 Tests x64', ], - 'modifications': { - # chromium.fyi - 'Fuchsia': { - 'args': [ - '--use-new-test-runner', - ], - }, - } }, 'services_unittests': { 'remove_from': [ @@ -2681,15 +2644,6 @@ 'Cast Audio Linux', 'Cast Linux', ], - 'modifications': { - # chromium.fyi - 'Fuchsia': { - 'args': [ - '--use-new-test-runner', - '-v', # Useful for getting debug info and SCP throughput stats. - ], - }, - }, }, 'snapshot_unittests': { 'remove_from': [ @@ -2732,14 +2686,6 @@ 'hard_timeout': 120, }, }, - - # chromium.fyi - 'Fuchsia': { - 'args': [ - '--use-new-test-runner', - '-v', # Useful for getting debug info and SCP throughput stats. - ], - }, }, }, 'storage_unittests': { @@ -3264,7 +3210,6 @@ # chromium.win 'Win 7 Tests x64 (1)', 'Win10 Tests x64', - 'Win7 Tests (1)', ], 'modifications': { # chromium.fyi @@ -3499,6 +3444,10 @@ }, }, + 'Win7 Tests (1)': { + 'experiment_percentage': 100, + }, + # chromium.win 'Win7 Tests (dbg)(1)': { 'args': [
diff --git a/testing/libfuzzer/fuzzer_test.gni b/testing/libfuzzer/fuzzer_test.gni index 7fe926dc..20f6ec9 100644 --- a/testing/libfuzzer/fuzzer_test.gni +++ b/testing/libfuzzer/fuzzer_test.gni
@@ -93,12 +93,12 @@ } # Generate .options file. - config_name = target_name + ".options" - action(config_name) { + config_file_name = target_name + ".options" + action(config_file_name) { script = "//testing/libfuzzer/gen_fuzzer_config.py" args = [ "--config", - rebase_path("$root_build_dir/" + config_name, root_build_dir), + rebase_path("$root_build_dir/" + config_file_name, root_build_dir), ] if (defined(invoker.dict)) { @@ -115,32 +115,36 @@ } outputs = [ - "$root_build_dir/$config_name", + "$root_build_dir/$config_file_name", ] } - test_deps += [ ":" + config_name ] + test_deps += [ ":" + config_file_name ] } # Generate .owners file (if skip_owners is not true). - # FIXME: Add support for sources parsing in deps attribute. - if (invoker.sources != [] && - (!defined(invoker.skip_owners) || !invoker.skip_owners)) { - owners_name = target_name + ".owners" - action(owners_name) { - script = "//testing/libfuzzer/gen_fuzzer_owners.py" - args = [ - "--owners", - rebase_path("$root_build_dir/" + owners_name, root_build_dir), - "--sources", - ] - args += rebase_path(invoker.sources, root_build_dir) + owners_file_name = target_name + ".owners" + action(owners_file_name) { + script = "//testing/libfuzzer/gen_fuzzer_owners.py" + args = [ + "--owners", + rebase_path("$root_build_dir/" + owners_file_name, root_build_dir), + ] - outputs = [ - "$root_build_dir/$owners_name", - ] + if (defined(invoker.sources) && invoker.sources != []) { + args += [ "--sources" ] + rebase_path(invoker.sources, root_build_dir) + } else if (defined(invoker.deps) && invoker.deps != []) { + args += [ + "--build-dir", + rebase_path("$root_build_dir/", root_build_dir), + "--deps", + ] + invoker.deps } - test_deps += [ ":" + owners_name ] + + outputs = [ + "$root_build_dir/$owners_file_name", + ] } + test_deps += [ ":" + owners_file_name ] test(target_name) { forward_variables_from(invoker,
diff --git a/testing/libfuzzer/gen_fuzzer_owners.py b/testing/libfuzzer/gen_fuzzer_owners.py index 605f080..39c225c 100755 --- a/testing/libfuzzer/gen_fuzzer_owners.py +++ b/testing/libfuzzer/gen_fuzzer_owners.py
@@ -16,8 +16,10 @@ import sys AUTHOR_REGEX = re.compile('author-mail <(.+)>') -THIRD_PARTY_SEARCH_STRING = 'third_party' + os.sep +CHROMIUM_SRC_DIR = os.path.dirname( + os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) OWNERS_FILENAME = 'OWNERS' +THIRD_PARTY_SEARCH_STRING = 'third_party' + os.sep def GetAuthorFromGitBlame(blame_output): @@ -53,6 +55,9 @@ def GetOwnersForFuzzer(sources): """Return owners given a list of sources as input.""" + if not sources: + return + for source in sources: if not os.path.exists(source): continue @@ -60,8 +65,9 @@ with open(source, 'r') as source_file_handle: source_content = source_file_handle.read() - if ('LLVMFuzzerTestOneInput' in source_content or - 'PROTO_FUZZER' in source_content): + if SubStringExistsIn( + ['FuzzOneInput', 'LLVMFuzzerTestOneInput', 'PROTO_FUZZER'], + source_content): # Found the fuzzer source (and not dependency of fuzzer). is_git_file = bool(subprocess.check_output(['git', 'ls-files', source])) @@ -80,18 +86,65 @@ return None +def GetSourcesFromDeps(deps_list, build_dir): + """Return list of sources from parsing deps.""" + if not deps_list: + return None + + all_sources = [] + for deps in deps_list: + output = subprocess.check_output( + [GNPath(), 'desc', build_dir, deps, 'sources']) + for source in output.splitlines(): + if source.startswith('//'): + source = source[2:] + actual_source = os.path.join(CHROMIUM_SRC_DIR, source) + all_sources.append(actual_source) + + return all_sources + + +def GNPath(): + if sys.platform.startswith('linux'): + subdir, exe = 'linux64', 'gn' + elif sys.platform == 'darwin': + subdir, exe = 'mac', 'gn' + else: + subdir, exe = 'win', 'gn.exe' + + return os.path.join(CHROMIUM_SRC_DIR, 'buildtools', subdir, exe) + + +def SubStringExistsIn(substring_list, string): + """Return true if one of the substring in the list is found in |string|.""" + for substring in substring_list: + if substring in string: + return True + + return False + + def main(): parser = argparse.ArgumentParser(description='Generate fuzzer owners file.') parser.add_argument('--owners', required=True) + parser.add_argument('--build-dir') + parser.add_argument('--deps', nargs='+') parser.add_argument('--sources', nargs='+') args = parser.parse_args() - owners = GetOwnersForFuzzer(args.sources) - # Generate owners file. with open(args.owners, 'w') as owners_file: # If we found an owner, then write it to file. # Otherwise, leave empty file to keep ninja happy. + owners = GetOwnersForFuzzer(args.sources) + if owners: + owners_file.write(owners) + return + + # Could not determine owners from |args.sources|. + # So, try parsing sources from |args.deps|. + deps_sources = GetSourcesFromDeps(args.deps, args.build_dir) + owners = GetOwnersForFuzzer(deps_sources) if owners: owners_file.write(owners)
diff --git a/testing/test.gni b/testing/test.gni index 397ebba1..d2f9b67 100644 --- a/testing/test.gni +++ b/testing/test.gni
@@ -268,12 +268,7 @@ # Makes the script which invokes the executable. test_runner_script(_gen_runner_target) { forward_variables_from(invoker, [ "use_test_server" ]) - deps = [ - ":$_exec_target", - ] test_name = _output_name - exe_path = - "$root_out_dir/exe.unstripped/" + get_label_info(_exec_target, "name") package_name = _output_name }
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 5247807..98a4fbd2 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -470,6 +470,24 @@ ] } ], + "AutofillUpstreamUpdatePromptExplanation": [ + { + "platforms": [ + "chromeos", + "linux", + "mac", + "win" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "AutofillUpstreamUpdatePromptExplanation" + ] + } + ] + } + ], "AutofillUpstreamUseGooglePayOnAndroidBranding": [ { "platforms": [ @@ -4223,6 +4241,24 @@ ] } ], + "WebApkGooglePlay": [ + { + "platforms": [ + "android" + ], + "experiments": [ + { + "name": "EnabledLaunch", + "params": { + "webapk_extra_installation_space_mb": "100" + }, + "enable_features": [ + "AdjustWebApkInstallationSpace" + ] + } + ] + } + ], "WebBluetoothBlocklist": [ { "platforms": [
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService b/third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService index e69c92ba..d359385 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService
@@ -40,5 +40,9 @@ # Cross-Origin Read Blocking is not implemented. crbug.com/792546 http/tests/inspector-protocol/network/block_cross_site_document_load.js [ Failure ] +crbug.com/792546 external/wpt/fetch/corb/img-mime-types-coverage.tentative.sub.html [ Failure ] +crbug.com/792546 external/wpt/fetch/corb/img-png-mislabeled-as-html-nosniff.tentative.sub.html [ Failure ] +crbug.com/792546 external/wpt/fetch/corb/preload-image-png-mislabeled-as-html-nosniff.tentative.sub.html [ Failure ] +crbug.com/792546 external/wpt/fetch/corb/script-html-correctly-labeled.tentative.sub.html [ Failure ] crbug.com/812464 inspector-protocol/network/interception-file-url.js [ Pass Crash ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index d02a4b20..9654788 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1220,8 +1220,21 @@ # virtual/outofblink-cors. # # ./thrid_party/blink/tools/run_web_tests.py virtual/outofblink-cors -# Found 2061 tests; running 2060, skipping 1. -# 2060 tests ran as expected (1968 passed, 92 didn't). +# Passed 2005 +# Total 2098 +# Counts skip: 2 crash: 14 text: 67 image: 1 pass: 2005 timeout: 9 + +# Release build only wpt test crashes on CORS-preflight. Should be fixed soon. +crbug.com/836741 [ Release ] virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-cookies-redirect.any.html [ Crash ] +crbug.com/836741 [ Release ] virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-cookies-redirect.any.worker.html [ Crash ] +crbug.com/836741 [ Release ] virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-preflight-star.any.html [ Crash ] +crbug.com/836741 [ Release ] virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-preflight-star.any.worker.html [ Crash ] +crbug.com/836741 [ Release ] virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-preflight.any.html [ Crash ] +crbug.com/836741 [ Release ] virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-preflight.any.worker.html [ Crash ] +crbug.com/836741 [ Release ] virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-redirect-preflight.any.html [ Crash ] +crbug.com/836741 [ Release ] virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-redirect-preflight.any.worker.html [ Crash ] +crbug.com/836741 [ Release ] virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-canvas-tainting-video-cache.https.html [ Crash ] +crbug.com/836741 [ Release ] virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-canvas-tainting-video.https.html [ Crash ] # Skipped tests in dictionary order. crbug.com/757165 [ Win ] virtual/outofblink-cors/external/wpt/service-workers/service-worker/navigation-redirect.https.html [ Skip ] @@ -1233,13 +1246,11 @@ crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-event-network-error.https.html [ Crash ] crbug.com/807954 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-event-respond-with-readable-stream-chunk.https.html [ Crash ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-request-fallback.https.html [ Crash Failure ] -crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-request-redirect.https.html [ Crash ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/performance-timeline.https.html [ Crash ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/redirected-response.https.html [ Crash ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/referer.https.html [ Crash ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/referrer-policy-header.https.html [ Crash ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/redirect-cross-origin-post.html [ Pass Crash ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/upload-onload-event.html [ Crash ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html [ Crash ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/upload-onloadend-event-after-load.html [ Crash ] @@ -1251,7 +1262,6 @@ # Timeout tests in dictionary order. crbug.com/705490 virtual/outofblink-cors/external/wpt/fetch/api/basic/error-after-response.html [ Timeout Pass ] crbug.com/736308 virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-preflight-status.any.html [ Pass Timeout ] -crbug.com/736308 virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-redirect-preflight.any.html [ Pass Timeout ] crbug.com/736308 virtual/outofblink-cors/external/wpt/fetch/api/redirect/redirect-location.html [ Pass Timeout ] crbug.com/813694 virtual/outofblink-cors/external/wpt/fetch/api/redirect/redirect-location-worker.html [ Pass Timeout ] crbug.com/736308 virtual/outofblink-cors/external/wpt/fetch/api/redirect/redirect-origin.html [ Pass Timeout ] @@ -1260,22 +1270,34 @@ crbug.com/626703 virtual/outofblink-cors/external/wpt/fetch/api/response/response-cancel-stream.html [ Pass Timeout ] crbug.com/626703 virtual/outofblink-cors/external/wpt/fetch/http-cache/status.html [ Pass Timeout ] crbug.com/626703 virtual/outofblink-cors/external/wpt/http/basic-auth-cache-test.html [ Timeout ] +crbug.com/688486 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-request-resources.https.html [ Timeout Failure Pass ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/foreign-fetch-basics.https.html [ Timeout ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/sandboxed-iframe-fetch-event.https.html [ Timeout ] crbug.com/626703 virtual/outofblink-cors/external/wpt/service-workers/service-worker/update-bytecheck.https.html [ Timeout ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https.html [ Timeout ] +crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/cross-origin-unsupported-url.html [ Timeout ] +crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/redirect-cross-origin-post.html [ Timeout ] +crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/simple-cross-origin-denied-events-post.html [ Timeout ] +crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/workers/cross-origin-unsupported-url.html [ Timeout ] # Failing tests in dictionary order. -crbug.com/834183 virtual/outofblink-cors/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/update.https.html [ Failure Pass ] +crbug.com/736308 [ Debug ] virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-redirect-preflight.any.html [ Failure ] +crbug.com/736308 [ Debug ] virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-redirect-preflight.any.worker.html [ Failure ] +crbug.com/736308 virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-redirect.any.html [ Failure ] +crbug.com/736308 virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-redirect.any.worker.html [ Failure ] +crbug.com/802835 virtual/outofblink-cors/external/wpt/fetch/corb/img-mime-types-coverage.tentative.sub.html [ Failure ] +crbug.com/802835 virtual/outofblink-cors/external/wpt/fetch/corb/img-png-mislabeled-as-html-nosniff.tentative.sub.html [ Failure ] +crbug.com/802835 virtual/outofblink-cors/external/wpt/fetch/corb/preload-image-png-mislabeled-as-html-nosniff.tentative.sub.html [ Failure ] +crbug.com/802835 virtual/outofblink-cors/external/wpt/fetch/corb/script-html-correctly-labeled.tentative.sub.html [ Failure ] crbug.com/745327 virtual/outofblink-cors/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/registration-attribute.https.html [ Failure Pass ] +crbug.com/834183 virtual/outofblink-cors/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/update.https.html [ Failure Pass ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-canvas-tainting-image-cache.https.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-canvas-tainting-image.https.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-canvas-tainting-video-cache.https.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-canvas-tainting-video.https.html [ Failure ] +crbug.com/736308 [ Debug ] virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-canvas-tainting-video-cache.https.html [ Failure ] +crbug.com/736308 [ Debug ] virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-canvas-tainting-video.https.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-event-referrer-policy.https.html [ Failure ] crbug.com/595993 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-header-visibility.https.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-request-html-imports.https.html [ Failure ] -crbug.com/688486 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-request-resources.https.html [ Failure Pass ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-request-xhr.https.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-response-taint.https.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/foreign-fetch-cors.https.html [ Failure ] @@ -1285,13 +1307,9 @@ crbug.com/831509 virtual/outofblink-cors/external/wpt/service-workers/service-worker/skip-waiting-installed.https.html [ Failure Pass ] crbug.com/832071 virtual/outofblink-cors/external/wpt/service-workers/service-worker/worker-client-id.https.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/chromium/access-control-origin-header-in-isolated-world.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/cross-origin-no-credential-prompt.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/cross-site-denied-response-sync-2.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/cross-site-denied-response-sync.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-whitelisting-all.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-whitelisting-exact-match.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-with-subdomains.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-whitelisting-removal.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-whitelisting-subdomains.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/07.html [ Failure ] @@ -1309,13 +1327,10 @@ crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/19.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/20.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/21.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/22.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/23.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/24.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/25.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/26.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/27.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/28.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/29.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/30.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/31.html [ Failure ] @@ -1323,7 +1338,6 @@ crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/33.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/34.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/35.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/36.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/37.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/38.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/39.html [ Failure ] @@ -1331,19 +1345,13 @@ crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/41.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/42.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/43.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/44.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/45.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/46.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-exact-matching/47.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-whitelisting-https.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/origin-whitelisting-ip-addresses.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/post-blob-content-type-sync.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/redirect-cors-origin-null.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-sync.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/simple-cross-origin-denied-events-sync.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/workers/xmlhttprequest-allowed-with-disabled-web-security.html [ Failure ] crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/xmlhttprequest-allowed-with-disabled-web-security.html [ Failure ] -crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events.html [ Failure ] # ====== Out of Blink CORS related tests END ====== crbug.com/492664 [ Linux ] external/wpt/css/css-writing-modes/box-offsets-rel-pos-vlr-005.xht [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json index 93c530e8..50ea1dcd 100644 --- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -164477,6 +164477,11 @@ {} ] ], + "webmessaging/message-channels/close-expected.txt": [ + [ + {} + ] + ], "webmessaging/support/ChildWindowPostMessage.htm": [ [ {} @@ -383993,8 +383998,12 @@ "e08db72d4b10fd86e278d391e0f204e5a0e6b0d5", "testharness" ], + "webmessaging/message-channels/close-expected.txt": [ + "f3f549b21f200e9c784d1b80a719517df37b5839", + "support" + ], "webmessaging/message-channels/close.html": [ - "f5e17f831c797f2dac4fc5f75e09c5bb79288a5f", + "bcfac9e222374a485ed23433513012733551dafe", "testharness" ], "webmessaging/message-channels/worker.html": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats/new-fc-beside-adjoining-float.html b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats/new-fc-beside-adjoining-float.html new file mode 100644 index 0000000..91adbfc --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats/new-fc-beside-adjoining-float.html
@@ -0,0 +1,16 @@ +<!DOCTYPE html> +<title>A new formatting context that fits beside an adjoining float, and thus pulls down the float with its top margin</title> +<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#bfc-next-to-float" title="9.5 Floats"> +<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#flow-control" title="9.5.2 Controlling flow next to floats: the 'clear' property"> +<meta name="assert" content="The float is adjoining with the box that establishes a new formatting context when it fits beside it, and will therefore be affected by its margin"> +<link rel="match" href="../../reference/ref-filled-green-200px-square.html"> +<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> +<div style="overflow:hidden; width:200px; background:green;"> + <div style="width:300px; margin-top:50px; background:red;"> + <div> + <div style="float:left; width:200px; height:10px; background:green;"></div> + </div> + <div style="margin-top:190px; overflow:hidden; width:100px; height:10px; background:red;"></div> + </div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats/new-fc-separates-from-float.html b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats/new-fc-separates-from-float.html new file mode 100644 index 0000000..89ee7516 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/floats/new-fc-separates-from-float.html
@@ -0,0 +1,16 @@ +<!DOCTYPE html> +<title>A new formatting context that doesn't fit beside a float make the float non-adjoining</title> +<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#bfc-next-to-float" title="9.5 Floats"> +<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#flow-control" title="9.5.2 Controlling flow next to floats: the 'clear' property"> +<meta name="assert" content="Although the 'clear' property isn't specified in this test, a new formatting context that doesn't fit below a float that would otherwise be adjoining will need to separate its margin from the float, so that it doesn't affect the float. This is very similar to clearance."> +<link rel="match" href="../../reference/ref-filled-green-200px-square.html"> +<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> +<div style="overflow:hidden; width:200px; background:red;"> + <div> + <div> + <div style="float:left; width:200px; height:200px; background:green;"></div> + </div> + <div style="margin-top:200px; overflow:hidden; width:200px; height:1px; background:white;"></div> + </div> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/feature-policy/experimental-features/vertical-scroll-scrollintoview.tentative.sub.html b/third_party/WebKit/LayoutTests/external/wpt/feature-policy/experimental-features/vertical-scroll-scrollintoview.tentative.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/feature-policy/experimental-features/vertical-scroll-scrollintoview.tentative.sub.html rename to third_party/WebKit/LayoutTests/external/wpt/feature-policy/experimental-features/vertical-scroll-scrollintoview.tentative.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt index cbc260bc..719cf0eb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 75 tests; 68 PASS, 7 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 76 tests; 69 PASS, 7 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Keyframes can be replaced with an empty keyframe PASS Keyframes can be replaced with a one property two value property-indexed keyframes specification FAIL Keyframes can be replaced with a one shorthand property two value property-indexed keyframes specification assert_equals: properties on ComputedKeyframe #0 should match expected "composite,computedOffset,easing,margin,offset" but got "composite,computedOffset,easing,marginBottom,marginLeft,marginRight,marginTop,offset" @@ -75,5 +75,6 @@ PASS KeyframeEffect constructor throws with property-indexed keyframes with an invalid composite value PASS KeyframeEffect constructor throws with property-indexed keyframes with an invalid composite value as one of the array values PASS KeyframeEffect constructor throws with keyframes with an invalid composite value +PASS Changes made via setKeyframes should be immediately visible in style Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes.html index 90ab89d..675a7058 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes.html
@@ -39,5 +39,17 @@ }); }, `KeyframeEffect constructor throws with ${subtest.desc}`); } + +test(t => { + const frames1 = [ { left: '100px' }, { left: '200px' } ]; + const frames2 = [ { left: '200px' }, { left: '300px' } ]; + + const animation = target.animate(frames1, 1000); + animation.currentTime = 500; + assert_equals(getComputedStyle(target).left, "150px"); + + animation.effect.setKeyframes(frames2); + assert_equals(getComputedStyle(target).left, "250px"); +}, 'Changes made via setKeyframes should be immediately visible in style'); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webmessaging/message-channels/close-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/webmessaging/message-channels/close-expected.txt new file mode 100644 index 0000000..fd66625 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/webmessaging/message-channels/close-expected.txt
@@ -0,0 +1,9 @@ +This is a testharness.js-based test. +PASS Message sent to closed port should not arrive. +PASS Message sent from closed port should not arrive. +PASS Message sent to closed port from transferred port should not arrive. +PASS Inflight messages should be delivered even when sending port is closed afterwards. +PASS Close in onmessage should not cancel inflight messages. +FAIL close() detaches a MessagePort (but not the one its entangled with) assert_throws: function "() => self.postMessage(null, "*", [c.port1])" did not throw +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webmessaging/message-channels/close.html b/third_party/WebKit/LayoutTests/external/wpt/webmessaging/message-channels/close.html index cc3afd8..d975ea7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/webmessaging/message-channels/close.html +++ b/third_party/WebKit/LayoutTests/external/wpt/webmessaging/message-channels/close.html
@@ -59,4 +59,10 @@ c.port2.postMessage('DONE'); }, 'Close in onmessage should not cancel inflight messages.'); +test(() => { + const c = new MessageChannel(); + c.port1.close(); + assert_throws("DataCloneError", () => self.postMessage(null, "*", [c.port1])); + self.postMessage(null, "*", [c.port2]); +}, "close() detaches a MessagePort (but not the one its entangled with)"); </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/side-effects/evaluate-embedder-side-effect-free-constructors-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/side-effects/evaluate-embedder-side-effect-free-constructors-expected.txt index 9bb134d..4b75fabf 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/side-effects/evaluate-embedder-side-effect-free-constructors-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/side-effects/evaluate-embedder-side-effect-free-constructors-expected.txt
@@ -1,3 +1,5 @@ Tests that invoking embedder constructors is side-effect-free. Should not crash. Checking functions on 'window' +Function "Worker" failed side-effect check +Function "SharedWorker" failed side-effect check
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/side-effects/evaluate-embedder-side-effect-free-constructors.js b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/side-effects/evaluate-embedder-side-effect-free-constructors.js index 27d88fe..589370b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/side-effects/evaluate-embedder-side-effect-free-constructors.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/side-effects/evaluate-embedder-side-effect-free-constructors.js
@@ -25,6 +25,20 @@ // that invoke these as constructors MUST properly handle exceptions. var EmbedderCallbacksWithoutSideEffect = new Set(['ReadableStream', 'WritableStream', 'TransformStream']); + // These constructor callbacks are blacklisted with `[Affects=Everything]`, + // and should throwOnSideEffect. + var EmbedderConstructorBlacklist = new Set([ + // The Worker constructor may run a worker in parallel, fetch URLs, and + // modify the global worker set. See spec section 10.2.6.3, step 9. + // https://html.spec.whatwg.org/#dedicated-workers-and-the-worker-interface + 'Worker', + + // The SharedWorker constructor may run a worker in parallel, fetch URLs, + // and modify the global worker set. See spec section 10.2.6.4, step 11. + // https://html.spec.whatwg.org/#shared-workers-and-the-sharedworker-interface + 'SharedWorker' + ]); + testRunner.log(`Checking functions on 'window'`); for (var i = 0; i < constructorNames.length; i++) { var name = constructorNames[i]; @@ -33,8 +47,9 @@ var response = await dp.Runtime.evaluate({expression: `new nativeConstructors[${i}]`, throwOnSideEffect: true}); var exception = response.result.exceptionDetails; var failedSideEffectCheck = exception && exception.exception.description.startsWith('EvalError: Possible side-effect in debug-evaluate'); + var expectedToThrow = EmbedderConstructorBlacklist.has(name); if (failedSideEffectCheck && !EmbedderCallbacksWithoutSideEffect.has(name)) - testRunner.log(`Function "${name}" failed side-effect check`); + testRunner.log(`${expectedToThrow ? '' : 'FAIL: '}Function "${name}" failed side-effect check`); } testRunner.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt index c6c9460f..f820d73 100644 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE ERROR: line 37: Failed to load http://localhost:8000/xmlhttprequest/resources/access-control-basic-get-fail-non-simple.cgi: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The response had HTTP status code 403. +CONSOLE ERROR: line 37: Failed to load http://localhost:8000/xmlhttprequest/resources/access-control-basic-get-fail-non-simple.cgi: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. GET should not trigger a preflight request from a worker unless it has non-simple headers. PASS: Cross-domain access allowed for simple get.
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/svg/paintorder-filtered-expected.png b/third_party/WebKit/LayoutTests/paint/invalidation/svg/paintorder-filtered-expected.png index db3cbf6..9a7de19 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/svg/paintorder-filtered-expected.png +++ b/third_party/WebKit/LayoutTests/paint/invalidation/svg/paintorder-filtered-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/svg/repaint-paintorder-expected.png b/third_party/WebKit/LayoutTests/paint/invalidation/svg/repaint-paintorder-expected.png index b4df77f..8783803 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/svg/repaint-paintorder-expected.png +++ b/third_party/WebKit/LayoutTests/paint/invalidation/svg/repaint-paintorder-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/drawImage-with-globalAlpha-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/drawImage-with-globalAlpha-expected.png index c41ee21..fac5ed7 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/drawImage-with-globalAlpha-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/drawImage-with-globalAlpha-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png index 9f0c697..bfd8fcc 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png index c42690489..4c9b9d5 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-offset-01-b-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-offset-01-b-expected.png index 9f3c7a3..62628bb 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-offset-01-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-offset-01-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-tile-01-b-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-tile-01-b-expected.png index 6f32d1d..b42c8f0 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-tile-01-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-tile-01-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png index afe66d9..905647f 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/painting-fill-05-b-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/painting-fill-05-b-expected.png index 80792c1e..2a612ba1 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/painting-fill-05-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/painting-fill-05-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/text-text-08-b-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/text-text-08-b-expected.png index aaa6ec8..c30799cd 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/text-text-08-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/text-text-08-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-1-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-1-expected.png index e02bbd2..6c7978a0 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-6-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-6-expected.png index 02ad367..2b3915ad 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-6-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/svg-as-background-6-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/batik/filters/filterRegions-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/batik/filters/filterRegions-expected.png index 0617af25..3fcfbf6 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/batik/filters/filterRegions-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/batik/filters/filterRegions-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/batik/paints/patternRegionA-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/batik/paints/patternRegionA-expected.png index 7f71a24..836879d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/batik/paints/patternRegionA-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/batik/paints/patternRegionA-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/textDecoration-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/textDecoration-expected.png index 3759248..ebaabf04 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/textDecoration-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/textDecoration-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/carto.net/colourpicker-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/carto.net/colourpicker-expected.png index 599aeb4..8cc7d64 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/carto.net/colourpicker-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/carto.net/colourpicker-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/carto.net/combobox-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/carto.net/combobox-expected.png index e0ca5c3b..9bfc149 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/carto.net/combobox-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/carto.net/combobox-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/embedding-external-svgs-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/embedding-external-svgs-expected.png index 53d7679..f4127ca1 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/embedding-external-svgs-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/embedding-external-svgs-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-div-area-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-div-area-expected.png index f61bc353..80c064c 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-div-area-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-div-area-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png index c5a448a..960cfe0 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png index 8c0f561..5b7ad435 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/filters/sourceAlpha-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/filters/sourceAlpha-expected.png index d49efc5..7ae82e3 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/filters/sourceAlpha-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/filters/sourceAlpha-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/hixie/perf/002-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/hixie/perf/002-expected.png index a108dab4..04fbdc26 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/hixie/perf/002-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/hixie/perf/002-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/bidi-text-query-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/bidi-text-query-expected.png index 39bbfdc..866428c 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/bidi-text-query-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/bidi-text-query-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.png index 3b6aa09b..f646c371 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/ligature-queries-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/ligature-queries-expected.png index 9256c67..ae9b82db 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/ligature-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/ligature-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-1-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-1-expected.png index 0df4b2c8..b2f43e19 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-2-expected.png index 2ff9b7f..e7f56bb 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-3-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-3-expected.png index 9e980612..c902553 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-4-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-4-expected.png index c718474..27b984c 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-1-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-1-expected.png index 2409956b..85cd1ae 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-2-expected.png index 30d880b7..b709a01 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-3-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-3-expected.png index c83dcaa..a3376a04 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-4-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-4-expected.png index 7234038d..69b063c 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png index 1bb582c..6e462b6 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png index 4b9c44d3..93972a1 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png index 374b9267..756bec5 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png index 48b97fa1..0a02b18 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png index 002e0ae0..41dfbb2 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png index 8a5fc26..eb3ea67 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png index 2520e8a5..acc3443 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.png index e8b36a04..3a1fde4 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-1-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-1-expected.png index cafcb3d1..5f0b606 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-2-expected.png index b89c598..fa6e254 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-3-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-3-expected.png index d89687e..9ec4f82 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-4-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-4-expected.png index 770a83a..bb3b775b 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-1-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-1-expected.png index cafcb3d1..5f0b606 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-2-expected.png index b89c598..fa6e254 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-3-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-3-expected.png index d89687e..9ec4f82 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-4-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-4-expected.png index 770a83a..bb3b775b 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-x-list-with-tspans-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/surrogate-pair-queries-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/surrogate-pair-queries-expected.png index 0565f32..b91e99b 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/surrogate-pair-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/surrogate-pair-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-fill-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-fill-opacity-expected.png index 202f30f..cf63b26c 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-fill-opacity-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-fill-opacity-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-selection-text-08-b-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-selection-text-08-b-expected.png index a685580..12e717e 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-selection-text-08-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-selection-text-08-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/transforms/text-with-mask-with-svg-transform-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/transforms/text-with-mask-with-svg-transform-expected.png index 8fc19e0..e14d870 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/transforms/text-with-mask-with-svg-transform-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/transforms/text-with-mask-with-svg-transform-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/wicd/test-scalable-background-image2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/wicd/test-scalable-background-image2-expected.png index 7a0453e..dc9e14d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/wicd/test-scalable-background-image2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/wicd/test-scalable-background-image2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spv175/paint/invalidation/svg/paintorder-filtered-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spv175/paint/invalidation/svg/paintorder-filtered-expected.png index 8b20413..4f07c41 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spv175/paint/invalidation/svg/paintorder-filtered-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spv175/paint/invalidation/svg/paintorder-filtered-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spv175/paint/invalidation/svg/repaint-paintorder-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spv175/paint/invalidation/svg/repaint-paintorder-expected.png index 631f05d..0651818 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spv175/paint/invalidation/svg/repaint-paintorder-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spv175/paint/invalidation/svg/repaint-paintorder-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/drawImage-with-globalAlpha-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/drawImage-with-globalAlpha-expected.png index c41ee21..fac5ed7 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/drawImage-with-globalAlpha-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/drawImage-with-globalAlpha-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.png index 7d170b4..63e0b37 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/svg/text/surrogate-pair-queries-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/svg/text/surrogate-pair-queries-expected.png index 5818c260..96b71bbd 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/svg/text/surrogate-pair-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/svg/text/surrogate-pair-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/as-background-image/svg-as-background-1-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/as-background-image/svg-as-background-1-expected.png index 4be4159..7ae1e17 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/as-background-image/svg-as-background-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/as-background-image/svg-as-background-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/as-background-image/svg-as-background-6-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/as-background-image/svg-as-background-6-expected.png index 43fff59..628edc5 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/as-background-image/svg-as-background-6-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/as-background-image/svg-as-background-6-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/hixie/perf/002-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/hixie/perf/002-expected.png index 62aaaa6..2b1c2d8 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/hixie/perf/002-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/hixie/perf/002-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/text/combining-character-queries-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/text/combining-character-queries-expected.png index be5dc80c..cfb23833 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/text/combining-character-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/text/combining-character-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/text/ligature-queries-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/text/ligature-queries-expected.png index df561ffe..4e2a83d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/text/ligature-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/text/ligature-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/text/surrogate-pair-queries-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/text/surrogate-pair-queries-expected.png index b5d7024..4ecfa2f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/text/surrogate-pair-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.12/svg/text/surrogate-pair-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/drawImage-with-globalAlpha-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/drawImage-with-globalAlpha-expected.png index 8ccc73a1a..479a742 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/drawImage-with-globalAlpha-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/drawImage-with-globalAlpha-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/images/color-profile-background-image-cross-fade-expected.png b/third_party/WebKit/LayoutTests/platform/mac/images/color-profile-background-image-cross-fade-expected.png index 3f444f3b..bf8c08bd 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/images/color-profile-background-image-cross-fade-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/images/color-profile-background-image-cross-fade-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/images/color-profile-background-image-cross-fade-png-expected.png b/third_party/WebKit/LayoutTests/platform/mac/images/color-profile-background-image-cross-fade-png-expected.png index 3f444f3b..bf8c08bd 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/images/color-profile-background-image-cross-fade-png-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/images/color-profile-background-image-cross-fade-png-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/images/cross-fade-background-size-expected.png b/third_party/WebKit/LayoutTests/platform/mac/images/cross-fade-background-size-expected.png index 59603e2..cd00488 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/images/cross-fade-background-size-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/images/cross-fade-background-size-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png index 75b31122..761668f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png index 68b9d493..5e599a5 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-offset-01-b-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-offset-01-b-expected.png index 330fe5f..65bfb4c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-offset-01-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-offset-01-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-tile-01-b-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-tile-01-b-expected.png index c8653eec..ce8e37f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-tile-01-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-tile-01-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png index 0f90944..d5460a1 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/painting-fill-05-b-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/painting-fill-05-b-expected.png index acf8d75..2186cfd 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/painting-fill-05-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/painting-fill-05-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-text-08-b-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-text-08-b-expected.png index 5fd2675..f00c9095 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-text-08-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-text-08-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-1-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-1-expected.png index 82496d9b..7f2170f3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-6-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-6-expected.png index 27ddb0b5..2f0b4db 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-6-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-6-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/batik/filters/filterRegions-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/batik/filters/filterRegions-expected.png index 386de5ed..0df9e6859 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/batik/filters/filterRegions-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/batik/filters/filterRegions-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/batik/paints/patternRegionA-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/batik/paints/patternRegionA-expected.png index abc1d61..2f16c40 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/batik/paints/patternRegionA-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/batik/paints/patternRegionA-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/textDecoration-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/textDecoration-expected.png index 5bb1931..061ac630 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/textDecoration-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/textDecoration-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/carto.net/colourpicker-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/carto.net/colourpicker-expected.png index 05caae5..f5e217b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/carto.net/colourpicker-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/carto.net/colourpicker-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/carto.net/combobox-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/carto.net/combobox-expected.png index 5a547ae..419f95b 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/carto.net/combobox-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/carto.net/combobox-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/embedding-external-svgs-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/embedding-external-svgs-expected.png index 54561bf0..796b69c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/embedding-external-svgs-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/embedding-external-svgs-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.png index 2cbcfbc..6950dc30 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png index 1bd2ce7..d2ef65c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png index b4f77efc..54433ca7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/mask-with-all-units-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/custom/mask-with-all-units-expected.png deleted file mode 100644 index 7c14c4f8..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/custom/mask-with-all-units-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/filters/sourceAlpha-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/filters/sourceAlpha-expected.png index faad9b8..821078c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/filters/sourceAlpha-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/filters/sourceAlpha-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/hixie/perf/002-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/hixie/perf/002-expected.png index bd3ef5e9..32659056 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/hixie/perf/002-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/hixie/perf/002-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/bidi-text-query-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/bidi-text-query-expected.png index b39f73e..bea0755 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/bidi-text-query-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/bidi-text-query-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.png index d2ffe93..1377c90 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/ligature-queries-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/ligature-queries-expected.png index 02d22f7..fc618aab 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/ligature-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/ligature-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-1-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-1-expected.png index 735261f..96be546 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-2-expected.png index c3c3b21..96a1bd8 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-3-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-3-expected.png index 6ecf323..539ba6f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-4-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-4-expected.png index ac8dda1..f0e85b3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-1-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-1-expected.png index 96c37fc5..99044c9c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-2-expected.png index 755bb57..4566314 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-3-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-3-expected.png index 3025dc0..be21103 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-4-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-4-expected.png index 55e416b..e78f4cb5 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png index 2c3334e..63ad8cc 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png index 334bcc8..9847cce 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png index 68bf88d..5e40847 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png index b662cac..c36bd73c2 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png index d8adfa9..0912aac 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png index f287438..3cecd49a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png index 819d3d9..fec87e0 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.png index c3dcd230..e5116b4d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-1-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-1-expected.png index 2effcb4..14f46d7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-2-expected.png index 1450290..0d74c36 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-3-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-3-expected.png index 18c9f4d..c18bb9d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-4-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-4-expected.png index 6b509a81..a215c65 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-1-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-1-expected.png index 2effcb4..14f46d7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-2-expected.png index 1450290..0d74c36 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-3-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-3-expected.png index 18c9f4d..c18bb9d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-4-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-4-expected.png index 6b509a81..a215c65 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-x-list-with-tspans-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/surrogate-pair-queries-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/surrogate-pair-queries-expected.png index d61a9149..68742d3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/surrogate-pair-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/surrogate-pair-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-fill-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-fill-opacity-expected.png index adfbda2..a7b83ea 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-fill-opacity-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-fill-opacity-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-selection-text-08-b-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-selection-text-08-b-expected.png index ae3373e..b01cf88 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-selection-text-08-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-selection-text-08-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.png index fa5ca11..5150644c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/wicd/test-scalable-background-image2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/wicd/test-scalable-background-image2-expected.png index d7a4f5cc..2ee8176 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/wicd/test-scalable-background-image2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/wicd/test-scalable-background-image2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-expected.png index 278d2e6..a86af38 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-png-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-png-expected.png index 278d2e6..a86af38 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-png-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-png-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/cross-fade-background-size-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/cross-fade-background-size-expected.png index 3bba5d2..3e28b60a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/cross-fade-background-size-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/exotic-color-space/images/cross-fade-background-size-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-expected.png index 7b9d295..5ced3be 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png-expected.png index 7b9d295..5ced3be 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/cross-fade-background-size-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/cross-fade-background-size-expected.png index b31c5da..ac27cdd 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/cross-fade-background-size-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu-rasterization/images/cross-fade-background-size-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/canvas/drawImage-with-globalAlpha-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/canvas/drawImage-with-globalAlpha-expected.png index c58b90c..c1368a4d 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/canvas/drawImage-with-globalAlpha-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/canvas/drawImage-with-globalAlpha-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/images/color-profile-background-image-cross-fade-expected.png b/third_party/WebKit/LayoutTests/platform/win/images/color-profile-background-image-cross-fade-expected.png index 1791e22..92a9072 100644 --- a/third_party/WebKit/LayoutTests/platform/win/images/color-profile-background-image-cross-fade-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/images/color-profile-background-image-cross-fade-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/images/color-profile-background-image-cross-fade-png-expected.png b/third_party/WebKit/LayoutTests/platform/win/images/color-profile-background-image-cross-fade-png-expected.png index 1791e22..92a9072 100644 --- a/third_party/WebKit/LayoutTests/platform/win/images/color-profile-background-image-cross-fade-png-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/images/color-profile-background-image-cross-fade-png-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/images/cross-fade-background-size-expected.png b/third_party/WebKit/LayoutTests/platform/win/images/cross-fade-background-size-expected.png index 2e31f1d..592e71f6 100644 --- a/third_party/WebKit/LayoutTests/platform/win/images/cross-fade-background-size-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/images/cross-fade-background-size-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png index 6f8c2c85..997121c 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png index 1989f9a..b3215c8 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-offset-01-b-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-offset-01-b-expected.png index 7e1b9ce..6ea50bf 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-offset-01-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-offset-01-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-tile-01-b-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-tile-01-b-expected.png index 64e610f..fb0f4df 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-tile-01-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-tile-01-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png index 2c33d948..e5bcce2c 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/painting-fill-05-b-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/painting-fill-05-b-expected.png index b8a9289..a36f60b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/painting-fill-05-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/painting-fill-05-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/text-text-08-b-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/text-text-08-b-expected.png index 14bfab6..1c68e42d 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/text-text-08-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/text-text-08-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-1-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-1-expected.png index 0d29935..dcc8070 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-6-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-6-expected.png index 6a86fac..0e84bc31 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-6-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/svg-as-background-6-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/batik/filters/filterRegions-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/batik/filters/filterRegions-expected.png index e10caf3..3d0df92 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/batik/filters/filterRegions-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/batik/filters/filterRegions-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/batik/paints/patternRegionA-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/batik/paints/patternRegionA-expected.png index 6e3c7b6a4..a784766 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/batik/paints/patternRegionA-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/batik/paints/patternRegionA-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/textDecoration-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/textDecoration-expected.png index 1fa48e5..fd8bc53 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/textDecoration-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/textDecoration-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/carto.net/colourpicker-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/carto.net/colourpicker-expected.png index bfcd5bc8d..64f5e70 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/carto.net/colourpicker-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/carto.net/colourpicker-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/carto.net/combobox-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/carto.net/combobox-expected.png index ddee4ce3..6a6ddfd2 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/carto.net/combobox-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/carto.net/combobox-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/custom/embedding-external-svgs-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/custom/embedding-external-svgs-expected.png index c4fce55..8bd5876 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/custom/embedding-external-svgs-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/custom/embedding-external-svgs-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-div-area-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-div-area-expected.png index ff609cb..adf04df 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-div-area-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-div-area-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png index 31c3cd19..68f6b1781 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png index d0955f5e..36dabba 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/custom/mask-with-all-units-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/custom/mask-with-all-units-expected.png deleted file mode 100644 index 57a8155..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/svg/custom/mask-with-all-units-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/filters/sourceAlpha-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/filters/sourceAlpha-expected.png index 2de1cb9..e971321 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/filters/sourceAlpha-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/filters/sourceAlpha-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/hixie/perf/002-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/hixie/perf/002-expected.png index d9a39dc..baa3f30b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/hixie/perf/002-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/hixie/perf/002-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/bidi-text-query-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/bidi-text-query-expected.png index 4d9cd00..f1790c3 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/bidi-text-query-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/bidi-text-query-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.png index 4e23455..b912545 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/ligature-queries-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/ligature-queries-expected.png index 023e7c8..8ac0fa1 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/ligature-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/ligature-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-1-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-1-expected.png index 70df77cd..c0ab402b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-2-expected.png index 4bb551a..03ed987 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-3-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-3-expected.png index 3d8edd3..da31920 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-4-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-4-expected.png index 1cb6bf6..b6a679a 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-1-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-1-expected.png index 0de5bfd..e0126f6f 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-2-expected.png index b76be67..45b0d24 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-3-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-3-expected.png index 11f89fe..4306ad0 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-4-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-4-expected.png index 067b58f..53de0ba 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png index 1f287526..fe476d2 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png index 4aff33ad..5db9a9a 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png index d10fe46..5737b8b 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png index 4a72510..f7d6b0c 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png index 469a6d94..27162a6 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png index eada8c6..7e87a80 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png index fcc06f7..edaa6d23 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.png index 34c33d0..86285d2 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-1-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-1-expected.png index de95328b..a0192604 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-2-expected.png index a8f7e0c..080c951 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-3-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-3-expected.png index ed2b0ee..69ecfa6 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-4-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-4-expected.png index 270a31f..d96b092 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-1-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-1-expected.png index de95328b..a0192604 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-1-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-1-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-2-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-2-expected.png index a8f7e0c..080c951 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-3-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-3-expected.png index ed2b0ee..69ecfa6 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-4-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-4-expected.png index 270a31f..d96b092 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-4-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/select-x-list-with-tspans-4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/surrogate-pair-queries-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/surrogate-pair-queries-expected.png index a58e98bb..a963dfa 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/surrogate-pair-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/surrogate-pair-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/text-fill-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/text-fill-opacity-expected.png index 5781095..c9e445e 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/text-fill-opacity-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/text-fill-opacity-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/text-selection-text-08-b-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/text-selection-text-08-b-expected.png index d8a8d97..2520906 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/text/text-selection-text-08-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/text-selection-text-08-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/transforms/text-with-mask-with-svg-transform-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/transforms/text-with-mask-with-svg-transform-expected.png index 8fd9b2ac..a1f3736 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/transforms/text-with-mask-with-svg-transform-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/transforms/text-with-mask-with-svg-transform-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/wicd/test-scalable-background-image2-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/wicd/test-scalable-background-image2-expected.png index 1bbfdec..5d85097f 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/wicd/test-scalable-background-image2-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/wicd/test-scalable-background-image2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-expected.png index aa09b7e..53b15b9 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-png-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-png-expected.png index aa09b7e..53b15b9 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-png-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/color-profile-background-image-cross-fade-png-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/cross-fade-background-size-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/cross-fade-background-size-expected.png index 1cd9f2d..b86fc63 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/cross-fade-background-size-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/exotic-color-space/images/cross-fade-background-size-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-expected.png index 9bb1ebc..f29f676 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png-expected.png index 9bb1ebc..f29f676 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/cross-fade-background-size-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/cross-fade-background-size-expected.png index e215802c..c922405 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/cross-fade-background-size-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu-rasterization/images/cross-fade-background-size-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png b/third_party/WebKit/LayoutTests/platform/win7/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png index 6a4680ee..7a8fc9b 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/svg/W3C-SVG-1.1/filters-composite-02-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/svg/W3C-SVG-1.1/text-text-08-b-expected.png b/third_party/WebKit/LayoutTests/platform/win7/svg/W3C-SVG-1.1/text-text-08-b-expected.png index f0372fb..b9d8fe6 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/svg/W3C-SVG-1.1/text-text-08-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/svg/W3C-SVG-1.1/text-text-08-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/svg/carto.net/combobox-expected.png b/third_party/WebKit/LayoutTests/platform/win7/svg/carto.net/combobox-expected.png index c3781ab4..231e4f5 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/svg/carto.net/combobox-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/svg/carto.net/combobox-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/svg/text/bidi-text-query-expected.png b/third_party/WebKit/LayoutTests/platform/win7/svg/text/bidi-text-query-expected.png index 40c252c0..5639007b 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/svg/text/bidi-text-query-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/svg/text/bidi-text-query-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/svg/text/surrogate-pair-queries-expected.png b/third_party/WebKit/LayoutTests/platform/win7/svg/text/surrogate-pair-queries-expected.png index 01cc62f..0d2139f5 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/svg/text/surrogate-pair-queries-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/svg/text/surrogate-pair-queries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/svg/text/text-selection-text-08-b-expected.png b/third_party/WebKit/LayoutTests/platform/win7/svg/text/text-selection-text-08-b-expected.png index b241e55d..a88229e 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/svg/text/text-selection-text-08-b-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/svg/text/text-selection-text-08-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/custom/group-opacity-expected.png b/third_party/WebKit/LayoutTests/svg/custom/group-opacity-expected.png index b0a2d82..cc07288 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/group-opacity-expected.png +++ b/third_party/WebKit/LayoutTests/svg/custom/group-opacity-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/custom/marker-opacity-expected.png b/third_party/WebKit/LayoutTests/svg/custom/marker-opacity-expected.png index ce19399..3d613be 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/marker-opacity-expected.png +++ b/third_party/WebKit/LayoutTests/svg/custom/marker-opacity-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/custom/mask-with-all-units-expected.png b/third_party/WebKit/LayoutTests/svg/custom/mask-with-all-units-expected.png new file mode 100644 index 0000000..9ff61a8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/svg/custom/mask-with-all-units-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/custom/opacity-overflow-expected.svg b/third_party/WebKit/LayoutTests/svg/custom/opacity-overflow-expected.svg new file mode 100644 index 0000000..30be24a1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/svg/custom/opacity-overflow-expected.svg
@@ -0,0 +1,3 @@ +<svg version="1.1" xmlns="http://www.w3.org/2000/svg"> + <rect width="100" height="100" fill="green"/> +</svg>
diff --git a/third_party/WebKit/LayoutTests/svg/custom/opacity-overflow.svg b/third_party/WebKit/LayoutTests/svg/custom/opacity-overflow.svg new file mode 100644 index 0000000..a3b5c344 --- /dev/null +++ b/third_party/WebKit/LayoutTests/svg/custom/opacity-overflow.svg
@@ -0,0 +1,3 @@ +<svg version="1.1" xmlns="http://www.w3.org/2000/svg"> + <rect width="100" height="100" fill="green" fill-opacity="2147483647"/> +</svg>
diff --git a/third_party/WebKit/LayoutTests/svg/custom/use-css-no-effect-on-shadow-tree-expected.png b/third_party/WebKit/LayoutTests/svg/custom/use-css-no-effect-on-shadow-tree-expected.png index ad529ec8..f11ae5f 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/use-css-no-effect-on-shadow-tree-expected.png +++ b/third_party/WebKit/LayoutTests/svg/custom/use-css-no-effect-on-shadow-tree-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/filters/subRegion-one-effect-expected.png b/third_party/WebKit/LayoutTests/svg/filters/subRegion-one-effect-expected.png index 2b439b1..e5289c9 100644 --- a/third_party/WebKit/LayoutTests/svg/filters/subRegion-one-effect-expected.png +++ b/third_party/WebKit/LayoutTests/svg/filters/subRegion-one-effect-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/filters/subRegion-two-effects-expected.png b/third_party/WebKit/LayoutTests/svg/filters/subRegion-two-effects-expected.png index e6cc897b..cd1f0d74 100644 --- a/third_party/WebKit/LayoutTests/svg/filters/subRegion-two-effects-expected.png +++ b/third_party/WebKit/LayoutTests/svg/filters/subRegion-two-effects-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-cookies-redirect.any-expected.txt b/third_party/WebKit/LayoutTests/virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-cookies-redirect.any-expected.txt index 2c0512c..da2eabc 100644 --- a/third_party/WebKit/LayoutTests/virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-cookies-redirect.any-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-cookies-redirect.any-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. PASS Set cookies -FAIL Testing credentials after cross-origin redirection with CORS and no preflight promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch" +PASS Testing credentials after cross-origin redirection with CORS and no preflight FAIL Testing credentials after cross-origin redirection with CORS and preflight promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch" PASS Clean cookies Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-cookies-redirect.any.worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-cookies-redirect.any.worker-expected.txt index 2c0512c..da2eabc 100644 --- a/third_party/WebKit/LayoutTests/virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-cookies-redirect.any.worker-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/outofblink-cors/external/wpt/fetch/api/cors/cors-cookies-redirect.any.worker-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. PASS Set cookies -FAIL Testing credentials after cross-origin redirection with CORS and no preflight promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch" +PASS Testing credentials after cross-origin redirection with CORS and no preflight FAIL Testing credentials after cross-origin redirection with CORS and preflight promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch" PASS Clean cookies Harness: the test ran to completion.
diff --git a/third_party/blink/API_OWNERS b/third_party/blink/API_OWNERS index 72f5306..6d9b329 100644 --- a/third_party/blink/API_OWNERS +++ b/third_party/blink/API_OWNERS
@@ -10,5 +10,6 @@ mkwst@chromium.org ojan@chromium.org rbyers@chromium.org +slightlyoff@chromium.org tkent@chromium.org yoav@yoav.ws
diff --git a/third_party/blink/public/platform/web_video_frame_submitter.h b/third_party/blink/public/platform/web_video_frame_submitter.h index a24d5d88..62f54c3a 100644 --- a/third_party/blink/public/platform/web_video_frame_submitter.h +++ b/third_party/blink/public/platform/web_video_frame_submitter.h
@@ -13,10 +13,6 @@ class LayerTreeSettings; } -namespace gpu { -class GpuMemoryBufferManager; -} - namespace viz { class ContextProvider; class FrameSinkId; @@ -36,7 +32,6 @@ public: static std::unique_ptr<WebVideoFrameSubmitter> Create( WebContextProviderCallback, - gpu::GpuMemoryBufferManager*, const cc::LayerTreeSettings&); ~WebVideoFrameSubmitter() override = default;
diff --git a/third_party/blink/public/web/web_frame_client.h b/third_party/blink/public/web/web_frame_client.h index 8255409..430ce643 100644 --- a/third_party/blink/public/web/web_frame_client.h +++ b/third_party/blink/public/web/web_frame_client.h
@@ -320,7 +320,10 @@ // Load commands ------------------------------------------------------- // The client should handle the request as a download. - virtual void DownloadURL(const WebURLRequest&) {} + // If the request is for a blob: URL, a BlobURLTokenPtr should be provided + // as |blob_url_token| to ensure the correct blob gets downloaded. + virtual void DownloadURL(const WebURLRequest&, + mojo::ScopedMessagePipeHandle blob_url_token) {} // The client should load an error page in the current frame. virtual void LoadErrorPage(int reason) {}
diff --git a/third_party/blink/renderer/bindings/IDLExtendedAttributes.md b/third_party/blink/renderer/bindings/IDLExtendedAttributes.md index 1be25553..f1e8254 100644 --- a/third_party/blink/renderer/bindings/IDLExtendedAttributes.md +++ b/third_party/blink/renderer/bindings/IDLExtendedAttributes.md
@@ -1548,17 +1548,24 @@ ``` -### [Affects] _(m, a)_ +### [Affects] _(i, m, a)_ -Summary: `[Affects=Nothing]` indicates that a function must not produce JS-observable side effects. Functions without this attribute are never invoked by V8 with throwOnSideEffect. +Summary: `[Affects=Nothing]` indicates that a function must not produce JS-observable side effects, and functions without this attribute are never invoked by V8 with throwOnSideEffect. `[Affects=Everything]` indicates that a constructor will throwOnSideEffect. Marked functions are allowed to be nondeterministic, throw exceptions, force layout, and recalculate style, but must not set values, cache objects, or schedule execution that will be observable after the function completes. If a marked function calls into V8, it must properly handle cases when the V8 call returns an MaybeHandle. -All DOM constructors are assumed to have no JS-observable side effects. +All DOM constructors are assumed to have no JS-observable side effects, unless blacklisted with `[Affects=Everything]`. There is not yet support for marking SymbolKeyedMethodConfigurations as side-effect free. This requires additional support in V8 to whitelist Intrinsics. -Usage: `[Affects=Nothing]` can be specified on a method, or on an attribute to indicate that its getter callback is side effect free: +Usage for interfaces: `[Affects=Everything]` can be specified on an interface to indicate that its constructor callback does have side effects. + +```webidl +[Affects=Everything] +interface HTMLFoo {}; +``` + +Usage for attributes and operations: `[Affects=Nothing]` can be specified on an operation, or on an attribute to indicate that its getter callback is side effect free: ```webidl interface HTMLFoo {
diff --git a/third_party/blink/renderer/bindings/IDLExtendedAttributes.txt b/third_party/blink/renderer/bindings/IDLExtendedAttributes.txt index d3cd5b7..bd924eb 100644 --- a/third_party/blink/renderer/bindings/IDLExtendedAttributes.txt +++ b/third_party/blink/renderer/bindings/IDLExtendedAttributes.txt
@@ -32,7 +32,7 @@ # ActiveScriptWrappable -Affects=Nothing +Affects=Everything|Nothing AllowShared CEReactions CachedAccessor
diff --git a/third_party/blink/renderer/bindings/core/v8/scheduled_action.cc b/third_party/blink/renderer/bindings/core/v8/scheduled_action.cc index 68c9245..55b132e8 100644 --- a/third_party/blink/renderer/bindings/core/v8/scheduled_action.cc +++ b/third_party/blink/renderer/bindings/core/v8/scheduled_action.cc
@@ -93,6 +93,14 @@ } void ScheduledAction::Execute(ExecutionContext* context) { + if (!script_state_->ContextIsValid()) { + DVLOG(1) << "ScheduledAction::execute " << this << ": context is empty"; + return; + } + // ExecutionContext::CanExecuteScripts() relies on the current context to + // determine if it is allowed. Enter the scope here. + ScriptState::Scope scope(script_state_.Get()); + if (context->IsDocument()) { LocalFrame* frame = ToDocument(context)->GetFrame(); if (!frame) { @@ -132,13 +140,9 @@ : script_state_(script_state), info_(script_state->GetIsolate()) {} void ScheduledAction::Execute(LocalFrame* frame) { - if (!script_state_->ContextIsValid()) { - DVLOG(1) << "ScheduledAction::execute " << this << ": context is empty"; - return; - } + DCHECK(script_state_->ContextIsValid()); TRACE_EVENT0("v8", "ScheduledAction::execute"); - ScriptState::Scope scope(script_state_.Get()); if (!function_.IsEmpty()) { DVLOG(1) << "ScheduledAction::execute " << this << ": have function"; v8::Local<v8::Function> function =
diff --git a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.cc b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.cc index 34e8223..b50601a 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.cc +++ b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.cc
@@ -122,7 +122,7 @@ } void ScriptCustomElementDefinition::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(constructor_.Cast<v8::Value>()); visitor->TraceWrappers(connected_callback_.Cast<v8::Value>()); visitor->TraceWrappers(disconnected_callback_.Cast<v8::Value>());
diff --git a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h index 9026fcfe..73d8b5e 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h +++ b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h
@@ -43,7 +43,7 @@ ~ScriptCustomElementDefinition() override = default; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; v8::Local<v8::Object> Constructor() const;
diff --git a/third_party/blink/renderer/bindings/core/v8/script_wrappable_marking_visitor_test.cc b/third_party/blink/renderer/bindings/core/v8/script_wrappable_marking_visitor_test.cc index 495ef28..9441a7b 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_wrappable_marking_visitor_test.cc +++ b/third_party/blink/renderer/bindings/core/v8/script_wrappable_marking_visitor_test.cc
@@ -151,11 +151,11 @@ ->GetScriptWrappableMarkingVisitor(); visitor->TracePrologue(); auto* header = HeapObjectHeader::FromPayload(object); - visitor->HeadersToUnmark()->push_back(header); + visitor->headers_to_unmark_.push_back(header); PreciselyCollectGarbage(); - EXPECT_FALSE(visitor->HeadersToUnmark()->Contains(header)); + EXPECT_FALSE(visitor->headers_to_unmark_.Contains(header)); visitor->AbortTracing(); } @@ -248,7 +248,7 @@ virtual ~HandleContainer() = default; void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(handle_.Cast<v8::Value>()); } const char* NameInHeapSnapshot() const override { return "HandleContainer"; } @@ -273,7 +273,7 @@ delete marked_wrappers_; } - void Visit(const TraceWrapperV8Reference<v8::Value>&) const override { + void Visit(const TraceWrapperV8Reference<v8::Value>&) override { *marked_wrappers_ += 1; // Do not actually mark this visitor, as this would call into v8, which // would require executing an actual GC. @@ -451,7 +451,7 @@ explicit Mixin(DeathAwareScriptWrappable* wrapper_in_mixin) : wrapper_in_mixin_(wrapper_in_mixin) {} - void TraceWrappers(const ScriptWrappableVisitor* visitor) const { + void TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(wrapper_in_mixin_); } @@ -476,7 +476,7 @@ return new Base(wrapper_in_base, wrapper_in_mixin); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(wrapper_in_base_); Mixin::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.cc b/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.cc index bd2d7b3..0bbdb70f 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.cc
@@ -263,7 +263,7 @@ } void V8AbstractEventListener::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(listener_.Cast<v8::Value>()); EventListener::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.h b/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.h index 961d27e..1674ddd 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.h +++ b/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.h
@@ -112,7 +112,7 @@ DOMWrapperWorld& World() const { return *world_; } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: V8AbstractEventListener(v8::Isolate*, bool is_attribute, DOMWrapperWorld&);
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_embedder_graph_builder.cc b/third_party/blink/renderer/bindings/core/v8/v8_embedder_graph_builder.cc index b8241c0..1581ecf 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_embedder_graph_builder.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_embedder_graph_builder.cc
@@ -126,7 +126,7 @@ } void V8EmbedderGraphBuilder::Visit( - const TraceWrapperV8Reference<v8::Value>& traced_wrapper) const { + const TraceWrapperV8Reference<v8::Value>& traced_wrapper) { const v8::PersistentBase<v8::Value>* value = &traced_wrapper.Get(); // Add an edge from the current parent to the V8 object. v8::Local<v8::Value> v8_value = v8::Local<v8::Value>::New(isolate_, *value); @@ -136,7 +136,7 @@ } void V8EmbedderGraphBuilder::Visit( - const TraceWrapperDescriptor& wrapper_descriptor) const { + const TraceWrapperDescriptor& wrapper_descriptor) { // Add an edge from the current parent to this object. // Also push the object to the worklist in order to process its members. const void* traceable = wrapper_descriptor.base_object_payload; @@ -148,7 +148,7 @@ } void V8EmbedderGraphBuilder::Visit(DOMWrapperMap<ScriptWrappable>* wrapper_map, - const ScriptWrappable* key) const { + const ScriptWrappable* key) { // Add an edge from the current parent to the V8 object. v8::Local<v8::Value> v8_value = wrapper_map->NewLocal(isolate_, const_cast<ScriptWrappable*>(key));
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_embedder_graph_builder.h b/third_party/blink/renderer/bindings/core/v8/v8_embedder_graph_builder.h index c4383a8..9ec32547 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_embedder_graph_builder.h +++ b/third_party/blink/renderer/bindings/core/v8/v8_embedder_graph_builder.h
@@ -28,10 +28,9 @@ protected: // ScriptWrappableVisitor overrides. - void Visit(const TraceWrapperV8Reference<v8::Value>&) const final; - void Visit(const TraceWrapperDescriptor&) const final; - void Visit(DOMWrapperMap<ScriptWrappable>*, - const ScriptWrappable*) const final; + void Visit(const TraceWrapperV8Reference<v8::Value>&) final; + void Visit(const TraceWrapperDescriptor&) final; + void Visit(DOMWrapperMap<ScriptWrappable>*, const ScriptWrappable*) final; private: // Information about whether a node is attached to the main DOM tree
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_delegate.cc b/third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_delegate.cc index 3574b42..402752f3 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_delegate.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_delegate.cc
@@ -39,7 +39,7 @@ } void V8IntersectionObserverDelegate::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(callback_); IntersectionObserverDelegate::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_delegate.h b/third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_delegate.h index 9e140b2..9fb8cdd 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_delegate.h +++ b/third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_delegate.h
@@ -30,7 +30,7 @@ ExecutionContext* GetExecutionContext() const override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; void Deliver(const HeapVector<Member<IntersectionObserverEntry>>&, IntersectionObserver&) override;
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_node_filter_condition.cc b/third_party/blink/renderer/bindings/core/v8/v8_node_filter_condition.cc index 99a5142..a1928d2 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_node_filter_condition.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_node_filter_condition.cc
@@ -54,7 +54,7 @@ V8NodeFilterCondition::~V8NodeFilterCondition() = default; void V8NodeFilterCondition::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(filter_.Cast<v8::Value>()); }
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_node_filter_condition.h b/third_party/blink/renderer/bindings/core/v8/v8_node_filter_condition.h index 6e4550a4..876bd48 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_node_filter_condition.h +++ b/third_party/blink/renderer/bindings/core/v8/v8_node_filter_condition.h
@@ -59,7 +59,7 @@ ~V8NodeFilterCondition(); virtual void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "V8NodeFilterCondition"; }
diff --git a/third_party/blink/renderer/bindings/scripts/v8_interface.py b/third_party/blink/renderer/bindings/scripts/v8_interface.py index b3da453..b96549c 100644 --- a/third_party/blink/renderer/bindings/scripts/v8_interface.py +++ b/third_party/blink/renderer/bindings/scripts/v8_interface.py
@@ -377,6 +377,7 @@ context.update({ 'constructors': constructors, + 'constructor_has_side_effect': has_extended_attribute_value(interface, 'Affects', 'Everything'), 'has_custom_constructor': bool(custom_constructors), 'has_html_constructor': has_html_constructor, 'interface_length':
diff --git a/third_party/blink/renderer/bindings/templates/interface_base.cpp.tmpl b/third_party/blink/renderer/bindings/templates/interface_base.cpp.tmpl index 4b61bcf..a53602f6 100644 --- a/third_party/blink/renderer/bindings/templates/interface_base.cpp.tmpl +++ b/third_party/blink/renderer/bindings/templates/interface_base.cpp.tmpl
@@ -452,7 +452,7 @@ 'v8::Local<v8::FunctionTemplate>()' %} V8DOMConfiguration::InitializeDOMInterfaceTemplate(isolate, interfaceTemplate, {{v8_class}}::wrapperTypeInfo.interface_name, {{parent_interface_template}}, {{v8_class}}::internalFieldCount); {% if constructors or has_custom_constructor or has_html_constructor %} - interfaceTemplate->SetCallHandler({{v8_class}}::constructorCallback, v8::Local<v8::Value>(), v8::SideEffectType::kHasNoSideEffect); + interfaceTemplate->SetCallHandler({{v8_class}}::constructorCallback, v8::Local<v8::Value>(), v8::SideEffectType::{% if constructor_has_side_effect %}kHasSideEffect{% else %}kHasNoSideEffect{% endif %}); interfaceTemplate->SetLength({{interface_length}}); {% endif %} {% endif %}{# is_partial #}
diff --git a/third_party/blink/renderer/core/animation/animation.cc b/third_party/blink/renderer/core/animation/animation.cc index 4f4fc68..156d039 100644 --- a/third_party/blink/renderer/core/animation/animation.cc +++ b/third_party/blink/renderer/core/animation/animation.cc
@@ -1047,7 +1047,7 @@ DCHECK(!Outdated()); } -void Animation::SpecifiedTimingChanged() { +void Animation::EffectInvalidated() { SetOutdated(); // FIXME: Needs to consider groups when added. SetCompositorPending(true);
diff --git a/third_party/blink/renderer/core/animation/animation.h b/third_party/blink/renderer/core/animation/animation.h index 1827f61..8acfaedb 100644 --- a/third_party/blink/renderer/core/animation/animation.h +++ b/third_party/blink/renderer/core/animation/animation.h
@@ -101,7 +101,7 @@ // AnimationEffectOwner: void UpdateIfNecessary() override; - void SpecifiedTimingChanged() override; + void EffectInvalidated() override; bool IsEventDispatchAllowed() const override; Animation* GetAnimation() override { return this; }
diff --git a/third_party/blink/renderer/core/animation/animation_effect.cc b/third_party/blink/renderer/core/animation/animation_effect.cc index 4ea4d18..56acf864 100644 --- a/third_party/blink/renderer/core/animation/animation_effect.cc +++ b/third_party/blink/renderer/core/animation/animation_effect.cc
@@ -98,9 +98,7 @@ void AnimationEffect::UpdateSpecifiedTiming(const Timing& timing) { // FIXME: Test whether the timing is actually different? timing_ = timing; - Invalidate(); - if (owner_) - owner_->SpecifiedTimingChanged(); + InvalidateAndNotifyOwner(); } void AnimationEffect::getTiming(EffectTiming& effect_timing) const { @@ -179,9 +177,7 @@ // (and which) to resolve the CSS secure/insecure context against. if (!TimingInput::Update(timing_, optional_timing, nullptr, exception_state)) return; - Invalidate(); - if (owner_) - owner_->SpecifiedTimingChanged(); + InvalidateAndNotifyOwner(); } void AnimationEffect::UpdateInheritedTime(double inherited_time, @@ -305,6 +301,12 @@ } } +void AnimationEffect::InvalidateAndNotifyOwner() const { + Invalidate(); + if (owner_) + owner_->EffectInvalidated(); +} + const AnimationEffect::CalculatedTiming& AnimationEffect::EnsureCalculated() const { if (!owner_)
diff --git a/third_party/blink/renderer/core/animation/animation_effect.h b/third_party/blink/renderer/core/animation/animation_effect.h index 1690a3f..65a8808 100644 --- a/third_party/blink/renderer/core/animation/animation_effect.h +++ b/third_party/blink/renderer/core/animation/animation_effect.h
@@ -146,6 +146,7 @@ // updateChildrenAndEffects. void UpdateInheritedTime(double inherited_time, TimingUpdateReason) const; void Invalidate() const { needs_update_ = true; } + void InvalidateAndNotifyOwner() const; bool RequiresIterationEvents() const { return event_delegate_ && event_delegate_->RequiresIterationEvents(*this); }
diff --git a/third_party/blink/renderer/core/animation/animation_effect_owner.h b/third_party/blink/renderer/core/animation/animation_effect_owner.h index 15e2fbc..aa99a2d 100644 --- a/third_party/blink/renderer/core/animation/animation_effect_owner.h +++ b/third_party/blink/renderer/core/animation/animation_effect_owner.h
@@ -34,11 +34,10 @@ // to be updated or not. virtual bool EffectSuppressed() const = 0; - // Notifies the owning animation that the effect's specified timing has - // changed. This means that the owning animation may need to update its play - // state and current time. - // For more info on specified timing see: core/animation/Timing.h - virtual void SpecifiedTimingChanged() = 0; + // Notifies the owning animation that the effect has been invalidated, and any + // cached information regarding it may need to be invalidated. This can + // happen e.g. if the timing information changes or the keyframes change. + virtual void EffectInvalidated() = 0; virtual void UpdateIfNecessary() = 0;
diff --git a/third_party/blink/renderer/core/animation/animation_effect_test.cc b/third_party/blink/renderer/core/animation/animation_effect_test.cc index ecc506f..1391301 100644 --- a/third_party/blink/renderer/core/animation/animation_effect_test.cc +++ b/third_party/blink/renderer/core/animation/animation_effect_test.cc
@@ -48,7 +48,7 @@ MOCK_CONST_METHOD0(Playing, bool()); MOCK_CONST_METHOD0(IsEventDispatchAllowed, bool()); MOCK_CONST_METHOD0(EffectSuppressed, bool()); - MOCK_METHOD0(SpecifiedTimingChanged, void()); + MOCK_METHOD0(EffectInvalidated, void()); MOCK_METHOD0(UpdateIfNecessary, void()); MOCK_METHOD0(GetAnimation, Animation*()); }; @@ -860,7 +860,7 @@ MockAnimationEffectOwner* owner = new MockAnimationEffectOwner(); effect->Attach(owner); - EXPECT_CALL(*owner, SpecifiedTimingChanged()).Times(1); + EXPECT_CALL(*owner, EffectInvalidated()).Times(1); OptionalEffectTiming effect_timing; effect_timing.setDelay(5); @@ -884,7 +884,7 @@ // None of the below calls to updateTime should cause the AnimationEffect to // update, as they all match the existing timing information. - EXPECT_CALL(*owner, SpecifiedTimingChanged()).Times(0); + EXPECT_CALL(*owner, EffectInvalidated()).Times(0); OptionalEffectTiming effect_timing; effect->updateTiming(effect_timing);
diff --git a/third_party/blink/renderer/core/animation/animation_test.cc b/third_party/blink/renderer/core/animation/animation_test.cc index 35356d8..568991c 100644 --- a/third_party/blink/renderer/core/animation/animation_test.cc +++ b/third_party/blink/renderer/core/animation/animation_test.cc
@@ -73,6 +73,44 @@ void StartTimeline() { SimulateFrame(0); } + void ResetWithCompositedAnimation() { + // Get rid of the default animation. + animation->cancel(); + + EnableCompositing(); + + SetBodyInnerHTML("<div id='target'></div>"); + + // Create a compositable animation; in this case opacity from 1 to 0. + Timing timing; + timing.iteration_duration = 30; + + scoped_refptr<StringKeyframe> start_keyframe = StringKeyframe::Create(); + start_keyframe->SetCSSPropertyValue(CSSPropertyOpacity, "1.0", + SecureContextMode::kInsecureContext, + nullptr); + scoped_refptr<StringKeyframe> end_keyframe = StringKeyframe::Create(); + end_keyframe->SetCSSPropertyValue(CSSPropertyOpacity, "0.0", + SecureContextMode::kInsecureContext, + nullptr); + + StringKeyframeVector keyframes; + keyframes.push_back(start_keyframe); + keyframes.push_back(end_keyframe); + + Element* element = GetElementById("target"); + StringKeyframeEffectModel* model = + StringKeyframeEffectModel::Create(keyframes); + animation = timeline->Play(KeyframeEffect::Create(element, model, timing)); + + // After creating the animation we need to clean the lifecycle so that the + // animation can be pushed to the compositor. + UpdateAllLifecyclePhases(); + + document->GetAnimationClock().UpdateTime(0); + document->GetPendingAnimations().Update(base::nullopt, true); + } + KeyframeEffectModelBase* MakeEmptyEffectModel() { return StringKeyframeEffectModel::Create(StringKeyframeVector()); } @@ -845,41 +883,7 @@ // compositor side), the pausing must still set compositor pending or the pause // won't be synced. TEST_F(AnimationAnimationTest, SetCompositorPendingWithUnresolvedStartTimes) { - // Get rid of the default animation. - animation->cancel(); - - EnableCompositing(); - - SetBodyInnerHTML("<div id='target'></div>"); - - // Create a compositable animation; in this case opacity from 1 to 0. - Timing timing; - timing.iteration_duration = 30; - - scoped_refptr<StringKeyframe> start_keyframe = StringKeyframe::Create(); - start_keyframe->SetCSSPropertyValue( - CSSPropertyOpacity, "1.0", SecureContextMode::kInsecureContext, nullptr); - scoped_refptr<StringKeyframe> end_keyframe = StringKeyframe::Create(); - end_keyframe->SetCSSPropertyValue( - CSSPropertyOpacity, "0.0", SecureContextMode::kInsecureContext, nullptr); - - StringKeyframeVector keyframes; - keyframes.push_back(start_keyframe); - keyframes.push_back(end_keyframe); - - auto* element = GetElementById("target"); - StringKeyframeEffectModel* model = - StringKeyframeEffectModel::Create(keyframes); - KeyframeEffect* keyframe_effect_composited = - KeyframeEffect::Create(element, model, timing); - Animation* animation = timeline->Play(keyframe_effect_composited); - - // After creating the animation we need to clean the lifecycle so that the - // animation can be pushed to the compositor. - UpdateAllLifecyclePhases(); - - document->GetAnimationClock().UpdateTime(0); - document->GetPendingAnimations().Update(base::nullopt, true); + ResetWithCompositedAnimation(); // At this point, the animation exists on both the compositor and blink side, // but no start time has arrived on either side. The compositor is currently @@ -896,41 +900,7 @@ } TEST_F(AnimationAnimationTest, PreCommitWithUnresolvedStartTimes) { - // Get rid of the default animation. - animation->cancel(); - - EnableCompositing(); - - SetBodyInnerHTML("<div id='target'></div>"); - - // Create a compositable animation; in this case opacity from 1 to 0. - Timing timing; - timing.iteration_duration = 30; - - scoped_refptr<StringKeyframe> start_keyframe = StringKeyframe::Create(); - start_keyframe->SetCSSPropertyValue( - CSSPropertyOpacity, "1.0", SecureContextMode::kInsecureContext, nullptr); - scoped_refptr<StringKeyframe> end_keyframe = StringKeyframe::Create(); - end_keyframe->SetCSSPropertyValue( - CSSPropertyOpacity, "0.0", SecureContextMode::kInsecureContext, nullptr); - - StringKeyframeVector keyframes; - keyframes.push_back(start_keyframe); - keyframes.push_back(end_keyframe); - - auto* element = GetElementById("target"); - StringKeyframeEffectModel* model = - StringKeyframeEffectModel::Create(keyframes); - KeyframeEffect* keyframe_effect_composited = - KeyframeEffect::Create(element, model, timing); - Animation* animation = timeline->Play(keyframe_effect_composited); - - // After creating the animation we need to clean the lifecycle so that the - // animation can be pushed to the compositor. - UpdateAllLifecyclePhases(); - - document->GetAnimationClock().UpdateTime(0); - document->GetPendingAnimations().Update(base::nullopt, true); + ResetWithCompositedAnimation(); // At this point, the animation exists on both the compositor and blink side, // but no start time has arrived on either side. The compositor is currently @@ -942,4 +912,30 @@ EXPECT_FALSE(animation->PreCommit(0, base::nullopt, true)); } +TEST_F(AnimationAnimationTest, SetKeyframesCausesCompositorPending) { + ResetWithCompositedAnimation(); + + // At this point, the animation exists on both the compositor and blink side, + // but no start time has arrived on either side. The compositor is currently + // synced, no update is pending. + EXPECT_FALSE(animation->CompositorPendingForTesting()); + + // Now change the keyframes; this should mark the animation as compositor + // pending as we need to sync the compositor side. + scoped_refptr<StringKeyframe> start_keyframe = StringKeyframe::Create(); + start_keyframe->SetCSSPropertyValue( + CSSPropertyOpacity, "0.0", SecureContextMode::kInsecureContext, nullptr); + scoped_refptr<StringKeyframe> end_keyframe = StringKeyframe::Create(); + end_keyframe->SetCSSPropertyValue( + CSSPropertyOpacity, "1.0", SecureContextMode::kInsecureContext, nullptr); + + StringKeyframeVector keyframes; + keyframes.push_back(start_keyframe); + keyframes.push_back(end_keyframe); + + ToKeyframeEffect(animation->effect())->SetKeyframes(keyframes); + + EXPECT_TRUE(animation->CompositorPendingForTesting()); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/animation/keyframe_effect.cc b/third_party/blink/renderer/core/animation/keyframe_effect.cc index bfd37014..144e9f3 100644 --- a/third_party/blink/renderer/core/animation/keyframe_effect.cc +++ b/third_party/blink/renderer/core/animation/keyframe_effect.cc
@@ -35,7 +35,6 @@ #include "third_party/blink/renderer/bindings/core/v8/v8_object_builder.h" #include "third_party/blink/renderer/core/animation/effect_input.h" #include "third_party/blink/renderer/core/animation/element_animations.h" -#include "third_party/blink/renderer/core/animation/keyframe_effect_model.h" #include "third_party/blink/renderer/core/animation/keyframe_effect_options.h" #include "third_party/blink/renderer/core/animation/sampled_effect.h" #include "third_party/blink/renderer/core/animation/timing_input.h" @@ -181,10 +180,20 @@ if (exception_state.HadException()) return; - Model()->SetComposite(EffectInput::ResolveCompositeOperation( - Model()->Composite(), new_keyframes)); + SetKeyframes(new_keyframes); +} - ToStringKeyframeEffectModel(Model())->SetFrames(new_keyframes); +void KeyframeEffect::SetKeyframes(StringKeyframeVector keyframes) { + Model()->SetComposite( + EffectInput::ResolveCompositeOperation(Model()->Composite(), keyframes)); + + ToStringKeyframeEffectModel(Model())->SetFrames(keyframes); + + // Changing the keyframes will invalidate any sampled effect, as well as + // potentially affect the effect owner. + if (sampled_effect_) + ClearEffects(); + InvalidateAndNotifyOwner(); } bool KeyframeEffect::Affects(const PropertyHandle& property) const {
diff --git a/third_party/blink/renderer/core/animation/keyframe_effect.h b/third_party/blink/renderer/core/animation/keyframe_effect.h index bc3a582f..b504e814 100644 --- a/third_party/blink/renderer/core/animation/keyframe_effect.h +++ b/third_party/blink/renderer/core/animation/keyframe_effect.h
@@ -34,6 +34,7 @@ #include "third_party/blink/renderer/bindings/core/v8/script_value.h" #include "third_party/blink/renderer/core/animation/animation_effect.h" #include "third_party/blink/renderer/core/animation/compositor_animations.h" +#include "third_party/blink/renderer/core/animation/keyframe_effect_model.h" #include "third_party/blink/renderer/core/core_export.h" namespace blink { @@ -83,6 +84,8 @@ const ScriptValue& keyframes, ExceptionState&); + void SetKeyframes(StringKeyframeVector keyframes); + bool Affects(const PropertyHandle&) const; const KeyframeEffectModelBase* Model() const { return model_.Get(); } KeyframeEffectModelBase* Model() { return model_.Get(); }
diff --git a/third_party/blink/renderer/core/css/css_rule.cc b/third_party/blink/renderer/core/css/css_rule.cc index 479eb0a..3073ab9d 100644 --- a/third_party/blink/renderer/core/css/css_rule.cc +++ b/third_party/blink/renderer/core/css/css_rule.cc
@@ -70,7 +70,7 @@ ScriptWrappable::Trace(visitor); } -void CSSRule::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void CSSRule::TraceWrappers(ScriptWrappableVisitor* visitor) const { if (parent_is_rule_) visitor->TraceWrappersWithManualWriteBarrier(parent_rule_); else
diff --git a/third_party/blink/renderer/core/css/css_rule.h b/third_party/blink/renderer/core/css/css_rule.h index 73222a7..24b7c94 100644 --- a/third_party/blink/renderer/core/css/css_rule.h +++ b/third_party/blink/renderer/core/css/css_rule.h
@@ -67,7 +67,7 @@ void SetParentRule(CSSRule*); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; CSSStyleSheet* parentStyleSheet() const { if (parent_is_rule_)
diff --git a/third_party/blink/renderer/core/css/font_face_set_document.cc b/third_party/blink/renderer/core/css/font_face_set_document.cc index 23d673f..ea410a8d 100644 --- a/third_party/blink/renderer/core/css/font_face_set_document.cc +++ b/third_party/blink/renderer/core/css/font_face_set_document.cc
@@ -207,8 +207,7 @@ FontFaceSet::Trace(visitor); } -void FontFaceSetDocument::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void FontFaceSetDocument::TraceWrappers(ScriptWrappableVisitor* visitor) const { FontFaceSet::TraceWrappers(visitor); Supplement<Document>::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/css/font_face_set_document.h b/third_party/blink/renderer/core/css/font_face_set_document.h index 1bffa774..f324f86 100644 --- a/third_party/blink/renderer/core/css/font_face_set_document.h +++ b/third_party/blink/renderer/core/css/font_face_set_document.h
@@ -74,7 +74,7 @@ static size_t ApproximateBlankCharacterCount(Document&); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: bool InActiveContext() const override;
diff --git a/third_party/blink/renderer/core/css/style_engine.cc b/third_party/blink/renderer/core/css/style_engine.cc index 0470204..82c200b 100644 --- a/third_party/blink/renderer/core/css/style_engine.cc +++ b/third_party/blink/renderer/core/css/style_engine.cc
@@ -1531,7 +1531,7 @@ FontSelectorClient::Trace(visitor); } -void StyleEngine::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void StyleEngine::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (const auto& sheet : injected_user_style_sheets_) { visitor->TraceWrappers(sheet.second); }
diff --git a/third_party/blink/renderer/core/css/style_engine.h b/third_party/blink/renderer/core/css/style_engine.h index 4943081..e0246d2 100644 --- a/third_party/blink/renderer/core/css/style_engine.h +++ b/third_party/blink/renderer/core/css/style_engine.h
@@ -311,7 +311,7 @@ const AtomicString& animation_name); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "StyleEngine"; } private:
diff --git a/third_party/blink/renderer/core/css/style_rule_css_style_declaration.cc b/third_party/blink/renderer/core/css/style_rule_css_style_declaration.cc index ebc8e6b..ebfb9dc 100644 --- a/third_party/blink/renderer/core/css/style_rule_css_style_declaration.cc +++ b/third_party/blink/renderer/core/css/style_rule_css_style_declaration.cc
@@ -73,7 +73,7 @@ } void StyleRuleCSSStyleDeclaration::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(parent_rule_); PropertySetCSSStyleDeclaration::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/css/style_rule_css_style_declaration.h b/third_party/blink/renderer/core/css/style_rule_css_style_declaration.h index 9ec3a60..c30121e 100644 --- a/third_party/blink/renderer/core/css/style_rule_css_style_declaration.h +++ b/third_party/blink/renderer/core/css/style_rule_css_style_declaration.h
@@ -45,7 +45,7 @@ void Reattach(MutableCSSPropertyValueSet&); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: StyleRuleCSSStyleDeclaration(MutableCSSPropertyValueSet&, CSSRule*);
diff --git a/third_party/blink/renderer/core/css/style_sheet_collection.cc b/third_party/blink/renderer/core/css/style_sheet_collection.cc index 8945c86..04e29ef 100644 --- a/third_party/blink/renderer/core/css/style_sheet_collection.cc +++ b/third_party/blink/renderer/core/css/style_sheet_collection.cc
@@ -68,7 +68,7 @@ } void StyleSheetCollection::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (auto sheet : style_sheets_for_style_sheet_list_) { visitor->TraceWrappers(sheet); }
diff --git a/third_party/blink/renderer/core/css/style_sheet_collection.h b/third_party/blink/renderer/core/css/style_sheet_collection.h index 400a62b..d87a54a 100644 --- a/third_party/blink/renderer/core/css/style_sheet_collection.h +++ b/third_party/blink/renderer/core/css/style_sheet_collection.h
@@ -67,7 +67,7 @@ void MarkSheetListDirty() { sheet_list_dirty_ = true; } virtual void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "StyleSheetCollection"; }
diff --git a/third_party/blink/renderer/core/dom/attr.cc b/third_party/blink/renderer/core/dom/attr.cc index 7a1ed05..dde97c1d 100644 --- a/third_party/blink/renderer/core/dom/attr.cc +++ b/third_party/blink/renderer/core/dom/attr.cc
@@ -117,7 +117,7 @@ Node::Trace(visitor); } -void Attr::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void Attr::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(element_); Node::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/dom/attr.h b/third_party/blink/renderer/core/dom/attr.h index eb73c711..6bc6578f 100644 --- a/third_party/blink/renderer/core/dom/attr.h +++ b/third_party/blink/renderer/core/dom/attr.h
@@ -60,7 +60,7 @@ const AtomicString& prefix() const { return name_.Prefix(); } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: Attr(Element&, const QualifiedName&);
diff --git a/third_party/blink/renderer/core/dom/container_node.cc b/third_party/blink/renderer/core/dom/container_node.cc index 6494f04..12d29763 100644 --- a/third_party/blink/renderer/core/dom/container_node.cc +++ b/third_party/blink/renderer/core/dom/container_node.cc
@@ -642,7 +642,7 @@ Node::Trace(visitor); } -void ContainerNode::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void ContainerNode::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(first_child_); visitor->TraceWrappers(last_child_); Node::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/core/dom/container_node.h b/third_party/blink/renderer/core/dom/container_node.h index 5856e20..7ecbdf4 100644 --- a/third_party/blink/renderer/core/dom/container_node.h +++ b/third_party/blink/renderer/core/dom/container_node.h
@@ -367,7 +367,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: ContainerNode(TreeScope*, ConstructionType = kCreateContainer);
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index 271f72f2..121a0d1 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc
@@ -6203,7 +6203,15 @@ } bool Document::CanExecuteScripts(ReasonForCallingCanExecuteScripts reason) { - if (IsSandboxed(kSandboxScripts)) { + DCHECK(GetFrame()) + << "you are querying canExecuteScripts on a non contextDocument."; + + // Normally, scripts are not allowed in sandboxed contexts that disallow them. + // However, there is an exception for cases when the script should bypass the + // main world's CSP (such as for privileged isolated worlds). See + // https://crbug.com/811528. + if (IsSandboxed(kSandboxScripts) && + !GetFrame()->GetScriptController().ShouldBypassMainWorldCSP()) { // FIXME: This message should be moved off the console once a solution to // https://bugs.webkit.org/show_bug.cgi?id=103274 exists. if (reason == kAboutToExecuteScript) { @@ -6216,9 +6224,6 @@ return false; } - DCHECK(GetFrame()) - << "you are querying canExecuteScripts on a non contextDocument."; - ContentSettingsClient* settings_client = GetFrame()->GetContentSettingsClient(); if (!settings_client) @@ -7365,7 +7370,7 @@ return *slot_assignment_engine_; } -void Document::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void Document::TraceWrappers(ScriptWrappableVisitor* visitor) const { // node_lists_ are traced in their corresponding NodeListsNodeData, keeping // them only alive for live nodes. Otherwise we would keep lists of dead // nodes alive that have not yet been invalidated.
diff --git a/third_party/blink/renderer/core/dom/document.h b/third_party/blink/renderer/core/dom/document.h index 50ddf51..7198469 100644 --- a/third_party/blink/renderer/core/dom/document.h +++ b/third_party/blink/renderer/core/dom/document.h
@@ -1300,7 +1300,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; AtomicString ConvertLocalName(const AtomicString&);
diff --git a/third_party/blink/renderer/core/dom/document_parser.h b/third_party/blink/renderer/core/dom/document_parser.h index 2b2ce2d..7480b5a 100644 --- a/third_party/blink/renderer/core/dom/document_parser.h +++ b/third_party/blink/renderer/core/dom/document_parser.h
@@ -43,7 +43,7 @@ public: virtual ~DocumentParser(); virtual void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override {} + void TraceWrappers(ScriptWrappableVisitor*) const override {} const char* NameInHeapSnapshot() const override { return "DocumentParser"; } virtual ScriptableDocumentParser* AsScriptableDocumentParser() {
diff --git a/third_party/blink/renderer/core/dom/document_test.cc b/third_party/blink/renderer/core/dom/document_test.cc index 392f8e7..0226714 100644 --- a/third_party/blink/renderer/core/dom/document_test.cc +++ b/third_party/blink/renderer/core/dom/document_test.cc
@@ -35,6 +35,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/platform/web_application_cache_host.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h" #include "third_party/blink/renderer/core/dom/document_fragment.h" #include "third_party/blink/renderer/core/dom/node_with_index.h" @@ -945,6 +946,53 @@ EXPECT_EQ(1, obs.CountInvalidateCalled()); } +TEST_F(DocumentTest, CanExecuteScriptsWithSandboxAndIsolatedWorld) { + constexpr SandboxFlags kSandboxMask = kSandboxScripts; + GetDocument().EnforceSandboxFlags(kSandboxMask); + + LocalFrame* frame = GetDocument().GetFrame(); + frame->GetSettings()->SetScriptEnabled(true); + ScriptState* main_world_script_state = ToScriptStateForMainWorld(frame); + v8::Isolate* isolate = main_world_script_state->GetIsolate(); + + constexpr int kIsolatedWorldWithoutCSPId = 1; + scoped_refptr<DOMWrapperWorld> world_without_csp = + DOMWrapperWorld::EnsureIsolatedWorld(isolate, kIsolatedWorldWithoutCSPId); + ScriptState* isolated_world_without_csp_script_state = + ToScriptState(frame, *world_without_csp); + ASSERT_TRUE(world_without_csp->IsIsolatedWorld()); + EXPECT_FALSE(world_without_csp->IsolatedWorldHasContentSecurityPolicy()); + + constexpr int kIsolatedWorldWithCSPId = 2; + scoped_refptr<DOMWrapperWorld> world_with_csp = + DOMWrapperWorld::EnsureIsolatedWorld(isolate, kIsolatedWorldWithCSPId); + DOMWrapperWorld::SetIsolatedWorldContentSecurityPolicy( + kIsolatedWorldWithCSPId, String::FromUTF8("script-src *")); + ScriptState* isolated_world_with_csp_script_state = + ToScriptState(frame, *world_with_csp); + ASSERT_TRUE(world_with_csp->IsIsolatedWorld()); + EXPECT_TRUE(world_with_csp->IsolatedWorldHasContentSecurityPolicy()); + + { + // Since the page is sandboxed, main world script execution shouldn't be + // allowed. + ScriptState::Scope scope(main_world_script_state); + EXPECT_FALSE(GetDocument().CanExecuteScripts(kAboutToExecuteScript)); + } + { + // Isolated worlds without a dedicated CSP should also not be allowed to + // run scripts. + ScriptState::Scope scope(isolated_world_without_csp_script_state); + EXPECT_FALSE(GetDocument().CanExecuteScripts(kAboutToExecuteScript)); + } + { + // An isolated world with a CSP should bypass the main world CSP, and be + // able to run scripts. + ScriptState::Scope scope(isolated_world_with_csp_script_state); + EXPECT_TRUE(GetDocument().CanExecuteScripts(kAboutToExecuteScript)); + } +} + typedef bool TestParamRootLayerScrolling; class ParameterizedDocumentTest : public testing::WithParamInterface<TestParamRootLayerScrolling>,
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index c0a9b0f8..d8f1b72 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -4861,7 +4861,7 @@ ContainerNode::Trace(visitor); } -void Element::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void Element::TraceWrappers(ScriptWrappableVisitor* visitor) const { if (HasRareData()) { visitor->TraceWrappersWithManualWriteBarrier(GetElementRareData()); }
diff --git a/third_party/blink/renderer/core/dom/element.h b/third_party/blink/renderer/core/dom/element.h index 04ab39c..2d863ee 100644 --- a/third_party/blink/renderer/core/dom/element.h +++ b/third_party/blink/renderer/core/dom/element.h
@@ -847,8 +847,7 @@ const AttributeModificationParams&); void Trace(blink::Visitor*) override; - - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; SpellcheckAttributeState GetSpellcheckAttributeState() const;
diff --git a/third_party/blink/renderer/core/dom/element_rare_data.cc b/third_party/blink/renderer/core/dom/element_rare_data.cc index 5443c69..9bd1149 100644 --- a/third_party/blink/renderer/core/dom/element_rare_data.cc +++ b/third_party/blink/renderer/core/dom/element_rare_data.cc
@@ -110,7 +110,7 @@ } void ElementRareData::TraceWrappersAfterDispatch( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { if (attr_node_list_.Get()) { for (auto& attr : *attr_node_list_) { visitor->TraceWrappers(attr);
diff --git a/third_party/blink/renderer/core/dom/element_rare_data.h b/third_party/blink/renderer/core/dom/element_rare_data.h index ed08b74d..6b4896e7 100644 --- a/third_party/blink/renderer/core/dom/element_rare_data.h +++ b/third_party/blink/renderer/core/dom/element_rare_data.h
@@ -191,7 +191,7 @@ void SetNonce(const AtomicString& nonce) { nonce_ = nonce; } void TraceAfterDispatch(blink::Visitor*); - void TraceWrappersAfterDispatch(const ScriptWrappableVisitor*) const; + void TraceWrappersAfterDispatch(ScriptWrappableVisitor*) const; private: ScrollOffset saved_layer_scroll_offset_;
diff --git a/third_party/blink/renderer/core/dom/events/custom_event.cc b/third_party/blink/renderer/core/dom/events/custom_event.cc index eebe49f..a7291f3 100644 --- a/third_party/blink/renderer/core/dom/events/custom_event.cc +++ b/third_party/blink/renderer/core/dom/events/custom_event.cc
@@ -78,7 +78,7 @@ Event::Trace(visitor); } -void CustomEvent::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void CustomEvent::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(detail_); Event::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/dom/events/custom_event.h b/third_party/blink/renderer/core/dom/events/custom_event.h index 0eb3942..dcd6bf5 100644 --- a/third_party/blink/renderer/core/dom/events/custom_event.h +++ b/third_party/blink/renderer/core/dom/events/custom_event.h
@@ -60,7 +60,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: CustomEvent();
diff --git a/third_party/blink/renderer/core/dom/events/event_listener.h b/third_party/blink/renderer/core/dom/events/event_listener.h index e74db92..3e0cbc7c 100644 --- a/third_party/blink/renderer/core/dom/events/event_listener.h +++ b/third_party/blink/renderer/core/dom/events/event_listener.h
@@ -56,7 +56,7 @@ ListenerType GetType() const { return type_; } virtual void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override {} + void TraceWrappers(ScriptWrappableVisitor* visitor) const override {} const char* NameInHeapSnapshot() const override { return "EventListener"; } protected:
diff --git a/third_party/blink/renderer/core/dom/events/event_listener_map.cc b/third_party/blink/renderer/core/dom/events/event_listener_map.cc index 2dd5b50..86d8b9cf 100644 --- a/third_party/blink/renderer/core/dom/events/event_listener_map.cc +++ b/third_party/blink/renderer/core/dom/events/event_listener_map.cc
@@ -209,8 +209,7 @@ visitor->Trace(entries_); } -void EventListenerMap::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void EventListenerMap::TraceWrappers(ScriptWrappableVisitor* visitor) const { // Trace wrappers in entries_. for (auto& entry : entries_) { for (auto& listener : *entry.second) {
diff --git a/third_party/blink/renderer/core/dom/events/event_listener_map.h b/third_party/blink/renderer/core/dom/events/event_listener_map.h index 59a95ef..5f9f960 100644 --- a/third_party/blink/renderer/core/dom/events/event_listener_map.h +++ b/third_party/blink/renderer/core/dom/events/event_listener_map.h
@@ -73,7 +73,7 @@ void CopyEventListenersNotCreatedFromMarkupToTarget(EventTarget*); void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const; + void TraceWrappers(ScriptWrappableVisitor*) const; private: friend class EventListenerIterator;
diff --git a/third_party/blink/renderer/core/dom/events/event_target.cc b/third_party/blink/renderer/core/dom/events/event_target.cc index e7f3d893..0fee8148 100644 --- a/third_party/blink/renderer/core/dom/events/event_target.cc +++ b/third_party/blink/renderer/core/dom/events/event_target.cc
@@ -161,8 +161,7 @@ visitor->Trace(event_listener_map); } -void EventTargetData::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void EventTargetData::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(event_listener_map); }
diff --git a/third_party/blink/renderer/core/dom/events/event_target.h b/third_party/blink/renderer/core/dom/events/event_target.h index ed6a67f..6e83897 100644 --- a/third_party/blink/renderer/core/dom/events/event_target.h +++ b/third_party/blink/renderer/core/dom/events/event_target.h
@@ -80,7 +80,7 @@ ~EventTargetData(); void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const; + void TraceWrappers(ScriptWrappableVisitor*) const; EventListenerMap event_listener_map; std::unique_ptr<FiringEventIteratorVector> firing_event_iterators; @@ -232,7 +232,7 @@ EventTarget::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(event_target_data_); EventTarget::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/dom/frame_request_callback_collection.cc b/third_party/blink/renderer/core/dom/frame_request_callback_collection.cc index 659e7a0..7d51572 100644 --- a/third_party/blink/renderer/core/dom/frame_request_callback_collection.cc +++ b/third_party/blink/renderer/core/dom/frame_request_callback_collection.cc
@@ -87,7 +87,7 @@ } void FrameRequestCallbackCollection::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (const auto& callback : callbacks_) visitor->TraceWrappers(callback); for (const auto& callback_to_invoke : callbacks_to_invoke_) @@ -105,7 +105,7 @@ } void FrameRequestCallbackCollection::V8FrameCallback::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(callback_); FrameRequestCallbackCollection::FrameCallback::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/dom/frame_request_callback_collection.h b/third_party/blink/renderer/core/dom/frame_request_callback_collection.h index 05beac8c..37c568b 100644 --- a/third_party/blink/renderer/core/dom/frame_request_callback_collection.h +++ b/third_party/blink/renderer/core/dom/frame_request_callback_collection.h
@@ -31,7 +31,7 @@ public TraceWrapperBase { public: virtual void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override {} + void TraceWrappers(ScriptWrappableVisitor* visitor) const override {} const char* NameInHeapSnapshot() const override { return "FrameCallback"; } virtual ~FrameCallback() = default; virtual void Invoke(double) = 0; @@ -62,7 +62,7 @@ return new V8FrameCallback(callback); } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "V8FrameCallback"; } @@ -81,7 +81,7 @@ bool IsEmpty() const { return !callbacks_.size(); } void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "FrameRequestCallbackCollection"; }
diff --git a/third_party/blink/renderer/core/dom/mutation_observer.cc b/third_party/blink/renderer/core/dom/mutation_observer.cc index ab10626..5cbcc65 100644 --- a/third_party/blink/renderer/core/dom/mutation_observer.cc +++ b/third_party/blink/renderer/core/dom/mutation_observer.cc
@@ -74,7 +74,7 @@ ContextClient::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(callback_); MutationObserver::Delegate::TraceWrappers(visitor); } @@ -379,8 +379,7 @@ ContextClient::Trace(visitor); } -void MutationObserver::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void MutationObserver::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(delegate_); for (auto record : records_) visitor->TraceWrappers(record);
diff --git a/third_party/blink/renderer/core/dom/mutation_observer.h b/third_party/blink/renderer/core/dom/mutation_observer.h index 1693b2c..a00e5a6e 100644 --- a/third_party/blink/renderer/core/dom/mutation_observer.h +++ b/third_party/blink/renderer/core/dom/mutation_observer.h
@@ -95,7 +95,7 @@ virtual void Deliver(const MutationRecordVector& records, MutationObserver&) = 0; virtual void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override {} + void TraceWrappers(ScriptWrappableVisitor* visitor) const override {} const char* NameInHeapSnapshot() const override { return "MutationObserver::Delegate"; } @@ -128,7 +128,7 @@ EAGERLY_FINALIZE(); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: struct ObserverLessThan;
diff --git a/third_party/blink/renderer/core/dom/mutation_observer_registration.cc b/third_party/blink/renderer/core/dom/mutation_observer_registration.cc index 3e02ea43..2517cdd 100644 --- a/third_party/blink/renderer/core/dom/mutation_observer_registration.cc +++ b/third_party/blink/renderer/core/dom/mutation_observer_registration.cc
@@ -156,7 +156,7 @@ } void MutationObserverRegistration::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(observer_); }
diff --git a/third_party/blink/renderer/core/dom/mutation_observer_registration.h b/third_party/blink/renderer/core/dom/mutation_observer_registration.h index d8534fee..d3e6c77 100644 --- a/third_party/blink/renderer/core/dom/mutation_observer_registration.h +++ b/third_party/blink/renderer/core/dom/mutation_observer_registration.h
@@ -84,7 +84,7 @@ void Dispose(); void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "MutationObserverRegistration"; }
diff --git a/third_party/blink/renderer/core/dom/mutation_record.cc b/third_party/blink/renderer/core/dom/mutation_record.cc index ba9a2ab..0e9f9c0 100644 --- a/third_party/blink/renderer/core/dom/mutation_record.cc +++ b/third_party/blink/renderer/core/dom/mutation_record.cc
@@ -62,7 +62,7 @@ MutationRecord::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(target_); visitor->TraceWrappers(added_nodes_); visitor->TraceWrappers(removed_nodes_); @@ -96,7 +96,7 @@ MutationRecord::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(target_); visitor->TraceWrappers(added_nodes_); visitor->TraceWrappers(removed_nodes_); @@ -164,7 +164,7 @@ MutationRecord::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(record_); MutationRecord::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/dom/node.cc b/third_party/blink/renderer/core/dom/node.cc index f26198c..000f3833 100644 --- a/third_party/blink/renderer/core/dom/node.cc +++ b/third_party/blink/renderer/core/dom/node.cc
@@ -2775,7 +2775,7 @@ EventTarget::Trace(visitor); } -void Node::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void Node::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(parent_or_shadow_host_node_); visitor->TraceWrappers(previous_); visitor->TraceWrappers(next_);
diff --git a/third_party/blink/renderer/core/dom/node.h b/third_party/blink/renderer/core/dom/node.h index 8dc6cf7..9b184a4 100644 --- a/third_party/blink/renderer/core/dom/node.h +++ b/third_party/blink/renderer/core/dom/node.h
@@ -826,7 +826,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: enum NodeFlags {
diff --git a/third_party/blink/renderer/core/dom/node_iterator.cc b/third_party/blink/renderer/core/dom/node_iterator.cc index 302d48f3..11e81a0b 100644 --- a/third_party/blink/renderer/core/dom/node_iterator.cc +++ b/third_party/blink/renderer/core/dom/node_iterator.cc
@@ -205,7 +205,7 @@ NodeIteratorBase::Trace(visitor); } -void NodeIterator::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void NodeIterator::TraceWrappers(ScriptWrappableVisitor* visitor) const { ScriptWrappable::TraceWrappers(visitor); NodeIteratorBase::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/dom/node_iterator.h b/third_party/blink/renderer/core/dom/node_iterator.h index d2a7b1f..c63c016 100644 --- a/third_party/blink/renderer/core/dom/node_iterator.h +++ b/third_party/blink/renderer/core/dom/node_iterator.h
@@ -59,7 +59,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: NodeIterator(Node*, unsigned what_to_show, V8NodeFilterCondition*);
diff --git a/third_party/blink/renderer/core/dom/node_iterator_base.cc b/third_party/blink/renderer/core/dom/node_iterator_base.cc index 6fa78a9..b9c7009 100644 --- a/third_party/blink/renderer/core/dom/node_iterator_base.cc +++ b/third_party/blink/renderer/core/dom/node_iterator_base.cc
@@ -52,8 +52,7 @@ visitor->Trace(filter_); } -void NodeIteratorBase::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void NodeIteratorBase::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(filter_); }
diff --git a/third_party/blink/renderer/core/dom/node_iterator_base.h b/third_party/blink/renderer/core/dom/node_iterator_base.h index 8b74f7bb..5976b4ab 100644 --- a/third_party/blink/renderer/core/dom/node_iterator_base.h +++ b/third_party/blink/renderer/core/dom/node_iterator_base.h
@@ -41,7 +41,7 @@ V8NodeFilterCondition* filter() const { return filter_.Get(); } void Trace(blink::Visitor*) override; - virtual void TraceWrappers(const ScriptWrappableVisitor*) const; + virtual void TraceWrappers(ScriptWrappableVisitor*) const; protected: NodeIteratorBase(Node*, unsigned what_to_show, V8NodeFilterCondition*);
diff --git a/third_party/blink/renderer/core/dom/node_lists_node_data.cc b/third_party/blink/renderer/core/dom/node_lists_node_data.cc index cfdccd8..6e2dc54 100644 --- a/third_party/blink/renderer/core/dom/node_lists_node_data.cc +++ b/third_party/blink/renderer/core/dom/node_lists_node_data.cc
@@ -51,8 +51,7 @@ visitor->Trace(tag_collection_ns_caches_); } -void NodeListsNodeData::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void NodeListsNodeData::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(child_node_list_); for (const auto list : atomic_name_caches_.Values()) { visitor->TraceWrappers(list);
diff --git a/third_party/blink/renderer/core/dom/node_lists_node_data.h b/third_party/blink/renderer/core/dom/node_lists_node_data.h index 1fda734..1c73525 100644 --- a/third_party/blink/renderer/core/dom/node_lists_node_data.h +++ b/third_party/blink/renderer/core/dom/node_lists_node_data.h
@@ -171,7 +171,7 @@ } void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const; + void TraceWrappers(ScriptWrappableVisitor*) const; private: NodeListsNodeData() : child_node_list_(nullptr) {}
diff --git a/third_party/blink/renderer/core/dom/node_rare_data.cc b/third_party/blink/renderer/core/dom/node_rare_data.cc index ea0c23d..12d79e6 100644 --- a/third_party/blink/renderer/core/dom/node_rare_data.cc +++ b/third_party/blink/renderer/core/dom/node_rare_data.cc
@@ -65,7 +65,7 @@ TraceAfterDispatch(visitor); } -void NodeRareData::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void NodeRareData::TraceWrappers(ScriptWrappableVisitor* visitor) const { if (is_element_rare_data_) static_cast<const ElementRareData*>(this)->TraceWrappersAfterDispatch( visitor); @@ -74,7 +74,7 @@ } void NodeRareData::TraceWrappersAfterDispatch( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(node_lists_); visitor->TraceWrappers(mutation_observer_data_); }
diff --git a/third_party/blink/renderer/core/dom/node_rare_data.h b/third_party/blink/renderer/core/dom/node_rare_data.h index fe666b8d..3197cdd 100644 --- a/third_party/blink/renderer/core/dom/node_rare_data.h +++ b/third_party/blink/renderer/core/dom/node_rare_data.h
@@ -76,7 +76,7 @@ visitor->Trace(transient_registry_); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const { + void TraceWrappers(ScriptWrappableVisitor* visitor) const { for (auto registration : registry_) { visitor->TraceWrappers(registration); } @@ -210,8 +210,8 @@ void TraceAfterDispatch(blink::Visitor*); void FinalizeGarbageCollectedObject(); - void TraceWrappers(const ScriptWrappableVisitor*) const; - void TraceWrappersAfterDispatch(const ScriptWrappableVisitor*) const; + void TraceWrappers(ScriptWrappableVisitor*) const; + void TraceWrappersAfterDispatch(ScriptWrappableVisitor*) const; protected: explicit NodeRareData(NodeRenderingData* node_layout_data)
diff --git a/third_party/blink/renderer/core/dom/scripted_animation_controller.cc b/third_party/blink/renderer/core/dom/scripted_animation_controller.cc index 2759438..bc98185 100644 --- a/third_party/blink/renderer/core/dom/scripted_animation_controller.cc +++ b/third_party/blink/renderer/core/dom/scripted_animation_controller.cc
@@ -53,7 +53,7 @@ } void ScriptedAnimationController::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(callback_collection_); }
diff --git a/third_party/blink/renderer/core/dom/scripted_animation_controller.h b/third_party/blink/renderer/core/dom/scripted_animation_controller.h index d0f329a14..50bbd2a 100644 --- a/third_party/blink/renderer/core/dom/scripted_animation_controller.h +++ b/third_party/blink/renderer/core/dom/scripted_animation_controller.h
@@ -51,7 +51,7 @@ virtual ~ScriptedAnimationController() = default; void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "ScriptedAnimationController"; }
diff --git a/third_party/blink/renderer/core/dom/scripted_idle_task_controller.cc b/third_party/blink/renderer/core/dom/scripted_idle_task_controller.cc index 88e36443..f28a153f 100644 --- a/third_party/blink/renderer/core/dom/scripted_idle_task_controller.cc +++ b/third_party/blink/renderer/core/dom/scripted_idle_task_controller.cc
@@ -89,7 +89,7 @@ } void ScriptedIdleTaskController::V8IdleTask::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(callback_); ScriptedIdleTaskController::IdleTask::TraceWrappers(visitor); } @@ -115,7 +115,7 @@ } void ScriptedIdleTaskController::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (const auto& idle_task : idle_tasks_.Values()) { visitor->TraceWrappers(idle_task); }
diff --git a/third_party/blink/renderer/core/dom/scripted_idle_task_controller.h b/third_party/blink/renderer/core/dom/scripted_idle_task_controller.h index 6d658ffe..29208f8 100644 --- a/third_party/blink/renderer/core/dom/scripted_idle_task_controller.h +++ b/third_party/blink/renderer/core/dom/scripted_idle_task_controller.h
@@ -34,7 +34,7 @@ ~ScriptedIdleTaskController() override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "ScriptedIdleTaskController"; } @@ -47,7 +47,7 @@ public TraceWrapperBase { public: virtual void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override {} + void TraceWrappers(ScriptWrappableVisitor* visitor) const override {} const char* NameInHeapSnapshot() const override { return "IdleTask"; } virtual ~IdleTask() = default; virtual void invoke(IdleDeadline*) = 0; @@ -63,7 +63,7 @@ ~V8IdleTask() override = default; void invoke(IdleDeadline*) override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: explicit V8IdleTask(V8IdleRequestCallback*);
diff --git a/third_party/blink/renderer/core/dom/shadow_root.cc b/third_party/blink/renderer/core/dom/shadow_root.cc index 0509270..2a2fcbd 100644 --- a/third_party/blink/renderer/core/dom/shadow_root.cc +++ b/third_party/blink/renderer/core/dom/shadow_root.cc
@@ -294,7 +294,7 @@ DocumentFragment::Trace(visitor); } -void ShadowRoot::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void ShadowRoot::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(style_sheet_list_); DocumentFragment::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/dom/shadow_root.h b/third_party/blink/renderer/core/dom/shadow_root.h index 138d323..fb23e8ed 100644 --- a/third_party/blink/renderer/core/dom/shadow_root.h +++ b/third_party/blink/renderer/core/dom/shadow_root.h
@@ -165,7 +165,7 @@ } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: ShadowRoot(Document&, ShadowRootType);
diff --git a/third_party/blink/renderer/core/dom/shadow_root_v0.h b/third_party/blink/renderer/core/dom/shadow_root_v0.h index c80f595..362e7e6a 100644 --- a/third_party/blink/renderer/core/dom/shadow_root_v0.h +++ b/third_party/blink/renderer/core/dom/shadow_root_v0.h
@@ -86,7 +86,7 @@ visitor->Trace(node_to_insertion_points_); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const { + void TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(shadow_root_); }
diff --git a/third_party/blink/renderer/core/dom/static_node_list.h b/third_party/blink/renderer/core/dom/static_node_list.h index 2ab5e03b..adac717 100644 --- a/third_party/blink/renderer/core/dom/static_node_list.h +++ b/third_party/blink/renderer/core/dom/static_node_list.h
@@ -50,7 +50,7 @@ NodeType* item(unsigned index) const override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { for (unsigned i = 0; i < length(); i++) visitor->TraceWrappers(nodes_[i]); NodeList::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/core/dom/tree_walker.cc b/third_party/blink/renderer/core/dom/tree_walker.cc index 1ad2eb9..2685062c 100644 --- a/third_party/blink/renderer/core/dom/tree_walker.cc +++ b/third_party/blink/renderer/core/dom/tree_walker.cc
@@ -254,7 +254,7 @@ NodeIteratorBase::Trace(visitor); } -void TreeWalker::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void TreeWalker::TraceWrappers(ScriptWrappableVisitor* visitor) const { ScriptWrappable::TraceWrappers(visitor); NodeIteratorBase::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/dom/tree_walker.h b/third_party/blink/renderer/core/dom/tree_walker.h index 5a474a2..e732300 100644 --- a/third_party/blink/renderer/core/dom/tree_walker.h +++ b/third_party/blink/renderer/core/dom/tree_walker.h
@@ -58,7 +58,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: TreeWalker(Node*, unsigned what_to_show, V8NodeFilterCondition*);
diff --git a/third_party/blink/renderer/core/events/error_event.cc b/third_party/blink/renderer/core/events/error_event.cc index 72256d8..77b98363 100644 --- a/third_party/blink/renderer/core/events/error_event.cc +++ b/third_party/blink/renderer/core/events/error_event.cc
@@ -98,7 +98,7 @@ Event::Trace(visitor); } -void ErrorEvent::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void ErrorEvent::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(error_); Event::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/events/error_event.h b/third_party/blink/renderer/core/events/error_event.h index 834b995..7e51be4 100644 --- a/third_party/blink/renderer/core/events/error_event.h +++ b/third_party/blink/renderer/core/events/error_event.h
@@ -94,7 +94,7 @@ void SetUnsanitizedMessage(const String&); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: ErrorEvent();
diff --git a/third_party/blink/renderer/core/events/pop_state_event.cc b/third_party/blink/renderer/core/events/pop_state_event.cc index 11fd645..b03d50c 100644 --- a/third_party/blink/renderer/core/events/pop_state_event.cc +++ b/third_party/blink/renderer/core/events/pop_state_event.cc
@@ -92,7 +92,7 @@ Event::Trace(visitor); } -void PopStateEvent::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void PopStateEvent::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(state_); Event::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/events/pop_state_event.h b/third_party/blink/renderer/core/events/pop_state_event.h index f16dfaf..3a1f2cbe 100644 --- a/third_party/blink/renderer/core/events/pop_state_event.h +++ b/third_party/blink/renderer/core/events/pop_state_event.h
@@ -63,7 +63,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: PopStateEvent();
diff --git a/third_party/blink/renderer/core/events/promise_rejection_event.cc b/third_party/blink/renderer/core/events/promise_rejection_event.cc index da70a12..a8456f7 100644 --- a/third_party/blink/renderer/core/events/promise_rejection_event.cc +++ b/third_party/blink/renderer/core/events/promise_rejection_event.cc
@@ -64,7 +64,7 @@ } void PromiseRejectionEvent::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(promise_); visitor->TraceWrappers(reason_); Event::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/core/events/promise_rejection_event.h b/third_party/blink/renderer/core/events/promise_rejection_event.h index b77241d6..4f3dab9 100644 --- a/third_party/blink/renderer/core/events/promise_rejection_event.h +++ b/third_party/blink/renderer/core/events/promise_rejection_event.h
@@ -39,7 +39,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: PromiseRejectionEvent(ScriptState*,
diff --git a/third_party/blink/renderer/core/events/registered_event_listener.h b/third_party/blink/renderer/core/events/registered_event_listener.h index 419b7a3..e0dab76 100644 --- a/third_party/blink/renderer/core/events/registered_event_listener.h +++ b/third_party/blink/renderer/core/events/registered_event_listener.h
@@ -56,7 +56,7 @@ passive_specified_(options.PassiveSpecified()) {} void Trace(blink::Visitor* visitor) { visitor->Trace(callback_); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const { + void TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(callback_); }
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc index aa1d7711..97e2c95f 100644 --- a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc +++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
@@ -67,6 +67,7 @@ #include "third_party/blink/renderer/core/exported/web_document_loader_impl.h" #include "third_party/blink/renderer/core/exported/web_plugin_container_impl.h" #include "third_party/blink/renderer/core/exported/web_view_impl.h" +#include "third_party/blink/renderer/core/fileapi/public_url_manager.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/frame/web_local_frame_impl.h" @@ -638,7 +639,15 @@ if (!web_frame_->Client()) return; DCHECK(web_frame_->GetFrame()->GetDocument()); - web_frame_->Client()->DownloadURL(WrappedResourceRequest(request)); + mojom::blink::BlobURLTokenPtr blob_url_token; + if (request.Url().ProtocolIs("blob") && + RuntimeEnabledFeatures::MojoBlobURLsEnabled()) { + web_frame_->GetFrame()->GetDocument()->GetPublicURLManager().Resolve( + request.Url(), MakeRequest(&blob_url_token)); + } + web_frame_->Client()->DownloadURL( + WrappedResourceRequest(request), + blob_url_token.PassInterface().PassHandle()); } void LocalFrameClientImpl::LoadErrorPage(int reason) {
diff --git a/third_party/blink/renderer/core/frame/dom_window.cc b/third_party/blink/renderer/core/frame/dom_window.cc index 86908fa..7cae0ec 100644 --- a/third_party/blink/renderer/core/frame/dom_window.cc +++ b/third_party/blink/renderer/core/frame/dom_window.cc
@@ -442,7 +442,7 @@ EventTargetWithInlineData::Trace(visitor); } -void DOMWindow::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void DOMWindow::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(location_); EventTargetWithInlineData::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/frame/dom_window.h b/third_party/blink/renderer/core/frame/dom_window.h index 0727e75a..73464d0 100644 --- a/third_party/blink/renderer/core/frame/dom_window.h +++ b/third_party/blink/renderer/core/frame/dom_window.h
@@ -51,7 +51,7 @@ // GarbageCollectedFinalized overrides: void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; virtual bool IsLocalDOMWindow() const = 0; virtual bool IsRemoteDOMWindow() const = 0;
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc index 551309d2..6ca9d01c 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -1641,8 +1641,7 @@ Supplementable<LocalDOMWindow>::Trace(visitor); } -void LocalDOMWindow::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void LocalDOMWindow::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(custom_elements_); visitor->TraceWrappers(document_); visitor->TraceWrappers(modulator_);
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.h b/third_party/blink/renderer/core/frame/local_dom_window.h index f5d4ccc..b0a66c4f 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.h +++ b/third_party/blink/renderer/core/frame/local_dom_window.h
@@ -109,7 +109,7 @@ LocalFrame* GetFrame() const { return ToLocalFrame(DOMWindow::GetFrame()); } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; Document* InstallNewDocument(const String& mime_type, const DocumentInit&,
diff --git a/third_party/blink/renderer/core/frame/navigator.cc b/third_party/blink/renderer/core/frame/navigator.cc index 2e6e345e..a63307ea 100644 --- a/third_party/blink/renderer/core/frame/navigator.cc +++ b/third_party/blink/renderer/core/frame/navigator.cc
@@ -116,7 +116,7 @@ Supplementable<Navigator>::Trace(visitor); } -void Navigator::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void Navigator::TraceWrappers(ScriptWrappableVisitor* visitor) const { ScriptWrappable::TraceWrappers(visitor); Supplementable<Navigator>::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/frame/navigator.h b/third_party/blink/renderer/core/frame/navigator.h index c2a910ab..6e46f313 100644 --- a/third_party/blink/renderer/core/frame/navigator.h +++ b/third_party/blink/renderer/core/frame/navigator.h
@@ -66,7 +66,7 @@ Vector<String> languages() override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: explicit Navigator(LocalFrame*);
diff --git a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc index 485b9bcd..eb5b53b 100644 --- a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc +++ b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
@@ -1113,8 +1113,7 @@ HTMLElement::Trace(visitor); } -void HTMLCanvasElement::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void HTMLCanvasElement::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(context_); HTMLElement::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/html/canvas/html_canvas_element.h b/third_party/blink/renderer/core/html/canvas/html_canvas_element.h index f9823c1..8280a16 100644 --- a/third_party/blink/renderer/core/html/canvas/html_canvas_element.h +++ b/third_party/blink/renderer/core/html/canvas/html_canvas_element.h
@@ -223,7 +223,7 @@ unsigned resource_id) override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; void CreateCanvas2DLayerBridgeForTesting(std::unique_ptr<Canvas2DLayerBridge>, const IntSize&);
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_definition.h b/third_party/blink/renderer/core/html/custom/custom_element_definition.h index fd51340..0b23b5d 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_definition.h +++ b/third_party/blink/renderer/core/html/custom/custom_element_definition.h
@@ -36,7 +36,7 @@ virtual ~CustomElementDefinition(); virtual void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override {} + void TraceWrappers(ScriptWrappableVisitor* visitor) const override {} const char* NameInHeapSnapshot() const override { return "CustomElementDefinition"; }
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_reaction_stack.cc b/third_party/blink/renderer/core/html/custom/custom_element_reaction_stack.cc index 7163c85..fc958b2 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_reaction_stack.cc +++ b/third_party/blink/renderer/core/html/custom/custom_element_reaction_stack.cc
@@ -34,7 +34,7 @@ } void CustomElementReactionStack::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (auto key : map_.Keys()) { visitor->TraceWrappers(key); }
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_reaction_stack.h b/third_party/blink/renderer/core/html/custom/custom_element_reaction_stack.h index 1191140..a6150b3 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_reaction_stack.h +++ b/third_party/blink/renderer/core/html/custom/custom_element_reaction_stack.h
@@ -24,7 +24,7 @@ CustomElementReactionStack(); void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "CustomElementReactionStack"; }
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_registry.cc b/third_party/blink/renderer/core/html/custom/custom_element_registry.cc index 77ff17b..c8d3fe9 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_registry.cc +++ b/third_party/blink/renderer/core/html/custom/custom_element_registry.cc
@@ -117,7 +117,7 @@ } void CustomElementRegistry::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(reaction_stack_); for (auto definition : definitions_) visitor->TraceWrappers(definition);
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_registry.h b/third_party/blink/renderer/core/html/custom/custom_element_registry.h index 0b16096..3aee622 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_registry.h +++ b/third_party/blink/renderer/core/html/custom/custom_element_registry.h
@@ -69,7 +69,7 @@ void Entangle(V0CustomElementRegistrationContext*); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: friend class CustomElementRegistryTest;
diff --git a/third_party/blink/renderer/core/html/forms/slider_thumb_element.cc b/third_party/blink/renderer/core/html/forms/slider_thumb_element.cc index da6d757..b3e0d00 100644 --- a/third_party/blink/renderer/core/html/forms/slider_thumb_element.cc +++ b/third_party/blink/renderer/core/html/forms/slider_thumb_element.cc
@@ -52,10 +52,7 @@ using namespace HTMLNames; inline static bool HasVerticalAppearance(HTMLInputElement* input) { - DCHECK(input->GetLayoutObject()); - const ComputedStyle& slider_style = input->GetLayoutObject()->StyleRef(); - - return slider_style.Appearance() == kSliderVerticalPart; + return input->ComputedStyleRef().Appearance() == kSliderVerticalPart; } inline SliderThumbElement::SliderThumbElement(Document& document) @@ -346,6 +343,7 @@ touch_started_(false), sliding_direction_(kNoMove) { UpdateTouchEventHandlerRegistry(); + SetHasCustomStyleCallbacks(); } DEFINE_NODE_FACTORY(SliderContainerElement) @@ -497,4 +495,14 @@ has_touch_event_handler_ = false; } +scoped_refptr<ComputedStyle> +SliderContainerElement::CustomStyleForLayoutObject() { + HTMLInputElement* input = HostInput(); + DCHECK(input); + scoped_refptr<ComputedStyle> style = OriginalStyleForLayoutObject(); + style->SetFlexDirection(HasVerticalAppearance(input) ? EFlexDirection::kColumn + : EFlexDirection::kRow); + return style; +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/html/forms/slider_thumb_element.h b/third_party/blink/renderer/core/html/forms/slider_thumb_element.h index 43a2f1c..dab6251 100644 --- a/third_party/blink/renderer/core/html/forms/slider_thumb_element.h +++ b/third_party/blink/renderer/core/html/forms/slider_thumb_element.h
@@ -99,6 +99,7 @@ private: explicit SliderContainerElement(Document&); LayoutObject* CreateLayoutObject(const ComputedStyle&) override; + scoped_refptr<ComputedStyle> CustomStyleForLayoutObject() final; const AtomicString& ShadowPseudoId() const override; Direction GetDirection(LayoutPoint&, LayoutPoint&); bool CanSlide();
diff --git a/third_party/blink/renderer/core/html/html_anchor_element.cc b/third_party/blink/renderer/core/html/html_anchor_element.cc index 985dc2b..842b339 100644 --- a/third_party/blink/renderer/core/html/html_anchor_element.cc +++ b/third_party/blink/renderer/core/html/html_anchor_element.cc
@@ -432,8 +432,7 @@ HTMLElement::Trace(visitor); } -void HTMLAnchorElement::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void HTMLAnchorElement::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(rel_list_); HTMLElement::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/html/html_anchor_element.h b/third_party/blink/renderer/core/html/html_anchor_element.h index 967f7a9..a03d11f5 100644 --- a/third_party/blink/renderer/core/html/html_anchor_element.h +++ b/third_party/blink/renderer/core/html/html_anchor_element.h
@@ -93,7 +93,7 @@ void SendPings(const KURL& destination_url) const; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: HTMLAnchorElement(const QualifiedName&, Document&);
diff --git a/third_party/blink/renderer/core/html/html_link_element.cc b/third_party/blink/renderer/core/html/html_link_element.cc index 580603c..55c57cb9 100644 --- a/third_party/blink/renderer/core/html/html_link_element.cc +++ b/third_party/blink/renderer/core/html/html_link_element.cc
@@ -370,8 +370,7 @@ LinkLoaderClient::Trace(visitor); } -void HTMLLinkElement::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void HTMLLinkElement::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(rel_list_); HTMLElement::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/html/html_link_element.h b/third_party/blink/renderer/core/html/html_link_element.h index 92366b51..a80224c1 100644 --- a/third_party/blink/renderer/core/html/html_link_element.h +++ b/third_party/blink/renderer/core/html/html_link_element.h
@@ -110,7 +110,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: HTMLLinkElement(Document&, const CreateElementFlags);
diff --git a/third_party/blink/renderer/core/html/html_script_element.cc b/third_party/blink/renderer/core/html/html_script_element.cc index c286e427..e55707e 100644 --- a/third_party/blink/renderer/core/html/html_script_element.cc +++ b/third_party/blink/renderer/core/html/html_script_element.cc
@@ -232,8 +232,7 @@ ScriptElementBase::Trace(visitor); } -void HTMLScriptElement::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void HTMLScriptElement::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(loader_); HTMLElement::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/html/html_script_element.h b/third_party/blink/renderer/core/html/html_script_element.h index 851ffd25..e163fc4 100644 --- a/third_party/blink/renderer/core/html/html_script_element.h +++ b/third_party/blink/renderer/core/html/html_script_element.h
@@ -55,7 +55,7 @@ Document& GetDocument() const override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: HTMLScriptElement(Document&, const CreateElementFlags);
diff --git a/third_party/blink/renderer/core/html/html_template_element.cc b/third_party/blink/renderer/core/html/html_template_element.cc index 557c9859..9502271 100644 --- a/third_party/blink/renderer/core/html/html_template_element.cc +++ b/third_party/blink/renderer/core/html/html_template_element.cc
@@ -76,8 +76,7 @@ HTMLElement::Trace(visitor); } -void HTMLTemplateElement::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void HTMLTemplateElement::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(content_); HTMLElement::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/html/html_template_element.h b/third_party/blink/renderer/core/html/html_template_element.h index ebedde4..558624c 100644 --- a/third_party/blink/renderer/core/html/html_template_element.h +++ b/third_party/blink/renderer/core/html/html_template_element.h
@@ -52,7 +52,7 @@ DocumentFragment* content() const; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: void CloneNonAttributePropertiesFrom(const Element&,
diff --git a/third_party/blink/renderer/core/html/imports/html_import_tree_root.cc b/third_party/blink/renderer/core/html/imports/html_import_tree_root.cc index 9b7eea0a..d0952162 100644 --- a/third_party/blink/renderer/core/html/imports/html_import_tree_root.cc +++ b/third_party/blink/renderer/core/html/imports/html_import_tree_root.cc
@@ -87,8 +87,7 @@ HTMLImport::Trace(visitor); } -void HTMLImportTreeRoot::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void HTMLImportTreeRoot::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(document_); }
diff --git a/third_party/blink/renderer/core/html/imports/html_import_tree_root.h b/third_party/blink/renderer/core/html/imports/html_import_tree_root.h index ee972a6c..502061c8 100644 --- a/third_party/blink/renderer/core/html/imports/html_import_tree_root.h +++ b/third_party/blink/renderer/core/html/imports/html_import_tree_root.h
@@ -35,7 +35,7 @@ HTMLImportChild* Find(const KURL&) const; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "HTMLImportTreeRoot"; }
diff --git a/third_party/blink/renderer/core/html/imports/html_imports_controller.cc b/third_party/blink/renderer/core/html/imports/html_imports_controller.cc index 965d11d..12830470 100644 --- a/third_party/blink/renderer/core/html/imports/html_imports_controller.cc +++ b/third_party/blink/renderer/core/html/imports/html_imports_controller.cc
@@ -148,7 +148,7 @@ } void HTMLImportsController::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(root_); }
diff --git a/third_party/blink/renderer/core/html/imports/html_imports_controller.h b/third_party/blink/renderer/core/html/imports/html_imports_controller.h index a99f7e6..d16cacf 100644 --- a/third_party/blink/renderer/core/html/imports/html_imports_controller.h +++ b/third_party/blink/renderer/core/html/imports/html_imports_controller.h
@@ -72,7 +72,7 @@ void Dispose(); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "HTMLImportsController"; }
diff --git a/third_party/blink/renderer/core/html/media/html_media_element.cc b/third_party/blink/renderer/core/html/media/html_media_element.cc index 570ddd7..b1fb7e08 100644 --- a/third_party/blink/renderer/core/html/media/html_media_element.cc +++ b/third_party/blink/renderer/core/html/media/html_media_element.cc
@@ -3962,8 +3962,7 @@ PausableObject::Trace(visitor); } -void HTMLMediaElement::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void HTMLMediaElement::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(video_tracks_); visitor->TraceWrappers(audio_tracks_); visitor->TraceWrappers(text_tracks_);
diff --git a/third_party/blink/renderer/core/html/media/html_media_element.h b/third_party/blink/renderer/core/html/media/html_media_element.h index d7a9e3d8..dcd45173 100644 --- a/third_party/blink/renderer/core/html/media/html_media_element.h +++ b/third_party/blink/renderer/core/html/media/html_media_element.h
@@ -106,7 +106,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; void ClearWeakMembers(Visitor*); WebMediaPlayer* GetWebMediaPlayer() const { return web_media_player_.get(); }
diff --git a/third_party/blink/renderer/core/html/parser/html_document_parser.cc b/third_party/blink/renderer/core/html/parser/html_document_parser.cc index 5b1fbbe..c59ed824 100644 --- a/third_party/blink/renderer/core/html/parser/html_document_parser.cc +++ b/third_party/blink/renderer/core/html/parser/html_document_parser.cc
@@ -175,8 +175,7 @@ HTMLParserScriptRunnerHost::Trace(visitor); } -void HTMLDocumentParser::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void HTMLDocumentParser::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(script_runner_); ScriptableDocumentParser::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/html/parser/html_document_parser.h b/third_party/blink/renderer/core/html/parser/html_document_parser.h index f66b1112..80fc7c1 100644 --- a/third_party/blink/renderer/core/html/parser/html_document_parser.h +++ b/third_party/blink/renderer/core/html/parser/html_document_parser.h
@@ -79,7 +79,7 @@ } ~HTMLDocumentParser() override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; // TODO(alexclarke): Remove when background parser goes away. void Dispose();
diff --git a/third_party/blink/renderer/core/html/track/text_track.cc b/third_party/blink/renderer/core/html/track/text_track.cc index 97915d0d..e7d173d 100644 --- a/third_party/blink/renderer/core/html/track/text_track.cc +++ b/third_party/blink/renderer/core/html/track/text_track.cc
@@ -377,7 +377,7 @@ EventTargetWithInlineData::Trace(visitor); } -void TextTrack::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void TextTrack::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(cues_); EventTargetWithInlineData::TraceWrappers(visitor); TrackBase::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/core/html/track/text_track.h b/third_party/blink/renderer/core/html/track/text_track.h index 3076851..ae2260c3 100644 --- a/third_party/blink/renderer/core/html/track/text_track.h +++ b/third_party/blink/renderer/core/html/track/text_track.h
@@ -127,7 +127,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: TextTrack(const AtomicString& kind,
diff --git a/third_party/blink/renderer/core/html/track/text_track_cue_list.cc b/third_party/blink/renderer/core/html/track/text_track_cue_list.cc index 5d3203e..2cfa63b 100644 --- a/third_party/blink/renderer/core/html/track/text_track_cue_list.cc +++ b/third_party/blink/renderer/core/html/track/text_track_cue_list.cc
@@ -144,8 +144,7 @@ ScriptWrappable::Trace(visitor); } -void TextTrackCueList::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void TextTrackCueList::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (auto cue : list_) { visitor->TraceWrappers(cue); }
diff --git a/third_party/blink/renderer/core/html/track/text_track_cue_list.h b/third_party/blink/renderer/core/html/track/text_track_cue_list.h index 85ee9fd6..2550f3b 100644 --- a/third_party/blink/renderer/core/html/track/text_track_cue_list.h +++ b/third_party/blink/renderer/core/html/track/text_track_cue_list.h
@@ -57,7 +57,7 @@ void ValidateCueIndexes(); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: TextTrackCueList();
diff --git a/third_party/blink/renderer/core/html/track/text_track_list.cc b/third_party/blink/renderer/core/html/track/text_track_list.cc index 667e6d8..991b695 100644 --- a/third_party/blink/renderer/core/html/track/text_track_list.cc +++ b/third_party/blink/renderer/core/html/track/text_track_list.cc
@@ -310,7 +310,7 @@ EventTargetWithInlineData::Trace(visitor); } -void TextTrackList::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void TextTrackList::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (auto track : add_track_tracks_) visitor->TraceWrappers(track); for (auto track : element_tracks_)
diff --git a/third_party/blink/renderer/core/html/track/text_track_list.h b/third_party/blink/renderer/core/html/track/text_track_list.h index 727a239..57ce093 100644 --- a/third_party/blink/renderer/core/html/track/text_track_list.h +++ b/third_party/blink/renderer/core/html/track/text_track_list.h
@@ -75,7 +75,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: explicit TextTrackList(HTMLMediaElement*);
diff --git a/third_party/blink/renderer/core/html/track/track_list_base.h b/third_party/blink/renderer/core/html/track/track_list_base.h index 8ad444f..0a92161 100644 --- a/third_party/blink/renderer/core/html/track/track_list_base.h +++ b/third_party/blink/renderer/core/html/track/track_list_base.h
@@ -85,7 +85,7 @@ EventTargetWithInlineData::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { for (auto track : tracks_) { visitor->TraceWrappers(track); }
diff --git a/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc b/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc index 3835b0d..1539fc8 100644 --- a/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc +++ b/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc
@@ -262,7 +262,7 @@ } void ImageBitmapFactories::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { Supplement<LocalDOMWindow>::TraceWrappers(visitor); Supplement<WorkerGlobalScope>::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.h b/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.h index 7f65614..0ad28c2 100644 --- a/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.h +++ b/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.h
@@ -95,7 +95,7 @@ virtual ~ImageBitmapFactories() = default; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "ImageBitmapLoader"; }
diff --git a/third_party/blink/renderer/core/intersection_observer/element_intersection_observer_data.cc b/third_party/blink/renderer/core/intersection_observer/element_intersection_observer_data.cc index 9a5edc8..a8f64601 100644 --- a/third_party/blink/renderer/core/intersection_observer/element_intersection_observer_data.cc +++ b/third_party/blink/renderer/core/intersection_observer/element_intersection_observer_data.cc
@@ -68,7 +68,7 @@ } void ElementIntersectionObserverData::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (auto& entry : intersection_observations_) { visitor->TraceWrappers(entry.key); }
diff --git a/third_party/blink/renderer/core/intersection_observer/element_intersection_observer_data.h b/third_party/blink/renderer/core/intersection_observer/element_intersection_observer_data.h index 6ed499c..6b5d1b5b 100644 --- a/third_party/blink/renderer/core/intersection_observer/element_intersection_observer_data.h +++ b/third_party/blink/renderer/core/intersection_observer/element_intersection_observer_data.h
@@ -30,7 +30,7 @@ void DeactivateAllIntersectionObservers(Node&); void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "ElementIntersectionObserverData"; }
diff --git a/third_party/blink/renderer/core/intersection_observer/intersection_observer.cc b/third_party/blink/renderer/core/intersection_observer/intersection_observer.cc index fd230f1..ae9fc71 100644 --- a/third_party/blink/renderer/core/intersection_observer/intersection_observer.cc +++ b/third_party/blink/renderer/core/intersection_observer/intersection_observer.cc
@@ -380,7 +380,7 @@ } void IntersectionObserver::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(delegate_); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/intersection_observer/intersection_observer.h b/third_party/blink/renderer/core/intersection_observer/intersection_observer.h index 192b1b1..8301a33 100644 --- a/third_party/blink/renderer/core/intersection_observer/intersection_observer.h +++ b/third_party/blink/renderer/core/intersection_observer/intersection_observer.h
@@ -94,7 +94,7 @@ bool HasPendingActivity() const override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: explicit IntersectionObserver(IntersectionObserverDelegate&,
diff --git a/third_party/blink/renderer/core/intersection_observer/intersection_observer_controller.cc b/third_party/blink/renderer/core/intersection_observer/intersection_observer_controller.cc index f29de34..6599acb 100644 --- a/third_party/blink/renderer/core/intersection_observer/intersection_observer_controller.cc +++ b/third_party/blink/renderer/core/intersection_observer/intersection_observer_controller.cc
@@ -106,7 +106,7 @@ } void IntersectionObserverController::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (const auto& observer : pending_intersection_observers_) visitor->TraceWrappers(observer); for (const auto& observer : intersection_observers_being_invoked_)
diff --git a/third_party/blink/renderer/core/intersection_observer/intersection_observer_controller.h b/third_party/blink/renderer/core/intersection_observer/intersection_observer_controller.h index 46c7b22..b3c35797 100644 --- a/third_party/blink/renderer/core/intersection_observer/intersection_observer_controller.h +++ b/third_party/blink/renderer/core/intersection_observer/intersection_observer_controller.h
@@ -37,7 +37,7 @@ void RemoveTrackedObserversForRoot(const Node&); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "IntersectionObserverController"; }
diff --git a/third_party/blink/renderer/core/intersection_observer/intersection_observer_delegate.h b/third_party/blink/renderer/core/intersection_observer/intersection_observer_delegate.h index 941fcd4..8247e849 100644 --- a/third_party/blink/renderer/core/intersection_observer/intersection_observer_delegate.h +++ b/third_party/blink/renderer/core/intersection_observer/intersection_observer_delegate.h
@@ -23,7 +23,7 @@ IntersectionObserver&) = 0; virtual ExecutionContext* GetExecutionContext() const = 0; virtual void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override {} + void TraceWrappers(ScriptWrappableVisitor* visitor) const override {} const char* NameInHeapSnapshot() const override { return "IntersectionObserverDelegate"; }
diff --git a/third_party/blink/renderer/core/layout/custom/css_layout_definition.cc b/third_party/blink/renderer/core/layout/custom/css_layout_definition.cc index 09346d1..6e69013 100644 --- a/third_party/blink/renderer/core/layout/custom/css_layout_definition.cc +++ b/third_party/blink/renderer/core/layout/custom/css_layout_definition.cc
@@ -274,8 +274,7 @@ visitor->Trace(definition_); } -void CSSLayoutDefinition::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void CSSLayoutDefinition::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(constructor_.Cast<v8::Value>()); visitor->TraceWrappers(intrinsic_sizes_.Cast<v8::Value>()); visitor->TraceWrappers(layout_.Cast<v8::Value>());
diff --git a/third_party/blink/renderer/core/layout/custom/css_layout_definition.h b/third_party/blink/renderer/core/layout/custom/css_layout_definition.h index cae5fa2..c0ff5e7 100644 --- a/third_party/blink/renderer/core/layout/custom/css_layout_definition.h +++ b/third_party/blink/renderer/core/layout/custom/css_layout_definition.h
@@ -81,7 +81,7 @@ } void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "CSSLayoutDefinition"; }
diff --git a/third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope.cc b/third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope.cc index 44d0382..0687483 100644 --- a/third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope.cc +++ b/third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope.cc
@@ -163,7 +163,7 @@ } void LayoutWorkletGlobalScope::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (auto definition : layout_definitions_) visitor->TraceWrappers(definition.value); MainThreadWorkletGlobalScope::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope.h b/third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope.h index 6645721..a8e7fe0 100644 --- a/third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope.h +++ b/third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope.h
@@ -42,7 +42,7 @@ CSSLayoutDefinition* FindDefinition(const AtomicString& name); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: LayoutWorkletGlobalScope(LocalFrame*,
diff --git a/third_party/blink/renderer/core/layout/layout_slider_container.cc b/third_party/blink/renderer/core/layout/layout_slider_container.cc index 596286b1..111cbab 100644 --- a/third_party/blink/renderer/core/layout/layout_slider_container.cc +++ b/third_party/blink/renderer/core/layout/layout_slider_container.cc
@@ -100,15 +100,6 @@ void LayoutSliderContainer::UpdateLayout() { HTMLInputElement* input = ToHTMLInputElement(GetNode()->OwnerShadowHost()); bool is_vertical = HasVerticalAppearance(input); - MutableStyleRef().SetFlexDirection(is_vertical ? EFlexDirection::kColumn - : EFlexDirection::kRow); - TextDirection old_text_direction = Style()->Direction(); - if (is_vertical) { - // FIXME: Work around rounding issues in RTL vertical sliders. We want them - // to render identically to LTR vertical sliders. We can remove this work - // around when subpixel rendering is enabled on all ports. - MutableStyleRef().SetDirection(TextDirection::kLtr); - } Element* thumb_element = input->UserAgentShadowRoot()->getElementById( ShadowElementNames::SliderThumb()); @@ -127,7 +118,6 @@ LayoutFlexibleBox::UpdateLayout(); - MutableStyleRef().SetDirection(old_text_direction); // These should always exist, unless someone mutates the shadow DOM (e.g., in // the inspector). if (!thumb || !track)
diff --git a/third_party/blink/renderer/core/loader/document_threadable_loader.cc b/third_party/blink/renderer/core/loader/document_threadable_loader.cc index c61385c6..7054ae4 100644 --- a/third_party/blink/renderer/core/loader/document_threadable_loader.cc +++ b/third_party/blink/renderer/core/loader/document_threadable_loader.cc
@@ -381,7 +381,7 @@ void DocumentThreadableLoader::DispatchInitialRequest( ResourceRequest& request) { - if (!request.IsExternalRequest() && !cors_flag_) { + if (out_of_blink_cors_ || (!request.IsExternalRequest() && !cors_flag_)) { LoadRequest(request, resource_loader_options_); return; } @@ -828,20 +828,18 @@ void DocumentThreadableLoader::HandlePreflightResponse( const ResourceResponse& response) { - base::Optional<network::mojom::CORSError> cors_error = CORS::CheckAccess( - response.Url(), response.HttpStatusCode(), response.HttpHeaderFields(), - actual_request_.GetFetchCredentialsMode(), *GetSecurityOrigin()); + base::Optional<network::mojom::CORSError> cors_error = + CORS::CheckPreflightAccess(response.Url(), response.HttpStatusCode(), + response.HttpHeaderFields(), + actual_request_.GetFetchCredentialsMode(), + *GetSecurityOrigin()); if (cors_error) { - StringBuilder builder; - builder.Append( - "Response to preflight request doesn't pass access " - "control check: "); - builder.Append( + HandlePreflightFailure( + response.Url(), CORS::GetErrorString(CORS::ErrorParameter::CreateForAccessCheck( - *cors_error, response.Url(), response.HttpStatusCode(), + *cors_error, response.Url(), 0 /* do not provide the status_code */, response.HttpHeaderFields(), *GetSecurityOrigin(), request_context_))); - HandlePreflightFailure(response.Url(), builder.ToString()); return; } @@ -900,6 +898,8 @@ DCHECK(client_); // TODO(toyoshim): Support OOR-CORS preflight and Service Worker case. + // Note that CORS-preflight is usually handled in the Network Service side, + // but still done in Blink side when it is needed on redirects. // https://crbug.com/736308. if (out_of_blink_cors_ && actual_request_.IsNull() && !response.WasFetchedViaServiceWorker()) { @@ -1205,8 +1205,7 @@ // we have an HTTP response, then it wasn't a network error in fact. if (resource->LoadFailedOrCanceled() && !request_url.IsLocalFile() && response.HttpStatusCode() <= 0) { - client_ = nullptr; - client->DidFail(resource->GetResourceError()); + DispatchDidFail(resource->GetResourceError()); return; }
diff --git a/third_party/blink/renderer/core/loader/frame_loader.cc b/third_party/blink/renderer/core/loader/frame_loader.cc index bde7cc3..19b3c29 100644 --- a/third_party/blink/renderer/core/loader/frame_loader.cc +++ b/third_party/blink/renderer/core/loader/frame_loader.cc
@@ -250,6 +250,7 @@ : frame_(frame), progress_tracker_(ProgressTracker::Create(frame)), in_stop_all_loaders_(false), + in_restore_scroll_(false), forced_sandbox_flags_(kSandboxNone), dispatching_did_clear_window_object_in_main_world_(false), protect_provisional_loader_(false), @@ -1166,8 +1167,10 @@ void FrameLoader::RestoreScrollPositionAndViewState() { if (!frame_->GetPage() || !GetDocumentLoader() || - !GetDocumentLoader()->GetHistoryItem()) + !GetDocumentLoader()->GetHistoryItem() || in_restore_scroll_) { return; + } + AutoReset<bool> in_restore_scroll(&in_restore_scroll_, true); RestoreScrollPositionAndViewState( GetDocumentLoader()->LoadType(), kHistoryDifferentDocumentLoad, GetDocumentLoader()->GetHistoryItem()->GetViewState(), @@ -1318,6 +1321,10 @@ !IsReloadLoadType(load_type) && load_type != kFrameLoadTypeBackForward && url.HasFragmentIdentifier() && + // For provisional LocalFrame, there is no real document loaded and + // the initial empty document should not be considered, so there is + // no way to get a same-document load in this case. + !frame_->IsProvisional() && EqualIgnoringFragmentIdentifier(frame_->GetDocument()->Url(), url) // We don't want to just scroll if a link from within a frameset is // trying to reload the frameset into _top.
diff --git a/third_party/blink/renderer/core/loader/frame_loader.h b/third_party/blink/renderer/core/loader/frame_loader.h index 83987e0..851a1bd2 100644 --- a/third_party/blink/renderer/core/loader/frame_loader.h +++ b/third_party/blink/renderer/core/loader/frame_loader.h
@@ -307,6 +307,7 @@ Member<DocumentLoader> provisional_document_loader_; bool in_stop_all_loaders_; + bool in_restore_scroll_; SandboxFlags forced_sandbox_flags_;
diff --git a/third_party/blink/renderer/core/loader/link_loader.cc b/third_party/blink/renderer/core/loader/link_loader.cc index 3f2d813..1b2ad2da 100644 --- a/third_party/blink/renderer/core/loader/link_loader.cc +++ b/third_party/blink/renderer/core/loader/link_loader.cc
@@ -523,9 +523,11 @@ // metadata is "not-parser-inserted", and credentials mode is credentials // mode." [spec text] ModuleScriptFetchRequest request( - params.href, params.referrer_policy, + params.href, ScriptFetchOptions(params.nonce, integrity_metadata, params.integrity, - kNotParserInserted, credentials_mode)); + kNotParserInserted, credentials_mode), + Referrer::NoReferrer(), params.referrer_policy, + TextPosition::MinimumPosition()); // Step 10. "Fetch a single module script given url, settings object, // destination, options, settings object, "client", and with the top-level
diff --git a/third_party/blink/renderer/core/loader/modulescript/module_script_fetch_request.h b/third_party/blink/renderer/core/loader/modulescript/module_script_fetch_request.h index 1d707f8..82596a8a 100644 --- a/third_party/blink/renderer/core/loader/modulescript/module_script_fetch_request.h +++ b/third_party/blink/renderer/core/loader/modulescript/module_script_fetch_request.h
@@ -13,31 +13,13 @@ namespace blink { // A ModuleScriptFetchRequest essentially serves as a "parameter object" for -// Modulator::Fetch{Tree,Single,NewSingle}. +// Modulator::Fetch{Single,NewSingle}. class ModuleScriptFetchRequest final { STACK_ALLOCATED(); public: - ModuleScriptFetchRequest(const KURL& url, - ReferrerPolicy referrer_policy, - const ScriptFetchOptions& options) - : ModuleScriptFetchRequest(url, - options, - Referrer::NoReferrer(), - referrer_policy, - TextPosition::MinimumPosition()) {} - ~ModuleScriptFetchRequest() = default; - - const KURL& Url() const { return url_; } - const ScriptFetchOptions& Options() const { return options_; } - const AtomicString& GetReferrer() const { return referrer_; } - ReferrerPolicy GetReferrerPolicy() const { return referrer_policy_; } - const TextPosition& GetReferrerPosition() const { return referrer_position_; } - - private: // Referrer is set only for internal module script fetch algorithms triggered // from ModuleTreeLinker to fetch descendant module scripts. - friend class ModuleTreeLinker; ModuleScriptFetchRequest(const KURL& url, const ScriptFetchOptions& options, const String& referrer, @@ -49,6 +31,20 @@ referrer_policy_(referrer_policy), referrer_position_(referrer_position) {} + static ModuleScriptFetchRequest CreateForTest(const KURL& url) { + return ModuleScriptFetchRequest( + url, ScriptFetchOptions(), Referrer::NoReferrer(), + kReferrerPolicyDefault, TextPosition::MinimumPosition()); + } + ~ModuleScriptFetchRequest() = default; + + const KURL& Url() const { return url_; } + const ScriptFetchOptions& Options() const { return options_; } + const AtomicString& GetReferrer() const { return referrer_; } + ReferrerPolicy GetReferrerPolicy() const { return referrer_policy_; } + const TextPosition& GetReferrerPosition() const { return referrer_position_; } + + private: const KURL url_; const ScriptFetchOptions options_; const AtomicString referrer_;
diff --git a/third_party/blink/renderer/core/loader/modulescript/module_script_loader_test.cc b/third_party/blink/renderer/core/loader/modulescript/module_script_loader_test.cc index bc8992b..3dd31a1 100644 --- a/third_party/blink/renderer/core/loader/modulescript/module_script_loader_test.cc +++ b/third_party/blink/renderer/core/loader/modulescript/module_script_loader_test.cc
@@ -197,10 +197,9 @@ TestModuleScriptLoaderClient* client) { ModuleScriptLoaderRegistry* registry = ModuleScriptLoaderRegistry::Create(); KURL url("data:text/javascript,export default 'grapes';"); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); - registry->Fetch(module_request, ModuleGraphLevel::kTopLevelModuleFetch, - GetModulator(), client); + registry->Fetch(ModuleScriptFetchRequest::CreateForTest(url), + ModuleGraphLevel::kTopLevelModuleFetch, GetModulator(), + client); } TEST_F(ModuleScriptLoaderTest, FetchDataURL) { @@ -248,11 +247,10 @@ TestModuleScriptLoaderClient* client) { ModuleScriptLoaderRegistry* registry = ModuleScriptLoaderRegistry::Create(); KURL url("data:text/javascript,import 'invalid';export default 'grapes';"); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); GetModulator()->SetModuleRequests({"invalid"}); - registry->Fetch(module_request, ModuleGraphLevel::kTopLevelModuleFetch, - GetModulator(), client); + registry->Fetch(ModuleScriptFetchRequest::CreateForTest(url), + ModuleGraphLevel::kTopLevelModuleFetch, GetModulator(), + client); } TEST_F(ModuleScriptLoaderTest, InvalidSpecifier) { @@ -287,10 +285,9 @@ ModuleScriptLoaderRegistry* registry = ModuleScriptLoaderRegistry::Create(); KURL url; EXPECT_FALSE(url.IsValid()); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); - registry->Fetch(module_request, ModuleGraphLevel::kTopLevelModuleFetch, - GetModulator(), client); + registry->Fetch(ModuleScriptFetchRequest::CreateForTest(url), + ModuleGraphLevel::kTopLevelModuleFetch, GetModulator(), + client); } TEST_F(ModuleScriptLoaderTest, FetchInvalidURL) { @@ -323,10 +320,9 @@ url, test::CoreTestDataPath("module.js"), "text/javascript"); ModuleScriptLoaderRegistry* registry = ModuleScriptLoaderRegistry::Create(); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); - registry->Fetch(module_request, ModuleGraphLevel::kTopLevelModuleFetch, - GetModulator(), client); + registry->Fetch(ModuleScriptFetchRequest::CreateForTest(url), + ModuleGraphLevel::kTopLevelModuleFetch, GetModulator(), + client); } TEST_F(ModuleScriptLoaderTest, FetchURL) {
diff --git a/third_party/blink/renderer/core/loader/modulescript/module_tree_linker.cc b/third_party/blink/renderer/core/loader/modulescript/module_tree_linker.cc index bce42da..e1f2d31 100644 --- a/third_party/blink/renderer/core/loader/modulescript/module_tree_linker.cc +++ b/third_party/blink/renderer/core/loader/modulescript/module_tree_linker.cc
@@ -15,13 +15,13 @@ namespace blink { -ModuleTreeLinker* ModuleTreeLinker::Fetch( - const ModuleScriptFetchRequest& request, - Modulator* modulator, - ModuleTreeLinkerRegistry* registry, - ModuleTreeClient* client) { +ModuleTreeLinker* ModuleTreeLinker::Fetch(const KURL& url, + const ScriptFetchOptions& options, + Modulator* modulator, + ModuleTreeLinkerRegistry* registry, + ModuleTreeClient* client) { ModuleTreeLinker* fetcher = new ModuleTreeLinker(modulator, registry, client); - fetcher->FetchRoot(request); + fetcher->FetchRoot(url, options); return fetcher; } @@ -53,8 +53,7 @@ SingleModuleClient::Trace(visitor); } -void ModuleTreeLinker::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void ModuleTreeLinker::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(result_); SingleModuleClient::TraceWrappers(visitor); } @@ -128,20 +127,25 @@ } } -void ModuleTreeLinker::FetchRoot(const ModuleScriptFetchRequest& request) { - // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-script-tree +// https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-script-tree +void ModuleTreeLinker::FetchRoot(const KURL& url, + const ScriptFetchOptions& options) { #if DCHECK_IS_ON() - url_ = request.Url(); + url_ = url; root_is_inline_ = false; #endif AdvanceState(State::kFetchingSelf); // Step 1. Let visited set be << url >>. - visited_set_.insert(request.Url()); + visited_set_.insert(url); // Step 2. Perform the internal module script graph fetching procedure given // ... with the top-level module fetch flag set. ... + ModuleScriptFetchRequest request(url, options, Referrer::NoReferrer(), + modulator_->GetReferrerPolicy(), + TextPosition::MinimumPosition()); + InitiateInternalModuleScriptGraphFetching( request, ModuleGraphLevel::kTopLevelModuleFetch); }
diff --git a/third_party/blink/renderer/core/loader/modulescript/module_tree_linker.h b/third_party/blink/renderer/core/loader/modulescript/module_tree_linker.h index d6cc520..741c10b 100644 --- a/third_party/blink/renderer/core/loader/modulescript/module_tree_linker.h +++ b/third_party/blink/renderer/core/loader/modulescript/module_tree_linker.h
@@ -35,7 +35,8 @@ class CORE_EXPORT ModuleTreeLinker final : public SingleModuleClient { public: // https://html.spec.whatwg.org/#fetch-a-module-script-tree - static ModuleTreeLinker* Fetch(const ModuleScriptFetchRequest&, + static ModuleTreeLinker* Fetch(const KURL&, + const ScriptFetchOptions&, Modulator*, ModuleTreeLinkerRegistry*, ModuleTreeClient*); @@ -49,7 +50,7 @@ ~ModuleTreeLinker() override = default; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; bool IsFetching() const { return State::kFetchingSelf <= state_ && state_ < State::kFinished; @@ -74,7 +75,7 @@ #endif void AdvanceState(State); - void FetchRoot(const ModuleScriptFetchRequest&); + void FetchRoot(const KURL&, const ScriptFetchOptions&); void FetchRootInline(ModuleScript*); // Steps 1--2 of [IMSGF].
diff --git a/third_party/blink/renderer/core/loader/modulescript/module_tree_linker_registry.cc b/third_party/blink/renderer/core/loader/modulescript/module_tree_linker_registry.cc index 38e11d7..47dd025 100644 --- a/third_party/blink/renderer/core/loader/modulescript/module_tree_linker_registry.cc +++ b/third_party/blink/renderer/core/loader/modulescript/module_tree_linker_registry.cc
@@ -15,17 +15,18 @@ } void ModuleTreeLinkerRegistry::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (const auto& member : active_tree_linkers_) visitor->TraceWrappers(member); } ModuleTreeLinker* ModuleTreeLinkerRegistry::Fetch( - const ModuleScriptFetchRequest& request, + const KURL& url, + const ScriptFetchOptions& options, Modulator* modulator, ModuleTreeClient* client) { ModuleTreeLinker* fetcher = - ModuleTreeLinker::Fetch(request, modulator, this, client); + ModuleTreeLinker::Fetch(url, options, modulator, this, client); DCHECK(fetcher->IsFetching()); active_tree_linkers_.insert(fetcher); return fetcher;
diff --git a/third_party/blink/renderer/core/loader/modulescript/module_tree_linker_registry.h b/third_party/blink/renderer/core/loader/modulescript/module_tree_linker_registry.h index 1f84549..64e8084 100644 --- a/third_party/blink/renderer/core/loader/modulescript/module_tree_linker_registry.h +++ b/third_party/blink/renderer/core/loader/modulescript/module_tree_linker_registry.h
@@ -12,11 +12,12 @@ namespace blink { +class KURL; class Modulator; -class ModuleScriptFetchRequest; class ModuleTreeClient; class ModuleTreeLinker; class ModuleScript; +class ScriptFetchOptions; // ModuleTreeLinkerRegistry keeps active ModuleTreeLinkers alive. class CORE_EXPORT ModuleTreeLinkerRegistry @@ -27,12 +28,13 @@ return new ModuleTreeLinkerRegistry; } void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "ModuleTreeLinkerRegistry"; } - ModuleTreeLinker* Fetch(const ModuleScriptFetchRequest&, + ModuleTreeLinker* Fetch(const KURL&, + const ScriptFetchOptions&, Modulator*, ModuleTreeClient*); ModuleTreeLinker* FetchDescendantsForInlineScript(ModuleScript*,
diff --git a/third_party/blink/renderer/core/loader/modulescript/module_tree_linker_test.cc b/third_party/blink/renderer/core/loader/modulescript/module_tree_linker_test.cc index 6d2103f..8b7a1ee 100644 --- a/third_party/blink/renderer/core/loader/modulescript/module_tree_linker_test.cc +++ b/third_party/blink/renderer/core/loader/modulescript/module_tree_linker_test.cc
@@ -198,10 +198,8 @@ ModuleTreeLinkerRegistry* registry = ModuleTreeLinkerRegistry::Create(); KURL url("http://example.com/root.js"); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); TestModuleTreeClient* client = new TestModuleTreeClient; - registry->Fetch(module_request, GetModulator(), client); + registry->Fetch(url, ScriptFetchOptions(), GetModulator(), client); EXPECT_FALSE(client->WasNotifyFinished()) << "ModuleTreeLinker should always finish asynchronously."; @@ -219,10 +217,8 @@ ModuleTreeLinkerRegistry* registry = ModuleTreeLinkerRegistry::Create(); KURL url("http://example.com/root.js"); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); TestModuleTreeClient* client = new TestModuleTreeClient; - registry->Fetch(module_request, GetModulator(), client); + registry->Fetch(url, ScriptFetchOptions(), GetModulator(), client); EXPECT_FALSE(client->WasNotifyFinished()) << "ModuleTreeLinker should always finish asynchronously."; @@ -244,10 +240,8 @@ ModuleTreeLinkerRegistry* registry = ModuleTreeLinkerRegistry::Create(); KURL url("http://example.com/root.js"); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); TestModuleTreeClient* client = new TestModuleTreeClient; - registry->Fetch(module_request, GetModulator(), client); + registry->Fetch(url, ScriptFetchOptions(), GetModulator(), client); EXPECT_FALSE(client->WasNotifyFinished()) << "ModuleTreeLinker should always finish asynchronously."; @@ -270,10 +264,8 @@ ModuleTreeLinkerRegistry* registry = ModuleTreeLinkerRegistry::Create(); KURL url("http://example.com/root.js"); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); TestModuleTreeClient* client = new TestModuleTreeClient; - registry->Fetch(module_request, GetModulator(), client); + registry->Fetch(url, ScriptFetchOptions(), GetModulator(), client); EXPECT_FALSE(client->WasNotifyFinished()) << "ModuleTreeLinker should always finish asynchronously."; @@ -309,10 +301,8 @@ ModuleTreeLinkerRegistry* registry = ModuleTreeLinkerRegistry::Create(); KURL url("http://example.com/root.js"); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); TestModuleTreeClient* client = new TestModuleTreeClient; - registry->Fetch(module_request, GetModulator(), client); + registry->Fetch(url, ScriptFetchOptions(), GetModulator(), client); EXPECT_FALSE(client->WasNotifyFinished()) << "ModuleTreeLinker should always finish asynchronously."; @@ -367,10 +357,8 @@ ModuleTreeLinkerRegistry* registry = ModuleTreeLinkerRegistry::Create(); KURL url("http://example.com/depth1.js"); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); TestModuleTreeClient* client = new TestModuleTreeClient; - registry->Fetch(module_request, GetModulator(), client); + registry->Fetch(url, ScriptFetchOptions(), GetModulator(), client); EXPECT_FALSE(client->WasNotifyFinished()) << "ModuleTreeLinker should always finish asynchronously."; @@ -392,10 +380,8 @@ ModuleTreeLinkerRegistry* registry = ModuleTreeLinkerRegistry::Create(); KURL url("http://example.com/a.js"); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); TestModuleTreeClient* client = new TestModuleTreeClient; - registry->Fetch(module_request, GetModulator(), client); + registry->Fetch(url, ScriptFetchOptions(), GetModulator(), client); EXPECT_FALSE(client->WasNotifyFinished()) << "ModuleTreeLinker should always finish asynchronously.";
diff --git a/third_party/blink/renderer/core/mojo/mojo_watcher.cc b/third_party/blink/renderer/core/mojo/mojo_watcher.cc index 9708558..5e080cb 100644 --- a/third_party/blink/renderer/core/mojo/mojo_watcher.cc +++ b/third_party/blink/renderer/core/mojo/mojo_watcher.cc
@@ -56,7 +56,7 @@ ContextLifecycleObserver::Trace(visitor); } -void MojoWatcher::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void MojoWatcher::TraceWrappers(ScriptWrappableVisitor* visitor) const { ScriptWrappable::TraceWrappers(visitor); visitor->TraceWrappers(callback_); }
diff --git a/third_party/blink/renderer/core/mojo/mojo_watcher.h b/third_party/blink/renderer/core/mojo/mojo_watcher.h index ceebcff..a5a3387 100644 --- a/third_party/blink/renderer/core/mojo/mojo_watcher.h +++ b/third_party/blink/renderer/core/mojo/mojo_watcher.h
@@ -34,7 +34,7 @@ MojoResult cancel(); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; // ActiveScriptWrappable bool HasPendingActivity() const final;
diff --git a/third_party/blink/renderer/core/resize_observer/resize_observer.cc b/third_party/blink/renderer/core/resize_observer/resize_observer.cc index 17c85b8..af227168 100644 --- a/third_party/blink/renderer/core/resize_observer/resize_observer.cc +++ b/third_party/blink/renderer/core/resize_observer/resize_observer.cc
@@ -187,8 +187,7 @@ ContextClient::Trace(visitor); } -void ResizeObserver::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void ResizeObserver::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(callback_); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/resize_observer/resize_observer.h b/third_party/blink/renderer/core/resize_observer/resize_observer.h index 9e7531c..d90caa2 100644 --- a/third_party/blink/renderer/core/resize_observer/resize_observer.h +++ b/third_party/blink/renderer/core/resize_observer/resize_observer.h
@@ -62,7 +62,7 @@ bool HasPendingActivity() const override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: ResizeObserver(V8ResizeObserverCallback*, Document&);
diff --git a/third_party/blink/renderer/core/script/dynamic_module_resolver.cc b/third_party/blink/renderer/core/script/dynamic_module_resolver.cc index d2681741..b185b6f 100644 --- a/third_party/blink/renderer/core/script/dynamic_module_resolver.cc +++ b/third_party/blink/renderer/core/script/dynamic_module_resolver.cc
@@ -206,15 +206,13 @@ ScriptFetchOptions options(referrer_info.Nonce(), IntegrityMetadataSet(), String(), referrer_info.ParserState(), referrer_info.CredentialsMode()); - ModuleScriptFetchRequest request(url, modulator_->GetReferrerPolicy(), - options); // Step 2.4. "Fetch a module script graph given url, settings object, // "script", and options. Wait until the algorithm asynchronously completes // with result." auto* tree_client = DynamicImportTreeClient::Create(url, modulator_.Get(), promise_resolver); - modulator_->FetchTree(request, tree_client); + modulator_->FetchTree(url, options, tree_client); // Steps 2.[5-8] are implemented at // DynamicImportTreeClient::NotifyModuleLoadFinished.
diff --git a/third_party/blink/renderer/core/script/dynamic_module_resolver_test.cc b/third_party/blink/renderer/core/script/dynamic_module_resolver_test.cc index a15ae53..2473f29 100644 --- a/third_party/blink/renderer/core/script/dynamic_module_resolver_test.cc +++ b/third_party/blink/renderer/core/script/dynamic_module_resolver_test.cc
@@ -61,9 +61,10 @@ return module_script; } - void FetchTree(const ModuleScriptFetchRequest& request, + void FetchTree(const KURL& url, + const ScriptFetchOptions&, ModuleTreeClient* client) final { - EXPECT_EQ(expected_fetch_tree_url_, request.Url()); + EXPECT_EQ(expected_fetch_tree_url_, url); pending_client_ = client; fetch_tree_was_called_ = true;
diff --git a/third_party/blink/renderer/core/script/html_parser_script_runner.cc b/third_party/blink/renderer/core/script/html_parser_script_runner.cc index c6ca266..4438708 100644 --- a/third_party/blink/renderer/core/script/html_parser_script_runner.cc +++ b/third_party/blink/renderer/core/script/html_parser_script_runner.cc
@@ -578,7 +578,7 @@ PendingScriptClient::Trace(visitor); } void HTMLParserScriptRunner::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(parser_blocking_script_); for (const auto& member : scripts_to_execute_after_parsing_) visitor->TraceWrappers(member);
diff --git a/third_party/blink/renderer/core/script/html_parser_script_runner.h b/third_party/blink/renderer/core/script/html_parser_script_runner.h index 94c7634..5a2935c 100644 --- a/third_party/blink/renderer/core/script/html_parser_script_runner.h +++ b/third_party/blink/renderer/core/script/html_parser_script_runner.h
@@ -98,7 +98,7 @@ } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "HTMLParserScriptRunner"; }
diff --git a/third_party/blink/renderer/core/script/modulator.h b/third_party/blink/renderer/core/script/modulator.h index 20a9634..6a737ca 100644 --- a/third_party/blink/renderer/core/script/modulator.h +++ b/third_party/blink/renderer/core/script/modulator.h
@@ -42,7 +42,7 @@ public: virtual ~SingleModuleClient() = default; virtual void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor*) const override {} + void TraceWrappers(ScriptWrappableVisitor*) const override {} const char* NameInHeapSnapshot() const override { return "SingleModuleClient"; } @@ -58,7 +58,7 @@ public: virtual ~ModuleTreeClient() = default; virtual void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor*) const override {} + void TraceWrappers(ScriptWrappableVisitor*) const override {} const char* NameInHeapSnapshot() const override { return "ModuleTreeClient"; } virtual void NotifyModuleTreeLoadFinished(ModuleScript*) = 0; @@ -86,7 +86,7 @@ static void ClearModulator(ScriptState*); void Trace(blink::Visitor* visitor) override {} - void TraceWrappers(const ScriptWrappableVisitor*) const override {} + void TraceWrappers(ScriptWrappableVisitor*) const override {} const char* NameInHeapSnapshot() const override { return "Modulator"; } virtual ScriptModuleResolver* GetScriptModuleResolver() = 0; @@ -101,7 +101,8 @@ virtual ScriptState* GetScriptState() = 0; // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-script-tree - virtual void FetchTree(const ModuleScriptFetchRequest&, + virtual void FetchTree(const KURL&, + const ScriptFetchOptions&, ModuleTreeClient*) = 0; // Asynchronously retrieve a module script from the module map, or fetch it
diff --git a/third_party/blink/renderer/core/script/modulator_impl_base.cc b/third_party/blink/renderer/core/script/modulator_impl_base.cc index 4f416b7..93a01339 100644 --- a/third_party/blink/renderer/core/script/modulator_impl_base.cc +++ b/third_party/blink/renderer/core/script/modulator_impl_base.cc
@@ -51,7 +51,8 @@ // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-script-tree // [fetch-a-module-worker-script-tree] // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-worker-script-tree -void ModulatorImplBase::FetchTree(const ModuleScriptFetchRequest& request, +void ModulatorImplBase::FetchTree(const KURL& url, + const ScriptFetchOptions& options, ModuleTreeClient* client) { // <spec label="fetch-a-module-script-tree" step="2">Perform the internal // module script graph fetching procedure given url, settings object, @@ -66,11 +67,7 @@ // of this algorithm specified custom perform the fetch steps, pass those // along as well.</spec> - // Note: "Fetch a module script graph" algorithm doesn't have "referrer" as - // its argument. - DCHECK(request.GetReferrer().IsNull()); - - tree_linker_registry_->Fetch(request, this, client); + tree_linker_registry_->Fetch(url, options, this, client); // <spec label="fetch-a-module-script-tree" step="3">When the internal module // script graph fetching procedure asynchronously completes with result, @@ -258,8 +255,7 @@ visitor->Trace(dynamic_module_resolver_); } -void ModulatorImplBase::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void ModulatorImplBase::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(map_); visitor->TraceWrappers(tree_linker_registry_); Modulator::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/core/script/modulator_impl_base.h b/third_party/blink/renderer/core/script/modulator_impl_base.h index a056251..6381ee0a 100644 --- a/third_party/blink/renderer/core/script/modulator_impl_base.h +++ b/third_party/blink/renderer/core/script/modulator_impl_base.h
@@ -30,7 +30,7 @@ public: ~ModulatorImplBase() override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; ExecutionContext* GetExecutionContext() const; @@ -51,7 +51,9 @@ ReferrerPolicy GetReferrerPolicy() override; const SecurityOrigin* GetSecurityOriginForFetch() override; - void FetchTree(const ModuleScriptFetchRequest&, ModuleTreeClient*) override; + void FetchTree(const KURL&, + const ScriptFetchOptions&, + ModuleTreeClient*) override; void FetchDescendantsForInlineScript(ModuleScript*, ModuleTreeClient*) override; void FetchSingle(const ModuleScriptFetchRequest&,
diff --git a/third_party/blink/renderer/core/script/module_map.cc b/third_party/blink/renderer/core/script/module_map.cc index 8f1a605..dc8e944 100644 --- a/third_party/blink/renderer/core/script/module_map.cc +++ b/third_party/blink/renderer/core/script/module_map.cc
@@ -23,7 +23,7 @@ ~Entry() override {} void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "ModuleMap::Entry"; } // Notify fetched |m_moduleScript| to the client asynchronously. @@ -59,8 +59,7 @@ visitor->Trace(clients_); } -void ModuleMap::Entry::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void ModuleMap::Entry::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(module_script_); } @@ -108,7 +107,7 @@ visitor->Trace(modulator_); } -void ModuleMap::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void ModuleMap::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (const auto& it : map_) visitor->TraceWrappers(it.value); }
diff --git a/third_party/blink/renderer/core/script/module_map.h b/third_party/blink/renderer/core/script/module_map.h index 3c35435..1f87c07 100644 --- a/third_party/blink/renderer/core/script/module_map.h +++ b/third_party/blink/renderer/core/script/module_map.h
@@ -33,7 +33,7 @@ return new ModuleMap(modulator); } void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "ModuleMap"; } // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-module-script
diff --git a/third_party/blink/renderer/core/script/module_map_test.cc b/third_party/blink/renderer/core/script/module_map_test.cc index a17d245..a8c368e 100644 --- a/third_party/blink/renderer/core/script/module_map_test.cc +++ b/third_party/blink/renderer/core/script/module_map_test.cc
@@ -175,13 +175,12 @@ platform->AdvanceClockSeconds(1.); // For non-zero DocumentParserTimings KURL url(NullURL(), "https://example.com/foo.js"); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); // First request TestSingleModuleClient* client = new TestSingleModuleClient; - Map()->FetchSingleModuleScript( - module_request, ModuleGraphLevel::kTopLevelModuleFetch, client); + Map()->FetchSingleModuleScript(ModuleScriptFetchRequest::CreateForTest(url), + ModuleGraphLevel::kTopLevelModuleFetch, + client); Modulator()->ResolveFetches(); EXPECT_FALSE(client->WasNotifyFinished()) << "fetchSingleModuleScript shouldn't complete synchronously"; @@ -196,8 +195,9 @@ // Secondary request TestSingleModuleClient* client2 = new TestSingleModuleClient; - Map()->FetchSingleModuleScript( - module_request, ModuleGraphLevel::kTopLevelModuleFetch, client2); + Map()->FetchSingleModuleScript(ModuleScriptFetchRequest::CreateForTest(url), + ModuleGraphLevel::kTopLevelModuleFetch, + client2); Modulator()->ResolveFetches(); EXPECT_FALSE(client2->WasNotifyFinished()) << "fetchSingleModuleScript shouldn't complete synchronously"; @@ -218,18 +218,18 @@ platform->AdvanceClockSeconds(1.); // For non-zero DocumentParserTimings KURL url(NullURL(), "https://example.com/foo.js"); - ModuleScriptFetchRequest module_request(url, kReferrerPolicyDefault, - ScriptFetchOptions()); // First request TestSingleModuleClient* client = new TestSingleModuleClient; - Map()->FetchSingleModuleScript( - module_request, ModuleGraphLevel::kTopLevelModuleFetch, client); + Map()->FetchSingleModuleScript(ModuleScriptFetchRequest::CreateForTest(url), + ModuleGraphLevel::kTopLevelModuleFetch, + client); // Secondary request (which should join the first request) TestSingleModuleClient* client2 = new TestSingleModuleClient; - Map()->FetchSingleModuleScript( - module_request, ModuleGraphLevel::kTopLevelModuleFetch, client2); + Map()->FetchSingleModuleScript(ModuleScriptFetchRequest::CreateForTest(url), + ModuleGraphLevel::kTopLevelModuleFetch, + client2); Modulator()->ResolveFetches(); EXPECT_FALSE(client->WasNotifyFinished())
diff --git a/third_party/blink/renderer/core/script/module_pending_script.cc b/third_party/blink/renderer/core/script/module_pending_script.cc index dd098765..43e71e43 100644 --- a/third_party/blink/renderer/core/script/module_pending_script.cc +++ b/third_party/blink/renderer/core/script/module_pending_script.cc
@@ -38,7 +38,7 @@ } void ModulePendingScriptTreeClient::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(module_script_); visitor->TraceWrappers(pending_script_); ModuleTreeClient::TraceWrappers(visitor); @@ -66,8 +66,7 @@ PendingScript::Trace(visitor); } -void ModulePendingScript::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void ModulePendingScript::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(module_tree_client_); PendingScript::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/script/module_pending_script.h b/third_party/blink/renderer/core/script/module_pending_script.h index d420f3b7..61a43e66 100644 --- a/third_party/blink/renderer/core/script/module_pending_script.h +++ b/third_party/blink/renderer/core/script/module_pending_script.h
@@ -33,7 +33,7 @@ ModuleScript* GetModuleScript() const { return module_script_; } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: ModulePendingScriptTreeClient(); @@ -65,7 +65,7 @@ } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: ModulePendingScript(ScriptElementBase*,
diff --git a/third_party/blink/renderer/core/script/module_script.cc b/third_party/blink/renderer/core/script/module_script.cc index 14e44c1..b31d077 100644 --- a/third_party/blink/renderer/core/script/module_script.cc +++ b/third_party/blink/renderer/core/script/module_script.cc
@@ -223,7 +223,7 @@ visitor->Trace(settings_object_); Script::Trace(visitor); } -void ModuleScript::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void ModuleScript::TraceWrappers(ScriptWrappableVisitor* visitor) const { // TODO(mlippautz): Support TraceWrappers(const // TraceWrapperV8Reference<v8::Module>&) to remove the cast. visitor->TraceWrappers(record_.UnsafeCast<v8::Value>());
diff --git a/third_party/blink/renderer/core/script/module_script.h b/third_party/blink/renderer/core/script/module_script.h index 34d85c3..0fd6df8 100644 --- a/third_party/blink/renderer/core/script/module_script.h +++ b/third_party/blink/renderer/core/script/module_script.h
@@ -62,7 +62,7 @@ String* failure_reason = nullptr); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "ModuleScript"; } private:
diff --git a/third_party/blink/renderer/core/script/pending_script.h b/third_party/blink/renderer/core/script/pending_script.h index 9d318cf8..3245b98 100644 --- a/third_party/blink/renderer/core/script/pending_script.h +++ b/third_party/blink/renderer/core/script/pending_script.h
@@ -83,7 +83,7 @@ virtual ScriptType GetScriptType() const = 0; virtual void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override {} + void TraceWrappers(ScriptWrappableVisitor*) const override {} const char* NameInHeapSnapshot() const override { return "PendingScript"; } // Returns false if the script should not be run due to MIME type check.
diff --git a/third_party/blink/renderer/core/script/script_loader.cc b/third_party/blink/renderer/core/script/script_loader.cc index 68b3b60..c3897fa 100644 --- a/third_party/blink/renderer/core/script/script_loader.cc +++ b/third_party/blink/renderer/core/script/script_loader.cc
@@ -117,7 +117,7 @@ PendingScriptClient::Trace(visitor); } -void ScriptLoader::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void ScriptLoader::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(pending_script_); visitor->TraceWrappers(prepared_pending_script_); } @@ -732,9 +732,7 @@ // Fetch a module script graph given url, settings object, "script", and // options.</spec> auto* module_tree_client = ModulePendingScriptTreeClient::Create(); - modulator->FetchTree( - ModuleScriptFetchRequest(url, modulator->GetReferrerPolicy(), options), - module_tree_client); + modulator->FetchTree(url, options, module_tree_client); prepared_pending_script_ = ModulePendingScript::Create( element_, module_tree_client, is_external_script_); }
diff --git a/third_party/blink/renderer/core/script/script_loader.h b/third_party/blink/renderer/core/script/script_loader.h index c8c5080f..3493263b 100644 --- a/third_party/blink/renderer/core/script/script_loader.h +++ b/third_party/blink/renderer/core/script/script_loader.h
@@ -62,7 +62,7 @@ ~ScriptLoader() override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "ScriptLoader"; } enum LegacyTypeSupport {
diff --git a/third_party/blink/renderer/core/script/script_runner.cc b/third_party/blink/renderer/core/script/script_runner.cc index 20e82ed..abb59cd 100644 --- a/third_party/blink/renderer/core/script/script_runner.cc +++ b/third_party/blink/renderer/core/script/script_runner.cc
@@ -310,7 +310,7 @@ visitor->Trace(in_order_scripts_to_execute_soon_); } -void ScriptRunner::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void ScriptRunner::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (const auto& loader : pending_in_order_scripts_) visitor->TraceWrappers(loader); for (const auto& loader : pending_async_scripts_)
diff --git a/third_party/blink/renderer/core/script/script_runner.h b/third_party/blink/renderer/core/script/script_runner.h index 3bcdbdb..684087c 100644 --- a/third_party/blink/renderer/core/script/script_runner.h +++ b/third_party/blink/renderer/core/script/script_runner.h
@@ -67,7 +67,7 @@ static void MovePendingScript(Document&, Document&, ScriptLoader*); void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "ScriptRunner"; } private:
diff --git a/third_party/blink/renderer/core/svg/properties/svg_animated_property.h b/third_party/blink/renderer/core/svg/properties/svg_animated_property.h index 0051c39..6e75b24 100644 --- a/third_party/blink/renderer/core/svg/properties/svg_animated_property.h +++ b/third_party/blink/renderer/core/svg/properties/svg_animated_property.h
@@ -77,7 +77,7 @@ bool IsSpecified() const; void Trace(blink::Visitor* visitor) override {} - virtual void TraceWrappers(const ScriptWrappableVisitor* visitor) const { + virtual void TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappersWithManualWriteBarrier(context_element_.Get()); }
diff --git a/third_party/blink/renderer/core/svg/properties/svg_list_property_tear_off_helper.h b/third_party/blink/renderer/core/svg/properties/svg_list_property_tear_off_helper.h index 1e10d3f..fde742a 100644 --- a/third_party/blink/renderer/core/svg/properties/svg_list_property_tear_off_helper.h +++ b/third_party/blink/renderer/core/svg/properties/svg_list_property_tear_off_helper.h
@@ -182,7 +182,7 @@ return CreateItemTearOff(value); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { SVGPropertyTearOff<ListProperty>::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/properties/svg_property_tear_off.h b/third_party/blink/renderer/core/svg/properties/svg_property_tear_off.h index b47071dd..3421c65 100644 --- a/third_party/blink/renderer/core/svg/properties/svg_property_tear_off.h +++ b/third_party/blink/renderer/core/svg/properties/svg_property_tear_off.h
@@ -72,7 +72,7 @@ attribute_name_ = attribute_name; } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappersWithManualWriteBarrier(context_element_.Get()); ScriptWrappable::TraceWrappers(visitor); } @@ -114,7 +114,7 @@ SVGPropertyTearOffBase::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { SVGPropertyTearOffBase::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_angle.cc b/third_party/blink/renderer/core/svg/svg_animated_angle.cc index c2968e4..8a39ac1 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_angle.cc +++ b/third_party/blink/renderer/core/svg/svg_animated_angle.cc
@@ -51,8 +51,7 @@ ScriptWrappable::Trace(visitor); } -void SVGAnimatedAngle::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void SVGAnimatedAngle::TraceWrappers(ScriptWrappableVisitor* visitor) const { SVGAnimatedProperty<SVGAngle>::TraceWrappers(visitor); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_angle.h b/third_party/blink/renderer/core/svg/svg_animated_angle.h index 2a8fb354..e711b01 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_angle.h +++ b/third_party/blink/renderer/core/svg/svg_animated_angle.h
@@ -63,7 +63,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: explicit SVGAnimatedAngle(SVGElement* context_element);
diff --git a/third_party/blink/renderer/core/svg/svg_animated_boolean.h b/third_party/blink/renderer/core/svg/svg_animated_boolean.h index 1d149ed..81580b2 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_boolean.h +++ b/third_party/blink/renderer/core/svg/svg_animated_boolean.h
@@ -53,7 +53,7 @@ ScriptWrappable::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { SVGAnimatedProperty<SVGBoolean>::TraceWrappers(visitor); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_enumeration.h b/third_party/blink/renderer/core/svg/svg_animated_enumeration.h index de7ebfe..a4ba854 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_enumeration.h +++ b/third_party/blink/renderer/core/svg/svg_animated_enumeration.h
@@ -70,7 +70,7 @@ SVGAnimatedEnumerationBase::CurrentValue()); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { SVGAnimatedEnumerationBase::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_enumeration_base.h b/third_party/blink/renderer/core/svg/svg_animated_enumeration_base.h index 283c0ce..cb816850 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_enumeration_base.h +++ b/third_party/blink/renderer/core/svg/svg_animated_enumeration_base.h
@@ -53,7 +53,7 @@ ScriptWrappable::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { SVGAnimatedProperty<SVGEnumerationBase>::TraceWrappers(visitor); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_integer.cc b/third_party/blink/renderer/core/svg/svg_animated_integer.cc index 78fbf2b2..2c489d3 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_integer.cc +++ b/third_party/blink/renderer/core/svg/svg_animated_integer.cc
@@ -50,8 +50,7 @@ ScriptWrappable::Trace(visitor); } -void SVGAnimatedInteger::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void SVGAnimatedInteger::TraceWrappers(ScriptWrappableVisitor* visitor) const { SVGAnimatedProperty<SVGInteger>::TraceWrappers(visitor); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_integer.h b/third_party/blink/renderer/core/svg/svg_animated_integer.h index ff911602..697e09c 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_integer.h +++ b/third_party/blink/renderer/core/svg/svg_animated_integer.h
@@ -63,7 +63,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: SVGAnimatedInteger(SVGElement* context_element,
diff --git a/third_party/blink/renderer/core/svg/svg_animated_length.cc b/third_party/blink/renderer/core/svg/svg_animated_length.cc index 14afa108..e2b1e37 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_length.cc +++ b/third_party/blink/renderer/core/svg/svg_animated_length.cc
@@ -57,8 +57,7 @@ ScriptWrappable::Trace(visitor); } -void SVGAnimatedLength::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void SVGAnimatedLength::TraceWrappers(ScriptWrappableVisitor* visitor) const { SVGAnimatedProperty<SVGLength>::TraceWrappers(visitor); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_length.h b/third_party/blink/renderer/core/svg/svg_animated_length.h index 15feb859..8d5a774 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_length.h +++ b/third_party/blink/renderer/core/svg/svg_animated_length.h
@@ -60,7 +60,7 @@ } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: SVGAnimatedLength(SVGElement* context_element,
diff --git a/third_party/blink/renderer/core/svg/svg_animated_length_list.h b/third_party/blink/renderer/core/svg/svg_animated_length_list.h index 99a3cb0..e168c994 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_length_list.h +++ b/third_party/blink/renderer/core/svg/svg_animated_length_list.h
@@ -57,7 +57,7 @@ ScriptWrappable::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { SVGAnimatedProperty<SVGLengthList>::TraceWrappers(visitor); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_number.cc b/third_party/blink/renderer/core/svg/svg_animated_number.cc index 5ba4955..695abff 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_number.cc +++ b/third_party/blink/renderer/core/svg/svg_animated_number.cc
@@ -50,8 +50,7 @@ ScriptWrappable::Trace(visitor); } -void SVGAnimatedNumber::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void SVGAnimatedNumber::TraceWrappers(ScriptWrappableVisitor* visitor) const { SVGAnimatedProperty<SVGNumber>::TraceWrappers(visitor); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_number.h b/third_party/blink/renderer/core/svg/svg_animated_number.h index 8a789f68..e3f6366a 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_number.h +++ b/third_party/blink/renderer/core/svg/svg_animated_number.h
@@ -63,7 +63,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: SVGAnimatedNumber(SVGElement* context_element,
diff --git a/third_party/blink/renderer/core/svg/svg_animated_number_list.h b/third_party/blink/renderer/core/svg/svg_animated_number_list.h index 651e7bd..5daeacb 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_number_list.h +++ b/third_party/blink/renderer/core/svg/svg_animated_number_list.h
@@ -55,7 +55,7 @@ ScriptWrappable::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { SVGAnimatedProperty<SVGNumberList>::TraceWrappers(visitor); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_preserve_aspect_ratio.h b/third_party/blink/renderer/core/svg/svg_animated_preserve_aspect_ratio.h index 4d8f81f..a048a2e 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_preserve_aspect_ratio.h +++ b/third_party/blink/renderer/core/svg/svg_animated_preserve_aspect_ratio.h
@@ -55,7 +55,7 @@ ScriptWrappable::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { SVGAnimatedProperty<SVGPreserveAspectRatio>::TraceWrappers(visitor); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_rect.h b/third_party/blink/renderer/core/svg/svg_animated_rect.h index b79a5ac5..9b63ffa9 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_rect.h +++ b/third_party/blink/renderer/core/svg/svg_animated_rect.h
@@ -53,7 +53,7 @@ ScriptWrappable::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { SVGAnimatedProperty<SVGRect>::TraceWrappers(visitor); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_string.cc b/third_party/blink/renderer/core/svg/svg_animated_string.cc index d514d01e..b3b108a 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_string.cc +++ b/third_party/blink/renderer/core/svg/svg_animated_string.cc
@@ -24,8 +24,7 @@ ScriptWrappable::Trace(visitor); } -void SVGAnimatedString::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void SVGAnimatedString::TraceWrappers(ScriptWrappableVisitor* visitor) const { SVGAnimatedProperty<SVGString>::TraceWrappers(visitor); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_animated_string.h b/third_party/blink/renderer/core/svg/svg_animated_string.h index 9efe47b..930f66f 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_string.h +++ b/third_party/blink/renderer/core/svg/svg_animated_string.h
@@ -53,7 +53,7 @@ virtual String animVal(); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: SVGAnimatedString(SVGElement* context_element,
diff --git a/third_party/blink/renderer/core/svg/svg_animated_transform_list.h b/third_party/blink/renderer/core/svg/svg_animated_transform_list.h index a3e4815..64be226c 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_transform_list.h +++ b/third_party/blink/renderer/core/svg/svg_animated_transform_list.h
@@ -59,7 +59,7 @@ ScriptWrappable::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { SVGAnimatedProperty<SVGTransformList>::TraceWrappers(visitor); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_matrix_tear_off.cc b/third_party/blink/renderer/core/svg/svg_matrix_tear_off.cc index 1a98516..b608308 100644 --- a/third_party/blink/renderer/core/svg/svg_matrix_tear_off.cc +++ b/third_party/blink/renderer/core/svg/svg_matrix_tear_off.cc
@@ -50,8 +50,7 @@ ScriptWrappable::Trace(visitor); } -void SVGMatrixTearOff::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void SVGMatrixTearOff::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(context_transform_); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_matrix_tear_off.h b/third_party/blink/renderer/core/svg/svg_matrix_tear_off.h index fcb9692d..bdee2ce3 100644 --- a/third_party/blink/renderer/core/svg/svg_matrix_tear_off.h +++ b/third_party/blink/renderer/core/svg/svg_matrix_tear_off.h
@@ -89,7 +89,7 @@ const AffineTransform& Value() const; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: explicit SVGMatrixTearOff(const AffineTransform&);
diff --git a/third_party/blink/renderer/core/svg/svg_script_element.cc b/third_party/blink/renderer/core/svg/svg_script_element.cc index 2383e4cf..dea8454bc 100644 --- a/third_party/blink/renderer/core/svg/svg_script_element.cc +++ b/third_party/blink/renderer/core/svg/svg_script_element.cc
@@ -184,8 +184,7 @@ ScriptElementBase::Trace(visitor); } -void SVGScriptElement::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void SVGScriptElement::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(loader_); SVGElement::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/svg/svg_script_element.h b/third_party/blink/renderer/core/svg/svg_script_element.h index 15c643d..716aa665 100644 --- a/third_party/blink/renderer/core/svg/svg_script_element.h +++ b/third_party/blink/renderer/core/svg/svg_script_element.h
@@ -50,7 +50,7 @@ bool IsScriptElement() const override { return true; } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: SVGScriptElement(Document&, const CreateElementFlags);
diff --git a/third_party/blink/renderer/core/testing/death_aware_script_wrappable.h b/third_party/blink/renderer/core/testing/death_aware_script_wrappable.h index 84bdb6fa..519529d8 100644 --- a/third_party/blink/renderer/core/testing/death_aware_script_wrappable.h +++ b/third_party/blink/renderer/core/testing/death_aware_script_wrappable.h
@@ -44,7 +44,7 @@ ScriptWrappable::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(wrapped_dependency_); for (auto dep : wrapped_vector_dependency_) { visitor->TraceWrappers(dep);
diff --git a/third_party/blink/renderer/core/testing/dummy_modulator.cc b/third_party/blink/renderer/core/testing/dummy_modulator.cc index a8e2853..9be6bc35 100644 --- a/third_party/blink/renderer/core/testing/dummy_modulator.cc +++ b/third_party/blink/renderer/core/testing/dummy_modulator.cc
@@ -68,7 +68,8 @@ return nullptr; }; -void DummyModulator::FetchTree(const ModuleScriptFetchRequest&, +void DummyModulator::FetchTree(const KURL&, + const ScriptFetchOptions&, ModuleTreeClient*) { NOTREACHED(); }
diff --git a/third_party/blink/renderer/core/testing/dummy_modulator.h b/third_party/blink/renderer/core/testing/dummy_modulator.h index bf05c857..accf920 100644 --- a/third_party/blink/renderer/core/testing/dummy_modulator.h +++ b/third_party/blink/renderer/core/testing/dummy_modulator.h
@@ -37,7 +37,9 @@ const SecurityOrigin* GetSecurityOriginForFetch() override; ScriptState* GetScriptState() override; - void FetchTree(const ModuleScriptFetchRequest&, ModuleTreeClient*) override; + void FetchTree(const KURL&, + const ScriptFetchOptions&, + ModuleTreeClient*) override; void FetchSingle(const ModuleScriptFetchRequest&, ModuleGraphLevel, SingleModuleClient*) override;
diff --git a/third_party/blink/renderer/core/timing/dom_window_performance.cc b/third_party/blink/renderer/core/timing/dom_window_performance.cc index eb931c7..629e4689e 100644 --- a/third_party/blink/renderer/core/timing/dom_window_performance.cc +++ b/third_party/blink/renderer/core/timing/dom_window_performance.cc
@@ -19,7 +19,7 @@ } void DOMWindowPerformance::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(performance_); Supplement<LocalDOMWindow>::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/timing/dom_window_performance.h b/third_party/blink/renderer/core/timing/dom_window_performance.h index 7122f4b..8bee7c47 100644 --- a/third_party/blink/renderer/core/timing/dom_window_performance.h +++ b/third_party/blink/renderer/core/timing/dom_window_performance.h
@@ -27,7 +27,7 @@ static WindowPerformance* performance(LocalDOMWindow&); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: explicit DOMWindowPerformance(LocalDOMWindow&);
diff --git a/third_party/blink/renderer/core/timing/performance.cc b/third_party/blink/renderer/core/timing/performance.cc index 0b8c8b7..8131003d 100644 --- a/third_party/blink/renderer/core/timing/performance.cc +++ b/third_party/blink/renderer/core/timing/performance.cc
@@ -716,7 +716,7 @@ EventTargetWithInlineData::Trace(visitor); } -void Performance::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void Performance::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (const auto& observer : observers_) visitor->TraceWrappers(observer); EventTargetWithInlineData::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/core/timing/performance.h b/third_party/blink/renderer/core/timing/performance.h index c916e024..3166b04 100644 --- a/third_party/blink/renderer/core/timing/performance.h +++ b/third_party/blink/renderer/core/timing/performance.h
@@ -214,7 +214,7 @@ ScriptValue toJSONForBinding(ScriptState*) const; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: static bool PassesTimingAllowCheck(const ResourceResponse&,
diff --git a/third_party/blink/renderer/core/timing/performance_mark.cc b/third_party/blink/renderer/core/timing/performance_mark.cc index 7c46113..787169e1 100644 --- a/third_party/blink/renderer/core/timing/performance_mark.cc +++ b/third_party/blink/renderer/core/timing/performance_mark.cc
@@ -39,8 +39,7 @@ PerformanceEntry::Trace(visitor); } -void PerformanceMark::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void PerformanceMark::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(detail_); PerformanceEntry::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/timing/performance_mark.h b/third_party/blink/renderer/core/timing/performance_mark.h index 8e3eb0a8..b2e30e7f 100644 --- a/third_party/blink/renderer/core/timing/performance_mark.h +++ b/third_party/blink/renderer/core/timing/performance_mark.h
@@ -50,7 +50,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: PerformanceMark(ScriptState*,
diff --git a/third_party/blink/renderer/core/timing/performance_observer.cc b/third_party/blink/renderer/core/timing/performance_observer.cc index 3334b40..64639d33 100644 --- a/third_party/blink/renderer/core/timing/performance_observer.cc +++ b/third_party/blink/renderer/core/timing/performance_observer.cc
@@ -141,8 +141,7 @@ ContextClient::Trace(visitor); } -void PerformanceObserver::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void PerformanceObserver::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(callback_); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/timing/performance_observer.h b/third_party/blink/renderer/core/timing/performance_observer.h index ffc68fa..eab006f2 100644 --- a/third_party/blink/renderer/core/timing/performance_observer.h +++ b/third_party/blink/renderer/core/timing/performance_observer.h
@@ -49,7 +49,7 @@ bool HasPendingActivity() const final; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: PerformanceObserver(ExecutionContext*,
diff --git a/third_party/blink/renderer/core/timing/worker_global_scope_performance.cc b/third_party/blink/renderer/core/timing/worker_global_scope_performance.cc index b9222510..0a0344a 100644 --- a/third_party/blink/renderer/core/timing/worker_global_scope_performance.cc +++ b/third_party/blink/renderer/core/timing/worker_global_scope_performance.cc
@@ -72,7 +72,7 @@ } void WorkerGlobalScopePerformance::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(performance_); Supplement<WorkerGlobalScope>::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/timing/worker_global_scope_performance.h b/third_party/blink/renderer/core/timing/worker_global_scope_performance.h index 3f6faf8b..06ce8e34 100644 --- a/third_party/blink/renderer/core/timing/worker_global_scope_performance.h +++ b/third_party/blink/renderer/core/timing/worker_global_scope_performance.h
@@ -54,7 +54,7 @@ static WorkerPerformance* performance(WorkerGlobalScope&); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: explicit WorkerGlobalScopePerformance(WorkerGlobalScope&);
diff --git a/third_party/blink/renderer/core/workers/shared_worker.idl b/third_party/blink/renderer/core/workers/shared_worker.idl index e5b88eb..de07146 100644 --- a/third_party/blink/renderer/core/workers/shared_worker.idl +++ b/third_party/blink/renderer/core/workers/shared_worker.idl
@@ -33,6 +33,10 @@ [ ActiveScriptWrappable, + // The SharedWorker constructor may run a worker in parallel, fetch URLs, + // and modify the global worker set. See spec section 10.2.6.4, step 11. + // https://html.spec.whatwg.org/#shared-workers-and-the-sharedworker-interface + Affects=Everything, // TODO(foolip): The name argument should not have a default null value. Constructor(DOMString scriptURL, optional DOMString name = null), ConstructorCallWith=ExecutionContext,
diff --git a/third_party/blink/renderer/core/workers/worker.idl b/third_party/blink/renderer/core/workers/worker.idl index 90f0f89..98544ee 100644 --- a/third_party/blink/renderer/core/workers/worker.idl +++ b/third_party/blink/renderer/core/workers/worker.idl
@@ -29,6 +29,10 @@ [ ActiveScriptWrappable, + // The Worker constructor may run a worker in parallel, fetch URLs, and + // modify the global worker set. See spec section 10.2.6.3, step 9. + // https://html.spec.whatwg.org/#dedicated-workers-and-the-worker-interface + Affects=Everything, Constructor(DOMString scriptURL, optional WorkerOptions options), ConstructorCallWith=ExecutionContext, // TODO(foolip): Exposed=(Window,Worker),
diff --git a/third_party/blink/renderer/core/workers/worker_animation_frame_provider.h b/third_party/blink/renderer/core/workers/worker_animation_frame_provider.h index f9bd581..66b3228a 100644 --- a/third_party/blink/renderer/core/workers/worker_animation_frame_provider.h +++ b/third_party/blink/renderer/core/workers/worker_animation_frame_provider.h
@@ -39,7 +39,7 @@ void Trace(blink::Visitor* visitor) { visitor->Trace(callback_collection_); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const { + void TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(callback_collection_); }
diff --git a/third_party/blink/renderer/core/workers/worker_global_scope.cc b/third_party/blink/renderer/core/workers/worker_global_scope.cc index 9d7ae17..7d3901d 100644 --- a/third_party/blink/renderer/core/workers/worker_global_scope.cc +++ b/third_party/blink/renderer/core/workers/worker_global_scope.cc
@@ -439,8 +439,7 @@ Supplementable<WorkerGlobalScope>::Trace(visitor); } -void WorkerGlobalScope::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void WorkerGlobalScope::TraceWrappers(ScriptWrappableVisitor* visitor) const { Supplementable<WorkerGlobalScope>::TraceWrappers(visitor); WorkerOrWorkletGlobalScope::TraceWrappers(visitor); visitor->TraceWrappers(navigator_);
diff --git a/third_party/blink/renderer/core/workers/worker_global_scope.h b/third_party/blink/renderer/core/workers/worker_global_scope.h index 9e72000..a6f1134 100644 --- a/third_party/blink/renderer/core/workers/worker_global_scope.h +++ b/third_party/blink/renderer/core/workers/worker_global_scope.h
@@ -145,7 +145,7 @@ WorkerSettings* GetWorkerSettings() const { return worker_settings_.get(); } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; // TODO(fserb): This can be removed once we WorkerGlobalScope implements // FontFaceSource on the IDL.
diff --git a/third_party/blink/renderer/core/workers/worker_navigator.cc b/third_party/blink/renderer/core/workers/worker_navigator.cc index 3de10ef5..e670cb5d 100644 --- a/third_party/blink/renderer/core/workers/worker_navigator.cc +++ b/third_party/blink/renderer/core/workers/worker_navigator.cc
@@ -42,8 +42,7 @@ Supplementable<WorkerNavigator>::Trace(visitor); } -void WorkerNavigator::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void WorkerNavigator::TraceWrappers(ScriptWrappableVisitor* visitor) const { ScriptWrappable::TraceWrappers(visitor); Supplementable<WorkerNavigator>::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/workers/worker_navigator.h b/third_party/blink/renderer/core/workers/worker_navigator.h index 38d430d..53196e76c 100644 --- a/third_party/blink/renderer/core/workers/worker_navigator.h +++ b/third_party/blink/renderer/core/workers/worker_navigator.h
@@ -57,7 +57,7 @@ String userAgent() const override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: explicit WorkerNavigator(const String&);
diff --git a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc index 6185cc5..c55acd99 100644 --- a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc +++ b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc
@@ -218,9 +218,7 @@ Modulator* modulator = Modulator::From(ScriptController()->GetScriptState()); // Step 3. "Perform the internal module script graph fetching procedure ..." - ModuleScriptFetchRequest module_request( - module_url_record, modulator->GetReferrerPolicy(), options); - modulator->FetchTree(module_request, client); + modulator->FetchTree(module_url_record, options, client); } void WorkerOrWorkletGlobalScope::Trace(blink::Visitor* visitor) { @@ -235,7 +233,7 @@ } void WorkerOrWorkletGlobalScope::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(modulator_); EventTargetWithInlineData::TraceWrappers(visitor); ExecutionContext::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h index e966657..68adda2 100644 --- a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h +++ b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h
@@ -99,7 +99,7 @@ WorkerReportingProxy& ReportingProxy() { return reporting_proxy_; } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; scheduler::WorkerScheduler* GetScheduler() override; scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner(TaskType) override;
diff --git a/third_party/blink/renderer/core/workers/worklet_global_scope.cc b/third_party/blink/renderer/core/workers/worklet_global_scope.cc index bbfae09d..14b5cad 100644 --- a/third_party/blink/renderer/core/workers/worklet_global_scope.cc +++ b/third_party/blink/renderer/core/workers/worklet_global_scope.cc
@@ -126,8 +126,7 @@ WorkerOrWorkletGlobalScope::Trace(visitor); } -void WorkletGlobalScope::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void WorkletGlobalScope::TraceWrappers(ScriptWrappableVisitor* visitor) const { WorkerOrWorkletGlobalScope::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/core/workers/worklet_global_scope.h b/third_party/blink/renderer/core/workers/worklet_global_scope.h index ab61c063..ea64ab0 100644 --- a/third_party/blink/renderer/core/workers/worklet_global_scope.h +++ b/third_party/blink/renderer/core/workers/worklet_global_scope.h
@@ -84,7 +84,7 @@ bool DocumentSecureContext() const { return document_secure_context_; } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: // Partial implementation of the "set up a worklet environment settings
diff --git a/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc b/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc index 394148a..48e84bc 100644 --- a/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc +++ b/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc
@@ -2007,8 +2007,7 @@ PausableObject::Trace(visitor); } -void XMLHttpRequest::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void XMLHttpRequest::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(response_blob_); visitor->TraceWrappers(response_document_); visitor->TraceWrappers(response_array_buffer_);
diff --git a/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.h b/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.h index c0cd40b..abd52300 100644 --- a/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.h +++ b/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.h
@@ -167,7 +167,7 @@ DEFINE_ATTRIBUTE_EVENT_LISTENER(readystatechange); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "XMLHttpRequest"; } private:
diff --git a/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope.cc b/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope.cc index a7f946fc..e8246e0 100644 --- a/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope.cc +++ b/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope.cc
@@ -79,7 +79,7 @@ } void AnimationWorkletGlobalScope::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (auto animator : animators_) visitor->TraceWrappers(animator.value);
diff --git a/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope.h b/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope.h index c64c0d1..6899845 100644 --- a/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope.h +++ b/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope.h
@@ -37,7 +37,7 @@ WorkerThread*); ~AnimationWorkletGlobalScope() override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; void Dispose() override; bool IsAnimationWorkletGlobalScope() const final { return true; }
diff --git a/third_party/blink/renderer/modules/animationworklet/animator.cc b/third_party/blink/renderer/modules/animationworklet/animator.cc index a3a2e0551..ecbe437 100644 --- a/third_party/blink/renderer/modules/animationworklet/animator.cc +++ b/third_party/blink/renderer/modules/animationworklet/animator.cc
@@ -27,7 +27,7 @@ visitor->Trace(effect_); } -void Animator::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void Animator::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(definition_); visitor->TraceWrappers(instance_.Cast<v8::Value>()); }
diff --git a/third_party/blink/renderer/modules/animationworklet/animator.h b/third_party/blink/renderer/modules/animationworklet/animator.h index 297d5bae..c2817e22 100644 --- a/third_party/blink/renderer/modules/animationworklet/animator.h +++ b/third_party/blink/renderer/modules/animationworklet/animator.h
@@ -28,7 +28,7 @@ Animator(v8::Isolate*, AnimatorDefinition*, v8::Local<v8::Object> instance); ~Animator(); void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "Animator"; } // Returns true if it successfully invoked animate callback in JS. It receives
diff --git a/third_party/blink/renderer/modules/animationworklet/animator_definition.cc b/third_party/blink/renderer/modules/animationworklet/animator_definition.cc index d68eec7..637dc34 100644 --- a/third_party/blink/renderer/modules/animationworklet/animator_definition.cc +++ b/third_party/blink/renderer/modules/animationworklet/animator_definition.cc
@@ -19,8 +19,7 @@ AnimatorDefinition::~AnimatorDefinition() = default; -void AnimatorDefinition::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void AnimatorDefinition::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(constructor_.Cast<v8::Value>()); visitor->TraceWrappers(animate_.Cast<v8::Value>()); }
diff --git a/third_party/blink/renderer/modules/animationworklet/animator_definition.h b/third_party/blink/renderer/modules/animationworklet/animator_definition.h index f1e85abe..c59c599 100644 --- a/third_party/blink/renderer/modules/animationworklet/animator_definition.h +++ b/third_party/blink/renderer/modules/animationworklet/animator_definition.h
@@ -27,7 +27,7 @@ v8::Local<v8::Function> animate); ~AnimatorDefinition(); void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "AnimatorDefinition"; }
diff --git a/third_party/blink/renderer/modules/animationworklet/worklet_animation.h b/third_party/blink/renderer/modules/animationworklet/worklet_animation.h index c42d3365..aef0c19 100644 --- a/third_party/blink/renderer/modules/animationworklet/worklet_animation.h +++ b/third_party/blink/renderer/modules/animationworklet/worklet_animation.h
@@ -67,7 +67,7 @@ // TODO(crbug.com/833846): We should update compositor animation when this // happens. - void SpecifiedTimingChanged() override {} + void EffectInvalidated() override {} void UpdateIfNecessary() override; Animation* GetAnimation() override { return nullptr; }
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_state.cc b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_state.cc index 1183be5..6012886 100644 --- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_state.cc +++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_state.cc
@@ -192,11 +192,10 @@ if (!stroke_style_dirty_) return; - int clamped_alpha = ClampedAlphaForBlending(global_alpha_); DCHECK(stroke_style_); stroke_style_->ApplyToFlags(stroke_flags_); stroke_flags_.setColor( - ScaleAlpha(stroke_style_->PaintColor(), clamped_alpha)); + ScaleAlpha(stroke_style_->PaintColor(), global_alpha_)); stroke_style_dirty_ = false; } @@ -204,10 +203,9 @@ if (!fill_style_dirty_) return; - int clamped_alpha = ClampedAlphaForBlending(global_alpha_); DCHECK(fill_style_); fill_style_->ApplyToFlags(fill_flags_); - fill_flags_.setColor(ScaleAlpha(fill_style_->PaintColor(), clamped_alpha)); + fill_flags_.setColor(ScaleAlpha(fill_style_->PaintColor(), global_alpha_)); fill_style_dirty_ = false; } @@ -240,8 +238,7 @@ global_alpha_ = alpha; stroke_style_dirty_ = true; fill_style_dirty_ = true; - int image_alpha = ClampedAlphaForBlending(alpha); - image_flags_.setAlpha(image_alpha > 255 ? 255 : image_alpha); + image_flags_.setColor(ScaleAlpha(SK_ColorBLACK, alpha)); } void CanvasRenderingContext2DState::ClipPath(
diff --git a/third_party/blink/renderer/modules/csspaint/css_paint_definition.cc b/third_party/blink/renderer/modules/csspaint/css_paint_definition.cc index 864540cf..09dc49c6f 100644 --- a/third_party/blink/renderer/modules/csspaint/css_paint_definition.cc +++ b/third_party/blink/renderer/modules/csspaint/css_paint_definition.cc
@@ -154,8 +154,7 @@ did_call_constructor_ = true; } -void CSSPaintDefinition::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void CSSPaintDefinition::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(constructor_.Cast<v8::Value>()); visitor->TraceWrappers(paint_.Cast<v8::Value>()); visitor->TraceWrappers(instance_.Cast<v8::Value>());
diff --git a/third_party/blink/renderer/modules/csspaint/css_paint_definition.h b/third_party/blink/renderer/modules/csspaint/css_paint_definition.h index a0f20f7a..88f5259 100644 --- a/third_party/blink/renderer/modules/csspaint/css_paint_definition.h +++ b/third_party/blink/renderer/modules/csspaint/css_paint_definition.h
@@ -72,7 +72,7 @@ } void Trace(blink::Visitor* visitor){}; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "CSSPaintDefinition"; }
diff --git a/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope.cc b/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope.cc index 5325b29..6f8e07a 100644 --- a/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope.cc +++ b/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope.cc
@@ -233,7 +233,7 @@ } void PaintWorkletGlobalScope::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (auto definition : paint_definitions_) visitor->TraceWrappers(definition.value); MainThreadWorkletGlobalScope::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope.h b/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope.h index a447962..8507654 100644 --- a/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope.h +++ b/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope.h
@@ -42,7 +42,7 @@ double devicePixelRatio() const; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: PaintWorkletGlobalScope(LocalFrame*,
diff --git a/third_party/blink/renderer/modules/filesystem/local_file_system.cc b/third_party/blink/renderer/modules/filesystem/local_file_system.cc index 12b4da2..d1fea9c 100644 --- a/third_party/blink/renderer/modules/filesystem/local_file_system.cc +++ b/third_party/blink/renderer/modules/filesystem/local_file_system.cc
@@ -188,8 +188,7 @@ Supplement<WorkerClients>::Trace(visitor); } -void LocalFileSystem::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void LocalFileSystem::TraceWrappers(ScriptWrappableVisitor* visitor) const { Supplement<LocalFrame>::TraceWrappers(visitor); Supplement<WorkerClients>::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/filesystem/local_file_system.h b/third_party/blink/renderer/modules/filesystem/local_file_system.h index 2d9b66de..6c8e1b4 100644 --- a/third_party/blink/renderer/modules/filesystem/local_file_system.h +++ b/third_party/blink/renderer/modules/filesystem/local_file_system.h
@@ -76,7 +76,7 @@ static LocalFileSystem* From(ExecutionContext&); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "LocalFileSystem"; } private:
diff --git a/third_party/blink/renderer/modules/geolocation/geo_notifier.cc b/third_party/blink/renderer/modules/geolocation/geo_notifier.cc index 4324e94..101241da 100644 --- a/third_party/blink/renderer/modules/geolocation/geo_notifier.cc +++ b/third_party/blink/renderer/modules/geolocation/geo_notifier.cc
@@ -43,7 +43,7 @@ visitor->Trace(fatal_error_); } -void GeoNotifier::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void GeoNotifier::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(success_callback_); visitor->TraceWrappers(error_callback_); }
diff --git a/third_party/blink/renderer/modules/geolocation/geo_notifier.h b/third_party/blink/renderer/modules/geolocation/geo_notifier.h index 6d50254..2afe28c 100644 --- a/third_party/blink/renderer/modules/geolocation/geo_notifier.h +++ b/third_party/blink/renderer/modules/geolocation/geo_notifier.h
@@ -30,7 +30,7 @@ } ~GeoNotifier() = default; void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "GeoNotifier"; } const PositionOptions& Options() const { return options_; }
diff --git a/third_party/blink/renderer/modules/geolocation/geolocation.cc b/third_party/blink/renderer/modules/geolocation/geolocation.cc index 64134aa..1e8911b 100644 --- a/third_party/blink/renderer/modules/geolocation/geolocation.cc +++ b/third_party/blink/renderer/modules/geolocation/geolocation.cc
@@ -119,7 +119,7 @@ PageVisibilityObserver::Trace(visitor); } -void Geolocation::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void Geolocation::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (const auto& one_shot : one_shots_) visitor->TraceWrappers(one_shot); visitor->TraceWrappers(watchers_);
diff --git a/third_party/blink/renderer/modules/geolocation/geolocation.h b/third_party/blink/renderer/modules/geolocation/geolocation.h index a5177b7..2fac36a 100644 --- a/third_party/blink/renderer/modules/geolocation/geolocation.h +++ b/third_party/blink/renderer/modules/geolocation/geolocation.h
@@ -61,7 +61,7 @@ static Geolocation* Create(ExecutionContext*); ~Geolocation() override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; // Inherited from ContextLifecycleObserver and PageVisibilityObserver. void ContextDestroyed(ExecutionContext*) override;
diff --git a/third_party/blink/renderer/modules/geolocation/geolocation_watchers.cc b/third_party/blink/renderer/modules/geolocation/geolocation_watchers.cc index 6a25be823..842cac2 100644 --- a/third_party/blink/renderer/modules/geolocation/geolocation_watchers.cc +++ b/third_party/blink/renderer/modules/geolocation/geolocation_watchers.cc
@@ -14,8 +14,7 @@ visitor->Trace(notifier_to_id_map_); } -void GeolocationWatchers::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void GeolocationWatchers::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (const auto& notifier : id_to_notifier_map_.Values()) visitor->TraceWrappers(notifier); // |notifier_to_id_map_| is a HeapHashMap that is the inverse mapping of
diff --git a/third_party/blink/renderer/modules/geolocation/geolocation_watchers.h b/third_party/blink/renderer/modules/geolocation/geolocation_watchers.h index 2898165b..0fe3026 100644 --- a/third_party/blink/renderer/modules/geolocation/geolocation_watchers.h +++ b/third_party/blink/renderer/modules/geolocation/geolocation_watchers.h
@@ -18,7 +18,7 @@ public: GeolocationWatchers() = default; void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "GeolocationWatchers"; }
diff --git a/third_party/blink/renderer/modules/geolocation/navigator_geolocation.cc b/third_party/blink/renderer/modules/geolocation/navigator_geolocation.cc index 587d2002..a455f83 100644 --- a/third_party/blink/renderer/modules/geolocation/navigator_geolocation.cc +++ b/third_party/blink/renderer/modules/geolocation/navigator_geolocation.cc
@@ -63,7 +63,7 @@ } void NavigatorGeolocation::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(geolocation_); Supplement<Navigator>::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/geolocation/navigator_geolocation.h b/third_party/blink/renderer/modules/geolocation/navigator_geolocation.h index 0398424..3bbd3988 100644 --- a/third_party/blink/renderer/modules/geolocation/navigator_geolocation.h +++ b/third_party/blink/renderer/modules/geolocation/navigator_geolocation.h
@@ -44,7 +44,7 @@ Geolocation* geolocation(); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "NavigatorGeolocation"; }
diff --git a/third_party/blink/renderer/modules/indexeddb/idb_database.cc b/third_party/blink/renderer/modules/indexeddb/idb_database.cc index 52fc9a0..ca2a9d4 100644 --- a/third_party/blink/renderer/modules/indexeddb/idb_database.cc +++ b/third_party/blink/renderer/modules/indexeddb/idb_database.cc
@@ -128,7 +128,7 @@ ContextLifecycleObserver::Trace(visitor); } -void IDBDatabase::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void IDBDatabase::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (const auto& observer : observers_.Values()) { visitor->TraceWrappers(observer); }
diff --git a/third_party/blink/renderer/modules/indexeddb/idb_database.h b/third_party/blink/renderer/modules/indexeddb/idb_database.h index 504ede8..61189fc 100644 --- a/third_party/blink/renderer/modules/indexeddb/idb_database.h +++ b/third_party/blink/renderer/modules/indexeddb/idb_database.h
@@ -71,7 +71,7 @@ v8::Isolate*); ~IDBDatabase() override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; // Overwrites the database metadata, including object store and index // metadata. Used to pass metadata to the database when it is opened.
diff --git a/third_party/blink/renderer/modules/indexeddb/idb_observer.cc b/third_party/blink/renderer/modules/indexeddb/idb_observer.cc index 546a25d..ce090e91 100644 --- a/third_party/blink/renderer/modules/indexeddb/idb_observer.cc +++ b/third_party/blink/renderer/modules/indexeddb/idb_observer.cc
@@ -104,7 +104,7 @@ ScriptWrappable::Trace(visitor); } -void IDBObserver::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void IDBObserver::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(callback_); ScriptWrappable::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/indexeddb/idb_observer.h b/third_party/blink/renderer/modules/indexeddb/idb_observer.h index 29321fa..5bc8323 100644 --- a/third_party/blink/renderer/modules/indexeddb/idb_observer.h +++ b/third_party/blink/renderer/modules/indexeddb/idb_observer.h
@@ -36,7 +36,7 @@ void unobserve(IDBDatabase*, ExceptionState&); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: explicit IDBObserver(V8IDBObserverCallback*);
diff --git a/third_party/blink/renderer/modules/indexeddb/indexed_db_client.cc b/third_party/blink/renderer/modules/indexeddb/indexed_db_client.cc index d58dd81..7d7df26 100644 --- a/third_party/blink/renderer/modules/indexeddb/indexed_db_client.cc +++ b/third_party/blink/renderer/modules/indexeddb/indexed_db_client.cc
@@ -70,8 +70,7 @@ Supplement<WorkerClients>::Trace(visitor); } -void IndexedDBClient::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void IndexedDBClient::TraceWrappers(ScriptWrappableVisitor* visitor) const { Supplement<LocalFrame>::TraceWrappers(visitor); Supplement<WorkerClients>::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/indexeddb/indexed_db_client.h b/third_party/blink/renderer/modules/indexeddb/indexed_db_client.h index f2b0449..d6f2858 100644 --- a/third_party/blink/renderer/modules/indexeddb/indexed_db_client.h +++ b/third_party/blink/renderer/modules/indexeddb/indexed_db_client.h
@@ -55,7 +55,7 @@ static IndexedDBClient* Create(WorkerClients&); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "IndexedDBClient"; } bool AllowIndexedDB(ExecutionContext*, const String& name);
diff --git a/third_party/blink/renderer/modules/locks/lock_manager.cc b/third_party/blink/renderer/modules/locks/lock_manager.cc index 0e3a274..0539f12 100644 --- a/third_party/blink/renderer/modules/locks/lock_manager.cc +++ b/third_party/blink/renderer/modules/locks/lock_manager.cc
@@ -80,7 +80,7 @@ // Wrapper tracing is needed for callbacks. The reference chain is // NavigatorLocksImpl -> LockManager -> LockRequestImpl -> // V8LockGrantedCallback. - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(callback_); } const char* NameInHeapSnapshot() const override { @@ -338,7 +338,7 @@ visitor->Trace(held_locks_); } -void LockManager::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void LockManager::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (auto request : pending_requests_) visitor->TraceWrappers(request); ScriptWrappable::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/modules/locks/lock_manager.h b/third_party/blink/renderer/modules/locks/lock_manager.h index a45ee12..974e4646 100644 --- a/third_party/blink/renderer/modules/locks/lock_manager.h +++ b/third_party/blink/renderer/modules/locks/lock_manager.h
@@ -45,7 +45,7 @@ // Wrapper tracing is needed for callbacks. The reference chain is // NavigatorLocksImpl -> LockManager -> LockRequestImpl -> // V8LockGrantedCallback. - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; // Terminate all outstanding requests when the context is destroyed, since // this can unblock requests by other contexts.
diff --git a/third_party/blink/renderer/modules/locks/navigator_locks.cc b/third_party/blink/renderer/modules/locks/navigator_locks.cc index 4479028..264a6dc6 100644 --- a/third_party/blink/renderer/modules/locks/navigator_locks.cc +++ b/third_party/blink/renderer/modules/locks/navigator_locks.cc
@@ -49,7 +49,7 @@ // Wrapper tracing is needed for callbacks. The reference chain is // NavigatorLocksImpl -> LockManager -> LockRequestImpl -> // V8LockGrantedCallback. - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(lock_manager_); }
diff --git a/third_party/blink/renderer/modules/mediasession/media_session.cc b/third_party/blink/renderer/modules/mediasession/media_session.cc index 37caad24..9696453 100644 --- a/third_party/blink/renderer/modules/mediasession/media_session.cc +++ b/third_party/blink/renderer/modules/mediasession/media_session.cc
@@ -235,7 +235,7 @@ ContextClient::Trace(visitor); } -void MediaSession::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void MediaSession::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (auto handler : action_handlers_.Values()) visitor->TraceWrappers(handler); ScriptWrappable::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/modules/mediasession/media_session.h b/third_party/blink/renderer/modules/mediasession/media_session.h index 47becfa..6d2156e 100644 --- a/third_party/blink/renderer/modules/mediasession/media_session.h +++ b/third_party/blink/renderer/modules/mediasession/media_session.h
@@ -47,7 +47,7 @@ void OnMetadataChanged(); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: friend class V8MediaSession;
diff --git a/third_party/blink/renderer/modules/nfc/navigator_nfc.cc b/third_party/blink/renderer/modules/nfc/navigator_nfc.cc index bd31398..628ef88 100644 --- a/third_party/blink/renderer/modules/nfc/navigator_nfc.cc +++ b/third_party/blink/renderer/modules/nfc/navigator_nfc.cc
@@ -39,7 +39,7 @@ Supplement<Navigator>::Trace(visitor); } -void NavigatorNFC::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void NavigatorNFC::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(nfc_); Supplement<Navigator>::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/nfc/navigator_nfc.h b/third_party/blink/renderer/modules/nfc/navigator_nfc.h index 9cee6265..c91cba4 100644 --- a/third_party/blink/renderer/modules/nfc/navigator_nfc.h +++ b/third_party/blink/renderer/modules/nfc/navigator_nfc.h
@@ -27,7 +27,7 @@ static NFC* nfc(Navigator&); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: explicit NavigatorNFC(Navigator&);
diff --git a/third_party/blink/renderer/modules/nfc/nfc.cc b/third_party/blink/renderer/modules/nfc/nfc.cc index 78269ea..e5e6c06a 100644 --- a/third_party/blink/renderer/modules/nfc/nfc.cc +++ b/third_party/blink/renderer/modules/nfc/nfc.cc
@@ -926,7 +926,7 @@ ContextLifecycleObserver::Trace(visitor); } -void NFC::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void NFC::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (const auto& callback : callbacks_.Values()) visitor->TraceWrappers(callback); ScriptWrappable::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/modules/nfc/nfc.h b/third_party/blink/renderer/modules/nfc/nfc.h index 79658d0..be1a13c 100644 --- a/third_party/blink/renderer/modules/nfc/nfc.h +++ b/third_party/blink/renderer/modules/nfc/nfc.h
@@ -61,7 +61,7 @@ // Interface required by garbage collection. void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: // Returns boolean indicating whether NFC is supported in this context. If
diff --git a/third_party/blink/renderer/modules/remoteplayback/availability_callback_wrapper.cc b/third_party/blink/renderer/modules/remoteplayback/availability_callback_wrapper.cc index 98fe172..05fc406a 100644 --- a/third_party/blink/renderer/modules/remoteplayback/availability_callback_wrapper.cc +++ b/third_party/blink/renderer/modules/remoteplayback/availability_callback_wrapper.cc
@@ -33,7 +33,7 @@ } void AvailabilityCallbackWrapper::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(bindings_cb_); }
diff --git a/third_party/blink/renderer/modules/remoteplayback/availability_callback_wrapper.h b/third_party/blink/renderer/modules/remoteplayback/availability_callback_wrapper.h index c4cab47..a0f9477 100644 --- a/third_party/blink/renderer/modules/remoteplayback/availability_callback_wrapper.h +++ b/third_party/blink/renderer/modules/remoteplayback/availability_callback_wrapper.h
@@ -33,7 +33,7 @@ void Run(RemotePlayback*, bool new_availability); virtual void Trace(blink::Visitor*); - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "AvailabilityCallbackWrapper"; }
diff --git a/third_party/blink/renderer/modules/remoteplayback/remote_playback.cc b/third_party/blink/renderer/modules/remoteplayback/remote_playback.cc index 5e4390c..f04f1d7 100644 --- a/third_party/blink/renderer/modules/remoteplayback/remote_playback.cc +++ b/third_party/blink/renderer/modules/remoteplayback/remote_playback.cc
@@ -606,8 +606,7 @@ ContextLifecycleObserver::Trace(visitor); } -void RemotePlayback::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void RemotePlayback::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (auto callback : availability_callbacks_.Values()) visitor->TraceWrappers(callback); EventTargetWithInlineData::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/modules/remoteplayback/remote_playback.h b/third_party/blink/renderer/modules/remoteplayback/remote_playback.h index cd5d335..8d99914 100644 --- a/third_party/blink/renderer/modules/remoteplayback/remote_playback.h +++ b/third_party/blink/renderer/modules/remoteplayback/remote_playback.h
@@ -130,7 +130,7 @@ DEFINE_ATTRIBUTE_EVENT_LISTENER(disconnect); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: friend class V8RemotePlayback;
diff --git a/third_party/blink/renderer/modules/serviceworkers/service_worker_container_client.h b/third_party/blink/renderer/modules/serviceworkers/service_worker_container_client.h index 3442fe9..a163a6a 100644 --- a/third_party/blink/renderer/modules/serviceworkers/service_worker_container_client.h +++ b/third_party/blink/renderer/modules/serviceworkers/service_worker_container_client.h
@@ -44,7 +44,7 @@ Supplement<WorkerClients>::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { Supplement<Document>::TraceWrappers(visitor); Supplement<WorkerClients>::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/vr/vr_display.cc b/third_party/blink/renderer/modules/vr/vr_display.cc index 232377b..d17f0cc 100644 --- a/third_party/blink/renderer/modules/vr/vr_display.cc +++ b/third_party/blink/renderer/modules/vr/vr_display.cc
@@ -1081,7 +1081,7 @@ ContextLifecycleObserver::Trace(visitor); } -void VRDisplay::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void VRDisplay::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(scripted_animation_controller_); EventTargetWithInlineData::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/vr/vr_display.h b/third_party/blink/renderer/modules/vr/vr_display.h index 6eaa176..bb8a16d7e 100644 --- a/third_party/blink/renderer/modules/vr/vr_display.h +++ b/third_party/blink/renderer/modules/vr/vr_display.h
@@ -102,7 +102,7 @@ int PendingMagicWindowVSyncId() { return pending_magic_window_vsync_id_; } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: friend class VRController;
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc b/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc index 718620e9..d89c249 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc
@@ -395,7 +395,7 @@ } void AudioWorkletGlobalScope::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (auto definition : processor_definition_map_) visitor->TraceWrappers(definition.value);
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.h b/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.h index 75bafa5..ccb7df1 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.h +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.h
@@ -103,7 +103,7 @@ float sampleRate() const { return sample_rate_; } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: AudioWorkletGlobalScope(std::unique_ptr<GlobalScopeCreationParams>,
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.cc b/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.cc index 4712b7e..41da626 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.cc
@@ -64,7 +64,7 @@ } void AudioWorkletProcessorDefinition::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(constructor_.Cast<v8::Value>()); visitor->TraceWrappers(process_.Cast<v8::Value>()); }
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.h b/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.h index c4e1833..6de972b 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.h +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.h
@@ -49,7 +49,7 @@ void Trace(blink::Visitor* visitor) { visitor->Trace(audio_param_descriptors_); }; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "AudioWorkletProcessorDefinition"; }
diff --git a/third_party/blink/renderer/modules/webgl/webgl2_rendering_context.cc b/third_party/blink/renderer/modules/webgl/webgl2_rendering_context.cc index 6de52419..8ab8deef 100644 --- a/third_party/blink/renderer/modules/webgl/webgl2_rendering_context.cc +++ b/third_party/blink/renderer/modules/webgl/webgl2_rendering_context.cc
@@ -159,7 +159,7 @@ } void WebGL2RenderingContext::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { // Extensions are managed by WebGL2RenderingContextBase. WebGL2RenderingContextBase::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/webgl/webgl2_rendering_context.h b/third_party/blink/renderer/modules/webgl/webgl2_rendering_context.h index 371929e..1b48be4 100644 --- a/third_party/blink/renderer/modules/webgl/webgl2_rendering_context.h +++ b/third_party/blink/renderer/modules/webgl/webgl2_rendering_context.h
@@ -49,7 +49,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: WebGL2RenderingContext(
diff --git a/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc index 240c471..1725d95e 100644 --- a/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc
@@ -5698,7 +5698,7 @@ } void WebGL2RenderingContextBase::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(read_framebuffer_binding_); visitor->TraceWrappers(transform_feedback_binding_); visitor->TraceWrappers(bound_copy_read_buffer_);
diff --git a/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.h b/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.h index 981fa9a..9d25493 100644 --- a/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.h +++ b/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.h
@@ -977,7 +977,7 @@ GLint GetMaxTransformFeedbackSeparateAttribs() const; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: friend class V8WebGL2RenderingContext;
diff --git a/third_party/blink/renderer/modules/webgl/webgl_context_group.cc b/third_party/blink/renderer/modules/webgl/webgl_context_group.cc index 687a27d..8db5724a 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_context_group.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_context_group.cc
@@ -50,8 +50,7 @@ return number_of_context_losses_; } -void WebGLContextGroup::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void WebGLContextGroup::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (auto context : contexts_) { visitor->TraceWrappers(context); }
diff --git a/third_party/blink/renderer/modules/webgl/webgl_context_group.h b/third_party/blink/renderer/modules/webgl/webgl_context_group.h index 87e968c5..fb2ce66 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_context_group.h +++ b/third_party/blink/renderer/modules/webgl/webgl_context_group.h
@@ -62,8 +62,7 @@ uint32_t NumberOfContextLosses() const; void Trace(blink::Visitor* visitor) { visitor->Trace(contexts_); } - - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "WebGLContextGroup"; }
diff --git a/third_party/blink/renderer/modules/webgl/webgl_context_object.cc b/third_party/blink/renderer/modules/webgl/webgl_context_object.cc index 83a49657..33e5e4f2 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_context_object.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_context_object.cc
@@ -55,8 +55,7 @@ WebGLObject::Trace(visitor); } -void WebGLContextObject::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void WebGLContextObject::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(context_); WebGLObject::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/webgl/webgl_context_object.h b/third_party/blink/renderer/modules/webgl/webgl_context_object.h index b5b07c23..c5255945 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_context_object.h +++ b/third_party/blink/renderer/modules/webgl/webgl_context_object.h
@@ -44,7 +44,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: explicit WebGLContextObject(WebGLRenderingContextBase*);
diff --git a/third_party/blink/renderer/modules/webgl/webgl_framebuffer.cc b/third_party/blink/renderer/modules/webgl/webgl_framebuffer.cc index 5bb38e45..6afd427 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_framebuffer.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_framebuffer.cc
@@ -40,7 +40,7 @@ static WebGLFramebuffer::WebGLAttachment* Create(WebGLRenderbuffer*); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(renderbuffer_); } const char* NameInHeapSnapshot() const override { return "WebGLAttachment"; } @@ -114,7 +114,7 @@ GLint layer); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(texture_); } const char* NameInHeapSnapshot() const override { @@ -562,8 +562,7 @@ WebGLContextObject::Trace(visitor); } -void WebGLFramebuffer::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void WebGLFramebuffer::TraceWrappers(ScriptWrappableVisitor* visitor) const { for (const auto& attachment : attachments_) { visitor->TraceWrappers(attachment.value); }
diff --git a/third_party/blink/renderer/modules/webgl/webgl_framebuffer.h b/third_party/blink/renderer/modules/webgl/webgl_framebuffer.h index bfdd82f..080f469 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_framebuffer.h +++ b/third_party/blink/renderer/modules/webgl/webgl_framebuffer.h
@@ -117,7 +117,7 @@ GLenum GetReadBuffer() const { return read_buffer_; } void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "WebGLFramebuffer"; } protected:
diff --git a/third_party/blink/renderer/modules/webgl/webgl_program.cc b/third_party/blink/renderer/modules/webgl/webgl_program.cc index e6eb1e7e..82e6ef4 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_program.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_program.cc
@@ -153,7 +153,7 @@ WebGLSharedPlatform3DObject::Trace(visitor); } -void WebGLProgram::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void WebGLProgram::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(vertex_shader_); visitor->TraceWrappers(fragment_shader_); WebGLSharedPlatform3DObject::TraceWrappers(visitor);
diff --git a/third_party/blink/renderer/modules/webgl/webgl_program.h b/third_party/blink/renderer/modules/webgl/webgl_program.h index 0268ae55..4c340aaa 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_program.h +++ b/third_party/blink/renderer/modules/webgl/webgl_program.h
@@ -71,7 +71,7 @@ bool DetachShader(WebGLShader*); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: explicit WebGLProgram(WebGLRenderingContextBase*);
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context.cc index 72a5c10..a673105 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context.cc
@@ -221,7 +221,7 @@ } void WebGLRenderingContext::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { // Extensions are managed base WebGLRenderingContextBase. WebGLRenderingContextBase::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context.h b/third_party/blink/renderer/modules/webgl/webgl_rendering_context.h index 9f1e36a..bd444bb2 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context.h +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context.h
@@ -83,7 +83,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: WebGLRenderingContext(CanvasRenderingContextHost*,
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc index 7d8fa63..f80200c 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
@@ -7859,7 +7859,7 @@ } void WebGLRenderingContextBase::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(context_group_); visitor->TraceWrappers(bound_array_buffer_); visitor->TraceWrappers(renderbuffer_binding_);
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h index 830a4ec7..fe52412 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
@@ -569,7 +569,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; // Returns approximate gpu memory allocated per pixel. int ExternallyAllocatedBufferCountPerPixel() override; @@ -843,7 +843,7 @@ virtual WebGLExtension* GetExtensionObjectIfAlreadyEnabled() = 0; virtual void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor*) const override {} + void TraceWrappers(ScriptWrappableVisitor*) const override {} const char* NameInHeapSnapshot() const override { return "ExtensionTracker"; } @@ -894,7 +894,7 @@ ExtensionTracker::Trace(visitor); } - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(extension_); ExtensionTracker::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/webgl/webgl_shared_object.cc b/third_party/blink/renderer/modules/webgl/webgl_shared_object.cc index 07fe722..b71e1136 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_shared_object.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_shared_object.cc
@@ -56,8 +56,7 @@ WebGLObject::Trace(visitor); } -void WebGLSharedObject::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void WebGLSharedObject::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(context_group_); WebGLObject::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/webgl/webgl_shared_object.h b/third_party/blink/renderer/modules/webgl/webgl_shared_object.h index 8dd1902c..6f00f9f 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_shared_object.h +++ b/third_party/blink/renderer/modules/webgl/webgl_shared_object.h
@@ -54,7 +54,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: explicit WebGLSharedObject(WebGLRenderingContextBase*);
diff --git a/third_party/blink/renderer/modules/webgl/webgl_transform_feedback.cc b/third_party/blink/renderer/modules/webgl/webgl_transform_feedback.cc index db2c296..2488d04 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_transform_feedback.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_transform_feedback.cc
@@ -149,7 +149,7 @@ } void WebGLTransformFeedback::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (auto& buf : bound_indexed_transform_feedback_buffers_) { visitor->TraceWrappers(buf); }
diff --git a/third_party/blink/renderer/modules/webgl/webgl_transform_feedback.h b/third_party/blink/renderer/modules/webgl/webgl_transform_feedback.h index 75e3641..d7fc4a4 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_transform_feedback.h +++ b/third_party/blink/renderer/modules/webgl/webgl_transform_feedback.h
@@ -51,7 +51,7 @@ void UnbindBuffer(WebGLBuffer*); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; bool active() const { return active_; } bool paused() const { return paused_; }
diff --git a/third_party/blink/renderer/modules/webgl/webgl_vertex_array_object_base.cc b/third_party/blink/renderer/modules/webgl/webgl_vertex_array_object_base.cc index 8e15097..54bbc5a 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_vertex_array_object_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_vertex_array_object_base.cc
@@ -133,7 +133,7 @@ } void WebGLVertexArrayObjectBase::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(bound_element_array_buffer_); for (size_t i = 0; i < array_buffer_list_.size(); ++i) { visitor->TraceWrappers(array_buffer_list_[i]);
diff --git a/third_party/blink/renderer/modules/webgl/webgl_vertex_array_object_base.h b/third_party/blink/renderer/modules/webgl/webgl_vertex_array_object_base.h index e19998a..6f6596b3 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_vertex_array_object_base.h +++ b/third_party/blink/renderer/modules/webgl/webgl_vertex_array_object_base.h
@@ -43,7 +43,7 @@ void UnbindBuffer(WebGLBuffer*); void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; protected: WebGLVertexArrayObjectBase(WebGLRenderingContextBase*, VaoType);
diff --git a/third_party/blink/renderer/modules/webmidi/midi_port.cc b/third_party/blink/renderer/modules/webmidi/midi_port.cc index f1c0446..f18eb85e 100644 --- a/third_party/blink/renderer/modules/webmidi/midi_port.cc +++ b/third_party/blink/renderer/modules/webmidi/midi_port.cc
@@ -192,7 +192,7 @@ ContextLifecycleObserver::Trace(visitor); } -void MIDIPort::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void MIDIPort::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(access_); EventTargetWithInlineData::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/webmidi/midi_port.h b/third_party/blink/renderer/modules/webmidi/midi_port.h index b092a1a..f3c1783d 100644 --- a/third_party/blink/renderer/modules/webmidi/midi_port.h +++ b/third_party/blink/renderer/modules/webmidi/midi_port.h
@@ -80,7 +80,7 @@ void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange);
diff --git a/third_party/blink/renderer/modules/xr/xr_canvas_input_provider.cc b/third_party/blink/renderer/modules/xr/xr_canvas_input_provider.cc index cf77afb..458efaa 100644 --- a/third_party/blink/renderer/modules/xr/xr_canvas_input_provider.cc +++ b/third_party/blink/renderer/modules/xr/xr_canvas_input_provider.cc
@@ -118,7 +118,7 @@ } void XRCanvasInputProvider::TraceWrappers( - const blink::ScriptWrappableVisitor* visitor) const { + blink::ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(input_source_); }
diff --git a/third_party/blink/renderer/modules/xr/xr_canvas_input_provider.h b/third_party/blink/renderer/modules/xr/xr_canvas_input_provider.h index 092fec2..9e9560f 100644 --- a/third_party/blink/renderer/modules/xr/xr_canvas_input_provider.h +++ b/third_party/blink/renderer/modules/xr/xr_canvas_input_provider.h
@@ -39,7 +39,7 @@ XRInputSource* GetInputSource(); virtual void Trace(blink::Visitor*); - void TraceWrappers(const blink::ScriptWrappableVisitor*) const override; + void TraceWrappers(blink::ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "XRCanvasInputProvider"; }
diff --git a/third_party/blink/renderer/modules/xr/xr_frame_request_callback_collection.cc b/third_party/blink/renderer/modules/xr/xr_frame_request_callback_collection.cc index 04aa633..e3b0474 100644 --- a/third_party/blink/renderer/modules/xr/xr_frame_request_callback_collection.cc +++ b/third_party/blink/renderer/modules/xr/xr_frame_request_callback_collection.cc
@@ -62,7 +62,7 @@ } void XRFrameRequestCallbackCollection::TraceWrappers( - const blink::ScriptWrappableVisitor* visitor) const { + blink::ScriptWrappableVisitor* visitor) const { for (const auto& callback : callbacks_.Values()) { visitor->TraceWrappers(callback); }
diff --git a/third_party/blink/renderer/modules/xr/xr_frame_request_callback_collection.h b/third_party/blink/renderer/modules/xr/xr_frame_request_callback_collection.h index 4bc51f24..e8bea944 100644 --- a/third_party/blink/renderer/modules/xr/xr_frame_request_callback_collection.h +++ b/third_party/blink/renderer/modules/xr/xr_frame_request_callback_collection.h
@@ -29,7 +29,7 @@ bool IsEmpty() const { return !callbacks_.size(); } void Trace(blink::Visitor*); - void TraceWrappers(const blink::ScriptWrappableVisitor*) const override; + void TraceWrappers(blink::ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "XRFrameRequestCallbackCollection"; }
diff --git a/third_party/blink/renderer/modules/xr/xr_session.cc b/third_party/blink/renderer/modules/xr/xr_session.cc index 90441347..43dac3a 100644 --- a/third_party/blink/renderer/modules/xr/xr_session.cc +++ b/third_party/blink/renderer/modules/xr/xr_session.cc
@@ -604,8 +604,7 @@ EventTargetWithInlineData::Trace(visitor); } -void XRSession::TraceWrappers( - const blink::ScriptWrappableVisitor* visitor) const { +void XRSession::TraceWrappers(blink::ScriptWrappableVisitor* visitor) const { for (const auto& input_source : input_sources_.Values()) visitor->TraceWrappers(input_source);
diff --git a/third_party/blink/renderer/modules/xr/xr_session.h b/third_party/blink/renderer/modules/xr/xr_session.h index 779cc59..9d817f6 100644 --- a/third_party/blink/renderer/modules/xr/xr_session.h +++ b/third_party/blink/renderer/modules/xr/xr_session.h
@@ -113,7 +113,7 @@ void OnSelect(XRInputSource*); void Trace(blink::Visitor*) override; - void TraceWrappers(const blink::ScriptWrappableVisitor*) const override; + void TraceWrappers(blink::ScriptWrappableVisitor*) const override; private: class XRSessionResizeObserverDelegate;
diff --git a/third_party/blink/renderer/modules/xr/xr_webgl_layer.cc b/third_party/blink/renderer/modules/xr/xr_webgl_layer.cc index 84b1201..ad3db68d 100644 --- a/third_party/blink/renderer/modules/xr/xr_webgl_layer.cc +++ b/third_party/blink/renderer/modules/xr/xr_webgl_layer.cc
@@ -327,7 +327,7 @@ XRLayer::Trace(visitor); } -void XRWebGLLayer::TraceWrappers(const ScriptWrappableVisitor* visitor) const { +void XRWebGLLayer::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(webgl_context_); XRLayer::TraceWrappers(visitor); }
diff --git a/third_party/blink/renderer/modules/xr/xr_webgl_layer.h b/third_party/blink/renderer/modules/xr/xr_webgl_layer.h index e95da96f..a11b6a4 100644 --- a/third_party/blink/renderer/modules/xr/xr_webgl_layer.h +++ b/third_party/blink/renderer/modules/xr/xr_webgl_layer.h
@@ -77,7 +77,7 @@ std::unique_ptr<viz::SingleReleaseCallback>) override; void Trace(blink::Visitor*) override; - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; private: XRWebGLLayer(XRSession*,
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn index 14edbaf..92551f71 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1956,7 +1956,6 @@ "//cc:test_support", "//cc/blink", "//device/base/synchronization", - "//mojo/common:test_common_custom_types_blink", "//mojo/edk", "//mojo/public/cpp/bindings/tests:for_blink_tests", "//mojo/public/cpp/test_support:test_utils",
diff --git a/third_party/blink/renderer/platform/bindings/TraceWrapperReference.md b/third_party/blink/renderer/platform/bindings/TraceWrapperReference.md index fa32b874..23adab6a 100644 --- a/third_party/blink/renderer/platform/bindings/TraceWrapperReference.md +++ b/third_party/blink/renderer/platform/bindings/TraceWrapperReference.md
@@ -17,7 +17,7 @@ find other wrappers that this object should keep alive. 3. Use `TraceWrapperV8Reference<T>` to annotate references to V8 that this object should keep alive. -4. Declare a `virtual void TraceWrappers(const ScriptWrappableVisitor*) const` +4. Declare a `virtual void TraceWrappers(ScriptWrappableVisitor*) const` method to trace other wrappers. 5. Define the method and trace all fields that received a wrapper tracing type in (1) and (2) using `visitor->TraceWrappers(<field_>)` in the body. @@ -34,7 +34,7 @@ public: virtual void TraceWrappers( - const ScriptWrappableVisitor*) const; // (4) + ScriptWrappableVisitor*) const; // (4) private: TraceWrapperMember<OtherWrappable> other_wrappable_; // (2) @@ -44,7 +44,7 @@ }; void SomeDOMObject::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { // (5) + ScriptWrappableVisitor* visitor) const { // (5) visitor->TraceWrappers(other_wrappable_); // (5) visitor->TraceWrappers(v8object_); // (5) } @@ -112,7 +112,7 @@ DEFINE_WRAPPERTYPEINFO(); public: - virtual void TraceWrappers(const ScriptWrappableVisitor*) const; + virtual void TraceWrappers(ScriptWrappableVisitor*) const; private: Member<OtherWrappable> other_wrappable_; @@ -120,7 +120,7 @@ }; void SomeDOMObject::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(other_wrappable_); } ``` @@ -147,7 +147,7 @@ DEFINE_WRAPPERTYPEINFO(); public: - virtual void TraceWrappers(const ScriptWrappableVisitor*) const; + virtual void TraceWrappers(ScriptWrappableVisitor*) const; private: TraceWrapperMember<OtherWrappable> other_wrappable_; @@ -155,7 +155,7 @@ }; void SomeDOMObject::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(other_wrappable_); } ``` @@ -176,14 +176,14 @@ public: // ... void AppendNewValue(OtherWrappable* newValue); - virtual void TraceWrappers(const ScriptWrappableVisitor*) const; + virtual void TraceWrappers(ScriptWrappableVisitor*) const; private: HeapVector<TraceWrapperMember<OtherWrappable>> other_wrappables_; }; void SomeDOMObject::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { for (auto other : other_wrappables_) visitor->TraceWrappers(other); } @@ -253,13 +253,13 @@ SriptWrappableVisitor::WriteBarrier(other_wrappable_); } - virtual void TraceWrappers(const ScriptWrappableVisitor*) const; + virtual void TraceWrappers(ScriptWrappableVisitor*) const; private: Member<OtherWrappable>> other_wrappable_; }; void ManualWrappable::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappersWithManualWriteBarrier(other_wrappable_); } ```
diff --git a/third_party/blink/renderer/platform/bindings/callback_function_base.cc b/third_party/blink/renderer/platform/bindings/callback_function_base.cc index 265dbb5..7add6d9 100644 --- a/third_party/blink/renderer/platform/bindings/callback_function_base.cc +++ b/third_party/blink/renderer/platform/bindings/callback_function_base.cc
@@ -19,7 +19,7 @@ } void CallbackFunctionBase::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(callback_function_); }
diff --git a/third_party/blink/renderer/platform/bindings/callback_function_base.h b/third_party/blink/renderer/platform/bindings/callback_function_base.h index 9d8103a..1bed7cd 100644 --- a/third_party/blink/renderer/platform/bindings/callback_function_base.h +++ b/third_party/blink/renderer/platform/bindings/callback_function_base.h
@@ -30,7 +30,7 @@ virtual ~CallbackFunctionBase() = default; virtual void Trace(blink::Visitor* visitor) {} - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "CallbackFunctionBase"; }
diff --git a/third_party/blink/renderer/platform/bindings/callback_interface_base.cc b/third_party/blink/renderer/platform/bindings/callback_interface_base.cc index c6d306c..9fd0d8f 100644 --- a/third_party/blink/renderer/platform/bindings/callback_interface_base.cc +++ b/third_party/blink/renderer/platform/bindings/callback_interface_base.cc
@@ -22,7 +22,7 @@ } void CallbackInterfaceBase::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { + ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(callback_object_); }
diff --git a/third_party/blink/renderer/platform/bindings/callback_interface_base.h b/third_party/blink/renderer/platform/bindings/callback_interface_base.h index 5276381b..69714d7c 100644 --- a/third_party/blink/renderer/platform/bindings/callback_interface_base.h +++ b/third_party/blink/renderer/platform/bindings/callback_interface_base.h
@@ -37,7 +37,7 @@ virtual ~CallbackInterfaceBase() = default; virtual void Trace(blink::Visitor*) {} - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; const char* NameInHeapSnapshot() const override { return "CallbackInterfaceBase"; }
diff --git a/third_party/blink/renderer/platform/bindings/dom_data_store.h b/third_party/blink/renderer/platform/bindings/dom_data_store.h index a6b91193..0a2b95a 100644 --- a/third_party/blink/renderer/platform/bindings/dom_data_store.h +++ b/third_party/blink/renderer/platform/bindings/dom_data_store.h
@@ -144,7 +144,7 @@ } void TraceWrappers(const ScriptWrappable* script_wrappable, - const ScriptWrappableVisitor* visitor) { + ScriptWrappableVisitor* visitor) { visitor->TraceWrappers(&wrapper_map_.value(), script_wrappable); }
diff --git a/third_party/blink/renderer/platform/bindings/dom_wrapper_world.cc b/third_party/blink/renderer/platform/bindings/dom_wrapper_world.cc index 0351715..2744e4e9 100644 --- a/third_party/blink/renderer/platform/bindings/dom_wrapper_world.cc +++ b/third_party/blink/renderer/platform/bindings/dom_wrapper_world.cc
@@ -116,7 +116,7 @@ } void DOMWrapperWorld::TraceWrappers(const ScriptWrappable* script_wrappable, - const ScriptWrappableVisitor* visitor) { + ScriptWrappableVisitor* visitor) { // Marking for worlds other than the main world. DCHECK(ThreadState::Current()->GetIsolate()); for (DOMWrapperWorld* world : GetWorldMap().Values()) {
diff --git a/third_party/blink/renderer/platform/bindings/dom_wrapper_world.h b/third_party/blink/renderer/platform/bindings/dom_wrapper_world.h index 5e5bc75..445972c 100644 --- a/third_party/blink/renderer/platform/bindings/dom_wrapper_world.h +++ b/third_party/blink/renderer/platform/bindings/dom_wrapper_world.h
@@ -96,8 +96,7 @@ Vector<scoped_refptr<DOMWrapperWorld>>& worlds); // Traces wrappers corresponding to the ScriptWrappable in DOM data stores. - static void TraceWrappers(const ScriptWrappable*, - const ScriptWrappableVisitor*); + static void TraceWrappers(const ScriptWrappable*, ScriptWrappableVisitor*); static DOMWrapperWorld& World(v8::Local<v8::Context> context) { return ScriptState::From(context)->World();
diff --git a/third_party/blink/renderer/platform/bindings/script_wrappable.cc b/third_party/blink/renderer/platform/bindings/script_wrappable.cc index 950c3e88..a0b58337 100644 --- a/third_party/blink/renderer/platform/bindings/script_wrappable.cc +++ b/third_party/blink/renderer/platform/bindings/script_wrappable.cc
@@ -39,8 +39,7 @@ wrapper_type_info, wrapper); } -void ScriptWrappable::TraceWrappers( - const ScriptWrappableVisitor* visitor) const { +void ScriptWrappable::TraceWrappers(ScriptWrappableVisitor* visitor) const { visitor->TraceWrappers(main_world_wrapper_); DOMWrapperWorld::TraceWrappers(this, visitor); }
diff --git a/third_party/blink/renderer/platform/bindings/script_wrappable.h b/third_party/blink/renderer/platform/bindings/script_wrappable.h index 7cc10a8..bbb68a53 100644 --- a/third_party/blink/renderer/platform/bindings/script_wrappable.h +++ b/third_party/blink/renderer/platform/bindings/script_wrappable.h
@@ -60,7 +60,7 @@ virtual void Trace(blink::Visitor*) {} // Traces wrapper objects corresponding to this ScriptWrappable in all worlds. - void TraceWrappers(const ScriptWrappableVisitor*) const override; + void TraceWrappers(ScriptWrappableVisitor*) const override; bool IsScriptWrappable() const override { return true; }
diff --git a/third_party/blink/renderer/platform/bindings/script_wrappable_marking_visitor.cc b/third_party/blink/renderer/platform/bindings/script_wrappable_marking_visitor.cc index 2302f77..86888fc3 100644 --- a/third_party/blink/renderer/platform/bindings/script_wrappable_marking_visitor.cc +++ b/third_party/blink/renderer/platform/bindings/script_wrappable_marking_visitor.cc
@@ -209,7 +209,7 @@ } void ScriptWrappableMarkingVisitor::MarkWrapperHeader( - HeapObjectHeader* header) const { + HeapObjectHeader* header) { DCHECK(!header->IsWrapperHeaderMarked()); // Verify that no compactable & movable objects are slated for // lazy unmarking. @@ -243,7 +243,7 @@ } void ScriptWrappableMarkingVisitor::Visit( - const TraceWrapperV8Reference<v8::Value>& traced_wrapper) const { + const TraceWrapperV8Reference<v8::Value>& traced_wrapper) { // The write barrier may try to mark a wrapper because cleanup is still // delayed. Bail out in this case. We also allow unconditional marking which // requires us to bail out here when tracing is not in progress. @@ -253,7 +253,7 @@ } void ScriptWrappableMarkingVisitor::Visit( - const TraceWrapperDescriptor& wrapper_descriptor) const { + const TraceWrapperDescriptor& wrapper_descriptor) { HeapObjectHeader* header = HeapObjectHeader::FromPayload(wrapper_descriptor.base_object_payload); if (header->IsWrapperHeaderMarked()) @@ -271,7 +271,7 @@ void ScriptWrappableMarkingVisitor::Visit( DOMWrapperMap<ScriptWrappable>* wrapper_map, - const ScriptWrappable* key) const { + const ScriptWrappable* key) { wrapper_map->MarkWrapper(const_cast<ScriptWrappable*>(key)); }
diff --git a/third_party/blink/renderer/platform/bindings/script_wrappable_marking_visitor.h b/third_party/blink/renderer/platform/bindings/script_wrappable_marking_visitor.h index 09f09168..4fa38f7 100644 --- a/third_party/blink/renderer/platform/bindings/script_wrappable_marking_visitor.h +++ b/third_party/blink/renderer/platform/bindings/script_wrappable_marking_visitor.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_SCRIPT_WRAPPABLE_MARKING_VISITOR_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_SCRIPT_WRAPPABLE_MARKING_VISITOR_H_ +#include "base/gtest_prod_util.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable_visitor.h" #include "third_party/blink/renderer/platform/heap/heap_page.h" #include "third_party/blink/renderer/platform/heap/threading_traits.h" @@ -99,10 +100,10 @@ protected: // ScriptWrappableVisitor interface. - void Visit(const TraceWrapperV8Reference<v8::Value>&) const override; - void Visit(const TraceWrapperDescriptor&) const override; + void Visit(const TraceWrapperV8Reference<v8::Value>&) override; + void Visit(const TraceWrapperDescriptor&) override; void Visit(DOMWrapperMap<ScriptWrappable>*, - const ScriptWrappable* key) const override; + const ScriptWrappable* key) override; v8::Isolate* isolate() const { return isolate_; } @@ -145,7 +146,7 @@ TraceWrappersCallback trace_wrappers_callback_; }; - void MarkWrapperHeader(HeapObjectHeader*) const; + void MarkWrapperHeader(HeapObjectHeader*); // Schedule an idle task to perform a lazy (incremental) clean up of // wrappers. @@ -157,10 +158,7 @@ // Immediately cleans up all wrappers if necessary. void PerformCleanup(); - WTF::Deque<MarkingDequeItem>* MarkingDeque() const { return &marking_deque_; } - WTF::Vector<HeapObjectHeader*>* HeadersToUnmark() const { - return &headers_to_unmark_; - } + WTF::Deque<MarkingDequeItem>* MarkingDeque() { return &marking_deque_; } bool MarkingDequeContains(void* needle); @@ -187,7 +185,7 @@ // - oilpan object cannot move // - oilpan gc will call invalidateDeadObjectsInMarkingDeque to delete all // obsolete objects - mutable WTF::Deque<MarkingDequeItem> marking_deque_; + WTF::Deque<MarkingDequeItem> marking_deque_; // Collection of objects we started tracing from. We assume it is safe to // hold on to the raw pointers because: @@ -198,14 +196,14 @@ // These objects are used when TraceWrappablesVerifier feature is enabled to // verify that all objects reachable in the atomic pause were marked // incrementally. If not, there is one or multiple write barriers missing. - mutable WTF::Deque<MarkingDequeItem> verifier_deque_; + WTF::Deque<MarkingDequeItem> verifier_deque_; // Collection of headers we need to unmark after the tracing finished. We // assume it is safe to hold on to the headers because: // - oilpan objects cannot move // - objects this headers belong to are invalidated by the oilpan GC in // invalidateDeadObjectsInMarkingDeque. - mutable WTF::Vector<HeapObjectHeader*> headers_to_unmark_; + WTF::Vector<HeapObjectHeader*> headers_to_unmark_; v8::Isolate* isolate_; FRIEND_TEST_ALL_PREFIXES(ScriptWrappableMarkingVisitorTest, MixinTracing);
diff --git a/third_party/blink/renderer/platform/bindings/script_wrappable_visitor.cc b/third_party/blink/renderer/platform/bindings/script_wrappable_visitor.cc index 93fd619..af91f84 100644 --- a/third_party/blink/renderer/platform/bindings/script_wrappable_visitor.cc +++ b/third_party/blink/renderer/platform/bindings/script_wrappable_visitor.cc
@@ -12,17 +12,17 @@ void ScriptWrappableVisitor::TraceWrappers( DOMWrapperMap<ScriptWrappable>* wrapper_map, - const ScriptWrappable* key) const { + const ScriptWrappable* key) { Visit(wrapper_map, key); } void ScriptWrappableVisitor::DispatchTraceWrappers( - const TraceWrapperBase* wrapper_base) const { + TraceWrapperBase* wrapper_base) { wrapper_base->TraceWrappers(this); } void ScriptWrappableVisitor::DispatchTraceWrappersForSupplement( - const TraceWrapperBaseForSupplement* wrapper_base) const { + TraceWrapperBaseForSupplement* wrapper_base) { wrapper_base->TraceWrappers(this); } } // namespace blink
diff --git a/third_party/blink/renderer/platform/bindings/script_wrappable_visitor.h b/third_party/blink/renderer/platform/bindings/script_wrappable_visitor.h index 28063c8..d6545b43 100644 --- a/third_party/blink/renderer/platform/bindings/script_wrappable_visitor.h +++ b/third_party/blink/renderer/platform/bindings/script_wrappable_visitor.h
@@ -62,7 +62,7 @@ // for some reason (e.g., unions using raw pointers), see // |TraceWrappersWithManualWriteBarrier()| below. template <typename T> - void TraceWrappers(const TraceWrapperMember<T>& traceable) const { + void TraceWrappers(const TraceWrapperMember<T>& traceable) { static_assert(sizeof(T), "T must be fully defined"); Visit(traceable.Get()); } @@ -70,14 +70,14 @@ // Enable partial tracing of objects. This is used when tracing interior // objects without their own header. template <typename T> - void TraceWrappers(const T& traceable) const { + void TraceWrappers(const T& traceable) { static_assert(sizeof(T), "T must be fully defined"); traceable.TraceWrappers(this); } // Only called from automatically generated bindings code. template <typename T> - void TraceWrappersFromGeneratedCode(const T* traceable) const { + void TraceWrappersFromGeneratedCode(const T* traceable) { Visit(traceable); } @@ -87,23 +87,23 @@ // assignments to the field. Otherwise, the objects may be collected // prematurely. template <typename T> - void TraceWrappersWithManualWriteBarrier(const T* traceable) const { + void TraceWrappersWithManualWriteBarrier(const T* traceable) { Visit(traceable); } template <typename V8Type> - void TraceWrappers(const TraceWrapperV8Reference<V8Type>& v8reference) const { + void TraceWrappers(const TraceWrapperV8Reference<V8Type>& v8reference) { Visit(v8reference.template Cast<v8::Value>()); } // Trace wrappers in non-main worlds. void TraceWrappers(DOMWrapperMap<ScriptWrappable>*, - const ScriptWrappable* key) const; + const ScriptWrappable* key); - virtual void DispatchTraceWrappers(const TraceWrapperBase*) const; + virtual void DispatchTraceWrappers(TraceWrapperBase*); template <typename T> - void DispatchTraceWrappers(const Supplement<T>* traceable) const { - const TraceWrapperBaseForSupplement* base = traceable; + void DispatchTraceWrappers(Supplement<T>* traceable) { + TraceWrapperBaseForSupplement* base = traceable; DispatchTraceWrappersForSupplement(base); } // Catch all handlers needed because of mixins except for Supplement<T>. @@ -112,10 +112,10 @@ protected: // The visitor interface. Derived visitors should override this // function to visit V8 references and ScriptWrappables. - virtual void Visit(const TraceWrapperV8Reference<v8::Value>&) const = 0; - virtual void Visit(const TraceWrapperDescriptor&) const = 0; + virtual void Visit(const TraceWrapperV8Reference<v8::Value>&) = 0; + virtual void Visit(const TraceWrapperDescriptor&) = 0; virtual void Visit(DOMWrapperMap<ScriptWrappable>*, - const ScriptWrappable* key) const = 0; + const ScriptWrappable* key) = 0; template <typename T> static TraceWrapperDescriptor WrapperDescriptorFor(const T* traceable) { @@ -134,7 +134,7 @@ // Helper method to invoke the virtual Visit method with wrapper descriptor. template <typename T> - void Visit(const T* traceable) const { + void Visit(const T* traceable) { static_assert(sizeof(T), "T must be fully defined"); if (!traceable) return; @@ -144,8 +144,7 @@ // Supplement-specific implementation of DispatchTraceWrappers. The suffix of // "ForSupplement" is necessary not to make this member function a candidate // of overload resolutions. - void DispatchTraceWrappersForSupplement( - const TraceWrapperBaseForSupplement*) const; + void DispatchTraceWrappersForSupplement(TraceWrapperBaseForSupplement*); }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/bindings/script_wrappable_visitor_verifier.h b/third_party/blink/renderer/platform/bindings/script_wrappable_visitor_verifier.h index 4bd05ff..ab847dd 100644 --- a/third_party/blink/renderer/platform/bindings/script_wrappable_visitor_verifier.h +++ b/third_party/blink/renderer/platform/bindings/script_wrappable_visitor_verifier.h
@@ -14,8 +14,8 @@ // is also marked. class ScriptWrappableVisitorVerifier final : public ScriptWrappableVisitor { protected: - void Visit(const TraceWrapperV8Reference<v8::Value>&) const final {} - void Visit(const TraceWrapperDescriptor& descriptor) const final { + void Visit(const TraceWrapperV8Reference<v8::Value>&) final {} + void Visit(const TraceWrapperDescriptor& descriptor) final { if (!HeapObjectHeader::FromPayload(descriptor.base_object_payload) ->IsWrapperHeaderMarked()) { // If this branch is hit, it means that a white (not discovered by @@ -33,7 +33,7 @@ } } void Visit(DOMWrapperMap<ScriptWrappable>*, - const ScriptWrappable* key) const final {} + const ScriptWrappable* key) final {} }; } #endif
diff --git a/third_party/blink/renderer/platform/bindings/trace_wrapper_base.h b/third_party/blink/renderer/platform/bindings/trace_wrapper_base.h index 1b36e449..e35a12d 100644 --- a/third_party/blink/renderer/platform/bindings/trace_wrapper_base.h +++ b/third_party/blink/renderer/platform/bindings/trace_wrapper_base.h
@@ -20,7 +20,7 @@ ~TraceWrapperBase() = default; virtual bool IsScriptWrappable() const { return false; } - virtual void TraceWrappers(const ScriptWrappableVisitor*) const = 0; + virtual void TraceWrappers(ScriptWrappableVisitor*) const = 0; // Human-readable name of this object. The DevTools heap snapshot uses // this method to show the object.
diff --git a/third_party/blink/renderer/platform/bindings/trace_wrapper_v8_string.h b/third_party/blink/renderer/platform/bindings/trace_wrapper_v8_string.h index 1f637e3..557870a 100644 --- a/third_party/blink/renderer/platform/bindings/trace_wrapper_v8_string.h +++ b/third_party/blink/renderer/platform/bindings/trace_wrapper_v8_string.h
@@ -32,7 +32,7 @@ void Concat(v8::Isolate*, const String&); String Flatten(v8::Isolate*) const; - void TraceWrappers(const ScriptWrappableVisitor* visitor) const override { + void TraceWrappers(ScriptWrappableVisitor* visitor) const override { visitor->TraceWrappers(string_); } const char* NameInHeapSnapshot() const override {
diff --git a/third_party/blink/renderer/platform/exported/web_video_frame_submitter.cc b/third_party/blink/renderer/platform/exported/web_video_frame_submitter.cc index 3851408..16aa7806 100644 --- a/third_party/blink/renderer/platform/exported/web_video_frame_submitter.cc +++ b/third_party/blink/renderer/platform/exported/web_video_frame_submitter.cc
@@ -26,12 +26,10 @@ std::unique_ptr<WebVideoFrameSubmitter> WebVideoFrameSubmitter::Create( WebContextProviderCallback context_provider_callback, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, const cc::LayerTreeSettings& settings) { return std::make_unique<VideoFrameSubmitter>( std::make_unique<VideoFrameResourceProvider>( - std::move(context_provider_callback), gpu_memory_buffer_manager, - settings)); + std::move(context_provider_callback), settings)); } } // namespace blink
diff --git a/third_party/blink/renderer/platform/feature_policy/feature_policy.cc b/third_party/blink/renderer/platform/feature_policy/feature_policy.cc index 7fe35d76..b96ed0e 100644 --- a/third_party/blink/renderer/platform/feature_policy/feature_policy.cc +++ b/third_party/blink/renderer/platform/feature_policy/feature_policy.cc
@@ -151,9 +151,8 @@ case mojom::FeaturePolicyFeature::kSyncXHR: return true; case mojom::FeaturePolicyFeature::kUnsizedMedia: - return RuntimeEnabledFeatures::FeaturePolicyExperimentalFeaturesEnabled(); case mojom::FeaturePolicyFeature::kVerticalScroll: - return RuntimeEnabledFeatures::FeaturePolicyExperimentalFeaturesEnabled(); + return RuntimeEnabledFeatures::ExperimentalProductivityFeaturesEnabled(); default: return false; } @@ -195,6 +194,14 @@ default_feature_name_map.Set( "picture-in-picture", mojom::FeaturePolicyFeature::kPictureInPicture); } + if (RuntimeEnabledFeatures::ExperimentalProductivityFeaturesEnabled()) { + default_feature_name_map.Set("sync-script", + mojom::FeaturePolicyFeature::kSyncScript); + default_feature_name_map.Set("unsized-media", + mojom::FeaturePolicyFeature::kUnsizedMedia); + default_feature_name_map.Set( + "vertical-scroll", mojom::FeaturePolicyFeature::kVerticalScroll); + } if (RuntimeEnabledFeatures::FeaturePolicyExperimentalFeaturesEnabled()) { default_feature_name_map.Set( "cookie", mojom::FeaturePolicyFeature::kDocumentCookie); @@ -202,12 +209,6 @@ "domain", mojom::FeaturePolicyFeature::kDocumentDomain); default_feature_name_map.Set("docwrite", mojom::FeaturePolicyFeature::kDocumentWrite); - default_feature_name_map.Set("sync-script", - mojom::FeaturePolicyFeature::kSyncScript); - default_feature_name_map.Set("unsized-media", - mojom::FeaturePolicyFeature::kUnsizedMedia); - default_feature_name_map.Set( - "vertical-scroll", mojom::FeaturePolicyFeature::kVerticalScroll); } if (RuntimeEnabledFeatures::FeaturePolicyAutoplayFeatureEnabled()) { default_feature_name_map.Set("autoplay",
diff --git a/third_party/blink/renderer/platform/graphics/crossfade_generated_image.cc b/third_party/blink/renderer/platform/graphics/crossfade_generated_image.cc index 59dc7d42..2f481cb 100644 --- a/third_party/blink/renderer/platform/graphics/crossfade_generated_image.cc +++ b/third_party/blink/renderer/platform/graphics/crossfade_generated_image.cc
@@ -61,8 +61,7 @@ PaintFlags image_flags(flags); image_flags.setBlendMode(SkBlendMode::kSrcOver); - int image_alpha = ClampedAlphaForBlending(1 - percentage_); - image_flags.setAlpha(image_alpha > 255 ? 255 : image_alpha); + image_flags.setColor(ScaleAlpha(flags.getColor(), 1 - percentage_)); image_flags.setAntiAlias(flags.isAntiAlias()); // TODO(junov): This code should probably be propagating the // RespectImageOrientationEnum from CrossfadeGeneratedImage::draw(). Code was @@ -71,8 +70,7 @@ from_image_->Draw(canvas, image_flags, dest_rect, from_image_rect, kDoNotRespectImageOrientation, clamp_mode, decode_mode); image_flags.setBlendMode(SkBlendMode::kPlus); - image_alpha = ClampedAlphaForBlending(percentage_); - image_flags.setAlpha(image_alpha > 255 ? 255 : image_alpha); + image_flags.setColor(ScaleAlpha(flags.getColor(), percentage_)); to_image_->Draw(canvas, image_flags, dest_rect, to_image_rect, kDoNotRespectImageOrientation, clamp_mode, decode_mode); }
diff --git a/third_party/blink/renderer/platform/graphics/skia/skia_utils.cc b/third_party/blink/renderer/platform/graphics/skia/skia_utils.cc index 8d412e3..9bdc50f 100644 --- a/third_party/blink/renderer/platform/graphics/skia/skia_utils.cc +++ b/third_party/blink/renderer/platform/graphics/skia/skia_utils.cc
@@ -35,6 +35,9 @@ #include "third_party/blink/renderer/platform/graphics/paint/paint_flags.h" #include "third_party/skia/include/effects/SkCornerPathEffect.h" +#include <algorithm> +#include <cmath> + namespace blink { static const struct CompositOpToXfermodeMode { @@ -295,22 +298,11 @@ return kInterpolationDefault; } -int ClampedAlphaForBlending(float alpha) { - if (alpha < 0) - return 0; - int rounded_alpha = roundf(alpha * 256); - if (rounded_alpha > 256) - rounded_alpha = 256; - return rounded_alpha; -} - SkColor ScaleAlpha(SkColor color, float alpha) { - return ScaleAlpha(color, ClampedAlphaForBlending(alpha)); -} + const auto clamped_alpha = std::max(0.0f, std::min(1.0f, alpha)); + const auto rounded_alpha = std::lround(SkColorGetA(color) * clamped_alpha); -SkColor ScaleAlpha(SkColor color, int alpha) { - int a = (SkColorGetA(color) * alpha) >> 8; - return (color & 0x00FFFFFF) | (a << 24); + return SkColorSetA(color, rounded_alpha); } template <typename PrimitiveType>
diff --git a/third_party/blink/renderer/platform/graphics/skia/skia_utils.h b/third_party/blink/renderer/platform/graphics/skia/skia_utils.h index 9da9dd9..07a07a93 100644 --- a/third_party/blink/renderer/platform/graphics/skia/skia_utils.h +++ b/third_party/blink/renderer/platform/graphics/skia/skia_utils.h
@@ -66,17 +66,10 @@ CompositeOperator PLATFORM_EXPORT CompositeOperatorFromSkia(SkBlendMode); WebBlendMode PLATFORM_EXPORT BlendModeFromSkia(SkBlendMode); -// Map alpha values from [0, 1] to [0, 256] for alpha blending. -int PLATFORM_EXPORT ClampedAlphaForBlending(float); - // Multiply a color's alpha channel by an additional alpha factor where // alpha is in the range [0, 1]. SkColor PLATFORM_EXPORT ScaleAlpha(SkColor, float); -// Multiply a color's alpha channel by an additional alpha factor where -// alpha is in the range [0, 256]. -SkColor PLATFORM_EXPORT ScaleAlpha(SkColor, int); - // Skia has problems when passed infinite, etc floats, filter them to 0. inline SkScalar WebCoreFloatToSkScalar(float f) { return SkFloatToScalar(std::isfinite(f) ? f : 0);
diff --git a/third_party/blink/renderer/platform/graphics/video_frame_resource_provider.cc b/third_party/blink/renderer/platform/graphics/video_frame_resource_provider.cc index fb37b4d..28de8768 100644 --- a/third_party/blink/renderer/platform/graphics/video_frame_resource_provider.cc +++ b/third_party/blink/renderer/platform/graphics/video_frame_resource_provider.cc
@@ -16,18 +16,12 @@ #include "components/viz/common/quads/yuv_video_draw_quad.h" #include "media/base/video_frame.h" -namespace cc { -class VideoFrameExternalResources; -} // namespace cc - namespace blink { VideoFrameResourceProvider::VideoFrameResourceProvider( WebContextProviderCallback context_provider_callback, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, const cc::LayerTreeSettings& settings) : context_provider_callback_(std::move(context_provider_callback)), - gpu_memory_buffer_manager_(gpu_memory_buffer_manager), settings_(settings), weak_ptr_factory_(this) {} @@ -51,8 +45,7 @@ context_provider_ = media_context_provider; resource_provider_ = std::make_unique<cc::LayerTreeResourceProvider>( - media_context_provider, gpu_memory_buffer_manager_, true, - settings_.resource_settings); + media_context_provider, true, settings_.resource_settings); // TODO(kylechar): VideoResourceUpdater needs something it can notify about // SharedBitmaps that isn't a LayerTreeFrameSink. https://crbug.com/730660#c88
diff --git a/third_party/blink/renderer/platform/graphics/video_frame_resource_provider.h b/third_party/blink/renderer/platform/graphics/video_frame_resource_provider.h index c05fe02..30fa1515 100644 --- a/third_party/blink/renderer/platform/graphics/video_frame_resource_provider.h +++ b/third_party/blink/renderer/platform/graphics/video_frame_resource_provider.h
@@ -13,10 +13,6 @@ #include "third_party/blink/public/platform/web_video_frame_submitter.h" #include "third_party/blink/renderer/platform/platform_export.h" -namespace gpu { -class GpuMemoryBufferManager; -} - namespace viz { class RenderPass; } @@ -31,7 +27,6 @@ class PLATFORM_EXPORT VideoFrameResourceProvider { public: explicit VideoFrameResourceProvider(WebContextProviderCallback, - gpu::GpuMemoryBufferManager*, const cc::LayerTreeSettings&); virtual ~VideoFrameResourceProvider(); @@ -51,7 +46,6 @@ private: WebContextProviderCallback context_provider_callback_; - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; cc::LayerTreeSettings settings_; std::unique_ptr<cc::VideoResourceUpdater> resource_updater_; std::unique_ptr<cc::LayerTreeResourceProvider> resource_provider_;
diff --git a/third_party/blink/renderer/platform/graphics/video_frame_submitter_test.cc b/third_party/blink/renderer/platform/graphics/video_frame_submitter_test.cc index b30ac277..72c183e 100644 --- a/third_party/blink/renderer/platform/graphics/video_frame_submitter_test.cc +++ b/third_party/blink/renderer/platform/graphics/video_frame_submitter_test.cc
@@ -95,7 +95,6 @@ : blink::VideoFrameResourceProvider( base::BindRepeating( [](base::OnceCallback<void(viz::ContextProvider*)>) {}), - nullptr, cc::LayerTreeSettings()) { blink::VideoFrameResourceProvider::Initialize(context_provider); }
diff --git a/third_party/blink/renderer/platform/loader/cors/cors.cc b/third_party/blink/renderer/platform/loader/cors/cors.cc index ae07e93e..ff219bda 100644 --- a/third_party/blink/renderer/platform/loader/cors/cors.cc +++ b/third_party/blink/renderer/platform/loader/cors/cors.cc
@@ -85,6 +85,23 @@ !privilege->block_local_access_from_local_origin_); } +base::Optional<network::mojom::CORSError> CheckPreflightAccess( + const KURL& response_url, + const int response_status_code, + const HTTPHeaderMap& response_header, + network::mojom::FetchCredentialsMode actual_credentials_mode, + const SecurityOrigin& origin) { + std::unique_ptr<SecurityOrigin::PrivilegeData> privilege = + origin.CreatePrivilegeData(); + return network::cors::CheckPreflightAccess( + response_url, response_status_code, + GetHeaderValue(response_header, HTTPNames::Access_Control_Allow_Origin), + GetHeaderValue(response_header, + HTTPNames::Access_Control_Allow_Credentials), + actual_credentials_mode, origin.ToUrlOrigin(), + !privilege->block_local_access_from_local_origin_); +} + base::Optional<network::mojom::CORSError> CheckRedirectLocation( const KURL& url) { static const bool run_blink_side_scheme_check =
diff --git a/third_party/blink/renderer/platform/loader/cors/cors.h b/third_party/blink/renderer/platform/loader/cors/cors.h index f5266a1..e50bd9d 100644 --- a/third_party/blink/renderer/platform/loader/cors/cors.h +++ b/third_party/blink/renderer/platform/loader/cors/cors.h
@@ -30,6 +30,13 @@ network::mojom::FetchCredentialsMode, const SecurityOrigin&); +PLATFORM_EXPORT base::Optional<network::mojom::CORSError> CheckPreflightAccess( + const KURL&, + const int response_status_code, + const HTTPHeaderMap&, + network::mojom::FetchCredentialsMode, + const SecurityOrigin&); + PLATFORM_EXPORT base::Optional<network::mojom::CORSError> CheckRedirectLocation( const KURL&);
diff --git a/third_party/blink/renderer/platform/loader/cors/cors_error_string.cc b/third_party/blink/renderer/platform/loader/cors/cors_error_string.cc index e0d653ff..2ad0718f 100644 --- a/third_party/blink/renderer/platform/loader/cors/cors_error_string.cc +++ b/third_party/blink/renderer/platform/loader/cors/cors_error_string.cc
@@ -84,7 +84,13 @@ case network::mojom::CORSError::kMultipleAllowOriginValues: case network::mojom::CORSError::kInvalidAllowOriginValue: case network::mojom::CORSError::kAllowOriginMismatch: - case network::mojom::CORSError::kDisallowCredentialsNotSetToTrue: + case network::mojom::CORSError::kInvalidAllowCredentials: + case network::mojom::CORSError::kPreflightWildcardOriginNotAllowed: + case network::mojom::CORSError::kPreflightMissingAllowOriginHeader: + case network::mojom::CORSError::kPreflightMultipleAllowOriginValues: + case network::mojom::CORSError::kPreflightInvalidAllowOriginValue: + case network::mojom::CORSError::kPreflightAllowOriginMismatch: + case network::mojom::CORSError::kPreflightInvalidAllowCredentials: return ErrorParameter(error, request_url, redirect_url, response_status_code, response_header_map, origin, context, String(), false); @@ -182,6 +188,8 @@ " Have the server send the header with a valid value, or, if an opaque " "response serves your needs, set the request's mode to 'no-cors' to " "fetch the resource with CORS disabled."; + static const char kPreflightInformation[] = + "Response to preflight request doesn't pass access control check: "; if (param.unknown) return String::Format("CORS error, code %d", static_cast<int>(param.error)); @@ -205,21 +213,31 @@ "%sInvalid response. Origin '%s' is therefore not allowed access.", redirect_denied.Utf8().data(), param.origin.ToString().Utf8().data()); case network::mojom::CORSError::kWildcardOriginNotAllowed: + case network::mojom::CORSError::kPreflightWildcardOriginNotAllowed: return String::Format( - "%sThe value of the 'Access-Control-Allow-Origin' header in the " + "%s%sThe value of the 'Access-Control-Allow-Origin' header in the " "response must not be the wildcard '*' when the request's " "credentials mode is 'include'. Origin '%s' is therefore not allowed " "access.%s", + param.error == + network::mojom::CORSError::kPreflightWildcardOriginNotAllowed + ? kPreflightInformation + : "", redirect_denied.Utf8().data(), param.origin.ToString().Utf8().data(), param.context == WebURLRequest::kRequestContextXMLHttpRequest ? " The credentials mode of requests initiated by the " "XMLHttpRequest is controlled by the withCredentials attribute." : ""); case network::mojom::CORSError::kMissingAllowOriginHeader: + case network::mojom::CORSError::kPreflightMissingAllowOriginHeader: return String::Format( - "%sNo 'Access-Control-Allow-Origin' header is present on the " + "%s%sNo 'Access-Control-Allow-Origin' header is present on the " "requested resource. Origin '%s' is therefore not allowed access." "%s%s", + param.error == + network::mojom::CORSError::kPreflightMissingAllowOriginHeader + ? kPreflightInformation + : "", redirect_denied.Utf8().data(), param.origin.ToString().Utf8().data(), IsInterestingStatusCode(param.status_code) ? String::Format(" The response had HTTP status code %d.", @@ -232,10 +250,15 @@ "mode to 'no-cors' to fetch the resource with CORS disabled." : ""); case network::mojom::CORSError::kMultipleAllowOriginValues: + case network::mojom::CORSError::kPreflightMultipleAllowOriginValues: return String::Format( - "%sThe 'Access-Control-Allow-Origin' header contains multiple values " - "'%s', but only one is allowed. Origin '%s' is therefore not allowed " - "access.%s", + "%s%sThe 'Access-Control-Allow-Origin' header contains multiple " + "values '%s', but only one is allowed. Origin '%s' is therefore not " + "allowed access.%s", + param.error == + network::mojom::CORSError::kPreflightMultipleAllowOriginValues + ? kPreflightInformation + : "", redirect_denied.Utf8().data(), param.header_map.Get(HTTPNames::Access_Control_Allow_Origin) .Utf8() @@ -245,9 +268,14 @@ ? kNoCorsInformation : ""); case network::mojom::CORSError::kInvalidAllowOriginValue: + case network::mojom::CORSError::kPreflightInvalidAllowOriginValue: return String::Format( - "%sThe 'Access-Control-Allow-Origin' header contains the invalid " + "%s%sThe 'Access-Control-Allow-Origin' header contains the invalid " "value '%s'. Origin '%s' is therefore not allowed access.%s", + param.error == + network::mojom::CORSError::kPreflightInvalidAllowOriginValue + ? kPreflightInformation + : "", redirect_denied.Utf8().data(), param.header_map.Get(HTTPNames::Access_Control_Allow_Origin) .Utf8() @@ -257,10 +285,15 @@ ? kNoCorsInformation : ""); case network::mojom::CORSError::kAllowOriginMismatch: + case network::mojom::CORSError::kPreflightAllowOriginMismatch: return String::Format( - "%sThe 'Access-Control-Allow-Origin' header has a value '%s' that is " - "not equal to the supplied origin. Origin '%s' is therefore not " + "%s%sThe 'Access-Control-Allow-Origin' header has a value '%s' that " + "is not equal to the supplied origin. Origin '%s' is therefore not " "allowed access.%s", + param.error == + network::mojom::CORSError::kPreflightAllowOriginMismatch + ? kPreflightInformation + : "", redirect_denied.Utf8().data(), param.header_map.Get(HTTPNames::Access_Control_Allow_Origin) .Utf8() @@ -269,12 +302,17 @@ param.context == WebURLRequest::kRequestContextFetch ? kNoCorsInformation : ""); - case network::mojom::CORSError::kDisallowCredentialsNotSetToTrue: + case network::mojom::CORSError::kInvalidAllowCredentials: + case network::mojom::CORSError::kPreflightInvalidAllowCredentials: return String::Format( - "%sThe value of the 'Access-Control-Allow-Credentials' header in " + "%s%sThe value of the 'Access-Control-Allow-Credentials' header in " "the response is '%s' which must be 'true' when the request's " "credentials mode is 'include'. Origin '%s' is therefore not allowed " "access.%s", + param.error == + network::mojom::CORSError::kPreflightInvalidAllowCredentials + ? kPreflightInformation + : "", redirect_denied.Utf8().data(), param.header_map.Get(HTTPNames::Access_Control_Allow_Credentials) .Utf8() @@ -286,9 +324,7 @@ "attribute." : "")); case network::mojom::CORSError::kPreflightInvalidStatus: - return String::Format( - "Response for preflight has invalid HTTP status code %d.", - param.status_code); + return String("Response for preflight does not have HTTP ok status."); case network::mojom::CORSError::kPreflightMissingAllowExternal: return String( "No 'Access-Control-Allow-External' header was present in the "
diff --git a/third_party/blink/renderer/platform/mojo/DEPS b/third_party/blink/renderer/platform/mojo/DEPS index 1956952..294890d 100644 --- a/third_party/blink/renderer/platform/mojo/DEPS +++ b/third_party/blink/renderer/platform/mojo/DEPS
@@ -11,8 +11,6 @@ "+base/message_loop/message_loop_current.h", "+base/observer_list.h", "+base/strings/string16.h", - "+mojo/common/big_string.mojom-blink.h", - "+mojo/common/test_common_custom_types.mojom-blink.h", "+mojo/public/cpp/base/time_mojom_traits.h", "+mojo/public/cpp/bindings/binding.h", "+mojo/public/mojom/base/string16.mojom-blink.h",
diff --git a/third_party/blink/renderer/platform/mojo/big_string_mojom_traits_test.cc b/third_party/blink/renderer/platform/mojo/big_string_mojom_traits_test.cc index 4253e2fd..6548da7 100644 --- a/third_party/blink/renderer/platform/mojo/big_string_mojom_traits_test.cc +++ b/third_party/blink/renderer/platform/mojo/big_string_mojom_traits_test.cc
@@ -3,7 +3,6 @@ // found in the LICENSE file. #include "base/rand_util.h" -#include "mojo/common/test_common_custom_types.mojom-blink.h" #include "mojo/public/cpp/base/big_buffer_mojom_traits.h" #include "mojo/public/cpp/test_support/test_utils.h" #include "mojo/public/mojom/base/big_string.mojom-blink.h"
diff --git a/third_party/blink/renderer/platform/mojo/blink_typemaps.gni b/third_party/blink/renderer/platform/mojo/blink_typemaps.gni index b69eb6f9..1bf7644 100644 --- a/third_party/blink/renderer/platform/mojo/blink_typemaps.gni +++ b/third_party/blink/renderer/platform/mojo/blink_typemaps.gni
@@ -5,7 +5,6 @@ typemaps = [ "//mojo/public/cpp/base/file_info.typemap", "//mojo/public/cpp/base/file_path.typemap", - "//mojo/common/values.typemap", "//third_party/blink/renderer/core/messaging/blink_cloneable_message.typemap", "//third_party/blink/renderer/core/messaging/blink_transferable_message.typemap", "//third_party/blink/renderer/platform/blob/serialized_blob.typemap",
diff --git a/third_party/blink/renderer/platform/mojo/string16_mojom_traits_test.cc b/third_party/blink/renderer/platform/mojo/string16_mojom_traits_test.cc index 8aa308d..8018f6c 100644 --- a/third_party/blink/renderer/platform/mojo/string16_mojom_traits_test.cc +++ b/third_party/blink/renderer/platform/mojo/string16_mojom_traits_test.cc
@@ -7,7 +7,6 @@ #include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/rand_util.h" -#include "mojo/common/test_common_custom_types.mojom-blink.h" #include "mojo/public/cpp/base/big_buffer_mojom_traits.h" #include "mojo/public/cpp/bindings/binding_set.h" #include "mojo/public/cpp/test_support/test_utils.h"
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index f8871905..64c7d76 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -425,6 +425,14 @@ origin_trial_feature_name: "ExperimentalHardwareEchoCancellation", status: "experimental", }, + // Enables a set of features intended to help improve web developer + // productivity, by restricting the use of potentially problematic web- + // platform behaviors, as well as adding new high-level APIs for common + // development patterns. + { + name: "ExperimentalProductivityFeatures", + status: "experimental" + }, { name: "ExperimentalV8Extras", status: "experimental",
diff --git a/third_party/blink/renderer/platform/scheduler/base/lazy_now.cc b/third_party/blink/renderer/platform/scheduler/base/lazy_now.cc index 4ac96989..a4cfded 100644 --- a/third_party/blink/renderer/platform/scheduler/base/lazy_now.cc +++ b/third_party/blink/renderer/platform/scheduler/base/lazy_now.cc
@@ -8,10 +8,30 @@ namespace blink { namespace scheduler { + +LazyNow::LazyNow(base::TimeTicks now) : tick_clock_(nullptr), now_(now) { + DCHECK(!now.is_null()); +} + +LazyNow::LazyNow(const base::TickClock* tick_clock) + : tick_clock_(tick_clock), now_() { + DCHECK(tick_clock); +} + +LazyNow::LazyNow(LazyNow&& move_from) + : tick_clock_(move_from.tick_clock_), now_(move_from.now_) { + move_from.tick_clock_ = nullptr; + move_from.now_ = base::TimeTicks(); +} + base::TimeTicks LazyNow::Now() { - if (!now_) + // TickClock might return null values only in tests, we're okay with + // extra calls which might occur in that case. + if (now_.is_null()) { + DCHECK(tick_clock_); // It can fire only on use after std::move. now_ = tick_clock_->NowTicks(); - return now_.value(); + } + return now_; } } // namespace scheduler
diff --git a/third_party/blink/renderer/platform/scheduler/base/lazy_now.h b/third_party/blink/renderer/platform/scheduler/base/lazy_now.h index c841f20..b8e3052 100644 --- a/third_party/blink/renderer/platform/scheduler/base/lazy_now.h +++ b/third_party/blink/renderer/platform/scheduler/base/lazy_now.h
@@ -17,21 +17,23 @@ namespace scheduler { // Now() is somewhat expensive so it makes sense not to call Now() unless we -// really need to. +// really need to and to avoid subsequent calls if already called once. +// LazyNow objects are expected to be short-living to represent accurate time. class PLATFORM_EXPORT LazyNow { public: - explicit LazyNow(base::TimeTicks now) : tick_clock_(nullptr), now_(now) { - } + explicit LazyNow(base::TimeTicks now); + explicit LazyNow(const base::TickClock* tick_clock); - explicit LazyNow(const base::TickClock* tick_clock) - : tick_clock_(tick_clock) {} + LazyNow(LazyNow&& move_from); // Result will not be updated on any subsesequent calls. base::TimeTicks Now(); private: - const base::TickClock* tick_clock_; // NOT OWNED - base::Optional<base::TimeTicks> now_; + const base::TickClock* tick_clock_; // Not owned. + base::TimeTicks now_; + + DISALLOW_COPY_AND_ASSIGN(LazyNow); }; } // namespace scheduler
diff --git a/third_party/blink/renderer/platform/scheduler/base/task_queue.cc b/third_party/blink/renderer/platform/scheduler/base/task_queue.cc index d1dd378..d8733dd1 100644 --- a/third_party/blink/renderer/platform/scheduler/base/task_queue.cc +++ b/third_party/blink/renderer/platform/scheduler/base/task_queue.cc
@@ -5,6 +5,7 @@ #include "third_party/blink/renderer/platform/scheduler/base/task_queue.h" #include "base/bind_helpers.h" +#include "base/optional.h" #include "third_party/blink/renderer/platform/scheduler/base/task_queue_impl.h" #include "third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl.h" @@ -49,6 +50,15 @@ nestable(nestable), task_type(task_type) {} +TaskQueue::PostedTask::PostedTask(PostedTask&& move_from) + : callback(std::move(move_from.callback)), + posted_from(move_from.posted_from), + delay(move_from.delay), + nestable(move_from.nestable), + task_type(move_from.task_type) {} + +TaskQueue::PostedTask::~PostedTask() = default; + void TaskQueue::ShutdownTaskQueue() { DCHECK_CALLED_ON_VALID_THREAD(main_thread_checker_); base::AutoLock lock(impl_lock_); @@ -73,40 +83,30 @@ bool TaskQueue::PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { - internal::TaskQueueImpl::PostTaskResult result; - { - auto lock = AcquireImplReadLockIfNeeded(); - if (!impl_) - return false; - result = impl_->PostDelayedTask(PostedTask( - std::move(task), from_here, delay, base::Nestable::kNestable)); - } - return result.success; + return PostTaskWithMetadata( + PostedTask(std::move(task), from_here, delay, base::Nestable::kNestable)); } bool TaskQueue::PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { - internal::TaskQueueImpl::PostTaskResult result; - { - auto lock = AcquireImplReadLockIfNeeded(); - if (!impl_) - return false; - result = impl_->PostDelayedTask(PostedTask( - std::move(task), from_here, delay, base::Nestable::kNonNestable)); - } - return result.success; + return PostTaskWithMetadata(PostedTask(std::move(task), from_here, delay, + base::Nestable::kNonNestable)); } bool TaskQueue::PostTaskWithMetadata(PostedTask task) { - internal::TaskQueueImpl::PostTaskResult result; - { - auto lock = AcquireImplReadLockIfNeeded(); - if (!impl_) - return false; - result = impl_->PostDelayedTask(std::move(task)); - } - return result.success; + base::Optional<MoveableAutoLock> lock = AcquireImplReadLockIfNeeded(); + if (!impl_) + return false; + internal::TaskQueueImpl::PostTaskResult result( + impl_->PostDelayedTask(std::move(task))); + if (result.success) + return true; + // If posting task was unsuccessful then |result| will contain + // the original task which should be destructed outside of the lock. + lock = base::nullopt; + // Task gets implicitly destructed here. + return false; } std::unique_ptr<TaskQueue::QueueEnabledVoter>
diff --git a/third_party/blink/renderer/platform/scheduler/base/task_queue.h b/third_party/blink/renderer/platform/scheduler/base/task_queue.h index 031204f..47e7042 100644 --- a/third_party/blink/renderer/platform/scheduler/base/task_queue.h +++ b/third_party/blink/renderer/platform/scheduler/base/task_queue.h
@@ -62,6 +62,9 @@ base::TimeDelta delay = base::TimeDelta(), base::Nestable nestable = base::Nestable::kNestable, int task_type = 0); + PostedTask(PostedTask&& move_from); + PostedTask(const PostedTask& copy_from) = delete; + ~PostedTask(); base::OnceClosure callback; base::Location posted_from;
diff --git a/third_party/blink/renderer/platform/scheduler/base/task_queue_impl.cc b/third_party/blink/renderer/platform/scheduler/base/task_queue_impl.cc index 4db2d0a..a0e553d 100644 --- a/third_party/blink/renderer/platform/scheduler/base/task_queue_impl.cc +++ b/third_party/blink/renderer/platform/scheduler/base/task_queue_impl.cc
@@ -66,12 +66,17 @@ } TaskQueueImpl::PostTaskResult::PostTaskResult() - : task(base::OnceClosure(), base::Location()) {} + : success(false), task(base::OnceClosure(), base::Location()) {} TaskQueueImpl::PostTaskResult::PostTaskResult(bool success, TaskQueue::PostedTask task) : success(success), task(std::move(task)) {} +TaskQueueImpl::PostTaskResult::PostTaskResult(PostTaskResult&& move_from) + : success(move_from.success), task(std::move(move_from.task)) {} + +TaskQueueImpl::PostTaskResult::~PostTaskResult() = default; + TaskQueueImpl::PostTaskResult TaskQueueImpl::PostTaskResult::Success() { return PostTaskResult( true, TaskQueue::PostedTask(base::OnceClosure(), base::Location()));
diff --git a/third_party/blink/renderer/platform/scheduler/base/task_queue_impl.h b/third_party/blink/renderer/platform/scheduler/base/task_queue_impl.h index 9bb3da6a..e55d3c2 100644 --- a/third_party/blink/renderer/platform/scheduler/base/task_queue_impl.h +++ b/third_party/blink/renderer/platform/scheduler/base/task_queue_impl.h
@@ -144,11 +144,14 @@ struct PostTaskResult { PostTaskResult(); PostTaskResult(bool success, TaskQueue::PostedTask task); + PostTaskResult(PostTaskResult&& move_from); + PostTaskResult(const PostTaskResult& copy_from) = delete; + ~PostTaskResult(); static PostTaskResult Success(); static PostTaskResult Fail(TaskQueue::PostedTask task); - bool success = false; + bool success; TaskQueue::PostedTask task; };
diff --git a/third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl.cc b/third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl.cc index a130180..f89e700 100644 --- a/third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl.cc +++ b/third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl.cc
@@ -99,11 +99,17 @@ controller_->RemoveNestingObserver(this); } +TaskQueueManagerImpl::AnyThread::AnyThread() = default; + +TaskQueueManagerImpl::AnyThread::~AnyThread() = default; + TaskQueueManagerImpl::MainThreadOnly::MainThreadOnly() : random_generator(base::RandUint64()), uniform_distribution(0.0, 1.0), real_time_domain(new RealTimeDomain()) {} +TaskQueueManagerImpl::MainThreadOnly::~MainThreadOnly() = default; + std::unique_ptr<TaskQueueManagerImpl> TaskQueueManagerImpl::TakeOverCurrentThread() { return std::unique_ptr<TaskQueueManagerImpl>(
diff --git a/third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl.h b/third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl.h index 846bfd7..133e80a 100644 --- a/third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl.h +++ b/third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl.h
@@ -164,7 +164,8 @@ std::unordered_map<internal::TaskQueueImpl*, internal::EnqueueOrder>; struct AnyThread { - AnyThread() = default; + AnyThread(); + ~AnyThread(); // Task queues with newly available work on the incoming queue. IncomingImmediateWorkMap has_incoming_immediate_work; @@ -201,6 +202,7 @@ struct MainThreadOnly { MainThreadOnly(); + ~MainThreadOnly(); int nesting_depth = 0; NonNestableTaskDeque non_nestable_task_queue;
diff --git a/third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl_unittest.cc b/third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl_unittest.cc index ba8a400..42257fb 100644 --- a/third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl_unittest.cc +++ b/third_party/blink/renderer/platform/scheduler/base/task_queue_manager_impl_unittest.cc
@@ -138,7 +138,6 @@ }; void PostFromNestedRunloop( - base::MessageLoop* message_loop, base::SingleThreadTaskRunner* runner, std::vector<std::pair<base::OnceClosure, bool>>* tasks) { for (std::pair<base::OnceClosure, bool>& pair : *tasks) { @@ -204,8 +203,7 @@ runners_[0]->PostTask( FROM_HERE, - base::BindOnce(&PostFromNestedRunloop, message_loop_.get(), - base::RetainedRef(runners_[0]), + base::BindOnce(&PostFromNestedRunloop, base::RetainedRef(runners_[0]), base::Unretained(&tasks_to_post_from_nested_loop))); base::RunLoop().RunUntilIdle(); @@ -302,8 +300,7 @@ runners_[0]->PostTask( FROM_HERE, - base::BindOnce(&PostFromNestedRunloop, message_loop_.get(), - base::RetainedRef(runners_[0]), + base::BindOnce(&PostFromNestedRunloop, base::RetainedRef(runners_[0]), base::Unretained(&tasks_to_post_from_nested_loop))); base::RunLoop().RunUntilIdle(); @@ -342,8 +339,7 @@ runners_[0]->PostTask( FROM_HERE, - base::BindOnce(&PostFromNestedRunloop, message_loop_.get(), - base::RetainedRef(runners_[0]), + base::BindOnce(&PostFromNestedRunloop, base::RetainedRef(runners_[0]), base::Unretained(&tasks_to_post_from_nested_loop))); base::RunLoop().RunUntilIdle(); @@ -1060,8 +1056,7 @@ runners_[0]->PostTask(FROM_HERE, base::BindOnce(&TestTask, 0, &run_order)); runners_[0]->PostTask( FROM_HERE, - base::BindOnce(&PostFromNestedRunloop, message_loop_.get(), - base::RetainedRef(runners_[0]), + base::BindOnce(&PostFromNestedRunloop, base::RetainedRef(runners_[0]), base::Unretained(&tasks_to_post_from_nested_loop))); runners_[0]->PostTask(FROM_HERE, base::BindOnce(&TestTask, 2, &run_order)); @@ -1436,7 +1431,6 @@ void PostAndQuitFromNestedRunloop(base::RunLoop* run_loop, base::SingleThreadTaskRunner* runner, bool* was_nested) { - base::MessageLoopCurrent::ScopedNestableTaskAllower allow; runner->PostTask(FROM_HERE, run_loop->QuitClosure()); runner->PostTask(FROM_HERE, base::BindOnce(&CheckIsNested, was_nested)); run_loop->Run(); @@ -1449,7 +1443,7 @@ manager_->SetWorkBatchSize(2); bool was_nested = true; - base::RunLoop run_loop; + base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed); runners_[0]->PostTask( FROM_HERE, base::BindOnce(&PostAndQuitFromNestedRunloop, base::Unretained(&run_loop), @@ -1627,8 +1621,7 @@ std::make_pair(base::BindOnce(&NopTask), true)); runners_[0]->PostTask( FROM_HERE, - base::BindOnce(&PostFromNestedRunloop, message_loop_.get(), - base::RetainedRef(runners_[0]), + base::BindOnce(&PostFromNestedRunloop, base::RetainedRef(runners_[0]), base::Unretained(&tasks_to_post_from_nested_loop))); base::RunLoop().RunUntilIdle(); @@ -2263,18 +2256,16 @@ namespace { void RunloopCurrentlyExecutingTaskQueueTestTask( - base::MessageLoop* message_loop, TaskQueueManagerImpl* task_queue_manager, std::vector<internal::TaskQueueImpl*>* task_sources, std::vector<std::pair<base::OnceClosure, TestTaskQueue*>>* tasks) { - base::MessageLoop::ScopedNestableTaskAllower allow(message_loop); task_sources->push_back(task_queue_manager->currently_executing_task_queue()); for (std::pair<base::OnceClosure, TestTaskQueue*>& pair : *tasks) { pair.second->PostTask(FROM_HERE, std::move(pair.first)); } - base::RunLoop().RunUntilIdle(); + base::RunLoop(base::RunLoop::Type::kNestableTasksAllowed).RunUntilIdle(); task_sources->push_back(task_queue_manager->currently_executing_task_queue()); } } // namespace @@ -2298,11 +2289,10 @@ manager_.get(), &task_sources), queue2)); - queue0->PostTask( - FROM_HERE, - base::BindOnce(&RunloopCurrentlyExecutingTaskQueueTestTask, - message_loop_.get(), manager_.get(), &task_sources, - &tasks_to_post_from_nested_loop)); + queue0->PostTask(FROM_HERE, + base::BindOnce(&RunloopCurrentlyExecutingTaskQueueTestTask, + manager_.get(), &task_sources, + &tasks_to_post_from_nested_loop)); base::RunLoop().RunUntilIdle(); EXPECT_THAT( @@ -2703,11 +2693,9 @@ } namespace { -void MessageLoopTaskWithDelayedQuit(base::MessageLoop* message_loop, - base::SimpleTestTickClock* now_src, +void MessageLoopTaskWithDelayedQuit(base::SimpleTestTickClock* now_src, scoped_refptr<TaskQueue> task_queue) { - base::MessageLoop::ScopedNestableTaskAllower allow(message_loop); - base::RunLoop run_loop; + base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed); task_queue->PostDelayedTask(FROM_HERE, run_loop.QuitClosure(), base::TimeDelta::FromMilliseconds(100)); now_src->Advance(base::TimeDelta::FromMilliseconds(200)); @@ -2719,19 +2707,15 @@ InitializeWithRealMessageLoop(1u); base::RunLoop run_loop; runners_[0]->PostTask( - FROM_HERE, - base::BindOnce(&MessageLoopTaskWithDelayedQuit, message_loop_.get(), - &now_src_, base::RetainedRef(runners_[0]))); + FROM_HERE, base::BindOnce(&MessageLoopTaskWithDelayedQuit, &now_src_, + base::RetainedRef(runners_[0]))); run_loop.RunUntilIdle(); } namespace { -void MessageLoopTaskWithImmediateQuit(base::MessageLoop* message_loop, - base::OnceClosure non_nested_quit_closure, +void MessageLoopTaskWithImmediateQuit(base::OnceClosure non_nested_quit_closure, scoped_refptr<TaskQueue> task_queue) { - base::MessageLoop::ScopedNestableTaskAllower allow(message_loop); - - base::RunLoop run_loop; + base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed); // Needed because entering the nested run loop causes a DoWork to get // posted. task_queue->PostTask(FROM_HERE, base::BindOnce(&NopTask)); @@ -2747,8 +2731,8 @@ base::RunLoop run_loop; runners_[0]->PostDelayedTask( FROM_HERE, - base::BindOnce(&MessageLoopTaskWithImmediateQuit, message_loop_.get(), - run_loop.QuitClosure(), base::RetainedRef(runners_[0])), + base::BindOnce(&MessageLoopTaskWithImmediateQuit, run_loop.QuitClosure(), + base::RetainedRef(runners_[0])), base::TimeDelta::FromMilliseconds(100)); now_src_.Advance(base::TimeDelta::FromMilliseconds(200));
diff --git a/third_party/blink/renderer/platform/scheduler/base/task_queue_selector_unittest.cc b/third_party/blink/renderer/platform/scheduler/base/task_queue_selector_unittest.cc index 41c1712f..bd00d68 100644 --- a/third_party/blink/renderer/platform/scheduler/base/task_queue_selector_unittest.cc +++ b/third_party/blink/renderer/platform/scheduler/base/task_queue_selector_unittest.cc
@@ -103,8 +103,8 @@ protected: void SetUp() final { - virtual_time_domain_ = base::WrapUnique<VirtualTimeDomain>( - new VirtualTimeDomain(base::TimeTicks())); + virtual_time_domain_ = std::make_unique<VirtualTimeDomain>( + base::TimeTicks() + base::TimeDelta::FromSeconds(1)); for (size_t i = 0; i < kTaskQueueCount; i++) { std::unique_ptr<TaskQueueImpl> task_queue = std::make_unique<TaskQueueImpl>(nullptr, virtual_time_domain_.get(),
diff --git a/third_party/blink/renderer/platform/scheduler/base/thread_controller_impl.cc b/third_party/blink/renderer/platform/scheduler/base/thread_controller_impl.cc index 196cd5c5..87c247e8 100644 --- a/third_party/blink/renderer/platform/scheduler/base/thread_controller_impl.cc +++ b/third_party/blink/renderer/platform/scheduler/base/thread_controller_impl.cc
@@ -36,6 +36,14 @@ ThreadControllerImpl::~ThreadControllerImpl() = default; +ThreadControllerImpl::AnySequence::AnySequence() = default; + +ThreadControllerImpl::AnySequence::~AnySequence() = default; + +ThreadControllerImpl::MainSequenceOnly::MainSequenceOnly() = default; + +ThreadControllerImpl::MainSequenceOnly::~MainSequenceOnly() = default; + std::unique_ptr<ThreadControllerImpl> ThreadControllerImpl::Create( base::MessageLoop* message_loop, const base::TickClock* time_source) {
diff --git a/third_party/blink/renderer/platform/scheduler/base/thread_controller_impl.h b/third_party/blink/renderer/platform/scheduler/base/thread_controller_impl.h index bff48060..0965fa7 100644 --- a/third_party/blink/renderer/platform/scheduler/base/thread_controller_impl.h +++ b/third_party/blink/renderer/platform/scheduler/base/thread_controller_impl.h
@@ -72,7 +72,8 @@ void DoWork(SequencedTaskSource::WorkType work_type); struct AnySequence { - AnySequence() = default; + AnySequence(); + ~AnySequence(); int do_work_running_count = 0; int nesting_depth = 0; @@ -92,7 +93,8 @@ } struct MainSequenceOnly { - MainSequenceOnly() = default; + MainSequenceOnly(); + ~MainSequenceOnly(); int do_work_running_count = 0; int nesting_depth = 0;
diff --git a/third_party/blink/renderer/platform/scheduler/base/time_domain_unittest.cc b/third_party/blink/renderer/platform/scheduler/base/time_domain_unittest.cc index a16adba9..9ab36eb 100644 --- a/third_party/blink/renderer/platform/scheduler/base/time_domain_unittest.cc +++ b/third_party/blink/renderer/platform/scheduler/base/time_domain_unittest.cc
@@ -233,7 +233,7 @@ TEST_F(TimeDomainTest, WakeUpReadyDelayedQueues) { base::TimeDelta delay = base::TimeDelta::FromMilliseconds(50); base::TimeTicks now = time_domain_->Now(); - LazyNow lazy_now(now); + LazyNow lazy_now_1(now); base::TimeTicks delayed_runtime = now + delay; EXPECT_CALL(*time_domain_.get(), RequestWakeUpAt(_, delayed_runtime)); task_queue_->SetDelayedWakeUpForTesting( @@ -243,13 +243,13 @@ ASSERT_TRUE(time_domain_->NextScheduledRunTime(&next_run_time)); EXPECT_EQ(delayed_runtime, next_run_time); - time_domain_->WakeUpReadyDelayedQueues(&lazy_now); + time_domain_->WakeUpReadyDelayedQueues(&lazy_now_1); ASSERT_TRUE(time_domain_->NextScheduledRunTime(&next_run_time)); EXPECT_EQ(delayed_runtime, next_run_time); time_domain_->SetNow(delayed_runtime); - lazy_now = time_domain_->CreateLazyNow(); - time_domain_->WakeUpReadyDelayedQueues(&lazy_now); + LazyNow lazy_now_2(time_domain_->CreateLazyNow()); + time_domain_->WakeUpReadyDelayedQueues(&lazy_now_2); ASSERT_FALSE(time_domain_->NextScheduledRunTime(&next_run_time)); }
diff --git a/third_party/blink/renderer/platform/scheduler/common/throttling/task_queue_throttler_unittest.cc b/third_party/blink/renderer/platform/scheduler/common/throttling/task_queue_throttler_unittest.cc index e42954215..e8d57e2 100644 --- a/third_party/blink/renderer/platform/scheduler/common/throttling/task_queue_throttler_unittest.cc +++ b/third_party/blink/renderer/platform/scheduler/common/throttling/task_queue_throttler_unittest.cc
@@ -654,8 +654,8 @@ base::TimeDelta::FromMilliseconds(1000))); run_times.clear(); - LazyNow lazy_now(clock_.get()); - pool->DisableThrottling(&lazy_now); + LazyNow lazy_now_1(clock_.get()); + pool->DisableThrottling(&lazy_now_1); EXPECT_FALSE(pool->IsThrottlingEnabled()); // Pool should not be throttled now. @@ -669,8 +669,8 @@ base::TimeDelta::FromMilliseconds(2000))); run_times.clear(); - lazy_now = LazyNow(clock_.get()); - pool->EnableThrottling(&lazy_now); + LazyNow lazy_now_2(clock_.get()); + pool->EnableThrottling(&lazy_now_2); EXPECT_TRUE(pool->IsThrottlingEnabled()); // Because time pool was disabled, time budget level did not replenish @@ -1014,16 +1014,16 @@ task_queue_throttler_->CreateCPUTimeBudgetPool("test"); task_queue_throttler_->IncreaseThrottleRefCount(timer_queue_.get()); - LazyNow lazy_now(clock_.get()); - pool->DisableThrottling(&lazy_now); + LazyNow lazy_now_1(clock_.get()); + pool->DisableThrottling(&lazy_now_1); pool->AddQueue(base::TimeTicks(), timer_queue_.get()); mock_task_runner_->RunUntilTime(base::TimeTicks() + base::TimeDelta::FromMilliseconds(100)); - lazy_now = LazyNow(clock_.get()); - pool->EnableThrottling(&lazy_now); + LazyNow lazy_now_2(clock_.get()); + pool->EnableThrottling(&lazy_now_2); timer_queue_->PostDelayedTask( FROM_HERE, base::BindOnce(&TestTask, &run_times, clock_.get()),
diff --git a/third_party/blink/renderer/platform/supplementable.h b/third_party/blink/renderer/platform/supplementable.h index 028d68e0..50381117 100644 --- a/third_party/blink/renderer/platform/supplementable.h +++ b/third_party/blink/renderer/platform/supplementable.h
@@ -112,7 +112,7 @@ // support wrapper-tracing. class PLATFORM_EXPORT TraceWrapperBaseForSupplement { public: - virtual void TraceWrappers(const ScriptWrappableVisitor* visitor) const {} + virtual void TraceWrappers(ScriptWrappableVisitor* visitor) const {} }; template <typename T> @@ -205,7 +205,7 @@ } void Trace(blink::Visitor* visitor) override { visitor->Trace(supplements_); } - virtual void TraceWrappers(const ScriptWrappableVisitor* visitor) const { + virtual void TraceWrappers(ScriptWrappableVisitor* visitor) const { for (const auto& supplement : supplements_.Values()) visitor->TraceWrappers(supplement); }
diff --git a/third_party/boringssl/crypto_test_data.cc b/third_party/boringssl/crypto_test_data.cc index 91f0b465..2044b5af 100644 --- a/third_party/boringssl/crypto_test_data.cc +++ b/third_party/boringssl/crypto_test_data.cc
@@ -2570,20 +2570,21 @@ "9b9\n\nModMul = 31e179bfbf65b0695dde36a4fb72d131830dcdd6\nA = ce8d3adab8cbf15c332c0b289\nB = 9333f94eeb7d7a86b82becc51\nM = a532a76bd5cff409b580d54d12ef75ad8179b381\n\nModMul = 8f4b8a585415adff3a7bc35fa88891ba31e4a82672c664fb14\nA = 9a2b56a54bd0727ab4be57ff2\nB = edf1781b4296567990773005a\nM = c5a7c3b97ba00d6f174a019c6d37eda52036c528f351bef0f1\n\nModMul = 917bcdb402\nA = 55c7dbd314\nB = 997b29ef79\nM = af5b4cbd0f\n\nModMul = 660c4bb2b771f523a4fd\nA = 43fe52461d5139620a11\nB = 1f8ec4b67de1db54ddda\nM = d0458e215b7e6903d96f\n\nModMul = 7aeff02c143e4426fcbcf32bd1277b\nA = a2671586369a990dde7829f36\nB = c7ff67937c900daccc0ab1d8c\nM = 8ad9c1d4d3cce681d1ae27c27982df\n\nModMul = 4b153d57433f0f7276674d3484e9bd0d25227d07\nA = aea36cf51dd2ce06c66b7a407\nB = 80c9fe5bb0afd2bf8b3644f96\nM = 8cc22a67ed7e5a7a2322aaa09ec2be94998494f9\n\nModMul = 7f8447dd983b113f04c6288f9539e53a2e9cddbca8b2fefcc0\nA = f67636b03821c8f13f21217a5\nB = 8473a29f4ae33f36a0d2c6dc0\nM = b829af37b557c3ddbb5257c8b19144b90708a45a274d6655f5\n\nModMul = 17fe4644a2\nA = 912611576f\nB = 7a10d36b80\nM = c5fa605133\n\nModMul = 8159b23d4fd697b4fd35\nA = be2d646e76494439e60\nB = 60fa770d05ebc69772b2\nM = a6e7c940cd749925a85b\n\nModMul = 7c412dad5c9fff91357bf181caf2bf\nA = 80f476ed5acae75b34ed54c52\nB = fb818e2bdab3b5f4bd84db3d0\nM = d0339f7ee41337d8462d1a9c207d1d\n\nModMul = 70432c749da4ade2c38237545ebfe6c4c6a92f6b\nA = ee9c92de52210e61adaa6eb4a\nB = 8ab55a85b1abab62d33e75fe3\nM = cd3faa6de4cb62fece4c3f94492d457834a6a041\n\nModMul = 9fef1c18778a8691c5e71c0b5208e82778e9bfb632da0b7e28\nA = bd162c90bed25e84dd5b6b77c\nB = d887ee03020c5df356f091db6\nM = a2c2d45fe9decd93a0ca3edab8fee46d27ba23fad9b5294d5f\n\nModMul = 958951bd0f\nA = 12bd0d3375\nB = 668bb65b4e\nM = 9c617dfaad\n\nModMul = 8a109ebc9cbf86613e43\nA = a3e7019f1bbc35689a77\nB = 3189ecd3fd4ffd0229ef\nM = ddadc50600dff2abc1af\n\nModMul = 2b4d9f85a398c852b3a0cc82524619\nA = c244fd157267f707319ba6c6d\nB = 8a07018a748992429bbdbf326\nM = bf3813fb54f749ea5627f59ce30e07\n\nModMul = 28cab7d574e6dc56a6a622f8a7523cbb8dcc5e0f\nA = c9909dcfd3a59a3cfa538b267\nB = 8bbf89cd5a4e24adc2d8c646b\nM = c8f02682b9d480ea98faaca53b747ced33ed0419\n\nModMul = 69b2dfb3f1d8dbb13e9e479f38edcc427d5968acb7751a226a\nA = 8019266c548982a520ab48eff\nB = d33c3e3b13576dcdb3ffaa796\nM = e6255103732475604df7c6f7ef7e6b49a8ef9e2b0c717925a1\n\nModMul = 3eaa4c99fd\nA = 6fc42faa85\nB = dd0b4e318e\nM = fd7f22301b\n\nModMul = 56b6b811ced3433755cb\nA = 145573d17cb0c996c69\nB = 9d3297d5ccc184896822\nM = dcfb3b383506239e83e1\n\nModMul = 34315b6bc6d3690c28060485ae331f\nA = b963a26973894cfb42fcb2d22\nB = e8523304bbcdff1a0ed4141bb\nM = d7a379aeac7d8cf94f19e7924d35d1\n\nModMul = 2ec9466e8b3357496f07e37ba24d36a237883846\nA = a75f3904e564997695b6707eb\nB = f9f47bd779834dc1f5fba0654\nM = b3ae5abed45d09c4dc5abcadc3ac9abebe1949ed\n\nModMul = 88b4d86b2c1e1bd780e8d2499c2221e05fab4f9b7047c2a044\nA = a38eceb9c551f0e69a544072c\nB = d5f8e7c2d534b2b8985bfd213\nM = ff81809b84fb8eed3508ad891d3d8208249d8a902a12d6acf7\n\nModMul = 172f2e2e22\nA = 1584ff1055\nB = 2e0aee014d\nM = b904cb0bc9\n\nModMul = 122c10d3200270b9eaa1\nA = 86fd189e62a6dc1e4ba0\nB = 5235635f7b0336f5f235\nM = c93da97d0e95fb63dc4d\n\nModMul = 3e461e10ac4eb749512097fbf76616\nA = cf4ce10cbca07164f3812f89c\nB = b7e4639c233fbb0f923fb5104\nM = 949647857e1406871593fad5c30101\n\nModMul = 88117b59d9fed79dd6aaf083ee938215a995a221\nA = 94c888795567d434123d441a7\nB = c60ca79e61a352e34e0f78bee\nM = d2553a7c5dccd639a3927697a2e1af03845f2f25\n\nModMul = bc5f0076a8c2f6cc8f4e61540d2d6f6d6b13b775b363dcd71c\nA = c170eaddca5295d6ec6272dc2\nB = f94a5685ced7661df2efbd34e\nM = fa6bc46aa05033af72aa42793e9174af2e3ba38992f33572fd\n\nModMul = 1110cdbe5b\nA = 5db02b38f3\nB = 3369537903\nM = a8863f7979\n\nModMul = 90fcc5f3a346d3d4ea4c\nA = b93373680ea0feeb31d8\nB = 37f9dfaf0e180be64bd5\nM = d595cc29237d1c19e2db\n\nModMul = 8623a9997e514cf3c1d06c33c14053\nA = b396f5ede6212f1fdfc7e7b77\nB = 81a1ddc18306f2d2e84030148\nM = a6be32a91b34857842255ef8b1aafd\n\nModMul = 63f8f0254df06356f5cab8941b77619ad58025ed\nA = 806b2627b08d987438f920bae\nB = 83297039f4aa8efc1a185fea3\nM = bb8a7e7c19be02c25cf5682a0eee655fcd5b69a5\n\nModMul = 697238dbe3d395e81f20c9fcc8db30c234a1f75f3b2bc27438\nA = 930b04224bc097ac1d8bae8be\nB = b79496a80e45212c4663e5b64\nM = 8ff7e19d967d317c255380411898d73e3786269f09079f19f1\n\nModMul = cd93b5b8b1\nA = 47a51b2d5a\nB = 86d6ba5155\nM = efb0ad3643\n\nModMul = 2037821ea789118bde0a\nA = a92215dcae19be637ff\nB = 93b9a3664a406737958f\nM = 9df360b69ed26f610253\n\nModMul = 3bf11785d28ceb668dc55b870faf7b\nA = bc8758854dc48e057cb6210de\nB = f03ca689620a77ecd8a6f0de3\nM = f3ff0747d6e5f34a0ba4200f579259\n\nModMul = 7b30b44f75ed12f54136858ce4fe77d00e0952cf\nA = 993cd09f3e46423a8ba2053df\nB = feabee384158032dd013dc08d\nM = cd0b21388cb2033b1e792ec4078334df70b6c8f9\n\nModMul = 8ce1e17972f1a9d2e9437d0c5219354728a5f31337808d7650\nA = 90e5d18b017118177ffb080da\nB = f8e7e09032574f6c66e623ec8\nM = da795e6ef63ff7dc4baef5c327022ccf65d44e3c4e24823f11\n\nModMul = 8fcd412054\nA = 2e7f9b1a\nB = 6283de2c9a\nM = 9bff560ae7\n\nModMul = 57d0d3b79f1e2f3632fc\nA = 2f8cc403de5af54cfa39\nB = 3b798c3ead52878dfb2f\nM = 805e6cbde400d4b4bc9b\n\nModMul = 23331614e88633af879201f568c359\nA = f21f19da4b20980979a645dac\nB = ea752050b79883dcd69222536\nM = aed3faf4c88f7c4afe257c5ed90599\n\nModMul = 56dcf9ae1c787e773774df3c8762babb4675a212\nA = 9accf901fa599da05fa6ab5ff\nB = f7f6b9b1d7bae06237532e39f\nM = b5bcd776bb2eb0805ade3c8b47e883962d3cbdf5\n\nModMul = 61d0ee0786963906a028a1df01f836841ab6d39d88ca2717c0\nA = 8e57680f213d088ff1a1e7db3\nB = afebecc9943b0093f87022940\nM = b6201f68a45265d7e9183c3255feb4c110c05dadbcb13881bb\n\nModMul = 143ae78a29\nA = 334abb952a\nB = 74203e7a50\nM = c9535a9505\n\nModMul = 897a2b57e69f5a1469ea\nA = 1ec8ca0ea4fed52bdbbf\nB = 3a6273cab05e478a57b8\nM = dcb33163a8ea42c1ae6d\n\nModMul = 4a2c10e90e2d37111db79a44d3e31b\nA = a90e7bbd63fc4af6de83029ee\nB = cf09c3dd50b41afc7045e057b\nM = 8ab85d47e4270116a64f97dc4f0f15\n\nModMul = 70f94276c9d85fd3f71edfaad6051456f754da85\nA = fa3e9ff6e1aa1fb78e51711cb\nB = b115ed197c50b7ec4040ca255\nM = ad63f69ef1346e7549ba71c13b24b279f53bc9bd\n\nModMul = 861e7ef401866f815b983ba18a612913ecc20a67016d79cfac\nA = fc41a9ce06e882942f751be7a\nB = 881c05a51d1ba8134d126a48e\nM = b12200b39526c33b70e8aa23ebc400dea0d4d8fe42be103d5f\n\nModMul = 4e0051898a\nA = 2a06523f70\nB = 651b5044f0\nM = 9da4eb09b5\n\nModMul = cc8274c88d6affc3742f\nA = 9ccf0133f9628532f4f6\nB = c1d80907057be7a67b01\nM = d6e76e362da831f32685\n\nModMul = 568f15bed5c4405be9dd04673a9c46\nA = dd6029c3196feb6da7f0f4a48\nB = a5f6745f2cb64913d1d3236d8\nM = f62f02c9b9ca8993e3be9a02b444bf\n\nModMul = a629452d5ed19df040eca26eaca37d82c0fb1d8f\nA = 963c51a9415b03e85ccb09f25\nB = b1cffe333afe44311cb968ffe\nM = ab2128698d498e8d75455033cfbbf4487535773f\n\nModMul = 814030123025d287aaa8b826792999d72f2d589e0c7f7f3dbf\nA = c3b33f391e78bee97ceddf313\nB = a9136f3af450fdeb245eff425\nM = b6aa9c517eaecb70781e597b907583bbb569e970d229235a35\n\nModMul = 8735bd486d\nA = 563e15c52a\nB = 31293264e1\nM = 92f4b193df\n\nModMul = a541f69ca163b288dd0e\nA = a608b48c1dcaa18424b2\nB = 891b0b296e911068b00c\nM = d4140921f4b2c84f1eb1\n\nModMul = adc1b7cf65967b013d046866b4ed9d\nA = e97941448f65060cf63ecd486\nB = ca68936f76cb87a8fbdd37311\nM = ebbca2482fb82eeca2866057cf1179\n\nModMul = 44aa9f0dd58d4510a7364e130698b34eda23a632\nA = c11f83f01bb964ffac93a2e30\nB = e05ee40eea39f4538d735193d\nM = b5e8b511738979dc740a6a1f7291cf4561787be7\n\nModMul = 8b16b82f064f471983c7154abc9f9ba355111bacb90400372a\nA = acff8da571e1c96810bf95707\nB = cdd23e5504cc26d0c34a62b06\nM = f38902a99190ae0b5ef26849a6e943d651925666fea271fee7\n\nModMul = 193f453197\nA = 8cb3078675\nB = a8fb003a87\nM = b60ff22f4b\n\nModMul = 849c26c8cf5cae426a80\nA = 5d1e3d2b4d038a0a34be\nB = 34f70325565bf0523314\nM = cbc189f9a732cad8f425\n\nModMul = 9a4e64ff530c53a4c6c5b6b5021920\nA = f53b81723cf74f520a61e614e\nB = 9d8ac2e6b839143fdd079a2ff\nM = a115375435151798f3644bede9d863\n\nModMul = aac303a4623e80158af1cb3331965cc8e3184edd\nA = cce0a88606ff962fdc37e72c9\nB = 9840a500a2051625c517104db\nM = b99dafdbd91ec3c05791031df5e193c03d6a441d\n\nModMul = a31401dfa761bbe82b66b5f094151865b18a4ba75bb9b3dedf\nA = e6f48c027284856aaf3b96425\nB = b4c326f72a6a22fd4b93ba5b3\nM = e57d9608ac6e5b129b2c014958bfc59137f63838b1ba88a4ab\n\nModMul = 8b0929adbf\nA = 61fdf77ac0\nB = 8892f05400\nM = f12b3766eb\n\nModMul = 91b57f353307b173679d\nA = 33f8e73752072b4b5cfa\nB = b4c730f79f4f2c07945d\nM = d41be1d8d2e5753e3ae9\n\nModMul =", " af04c564adfeb120bc4770bc8c650c\nA = af151333b3d4cd1d29fd801db\nB = 9ccaac44ff91be11b30bdcdd0\nM = e0bd6e70d5f5ce08fbbfd48d43101f\n\nModMul = 1b8d623796a5065d9e993a53a9587a0fdbea1bbd\nA = a2fd08df2d4eab0cd6d29e213\nB = 92c9d26ae7c215b52199ee28b\nM = cd529f4cfa46f3bd3e7fadf167fdc02f6f881da3\n\nModMul = 4a8573dd8dc50a4fa39f3579d3869745eb8c1153ca508deefd\nA = 855f941d085305725da617f5d\nB = 8f09b7d2c36e0340523da5421\nM = fd8caa05edeaa81beefa01957eed97a981ab34bdeb6d8c704b\n\nModMul = 2d278e089\nA = 59d20a1716\nB = 8e2a58bc75\nM = b3d61ef699\n\nModMul = 2f937ce359d0f6cedd1\nA = 1019d11d26040ffd5b1d\nB = 7cdb6252087423d43e08\nM = e8f537323004447e669f\n\nModMul = 6567332e25af83089f7458786ab0ca\nA = bf9565e9f8a098894447b58fb\nB = fc867626f268c24cc0ab7bf8b\nM = 930f39183353363dcd822933a438ef\n\nModMul = 3692e73ad1d91ddc19cad3808eba2c5fc88e2bf9\nA = d0a42ce512629f0ffd233a9aa\nB = 97f6d3c4c655c7353a62d6ac4\nM = eac2ea84851f880214b8f40f881a2e56a6ba6f2d\n\nModMul = 81df390c9e51b30bd639db15adb464c7cb1d011cb5e260be58\nA = c237eb242c40960861c938c08\nB = ab2f481f0d768eebd90d2574b\nM = 8697d7a28a5f42c9a7b31949b8b568f861142f44fe66c6cd3f\n\nModMul = c952f9aef\nA = 81973bbcb3\nB = 28ddee3bf7\nM = c4a40993c9\n\nModMul = 241dd53d93f7bdbbb2ee\nA = 2136eda4495c45c9f96c\nB = e74c4baa8ca3f6b7cd5b\nM = fff4594e7a5f0a1d3e15\n\nModMul = 5f861ed8b0aa835761613e6c869cfd\nA = bfc5c1572086079f5f5d18d1b\nB = 95902e14923c8010b7e905178\nM = a819c6c109d623f9b845aa23712c9b\n\nModMul = 5b8ab089c4e4c6804e48a2bc1d218718b3a32598\nA = fbe65d3852224a812c432672a\nB = d57a3f38da966d2471d70a048\nM = b9e6a626d3ad026d14248fc90c882bedd64a1f13\n\nModMul = 761438baf5b02dc095b7040e082da7b167c2b9ace956284ed\nA = fd91701ed2151f8e994bf4ee1\nB = 88b66e735b76972bccd9db182\nM = 8008b2d1274456aa68dc627b1ec3e1762c6ed2d660c64a1a55\n\nModMul = cb743c97a1\nA = 9c69ca9b60\nB = 7488f48f5\nM = d67040ed0d\n\nModMul = 931b2bee1bc30725a31\nA = 650f567b544ce02303d4\nB = 5858da30dd1fae88a675\nM = 91ce30234bb29fb9e833\n\nModMul = 5b4f262cec958a20390b5e568ccdaf\nA = f7e240e8a077e8e87506db2f1\nB = f8653fe64e3bd414782f51634\nM = fdb8225eefc1620648737d31dfe1f7\n\nModMul = 4c011d1ddfa30c901793cc6ce74db47584cebbd1\nA = eda8e9a9ea3cdae17bd50b1b4\nB = 992e8ef4a45593e4ceff67876\nM = 95e2f120cfcefbada1058af6c8853cbebedd5763\n\nModMul = 6e99aa5b8107399848cf24fbd88ed6350efb68d737e505b466\nA = ca6c51ba2f410d09bf71d60fe\nB = 8bdfa8fe5ef3b2ad02bc63c4d\nM = 84daecf412b8c50ad6dfdb546c3eb783dcc6f32003eda914bb\n\nModMul = 536175913582e73c1002083cb0cfce5471d4193a5b717881e60abfe927c829d\nA = 9b474b6f7d7f11dfbeb7a0724694f2daf9ccbaf2ec13269b5ae3329e8df95f7833baa68324509dcddfb5afa1d14f2dafc55e2c225475f16fb396beecc7a66dee\nB = d74a5081f00af2361c3537642c06cd47aae7e366741c9b4785e185af8b328acf3e2ed71e3b9a4b6fd49d956eef76740b3c6ec5850a90e7e444dfeaa7214c5eca\nM = 5efaeebe212752b28b5441a5d0b2600190504467c6359e9ab26320ee72cffcb\n\nModMul = 6161cceee2b74e7965a926fdf5344ddf8cc41994d72154a8b6014c18cf71634\nA = e7d6b74a1af0834aaf93e09a6488340b661449ba2bbc73d775e7d828163813ddbcd82719351879a6d67ab6b518011e1db43a3d620d1f24403917691d15ed6f90\nB = 3ecc8fd3103fe52a7e73ec4be4e60b69584bd886a030f017b482bde9d4b0b964ba8471cb32b3e9bd49864d9028a22d6b6b46be0451bb4222c3987b74a509f8fc\nM = 7c3e3b8b1a6110da82674aaf88c288cef4cfddf22e7c9b75640fd67fa5fad59\n\nModMul = 2acd55bdcccd55882eff0bb262bb62f78bff8e932aefc9d32f54d5d4e9b8bd76\nA = c221d1f0d1b7efe7e078dd01bed773f8876fa324b3fe91985d47d343e7f3878b457dae2f9ae68971245278a1d23cb541c56b94dd9ac43a9fbe28a46efc627651\nB = 49f94c19ff7ce990637c3d2019ed66f7e6dbb1442b04a4593cc480521b991cb1b878f8c31903240f89e34336d9e6785433617e729b71adcbef622a683357e035\nM = 43760c71742e9cf22cae6fc262c008b7f1b97a78c8063957b74aa4cd370c1eeb\n\nModMul = 504c11e38284a30e3647c1ddfaed94503d833bcecdff05e749422ad1d9442540\nA = 3fbabe2d65f443e7db0a6f332330ecc4d1d40e14fcb510499552020405cafcf10a50a5ee47cf60fd8c22a22b3f753b4167c213851f32109babe4b5c298d6c4cf\nB = 62e5b0f887dcb1f1794bae7dad46a066f810cf5f82a1eea99207b5f0fb0ae9084c5e62cc97b2672b1cf4cc1400a19bdcb093c97404876b584a6482931e7ba9b7\nM = d79fab3eb31189268b2a0689cafdaa0826f07d432591e8aa8bd3c7cdce1470a7\n\nModMul = 13a6431c57ddf0ed3979412ba8454a0dd9a2694a0dd76453aae63366c46e41db\nA = 7e1fd0bd9ab0aa75b264475604aea09f24239f94847ce2549d43b71890c0549938d167adebc7890d3c492b5874da7bf18d895ccaf1803b9776820598928b407c\nB = 5e54e5185bc86f16177f1354a57d36ac2980def141b389e4bfda134fae7c158009ccc61ef66281905128b6297f876662104ead2315024f129c56eaa387f80b4d\nM = 182572149b860615dd853f37f7d51a35e85f5e4a4249a60fde58dc68e0dd7401\n\nModMul = 145a44566bd75103083b7556a822ea6008ed3a6a1bf135b68fcf87a294c09b4\nA = a195e4315caa8cc0707063c7359c28139d4dfffb57eb726156336e13227ad9766ea1fc99152893ebb194fecfc153d47cb927a633217328f05e4d8782aeb89d04\nB = a97ae97dc7e9a224cab94ecedc08d0cbf7a012dc5209b1e1e8b5b843fcf61e65db3457d6085545a633be47b742e8237cc716357ff5bce9b00e23671ec1d049a8\nM = 29b060ee2aef7e43e02163d279ce49259127198adf462d13aa195c7dccf573a1\n\nModMul = b00740cef7791692d45f5a7110f3eeb260638f19f87c9245436fc0422de90658\nA = e6b97c11ad44fd451d168d65d1691d2220db8c3b6c8436d59f4c1366aac52558d0d6b61f5d6966460a4a31085fac711e5a09af5563d938963555d4730982eb0\nB = 6805eab5a4da534f07def6d2c320a6cbdfe4831fc2163dfcef740607b3181d8647bfae8f8c16237c1c1c5d14b9e3417132f81b3a7db4b7fc11927aab30dca590\nM = f975a94fa62b4c0e68df5c3ac5917d18927c0a6d9cf39c26f6ed97a81cedf227\n\nModMul = dc04b6ba2eb1e34ea8942a50d1d0c5479dd22109895796ffdc9cd32b53d4764\nA = 7fd3310af09a67e0684dcd8e3b4b651c7c13c2f6a0a47b59a7f5cd8bd80854d1d4fe02eaa61843d6bb2b87f99d8ec4842864681eaf056538ffff610c231e1d\nB = 15f1661c59ee9f93400073e18a91503a93d47537d2da5cf5e4bc69ccc87b07bed171a95f1c5eaa9c7d7ab207ab3f1f7634c5d16e706969e869364207f61d84bf\nM = 22e2856f4c2b6c01448d4aef74aaaee3a14e9660b5b277200f2e67464ecadfab\n\nModMul = 19299c9e960ce15087e9fbd66f95cafe82546431b92d70db1de87c3425c1bef2\nA = 8e3abb1f24e1f91496db99be9409f57f67cfb6e0e33d603a2a31e1309f1d0bbdc413c3e4fbb5e3d923f683afa9942b9b9fad6a6e558b2297889fff47ccef7d23\nB = dbdf5940dcd68127d476badbd5a2f3018aa4d8db79f81337ddfcb108637110b934e946d3284ec09d5255605ad72424f1894238ee4f7964dffc27fad838532321\nM = ab6b4e3d3909512f5d1d62a30c1ab8dd5e584cadbce9dffd12fe203f8936ee93\n\nModMul = 4f88ad4e30e6e8e38cba0452d98d4a3547c680f16308692e33e5577772658764\nA = 5137697bf48982edd869e4a42f3cb858bf65ad5b25d1c0e8b75d054460d0944ecb5a6924721c5728964d84231c7ae808f556837aefb23fe3ad36aec9f5f60f20\nB = c79554304620f8116b9a8bb56f6a23620e9fd504f7163f732e1e6367d25c6ff98cb01d16faf3e018dec6a067d1204a6aa95470598ce757bcfbc3ab4f5d8ec88\nM = 9ba20dd78923d8ef82897ac46a509cf22c9b7986a4facf42e5416bfe3576a735\n\nModMul = 985a4d2a7431e09fcad03e6a3f926582dbc0aedc588f17aa5db40c2d3566233\nA = 908bff40440aaeee6c90b6312dc017c3bdae884a9074e02b26f01be1f018390e01f0d111f99a06c16e20538df8000d4066cd4bb3628da88a3a5cc240cfac719f\nB = 6ebfe9fe53909876784f9d6e5dcca4cfa9463fbd8426c5bb8890ae84c2fad119615fe1e1f2ee5fa544a5ac713ed1da8c1e04f282f1f1b9fba4b4c4bd9db20538\nM = c66842e0a11ed6ad1e8f192ea97f5f244536cfc5234c7fdae1ff905123c72793\n\nModMul = 133d7b31537b627da2c042217cd28625437c28c3e06258427d9a4384046a1f4\nA = afb695e3e40347f60a500e01fba4df1c1f2fd4ed79e3f65913d82369f79d80db6b3978e6351c70c148f572b9c0c2b1efeefa605251b3156d9b66d240467e550f\nB = 8855046dcf50f80f278227d5260b9be53ca2e4a1cfe1afce4d35b11d0fa17a36a8bee8126e13bbb318d476becad5a935e9d160fa481e1437b292bdc169dc7d45\nM = 3eae4f0d6c7e1fb9de1a4c160404a8767783c7f839fe27a543f5c389c679d47\n\nModMul = 7f4576a315bad5c7fbb1616e8b26c5b34ca6f701b9b1adf0485fec181c41dee9\nA = bc2baf0153a4598f6b5f488c43b2546cadfaca2c1931b919f98ba71835a8fe78886da1fea25b194e60ed6f9e0ad23c988b64af9278155c1722dcf4983a1566c2\nB = d8374d91fd3c523ecdd6bdd265c9a8958dd222f9f0e25454fd683bd86d7900a273b56f1f47e033c46527e32c721094ce6bc927d25fac05d7fa6db4d7a6773c94\nM = 9975d8e7f2a4d9d1ff8d442b93ff269a83fee43a18bbfa8c2ccd7ca5fac3a8d3\n\nModMul = 57ebfb39605d4fa6ef5fd03bd8e4fd685664297c29b7ad75a40b133e15fc5ae9\nA = efed8e442154b1eb6c75775cc23e01fa65c9c361e222da123d07daad3039f305e7102edff23b65c333f0caae4f7929857c3169f4ae47c9f0fd920c38eb42bf2f\nB = db05415ea90269a74b0919ff772c148c0eeb2ff9dea76a6e73e82eb86bc76fb42308b55ef83a769a91d23b7840d5d2f5129f15279dfab7cd8d63778acf202f26\nM = 7704390c4b1da86d51ff817003e5451d601a5352296e339e5da219ec5a330479\n\nModMul = 40b6b0d44cf8a5ca7f4fd03dd6e1e2a11f74f3911dcd8727e57db8d65cd490d\nA = 6500f3cf686eec", "4e1f243616ac0ea8e8d11ddbade490b86baf231e7b2fd55968ee14b6bb7badf8c898874099831976af46bcbfbfaea10d49aa803c6e51238e2\nB = 1fac744fa1e26e789639e049679d0e2eb57336279f09555e10210e7143199a3df5fbf5294edc386ac762fa3a3b0b4bc28945adf21a8af747a29018bf76d3710a\nM = 5c0781a87b84ecb4362b09c623d511de53c085671dd4f08e9a551685b55ddfd1\n\nModMul = 6b778ae9822221e6a8376379e0032d7edb14d7b5e32a7310897b54d1d5626113\nA = c4a5737a9496129a136753f8c2e52bbd2660f2d3fafe4ed702900b01c14e506d13e3bbeab19b357e5ba9fce8a4fc3dcc469406a16248d6fb53862781fd9d55e4\nB = 444e5a673eeb37fd3b4f6b6f5133b0f46c2ea532e1953da4a0e144407a8e2534c5ff40cc9af7756e5aff9df57d938fcedaffb868dcf4e458b36f506ed7fe0ce5\nM = 7f5978c0c066132a9bdcb00727bb802b72777b9e8e4265f76b80cfdc3a788817\n\nModMul = 5c717e5dd25abe60f761d6f9326ed056416add4c1384682d87b7ff12e112f855\nA = 4351965a421c75c5b4c251861e53316a300ed7983e27e17f9308420f0d2cb11e9c476294fcd9042a525bc1a044bb442d1d9f853c9e07245170e0e2711010cd1c\nB = 4e1046647c362c8f9c414be54075b4e9d151c6fa0c3da40d90e6042625947ca2c9f20cfbcfdab8666dac5a15f6cda9d47b09f654131fc5addc07e382c9639323\nM = a6c789884c66c7f028099e0367b3ed86871277bf070c541ee12fc02fcb6181d7\n\nModMul = 4452688244f542125168853f1d444f96ab0f82903bb12a97e59f0db633edfd6\nA = 9fd1cc81981bff977244c044146918057ad06d3cc26edfb8fb4118ee02b959d45555f9507ffeb23c3688e29ccdfe5f583fa3761f6727573542bee8ab5f5b600d\nB = 856e6a03b5c93fc19deea51b3bfe42c810c5bcf9ffbd08e2625eb209baf6a4e24943a3c090d89c1f70aea9f0128e511fe92e03715d917168c1e1ca77a3a8731f\nM = 2c245d407a78903ef2b279ddbe32106e6333b6f44cabf87b8641b047c79ea06b\n\nModMul = 375f8474ee47df6b9a038512002e56cddd374d69c69719d8d369232c64a839e2\nA = add40f1dd6d4a2414b17f0c628eed9a8f082f3ad1f34ec41935fa86b34d4505b22ea80c062386a9ed63f95c67e55c686f837bddf8f4da791f98b08c02f32d4b2\nB = dab1caaa11d5a208b7a6b7a1d6482a4859daaba5e3a77b1b1020e8ae62a664953dfddd0b47d40526e7a3c6a5363c6d41dd9f529fd8b58d5d31bb67e745cb71b3\nM = 4f506313a4f49873a405f2e5a6e9cfae9cd5e9f67b5ef900153366570e28a955\n\nModMul = 36fb0733a26902f0f8f11625305a3c94fcdfffe294eb6ccba110aa628a314df\nA = 52ee1498bd6a1677db801ae2eab4951345a1fcf8fe7d38e3f28dbc27fae508d87c9958e02a375ff4891b88ee916b96331e7cc082615faa028f6d541b5ce37876\nB = 9343cfa074f50c20e8472f8f7c4a7d330aa30ee417ed8027a4c956e84cc5cb31d5411c14796d9325fceef79a51b5d8a4c89182ca273ab633e6a7b22a27352300\nM = 9d7c334aa33634f9f313b71b42476a3b627a6c5bb8ac1d07a8d732d5c087bd9\n\nModMul = 4a377267508eb045e00cea66a417112dac07545304bbeac6315625275b7cbfad\nA = 19616a82b75b08499d4b1f869df2db8f71398672f3f97ffc6177a4a5aa913605ce8a6ab5f778cac508f0b3f2aa680b01ccdc57c0fdd6cd678a2ff2dcd7f01f3c\nB = a5643a9a9fe3be4134082daae4ee7dfd85d9452beee856fd939d3be9788b6bebcf3571c67ec481ff9b20f70d23e82e2171b1d0ddf0a9435b40115d32aedb6811\nM = ea0477e7f1a02cb6c21171066f3dab69d4e24429043b0f049de660fc80e51937\n\nModMul = 7952dfdb91252658430e365adeefd9093740de92cfc9dd3d92294f2dab6ca0b6\nA = 8e6cd7639b7c134b53e6ae6ac5f51268da83ed09e8e96d65e4bb130dcdbbab9e48226ddba6efe93faa510bde8ee92f2a641774c4272b5a2f88024b77a2cfa110\nB = fe4e8109a49b16b96871e384564cc096277dad4e1bbca8e5feb33f140a4fb800c8f3096b1bc7042bccf249aede88e6055c0db609f94e214b1251eda494be724b\nM = aa46853682af960824140c35d145a6dcff6283b2c59994b30ecf9b8def41a025\n\nModMul = 1aacec7f7e66b0cf4eb2dfda9d8d3fbf4eb8e928cbbc967d13e3e38612f0346d\nA = b0fd7a936b0908ba6fa797e4b855d673ff85d665ef3a345e560e2c0049becf5c25b6c0068dd617ab47a8fd151939ea0631f86806ddd40e557933c0e880fcdd0b\nB = 105c87fe2b1bf0be5405ca0d530beda1780f0045e892d7810f8a8abbe890f0a19de66497cba55bf38e190c52992467c22a320c38a4bd167f774ed812f1271d5a\nM = ac4f0a2b22df691331ded955a5d0e7d1910d7920a59d4a87636b2635397b7335\n\nModMul = 2c25d180156fa7d2fc20c9bd6d9ff0b111c9ad76ada0784e2f8fa0bd06413f66\nA = 2aa4a0a73df11f4e60956619d0b35eaef45730d619f9b920298e6d369b9861f6411de28a34af038f288d7a3d6a35b10c8082b8ad0fb275a8f67c6832ac46ba9\nB = fae1d50b72feb25da2581829409391bf289cd9f730c99d265b5b2d63889381cde4adbf85c3998c2478f2866526b8f64605d75765edd09b78ea45337207d173\nM = 65c9d79a09a820adbc9beb152bef387c1439147ed50cef872d36a69f1c7d5fe1\n\nModMul = 56ec8624fc199e7b4e68358f88f1a99f1d4d02577b8c6f7e28e4ccfdd981f995\nA = b0a0f9d05d144d2ef257c1e63a7127a3b8e0d8b64ff8f6447618560593574b5c5da6258b274efc28da0defd988bef1efca0f481f809665a78954b36741d668bd\nB = 10901b9dbf0016cbcc671da75a75b7a6ec6a66dd17b53a97344864b08f037098537380bfb0137b6becfc36a75206686d16bc4eb8fd54299494374e3f383d9b10\nM = 73882376ca850c125ce9f20c291e550ee48f0eb0d571109ab08c22d6719496e9\n\nModMul = acceebe131aa34ff21b3235f045bccc8a8f762dca20c1dd1ef6eb461ea971c6c\nA = a7714b249eb0f0cbe3e6fa0b04e895fcf14c404876197defafc6b57026ae7e5e993fc47c1819581adc03860ce07f2b7877a3f6d0912c0cbc659f5f6170a1cb2b\nB = b7278ecd154ef5243ad973ead291ea186acb63e09977e644a6a9fde195d1a33993fc47c1819581adc03860ce07f2b7877a3f6d0912c0cbc659f5f6170a1cb2b\nM = c52ae49e1a4b21ec392b76844ad559653b7b9f67a58b3bba6c2ce250017eab09\n\nModMul = 62b5b04dc84bb4ee04934c03ef361bc6e59b42144dc117b9f7771525c67c3688\nA = 2b65f491caf0b5cd9c66c859fbcadaec7213e6b848884638791b1620d6e4bc9dde087af0e7329d3b15a45df2d43ebde61b053ad7f63917aa922d58b4f3222620\nB = c1bfcdb34b0766be980540dc3256b9ee4158310fad2c43cf24bfafca08ee185647043f5842a9d9eda224449259341b7c50998086434528d47661bf5762a7ab5f\nM = f73398c32191b436d14a0b76c6069b1d61395568753c832dd0c707780a232dc9\n\nModMul = 5613c8fb0721bd3f605089def48fb2c38a4862bb387886c1edc1bc37d10f0e15\nA = a3d8b12a2c8f4021ca045a4e4903687dea63ee7e88893b1911aea77efbff00f8f5c7884cbafc71f59fa2636195c2ebee61edbf642923f34d87ba5eb49b06a7ee\nB = 3231829c81b26dcac432b502ce22e126ab564922b1e9818cd3da46edc5ce7df026d0e515809c97bcfdb9666581efbfd364437ba9959dfad099f90472f97c69ec\nM = df8344fa848d1066afe4f8d985cff65441751677dcf3a4e99b40365fc3c978e9\n\nModMul = 30325f7ccbc2c69e11d739ad7132a947c53377aa902ec70b152f3a75e050c244\nA = e4ba620125f58a63fe12fbd3eccdea477d56b120c76d5d1421bebd74e8686b4093f8169070453ccc04b63b173568385313a1d9c841a4aa82a61cb84d4286a941\nB = e87aaa990307855f8e5f2e5509d2ce31dd4b13bb7199cf5fa0593e350326e222efc33a26c69245565d6ebb5a484cfef7d2558f22dea8054d07831d536803d0dd\nM = 43d57108eb0ab9bebaa8ce137628ea825951c6accb9acb7f1e991c93b8563897\n\nModMul = 1975db7b72434ad32c9aee412645f6670b7f4af1f8a424a5031c559d3e18dce6\nA = bd64b1db27fa7da4c92a4ee092f58a2a53ed0f12d009fe13b36d5fd585defe778fafea4a60e8fe567d03e9ba3b72b189e22504ae8ca6aad7c2ac0f44abca2f6\nB = b487d8116198560d6c5b08c7ce63b0acc0c98e6f2a8d709cf4e3a409edd55f64d72fc27a70dc341e280ff5a1b09fe131773d466cb31991d2db23a2a86d225c80\nM = 39d57af763eabe569dac1a103e169e6e3b4375168e41e5c3b961b6e743915923\n\nModMul = 3bbb5bde9e3e240694326571360090e1fc0a4ea7b2311c1e0bd3961f6c159385\nA = 4181ee3bf9a98bcd49eaea243a179cddbf160981efc720685c7be1dfeb5aa552685a2cd46f340e1e1da893b3b460692fa2eaf6c100f24a14f239e45123242d53\nB = 77cd04d86dd5da322af78be54246dd6b7af490d903db1db03cbccde535570b81c6053a84110c07f097540ffe7510320024b7bafb77e9e239761def76092e1d59\nM = f3b9833a303eb540cf8b6cbc3cf16394b1634ef517be57684e42d364d8bec3e5\n\nModMul = 2d8174211f0367233b3a8df7c5bf0066d6aa792be7cdc5e850a477454d5c829f\nA = 1c08cec52d96136fbd9078b7b8db36ab63b86e19dd3dba7b2e3190ff566180e89dfee9423fa4e99be2187eda6aedfa86b9a45eb1e4655257315ae6a280f0a6ee\nB = a8b4bc9647d8df9b7c76cc6d0f2248cdbc41f5da9c061f9864aa8415c9557582cada456cf23cc32d47d1fc1caf19d36b398019aac4734e10f55ce3cad419e5e7\nM = 7eacffe21f88413af94155a2a8e37f70a431a59653738afda04a1bec72d0d9ed\n\n# Regression tests for CVE-2016-7055.\n\nModMul = ccd6f75b5f24b7c5ce2ce755fa89c2450c6a7d96ce8c8791e659eab84577a7695e3b2caa7c980fb23f60634233e9798499c28b0338c1f1a326d0ca89fd41f2fd88b759f317889832966b551a950043ec7a4b6152d3e2cbfb40e88458e70ab783b96f12d271f828d5b39e198ccaf8665411d85026282dbead5d24cd01b6c8a8e9\nA = 7878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878\nB = 095d72c08c097ba488c5e439c655a192eafb6380073d8c2664668eddb4060744e16e57fb4edb9ae10a0cefcdc28a894f689a128379db279d48a2e20849d685939b7803bcf46cebf5c533fb0dd35b080593de5472e3fe5db951b8bff9b4cb8f039cc638a5ee8cdd703719f8000e6a9f63beed5f2fcd52ff293ea05a251bb4ab81\nM = d78af684e71db0c39cff4e64fb9db567132cb9c50cc98009feb820b26f2ded9b91b9b5e2b83ae0ae4e", - "b4e0523ca726bfbe969b89fd754f674ce99118c3f2d1c5d81fdc7c54e02b60262b241d53c040e99e45826eca37a804668e690e1afc1ca42c9a15d84d4954425f0b7642fc0bd9d7b24e2618d2dcc9b729d944badacfddaf\n\nModMul = ccd6f75b5f24b7c5ce2ce755fa89c2450c6a7d96ce8c8791e659eab84577a7695e3b2caa7c980fb23f60634233e9798499c28b0338c1f1a326d0ca89fd41f2fd88b759f317889832966b551a950043ec7a4b6152d3e2cbfb40e88458e70ab783b96f12d271f828d5b39e198ccaf8665411d85026282dbead5d24cd01b6c8a8e9\nA = 095d72c08c097ba488c5e439c655a192eafb6380073d8c2664668eddb4060744e16e57fb4edb9ae10a0cefcdc28a894f689a128379db279d48a2e20849d685939b7803bcf46cebf5c533fb0dd35b080593de5472e3fe5db951b8bff9b4cb8f039cc638a5ee8cdd703719f8000e6a9f63beed5f2fcd52ff293ea05a251bb4ab81\nB = 7878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878\nM = d78af684e71db0c39cff4e64fb9db567132cb9c50cc98009feb820b26f2ded9b91b9b5e2b83ae0ae4eb4e0523ca726bfbe969b89fd754f674ce99118c3f2d1c5d81fdc7c54e02b60262b241d53c040e99e45826eca37a804668e690e1afc1ca42c9a15d84d4954425f0b7642fc0bd9d7b24e2618d2dcc9b729d944badacfddaf\n\n\n# ModSquare tests.\n#\n# These test vectors satisfy A * A = ModSquare (mod M) and 0 <= ModSquare < M.\n\n# Regression test for CVE-2017-3732.\nModSquare = fffffffdfffffd01000009000002f6fffdf403000312000402f3fff5f602fe080a0005fdfafffa00010001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000002000002fefffff7fffffd07000109fdfffef3fffdfd06000405ff00fdfbfffe00010001\nA = ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000ffffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff00000000\nM = ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000ffffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff\n\n# Regression test for CVE-2017-3736.\nModSquare = fe06fe0b06160c09\nA = fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8f8f8f800000000000010000000006c000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffffffffffff8f8f8f800000000000010000000006c000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffffff00fcfdfc\n# A in Montgomery form is fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8ffeadbcfc4dae7fff908e92820306b9544d954000000006c000000000000000000000000000000000000000000000000000000000000000000ff030202fffff8ffebdbcfc4dae7fff908e92820306b9544d954000000006c000000ff0302030000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01fc00ff02ffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00fcfdfcffffffffff000000000000000000ff0302030000000000ffffffffffffffffff00fcfdfdff030202ff00000000ffffffffffffffffff00fcfdfcffffffffff\nM = fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8f8f8f800000000000010000000006c000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffffffffffff8f8f8f800000000000010000000006c000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffffffff\n\n\n# ModExp tests.\n#\n# These test vectors satisfy A ^ E = ModExp (mod M) and 0 <= ModExp < M.\n\nModExp = 00\nA = -01\nE = 01\nM = 01\n\nModExp = 01\nA = -02\nE = 01\nM = 03\n\nModExp = 01\nA = -01\nE = 02\nM = 03\n\nModExp = 01\nA = -02\nE = 02\nM = 03\n\nModExp = 00\nA = -03\nE = 02\nM = 03\n\nModExp = 02\nA = -04\nE = 01\nM = 03\n\nModExp = 01\nA = -04\nE = 02\nM = 03\n\n# Regression test for carry propagation bug in sqr8x_reduction.\nModExp = 19324b647d967d644b3219\nA = 050505050505\nE = 02\nM = 414141414141414141414127414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001\n\nModExp = 208f8aa0\nA = 86b49\nE = 2\nM = 30d26ecb\n\nModExp = 27308229\nA = 17591bb\nE = 6\nM = 30d26ecb\n\nModExp = 2bdf498f\nA = 21292626\nE = d\nM = 30d26ecb\n\nModExp = 11317167\nA = 4a655df24\nE = 10\nM = 30d26ecb\n\nModExp = 2e1b88e\nA = da6b761a86\nE = 35\nM = 30d26ecb\n\nModExp = 20a12ec3\nA = ea811\nE = 2\nM = 23bc042f\n\nModExp = c42ced\nA = 1011a6a\nE = 4\nM = 23bc042f\n\nModExp = 4637d79\nA = 28d9a601\nE = 8\nM = 23bc042f\n\nModExp = 20e5669b\nA = 72fe6bc20\nE = 11\nM = 23bc042f\n\nModExp = 142ab9e3\nA = 9a07b9363c\nE = 29\nM = 23bc042f\n\nModExp = 14c64646\nA = 822df\nE = 3\nM = 30915765\n\nModExp = 160e35a2\nA = 15ea542\nE = 5\nM = 30915765\n\nModExp = 2f23a488\nA = 34d2e02e\nE = e\nM = 30915765\n\nModExp = 28e67f93\nA = 636a32703\nE = 14\nM = 30915765\n\nModExp = 29bfeaa5\nA = c8646998e6\nE = 2c\nM = 30915765\n\nModExp = 30959e22\nA = 81dad\nE = 3\nM = 326dd68d\n\nModExp = 1a1da4fa\nA = 116adb9\nE = 5\nM = 326dd68d\n\nModExp = 272bf0d8\nA = 2d21ef08\nE = 8\nM = 326dd68d\n\nModExp = 29f5054b\nA = ", - "76989850a\nE = 16\nM = 326dd68d\n\nModExp = e6c7b77\nA = b88ee70d2a\nE = 3e\nM = 326dd68d\n\nModExp = 369605e1\nA = cf26f\nE = 2\nM = 3ce082eb\n\nModExp = 168a3c5d\nA = 1f82caf\nE = 5\nM = 3ce082eb\n\nModExp = 125c4bb8\nA = 2e9c4c07\nE = 9\nM = 3ce082eb\n\nModExp = 1c5fe761\nA = 523ab37f1\nE = 14\nM = 3ce082eb\n\nModExp = 21703009\nA = dc832165e8\nE = 20\nM = 3ce082eb\n\nModExp = 1228d1e\nA = a5555\nE = 3\nM = 24665b27\n\nModExp = 5226af4\nA = 1077bd6\nE = 4\nM = 24665b27\n\nModExp = 1b14eac1\nA = 2db3a834\nE = f\nM = 24665b27\n\nModExp = 161727bc\nA = 6bd962cb6\nE = 19\nM = 24665b27\n\nModExp = 10d61d0d\nA = c10caed407\nE = 28\nM = 24665b27\n\nModExp = 233da406\nA = b125f\nE = 3\nM = 33509981\n\nModExp = 24032799\nA = 1656b7c\nE = 6\nM = 33509981\n\nModExp = 129ecebe\nA = 2e671504\nE = a\nM = 33509981\n\nModExp = 20c20bac\nA = 4d7a2de44\nE = 1f\nM = 33509981\n\nModExp = 2e3ce9d3\nA = c53b3def4d\nE = 31\nM = 33509981\n\nModExp = 12fadfd6\nA = b4cf8\nE = 2\nM = 36e9d4ae\n\nModExp = 457ac85\nA = 1b1c7e9\nE = 7\nM = 36e9d4ae\n\nModExp = 31debef4\nA = 3a973028\nE = d\nM = 36e9d4ae\n\nModExp = 2333ad93\nA = 552b97c45\nE = 11\nM = 36e9d4ae\n\nModExp = 99ba1fb\nA = 8bfb949cbb\nE = 28\nM = 36e9d4ae\n\nModExp = 27b691de\nA = 93492\nE = 3\nM = 298fdb16\n\nModExp = 3c2b70f\nA = 14e7b0d\nE = 4\nM = 298fdb16\n\nModExp = 1486cda7\nA = 29acff81\nE = c\nM = 298fdb16\n\nModExp = 11725275\nA = 507489205\nE = 13\nM = 298fdb16\n\nModExp = 24d14627\nA = e71c55606d\nE = 35\nM = 298fdb16\n\nModExp = 222b8d14\nA = 9b1a0\nE = 3\nM = 3db59d12\n\nModExp = 3b8bd47d\nA = 13f4e8d\nE = 7\nM = 3db59d12\n\nModExp = 17e72356\nA = 334774ce\nE = a\nM = 3db59d12\n\nModExp = 306447ca\nA = 47079ddd2\nE = 12\nM = 3db59d12\n\nModExp = 90bef3b\nA = a75d62616d\nE = 37\nM = 3db59d12\n\nModExp = 1\nA = cddd44f47e84b3276cc36a5c0d742cc703e61c4756168601fbb1b6eb598c161019562344dd56ab6f603d920a12c360b285e6496a3605a2f8d691c3598233ee9366b5f2692554893bdeb67b7bdaf35ab7273ac593145e26bed82c70ba5793bf4bc5cac4c80b01785d1496beede493806e4f4aa89fd8d41de80dd6d0a3e2742678\nE = 0\nM = c95943186c7567fe8cd1bb4f07e7c659475fd9f38217571af20dfe7e4666d86286bc5b2bb013197f9b1c452c69a95bb7e450cf6e45d46e452282d5d2826978e06c52c7ca204869e8d1b1fac4911e3aef92c7b2d7551ebd8c6fe0365fad49e275cc2949a124385cadc4ace24671c4fe86a849de07c6fafacb312f55e9f3c79dcb\n\nModExp = 0\nA = 0\nE = 8de689aef79eba6b20d7debb8d146541348df2f259dff6c3bfabf5517c8caf0473866a03ddbd03fc354bb00beda35e67f342d684896bf8dbb79238a6929692b1a87f58a2dcba596fe1a0514e3019baffe1b580fc810bd9774c00ab0f37af78619b30f273e3bfb95daac34e74566f84bb8809be7650dec75a20be61b4f904ed4e\nM = c95943186c7567fe8cd1bb4f07e7c659475fd9f38217571af20dfe7e4666d86286bc5b2bb013197f9b1c452c69a95bb7e450cf6e45d46e452282d5d2826978e06c52c7ca204869e8d1b1fac4911e3aef92c7b2d7551ebd8c6fe0365fad49e275cc2949a124385cadc4ace24671c4fe86a849de07c6fafacb312f55e9f3c79dcb\n\nModExp = 5150fb769d5c5d341aaf56639a7bcc77c415fe46439938a2190283409692f29cd080bfe3433005d98d24718a03a3553c8560c5e9c8ed0f53b8945eb18290e1c1a83d919302510f66dd89b58acc2de79ad54b8a30d3e1019d4d222556beefca0821b094ecf104b5e4cfce69d2d520d2abf54f3e393d25ed3d27e8c2e3ca2e5ff9\nA = ead8c5a451541c50cab74de530c89376d9a55c723e0cac3c84b25f0093c08a2961e49ab48966361c42c9f99111587252d98395b76788400d75c66ef208ea2767a28d6f8dc3a859f39c95765d57f139e7fc14f47c908c62df051e7216d379f52028843b4d82ef49133cce8fe671ae179423ac8da5be43b01caaf425cd969300cd\nE = 8de689aef79eba6b20d7debb8d146541348df2f259dff6c3bfabf5517c8caf0473866a03ddbd03fc354bb00beda35e67f342d684896bf8dbb79238a6929692b1a87f58a2dcba596fe1a0514e3019baffe1b580fc810bd9774c00ab0f37af78619b30f273e3bfb95daac34e74566f84bb8809be7650dec75a20be61b4f904ed4e\nM = c95943186c7567fe8cd1bb4f07e7c659475fd9f38217571af20dfe7e4666d86286bc5b2bb013197f9b1c452c69a95bb7e450cf6e45d46e452282d5d2826978e06c52c7ca204869e8d1b1fac4911e3aef92c7b2d7551ebd8c6fe0365fad49e275cc2949a124385cadc4ace24671c4fe86a849de07c6fafacb312f55e9f3c79dcb\n\nModExp = 1\nA = 935561297d1d90255aef891e2e30aa09935409de3d4a5abc340ac9a9b7dce33e9f5ce407f3a67ec30e0dc30481070823f8542463e46828d9cafb672a506d6753688cbad3d2761079f770c726c0b957071a30876c4d448e884b647833befbcd6b582787bf769d63cf55e68c7b869a0b86374f8920516cf5d528f348b6057450a1\nE = 0\nM = dcc24236a1bb94c71d9ec162a6aa4697b932717e82b667cad08b6bd1bbcbddf7cd167b7458de2b0b780486b39574e749d6405f9ede774a021d6b547271523e9e84a6fdd3a98315607ccf93356f54daa9c75e1e311e1672d0dc163be13f9ed6762f7dd301f5b0a1bb2398b608f40ac357ae34fc8a87d4fef3b961cbdb806d9061\n\nModExp = 0\nA = 0\nE = bb552be12c02ae8b9e90c8beb5689ffefe3378d2c30f12a6d14496250ecce30317c642857535a741642c3df689a8d71a276d247ed482b07b50135357da6143ac2f5c74f6c739c5ff6ada21e1ab35439f6445a1019d6b607950bffb0357c6009a2bfc88cd7f4f883dc591d4eb45b1d787e85aba5c10ee4fe05ea47bf556aec94d\nM = dcc24236a1bb94c71d9ec162a6aa4697b932717e82b667cad08b6bd1bbcbddf7cd167b7458de2b0b780486b39574e749d6405f9ede774a021d6b547271523e9e84a6fdd3a98315607ccf93356f54daa9c75e1e311e1672d0dc163be13f9ed6762f7dd301f5b0a1bb2398b608f40ac357ae34fc8a87d4fef3b961cbdb806d9061\n\nModExp = bbad67352704a6321809f742826bf3d1c31c0ad057bf81432abeb30dc9913c896c03e69eb1cde6b78ffcb320c4625bd38ef23a08d6c64dc86aec951b72d74b097e209ce63092959894614e3865a6153ec0ff6fda639e44071a33763f6b18edc1c22094c3f844f04a86d414c4cb618e9812991c61289360c7ba60f190f75038d0\nA = 855144760f2be2f2038d8ff628f03a902ae2e07736f2695ec980f84a1781665ab65e2b4e53d31856f431a32fd58d8a7727acee54cc54a62161b035c0293714ca294e2161ea4a48660bf084b885f504ad23ea338030460310bd19186be9030ab5136f09fe6a9223962bce385aaaf9c39fe6ed6d005fa96163fe15cdfa08fc914d\nE = bb552be12c02ae8b9e90c8beb5689ffefe3378d2c30f12a6d14496250ecce30317c642857535a741642c3df689a8d71a276d247ed482b07b50135357da6143ac2f5c74f6c739c5ff6ada21e1ab35439f6445a1019d6b607950bffb0357c6009a2bfc88cd7f4f883dc591d4eb45b1d787e85aba5c10ee4fe05ea47bf556aec94d\nM = dcc24236a1bb94c71d9ec162a6aa4697b932717e82b667cad08b6bd1bbcbddf7cd167b7458de2b0b780486b39574e749d6405f9ede774a021d6b547271523e9e84a6fdd3a98315607ccf93356f54daa9c75e1e311e1672d0dc163be13f9ed6762f7dd301f5b0a1bb2398b608f40ac357ae34fc8a87d4fef3b961cbdb806d9061\n\nModExp = 1\nA = 9d92629c1ab181c50c31619e8acd0d235a1f5fc7a0bef4d4fd54b4f1968d45921f8522efe88e69c6c14c576c564592b9feb00d1554b88b038934eaf4a8ce81a2582732387490181ef158360c8b2d9ccb326ffe043f776a50cb8202837f08ca743b562eefa007150ab7012c341b16248478d4775c02ad71ea13d5e82b71e2d600\nE = 0\nM = cd607549668469b792f495c141e500871880b0611c8004293a561ec7f9ab6561f8a9b90872742386adafb5cd1890e8204ae12aec529cca0a9e382c96439137f09de9973b12c8492c62847e107deabb7dd946ffbb9d0ac73b462c481092bd65326a17f21d8d6527c47a5dba50aaa20c7048b8788a49eb3ea5f29bd5cfce24eb3b\n\nModExp = 0\nA = 0\nE = 9f43dcb641f3ecf4dbc97450f2bdf3b7ec6a2f3e8e96bb1df2bf34b8d2d78e1a9018d04d960ffd0e932cfc60d3b9b923e3f9f29b3f3d61cae3a9f7245078143475c7fcb896ff200f7d94c4f2708bb42750e37c185a31c876814e4f06a00771707654e1da2fb69c16b6500b16385e3b933e2276ad3569977473f699b1c7926c3b\nM = cd607549668469b792f495c141e500871880b0611c8004293a561ec7f9ab6561f8a9b90872742386adafb5cd1890e8204ae12aec529cca0a9e382c96439137f09de9973b12c8492c62847e107deabb7dd946ffbb9d0ac73b462c481092bd65326a17f21d8d6527c47a5dba50aaa20c7048b8788a49eb3ea5f29bd5cfce24eb3b\n\nModExp = 24eaead5b57883c2f454928f8edd470a344bfe07a953194f7d635d705ef13ddfc64140c8ad6f363d4c828e7c7891a6b6d4df37335de4552c319dafd1c06d1f743240082a3535df4da1475d3eea3fead20e40815fd5a0876c881c162ab65a1eda494280c258901ca953d1d039a998bf0e9aa09273bbef4865f3054663b72d75ff\nA = a31618b4532f53729ba22efb2221432fab1dbb70853d6a1159b42fd19fc949965c709b209de106a652aa422d88922ce51dae47f7f6deaf0055202e13db79ee84fc3d3c6f4c003ef96597c49d6895fa53c22ac9e4819f7048146b5272f6279424fdb389819a0b251c823c76f4bebf4f1246de455aafe82a0d34454f5039e90839\nE = 9f43dcb641f3ecf4dbc97450f2bdf3b7ec6a2f3e8e96bb1df2bf34b8d2d78e1a9018d04d960ffd0e932cfc60d3b9b923e3f9f29b3f3d61cae3a9f7245078143475c7fcb896ff200f7d94c4f2708bb42750e37c185a31c876814e4f06a00771707654e1da2fb69c16b6500b16385e3b933e2276ad3569977473f699b1c7926c3b\nM = cd607549668469b792f495c141e500871880b0611c8004293a561ec7f9ab6561f8a9b90872742386adafb5cd1890e8204ae12aec529cca0a9e382c96439137f09de9973b12c8492c62847e107deabb7dd946ffbb9d0ac73b462c481092bd65326a17f21d8d6527c47a5dba50aaa20c7048b8788a49eb3ea5f29bd5cfce24eb3b\n\nModExp = 1\nA = a8558e7f455b27c0c46d7d0862eb409cdefbeca945e0284b5bf425b7ac0f3d316bc365594cc1639decffc621214d61479bc75135120d4ac09ea8b742ad7ec1822091b62b1c6f564fe5e2f4f5b7def92cbaaa9a8985492", - "07ab01b91c2324fbd306a87f7d6379b6fb6493c5fca76729767f136120da9c90bdc7d364f7d242d5acc\nE = 0\nM = 88f3c87ac5e3272a21b8a858da640d6939fb8113a95412c38663a0f352686d69a5d7927e60b484b9fcb8ef12978fe25ff2ebc9b61c5450e04222ef20ba3cbbdc5ec45581ce0f58e10be7bb9de7fa08752303a7a1db23b2ac9c6692ec63bf09ecd6639e06c5491ba568ea886620d71da32d329615f0e1443a75d09ae35b8a2d7f\n\nModExp = 0\nA = 0\nE = a5524b41dfc6b570df1d8f6633ac7777c1131abe3a99c6166b0d29d3b8883c41b00a0c53cdd6f42820bf05c810b6ec53e77a8c1b9344ea0c91d4f410a2f204c369f3db33bf8c88217fc2cf802a9d9bce8119242d8e781875b85431be170076498c0963574ee423551aec9557e2fc672ab1ab5d0cbb1c400535df9481e7934d8f\nM = 88f3c87ac5e3272a21b8a858da640d6939fb8113a95412c38663a0f352686d69a5d7927e60b484b9fcb8ef12978fe25ff2ebc9b61c5450e04222ef20ba3cbbdc5ec45581ce0f58e10be7bb9de7fa08752303a7a1db23b2ac9c6692ec63bf09ecd6639e06c5491ba568ea886620d71da32d329615f0e1443a75d09ae35b8a2d7f\n\nModExp = 292f0b39ca0f1c850b1a00cffd2d54924fcd5fc7e7504c9d593e6c0ff74760b1f4bdd81679fe06c50248336f3108c593fa111072ee87d0fcc89a63243a1dc89044503663eee9bc18f51c3e0193d9108303e12ac90ff78f6ec752a4386af09c42db524a7cbe9a3d4fcccd56c34d283bcc9debc17158b5fe8df0c1888a9841bf8f\nA = b4fde2908745ff92cc5826a27dcfdda09e8fffee681844fa4c7f1354d946d5d84e0e0c7a4a4cb20943d9c73dd707ca47d796945d6f6b55933b615e2c522f5dfc33e0652917b4809bab86f4fa56b32b746c177764895492d0a6a699812b2827fe701d40ef7effd78ea8efe1cac15ff74a295a09614bf04cae1a5017872ba22efe\nE = a5524b41dfc6b570df1d8f6633ac7777c1131abe3a99c6166b0d29d3b8883c41b00a0c53cdd6f42820bf05c810b6ec53e77a8c1b9344ea0c91d4f410a2f204c369f3db33bf8c88217fc2cf802a9d9bce8119242d8e781875b85431be170076498c0963574ee423551aec9557e2fc672ab1ab5d0cbb1c400535df9481e7934d8f\nM = 88f3c87ac5e3272a21b8a858da640d6939fb8113a95412c38663a0f352686d69a5d7927e60b484b9fcb8ef12978fe25ff2ebc9b61c5450e04222ef20ba3cbbdc5ec45581ce0f58e10be7bb9de7fa08752303a7a1db23b2ac9c6692ec63bf09ecd6639e06c5491ba568ea886620d71da32d329615f0e1443a75d09ae35b8a2d7f\n\nModExp = 1\nA = e2845c572b46496ac158a731f612fd40ef626fa7134755c25b1b7614f4d7b29164e6142ddb7985e4c7ebc575855ff901e95927fe98a5aea2ad3a4720c75782323bea1518b2c57790f44efd9411be4e95b3896bad1e73c59658290b309e5a7eb5ef8be08125063e57336b80f17eacee88966d12bbaaa15a25929c82e027cf696f\nE = 0\nM = cf0dee80177869a532f0c6c3a0bda3aad79bdb6b70b6c227b32d75c26e394a90c1f2a6c2bb841ba9f6556b15654a79d8b1dd0c90709a093497bf40be0807cdbb378a74de5893c25067224d3ea8d37387ed6c4a981138853cb89caa9ce6cd0f6a1e95de24d558e90960f93844db4d01e372650350d45a9d34a36042b4d4b9e78d\n\nModExp = 0\nA = 0\nE = a55703a72ca3f6074b939ed3d748196a684a3c8e411c2b39a9beb98993b6eb7ea3fa16f41bc5b5c3710b91c0fc74a8072793052f872f61695db3a2df872eaa427a110f1a8d568c85d58bd350d0df8eced7a10be80f7567360c1a8047b9c44aa2967cd0d9dd2caea2c1492358c2db4f0214da343fdf2e34272865dc5c63be2ae4\nM = cf0dee80177869a532f0c6c3a0bda3aad79bdb6b70b6c227b32d75c26e394a90c1f2a6c2bb841ba9f6556b15654a79d8b1dd0c90709a093497bf40be0807cdbb378a74de5893c25067224d3ea8d37387ed6c4a981138853cb89caa9ce6cd0f6a1e95de24d558e90960f93844db4d01e372650350d45a9d34a36042b4d4b9e78d\n\nModExp = c90e4c69df92e26549b016950b59080947f5403430698e128477782480dd70be96bed2b9042dd8c708eb432e02710555b97af11ce6fa9b53395022851c32d1f53f04237fb0763563b440ca6e81a50d909d907d9c26b7d3c420dbf88f7dadd488666848135f8cdc608dcfb0691989289fb54379c2e84c262f9765f68c012ca1b9\nA = 882ea1b9b6c79a3b1bdfd284658cb6227ad825e0178cab713c7413c2ec34f03cfaec470c4f5c521f5e9899a2123878ff0f5b36a4196c08ad1b04d03746c4bfb5d126f5eefbfe172627d6732710a8ac8890cedbd4fdef69a19f2b3253a5aa0e5dd5484f72d59b17bdd1dad3db209a3ab839368ed3975069685911d7b35e41a9e6\nE = a55703a72ca3f6074b939ed3d748196a684a3c8e411c2b39a9beb98993b6eb7ea3fa16f41bc5b5c3710b91c0fc74a8072793052f872f61695db3a2df872eaa427a110f1a8d568c85d58bd350d0df8eced7a10be80f7567360c1a8047b9c44aa2967cd0d9dd2caea2c1492358c2db4f0214da343fdf2e34272865dc5c63be2ae4\nM = cf0dee80177869a532f0c6c3a0bda3aad79bdb6b70b6c227b32d75c26e394a90c1f2a6c2bb841ba9f6556b15654a79d8b1dd0c90709a093497bf40be0807cdbb378a74de5893c25067224d3ea8d37387ed6c4a981138853cb89caa9ce6cd0f6a1e95de24d558e90960f93844db4d01e372650350d45a9d34a36042b4d4b9e78d\n\nModExp = 1\nA = d7a99e65b8af86b1c51d851f0447e43cd4f343cb0ada7236283e69aa7ebd383826acc9809e5dbc4002d0f2430022cb026458189db3805ce2de1142a31ba71a6c064ab51f0059eb4b931b8bcbaef023c38d57aa5f3e14f5df77e547fc028702071b58bd57338be1e1e4f98d3553484e4de359cefa29c5f58d3fa5d823f389dbef\nE = 0\nM = 8315dacf124bd473c578946347e83d1b20c750a7d9533d6215591be40bc78bcca77821f8c8f95375bbd6372515ada63d22bed2fa49bd6fabb0040c538d08db25b09d2fda02a93ab086cd1c27df93c37ee9c6a0527d089179b8f92b5dc3acf5ef1c75906fb80b03f5c2442a7a4088640f66376575ecfa4c697c1a571397ee5a0d\n\nModExp = 0\nA = 0\nE = 95793fe33696f53e37498b2b65aaf27079e27acf1da97dda2c3e0803e8a02139f574e04ee03f7d1ddd029f528e3f3644515ad6f10f0beac2767f23d9cd8a8b9b6c6e376e36b64a0ae2711d7d31a5a75011641935b503110edbefe9f0ff2da27b5c5f6bb8cc151fdc86f67191bb99160c6cacc86ca368d5bdfafd3f3ff5161b1e\nM = 8315dacf124bd473c578946347e83d1b20c750a7d9533d6215591be40bc78bcca77821f8c8f95375bbd6372515ada63d22bed2fa49bd6fabb0040c538d08db25b09d2fda02a93ab086cd1c27df93c37ee9c6a0527d089179b8f92b5dc3acf5ef1c75906fb80b03f5c2442a7a4088640f66376575ecfa4c697c1a571397ee5a0d\n\nModExp = 186c50ae259aa0fd31859cbcfea534e626a254de33956d5d719334bb32e7cf37cf199a21f079a5b90497228994d05efe19ccd8c769cd81f896286e8ae557cacd1630a928c629ecdfece29ab3697794aa707734e007318fa7029b050bb09ebbe6986187c6ca843f55266d275620b3f0fec0ad5f847ce8b314d929d128b33a249e\nA = 9d5e345793faddca9867f23eeddf6816c1e837f7a2cf96fa077212514acb6be87ac01a237d8f2f1d07d27a8ddd1b0ae0d97e1bda4f205a89435017284cdedea3e407b1b940d6f52112b6359b3e86e4c83074b17c210ae2c8856b42b169b4a7a6dfa65b368a7959496cf9bb1ee93d019dbd79101830e3f5ed08604ab90890b914\nE = 95793fe33696f53e37498b2b65aaf27079e27acf1da97dda2c3e0803e8a02139f574e04ee03f7d1ddd029f528e3f3644515ad6f10f0beac2767f23d9cd8a8b9b6c6e376e36b64a0ae2711d7d31a5a75011641935b503110edbefe9f0ff2da27b5c5f6bb8cc151fdc86f67191bb99160c6cacc86ca368d5bdfafd3f3ff5161b1e\nM = 8315dacf124bd473c578946347e83d1b20c750a7d9533d6215591be40bc78bcca77821f8c8f95375bbd6372515ada63d22bed2fa49bd6fabb0040c538d08db25b09d2fda02a93ab086cd1c27df93c37ee9c6a0527d089179b8f92b5dc3acf5ef1c75906fb80b03f5c2442a7a4088640f66376575ecfa4c697c1a571397ee5a0d\n\nModExp = 1\nA = e6a079bdf7b0638d50b183475e9ddfd5cbdebfb29f5fae8e9be402a0bd36085737b556492ea7fb4b1000ae9ce59db66098129b757cfb29224275fdaa46b8b7eb18a93ca7d3e446dc38c734b683d7ba7927b008d993aab01f44239d3c76be76d1503908e9b5e73b36c43ae0771368b01f39c042693bd92c4fc50810f059e1b332\nE = 0\nM = 81dd561d5d5327fc5ed7c9236b5fb21ef713c6d5e36264ba65ccc801b8eb107b714aad65bb503bb1f4721c0a6f97e5ab89300f049f42a4616ae43d29c089c286687484d18629c1be1b5befbdd0b3cfc86b1d28add89df4cc5e68dac3f56f2490a9068ca9c634ec258c030ec5023baa9133fd2af32fd1112895f9da549d410247\n\nModExp = 0\nA = 0\nE = f0460c5ca9b3a5c2d1b93c201d020dc43e1c81d1daba432e2cd310902da23eb81a5172b0b357484eb8fa2c04c270893b8198c8ad35453405dadaf05195b3aeb5ec0ccacecb4b6227ca43b27b97e240a4148a472670ed60f304302f757495fd4a91af0fe09800db0c3043a6ae213bee6703ad80523ca433d99ca0eab1e0b7c929\nM = 81dd561d5d5327fc5ed7c9236b5fb21ef713c6d5e36264ba65ccc801b8eb107b714aad65bb503bb1f4721c0a6f97e5ab89300f049f42a4616ae43d29c089c286687484d18629c1be1b5befbdd0b3cfc86b1d28add89df4cc5e68dac3f56f2490a9068ca9c634ec258c030ec5023baa9133fd2af32fd1112895f9da549d410247\n\nModExp = 60719701a2dc0bcde281a93ce0b8421d1a718adee43c1b5d9fe9e697a48ab3db4f9f33c73cff305ab6b6c300c149b05c6b289dce4580860dc56bc59de81ac074ecebdc65aa3ca040b44e5b3c80ddba1658d78b9abbc4c77e5f171f5582e70ab4438a8e1e2f062d618c4ad09c70c73b5b5fbc9f8f0bbdf1d530a933b705f85af8\nA = e1b400cd3b1f2f1c6b437adfdb970d2c8108f1b39bdbb13582179552011c6c97cba6bff2c463212b7f62776aa3e3aff9f175990e79395e819c144350b0a23d61638d500ecc97726b098e1af334aece23a851c718612442c04eb7b3805a24cc8f5b90042145eb5e5d6a408092832b6bbeb8a621419a9282fb5c075f41c7f1fdc1\nE = f0460c5ca9b3a5c2d1b93c201d020dc43e1c81d1daba432e2cd310902da23eb81a5172b0b357484eb8fa2c04c270893b8198c8ad35453405dadaf05195b3aeb5ec0ccacecb4b6227ca43b27b97e240a4148a472670ed60f304302f757495fd4a91af0fe09800db0c3043a6ae213bee6703ad80523ca433d99ca0eab1e0b7c929\nM = 81dd561d5d5327fc5ed7c9236b5fb21ef713c6d5e36264ba65ccc801b8eb107b714aad65bb503bb1f4721c0a6f97e5ab89300f049f42a4616ae43d", - "29c089c286687484d18629c1be1b5befbdd0b3cfc86b1d28add89df4cc5e68dac3f56f2490a9068ca9c634ec258c030ec5023baa9133fd2af32fd1112895f9da549d410247\n\nModExp = 1\nA = 9dd1e6f2d3ff24096b54e0ebf0f10e283e484a1cbafc0431adda1296ed97692f3ba99440fd4f67c96dd8bab850e1123361c99362df9ea205ff8e90d1b329459f54730992d5a360e46fcc5f5a909e691abb9a06613d6991bd7c2aa609f0d7b441d7ded0c07b8c394327672d38a905efb2d76aa3be5bb14d0c002aa37e287aee79\nE = 0\nM = fda6f9d8588e3614f5a68ce867a5619f6ddbb8d64450ff402e1c4f1a08b518f79dca21e5983c207c5b7324c16895a1e9f1282fc6cf60b0645f6b02b652ed5b129e67c939e854ab492dec30ea878c3edde10a4b7d1d14c57100c6cbcc5fc085a0d7308715ed132fb917251919c727487fedb66500d5610b0014a43419acfbb92f\n\nModExp = 0\nA = 0\nE = 8622c37631e428402343dccf8ed09d47b3f4201e95058910289a62707c3ce0b7113c390056cc4796cc9893e471b12cb3f63f900f3356ffd25c8b2fed6f6a7fba2c684eb241ca706c76cecbf72473d8a58c02338e40714b5610465cc319f0a529a7aa3898d9e638b247abd1380c6e8f7fa210c9f1a1a2164db6db83a6bba79436\nM = fda6f9d8588e3614f5a68ce867a5619f6ddbb8d64450ff402e1c4f1a08b518f79dca21e5983c207c5b7324c16895a1e9f1282fc6cf60b0645f6b02b652ed5b129e67c939e854ab492dec30ea878c3edde10a4b7d1d14c57100c6cbcc5fc085a0d7308715ed132fb917251919c727487fedb66500d5610b0014a43419acfbb92f\n\nModExp = 86fb0b8dc161c41de2adb0f3ddcc8ad49c1efd729a52793a3ac987d4011c9c1dadb18657dca718df75c8ddcc49d60f152c46ab85ae9076ee7bfd405679a7da3a5195a1bbfd7d2b998c7b135ea91f8c445cbafe1276fa502c2a85477716829a2e0d24ba02623405a3654bed8f355bc7ccdb67c3f9a01e249e358b60d7699498a9\nA = 816610e6018ca47074d55750dd16a281019dbf95dc752605794cbb8ea8d75775317ce685737859728320b529fb3b4414b40bf3a93d08d8994a21ae54682cc1c357eb529837a7b0129a0843eebd9341c9bee3a8ae30475bdbff517e885a0c9f2b6a680643bd981efb53bf9dd49f3dc3cb757e117895fb34b1b4336d9bf8384558\nE = 8622c37631e428402343dccf8ed09d47b3f4201e95058910289a62707c3ce0b7113c390056cc4796cc9893e471b12cb3f63f900f3356ffd25c8b2fed6f6a7fba2c684eb241ca706c76cecbf72473d8a58c02338e40714b5610465cc319f0a529a7aa3898d9e638b247abd1380c6e8f7fa210c9f1a1a2164db6db83a6bba79436\nM = fda6f9d8588e3614f5a68ce867a5619f6ddbb8d64450ff402e1c4f1a08b518f79dca21e5983c207c5b7324c16895a1e9f1282fc6cf60b0645f6b02b652ed5b129e67c939e854ab492dec30ea878c3edde10a4b7d1d14c57100c6cbcc5fc085a0d7308715ed132fb917251919c727487fedb66500d5610b0014a43419acfbb92f\n\nModExp = 1\nA = 9edfce4691f46eadaa2043c7b1092b831ed50f3429f0bca02f985c0b77c686d951be84d772ae4b55f08935bed6e3206c8441574f215736b5c1c1b7595b3b789b55cf56db83741b10144d6767ba2b97b23a5e83504c60e06ab22834b0145655aa0463108317a379cbfc8a93de8a66925a999b8b02bf88dd85fb9898cefe9c95c8\nE = 0\nM = dcb68f6aa530ae9b31d078e2e82670adcc98228e7cf1aa59f81e66426ef14b1591b833d889463564c75b5fd5551ea295a0da581dd80f62c7008ff0f26a1c9f4f756431d48198af157149be8698336b306b0a8b8635d3fc2c4c2194ecc4d2af31ca1892917cc2e621d702eaaeed0d9a0c3dca575451eb8bc5487e313988cae745\n\nModExp = 0\nA = 0\nE = a3be10ef04535fca6784e5dbf3733d677dedd50fabbc3a860496628950b4747a328c2ce0d903cbe1e700f0af30f59fb917202257815097a2b516df5d0a82642faeffdfc3b7883766c78fc4be5901ebef891a9ca27f3bcf00960729e659bb3fddd54a19ce628e95ab86e4c7a168588bc9f67b05dd21a583acd8dc36e615945648\nM = dcb68f6aa530ae9b31d078e2e82670adcc98228e7cf1aa59f81e66426ef14b1591b833d889463564c75b5fd5551ea295a0da581dd80f62c7008ff0f26a1c9f4f756431d48198af157149be8698336b306b0a8b8635d3fc2c4c2194ecc4d2af31ca1892917cc2e621d702eaaeed0d9a0c3dca575451eb8bc5487e313988cae745\n\nModExp = 442866609915aa6f1bae9dfb59e721e1b63f42c0f75fbf0a88344120fbbd7aacf15208fb7c9d8bb8477d553cbd826d7e685ad764a8423e81c2131c040ee83a03cab8d5ce50866a941b48c78e9f1330794d908562d4141cfbf26e8c80c69551339eec41e37e2b37b54330f7bd75748f8d26d56ab9eb3b0c127540484c6445a7fa\nA = 8ff65e2cbcbcd8697cc3ce9a26855d6422ac7eb4e66500648c08be697e005cc3c854a54cfab91d43489cd60be8b516a9b3c9688e5e009a1689c6b164a133859a5464ef422c86344fef42cc477c9df27768377c126a066d1b62f593b7f6d6e906feaee16addb7cfbfc043d741b7dc81a87c17f167b7b8ef1b1fb3dfd1eb14102d\nE = a3be10ef04535fca6784e5dbf3733d677dedd50fabbc3a860496628950b4747a328c2ce0d903cbe1e700f0af30f59fb917202257815097a2b516df5d0a82642faeffdfc3b7883766c78fc4be5901ebef891a9ca27f3bcf00960729e659bb3fddd54a19ce628e95ab86e4c7a168588bc9f67b05dd21a583acd8dc36e615945648\nM = dcb68f6aa530ae9b31d078e2e82670adcc98228e7cf1aa59f81e66426ef14b1591b833d889463564c75b5fd5551ea295a0da581dd80f62c7008ff0f26a1c9f4f756431d48198af157149be8698336b306b0a8b8635d3fc2c4c2194ecc4d2af31ca1892917cc2e621d702eaaeed0d9a0c3dca575451eb8bc5487e313988cae745\n\nModExp = 1\nA = fe9f77f7d0475e00ec964c0effb9b8e079c32e376ce77a9c40ce4018c3df44a77b4f294d9565502b2b79accb30cb58dda6d15e1543b6d4a53296543ed11c7f51baab60283ef03fae37dfeacb431392487ec2839551a933895c4dbf18844f7b375d3e6f558d3c39993cea1bbf7fb743a6a07bd3753c03eb7298811476d7f3ff1d\nE = 0\nM = e7a96cf6fa930f73c8bdc2726bbba246001a9d27f39cc2b978c99dc6f15af0e8aaf26b565302f1112e607e2df4066948baba931b89cd9bbdea2072e05b9a4968fdf282c43d997987c3a3a0434e925a679ac81f316b7a7b724b79be3d6888b66f4512759bf66cfaaa88b9513dd27a44aaea75437268a014c4eb50ba2e50093511\n\nModExp = 0\nA = 0\nE = a0bc148ed50a9b54036bb8fa1f214979052ebd47db8b347af3bb03b806bb457b468ba34781f8a25f289a7a90af4903dc14809a166df2f4c3527de2ea6911cb1afb9071a4afbb522a7d50634d66fd584c73f32d05217dc9f7f16394c68a692a953492ca85f89cc11da95fd8cac6231647923ced48a1b3b0ee68c010286d452836\nM = e7a96cf6fa930f73c8bdc2726bbba246001a9d27f39cc2b978c99dc6f15af0e8aaf26b565302f1112e607e2df4066948baba931b89cd9bbdea2072e05b9a4968fdf282c43d997987c3a3a0434e925a679ac81f316b7a7b724b79be3d6888b66f4512759bf66cfaaa88b9513dd27a44aaea75437268a014c4eb50ba2e50093511\n\nModExp = 91fd879d02f95a9f40fcd1037726f73892caf84e9b43b4aa4126d9062a0d22c464e7af2fbd91aa849612d99d9519b724a7fb1cb018fffdcff321d883ab2519953c9f174f09dd8f13ac87339887385966eb4a94842276637b2c36c0a5036b1d3bbea438bc6efd4b4851c7ec06879d60694df894717569bcd31c4b13d80df6cbca\nA = cdec5edc1cb3ea974342b85aabc0f9385cf877ca328747d40dd4d297623ad69ab6582653faeed5aef225208305135cfbee32e066cb43e18afacea3a32acc8aabbc49617ac33e741651924ae56dd6aa044a12a1ea50fef573b5befb2f4b21b9cf83ab2aaa6fd153580a0761666ade8fb94f202a3c3dc4f33297eabb4564374168\nE = a0bc148ed50a9b54036bb8fa1f214979052ebd47db8b347af3bb03b806bb457b468ba34781f8a25f289a7a90af4903dc14809a166df2f4c3527de2ea6911cb1afb9071a4afbb522a7d50634d66fd584c73f32d05217dc9f7f16394c68a692a953492ca85f89cc11da95fd8cac6231647923ced48a1b3b0ee68c010286d452836\nM = e7a96cf6fa930f73c8bdc2726bbba246001a9d27f39cc2b978c99dc6f15af0e8aaf26b565302f1112e607e2df4066948baba931b89cd9bbdea2072e05b9a4968fdf282c43d997987c3a3a0434e925a679ac81f316b7a7b724b79be3d6888b66f4512759bf66cfaaa88b9513dd27a44aaea75437268a014c4eb50ba2e50093511\n\n# Craft inputs whose Montgomery representation is 1, i.e., shorter than M, in\n# order to test the const time precomputation scattering/gathering.\n\nModExp = 9442d2eca2905ad796383947b14ddfcc341f5be8fec079135c36f6f0d9b8b2212f43e08bf29c46167ff0fe16b247cd365df4417d96cc31c94db1cf44b73b0ee3ebcc4920d9b0d003b68e49c1df91e61bc7758a8a1d2d6192ff4e1590b1a792f8be3a1b83db3ad9667d14398d873faf5d885ec3a2bef955026fae6dbf64daea2b\nA = 3a4b4c57e62c5e9d1a9065191f8268fed9d5f6f424d071acef66f0662b8210f4c029ed991512e40c9c912043c816d2c4c5b53fa0e5c253e16808aad4225130dafbbb89fd4f30cdfc1c2f2179b636a7ddc4be579795820b4b9377637bd8a21a0ef5a90d0e0f865321eee23d9be2a3b7320b4012d02941b892df2c40bdc85c1898\nE = a2c56ea1362511cac0301918e15a9afe7d37edd438a5c3538d258ea01f0a6df758de07111e868b3ad8fc89b629b4955d78a1b3af902be1806410ddde25ccc6a196ba5949395c1ad5d8725b18815dc1cd5ac1c7dd17773f571e3f2e628255af14476e0494be23a4a4dfd18e23142f33d7a59c236fec61660e360d9676a747c69f\nM = ede35a3a7afac817d413373a2032abbc067b1493f709ae6e1282ee5469743391d891b904938857168802b7872d3cd7ac18ab249a9e540a86f970b1d0f310a4cc29df1cc9d4063d98c554f1a32f4ca5eba3523cdfb142e0fc609907c7a92bb0187009d97ec471db3545f42dd5fd29c07b7816085d09477ba31fcf90084660116d\n\nModExp = a7f5844fa9e7202d4b70ee252c9846e63d3d091b0387768ded872cec53458e19df0d9b4960226e269b8ca5dd4c4eda423a67b6dbb48235c08c12c6c7c78db47287756d3ed9cecb9232f7d18d5d80b9676cb68ba4a290c97e220beb1a069976b5e6022a4c1e5ddbeec86b62dda24ffea1deda37695c9f61a8817218e6370c0679\nA = 7d6d0cc947ceb949cdc4e9e1044f5deca5bb05a491041e0d85bc4b92a0944a57c72845fad91e59010c61ad1712bd2f612d53a846a044632262a9f2e3373b062fde2484e0c165ff947f2469f743ab6e2e5e13c640fc4029b1c9213eb8473c674e7f9", - "e95a4a5c5636d4656c1e696962340d77b322daba47d6fc894f2a2cd9e0afc\nE = b78012afe806e2344d004c739c97324256850980ac97d88c4ed9a838517639ca112e235978d21a176c33f5a68703aba0f2a05501bbe3fc8d49a000fbf530cdb431581dfaf8683cb15a2aee5e239cbc542827100da3b47babf4a16ca7c588aff9912e674abb449e0b767a15e415f4e7f2bbd6380d7131da3df8d49b13bfd35ce3\nM = b72d5c55bd2998472f1965e75a51be6155c1ba04656da8f66bcb34db36a7b1db66a89d1d05b1bde10206acf85be7b474ab689220faf1bb52ab39d8dc00512dd4e26df1179c11b973e1274db85a88c7cc2a17113abdffe58cb930ddc5f3ccc4d68b4e65c913730509f7ce5656e8bbaba9b1be177ab9f766678f018fea05da9cdf\n\nModExp = 465ff295786a88496828fdc763e9292d557957544e9322b7996807b87fdbfa7a11614bffeec557ca831c4824c8e4ca3b1a1c7f3f4f95ec3fd6a86b73bb13d78b73af2b3c7e76954d0cc03bcb0cd606867ebb3765a8b3d0108cbe4f343a14016be9c33f6d200f0dc547e7d6b02bfab1e79dcdf9c9835a814cc6c855a12ebeb66d\nA = 89ad02bea3e9ab839a6e23f20122409daba52c68e1e893034b30d321c0305434a6af940015e3fa5ca9c35230da34beeb1ed4fbce6c1da3a8bfe3f3ae172276c1d1723b47ee61e6f8fcfdafad102d6f7ee2a79f510c7edb93096205a40a6c9e665b88b18f39a979e2e61286d939952a6f02fe8148b7515bb25f4252337cb6e60d\nE = cbd6ac628cc7afa3c61bee9c22a06a395087ec1811fe9681b55216700c435996c815e7cec8aaa90016dd2382d0306a5414630124e14f3d396a4ba02ee17851bf720f1607ff813e4bbddf01338983db12f59bd6371a738eee3eeb716f21051d6174d2d6c77602942b9edaac18d4b3a723096c0d00dd23a8a605c585022f311560\nM = fa7a3e40364c8a8d0f14f0213a3f3e035222ca0ea19d46d10ba41580e5dd2805c8a133f3856d7d5d97f922ea540e5eb0d10ad04dfdbb74f518f58da0099a6fc2b3f3def92985176e07fc78aff2faebccca10a429794e5f15ff92f75fe90f527c60ddea8093a9078c703c372ca09f7aeb27ade02f3595308c61dd9c44e62fd101\n\nModExp = cf08bf00261402102e9fe03f3074471dcf0e9b3c96d4d1503f099f24ec85e1901b023e9e048c1ad042244f5f70b38b25a99f4c0a7b57d5844bb0d0137367f45f4ce2cc7746105b77414768cb97648dc5721149aed2d4c682408cc0d50d26dd0bd77e848911f8625c727cac5f32e63bcb548f41a57d718d772f23983a42f603bd\nA = a419646a6631c2c69b18f7aa65011825eb31692eecaee9d74f92d92203811b68e9764bda31a1585bdf69b6273fc6f9f508c395ac081336506525dad88473512f08a205621ac8b16e9864c7a7c5a4f17435de00d0b32badec6ce4897e3e1076c562b6d9523f63d0b2079eaa416cb090471657763f24931d955d1fa2720c80a9c9\nE = d5a6f4a1842aaee39805356dc8d0d678ee03b2c81277345beccb2742f899132feb43271f95968a01ae68aa8277201851992dc0aa7a71c90aae71b124d873ee264ea400fb131be0fc6c4ce8c04c45f6bdaca89ac743635caf6158983d257e21cef6800d7f990e912ba21bbfb8fb779afa4abd19e07e7e07eee9908493d1ca502c\nM = e739689b6cc6def1d45fb1a2ab551643beeb303f4aaa4da47ee5e4948510f8445b4c40e99ae8354dede60b2ba6694e93bc4d573b7e8adf871b7a9a9636eb7d70f2e49328e2d7978143b177cee8374ef01bd1ee2d95862765883f5e7971668b53ef0ff41b6539faf63c397522b0bdce916388e72e26c8d3d2e58dadeb9eb5d479\n\nModExp = 827e6312ec3b14600203bb83f5b277ded197b2967363630ef673240df05edd3ba8ab2b11c86251a612206569c6c33952b31e264f129909bfe723bd0ee1624b36cfcfaa893a6ec8b5a1f7de79f83e79b459a3350f89f412ad1cfd6bc4c2a7a29272c783d6ecceeb1398fa17041835643f4debef9b5e87b098d104bb8912dddf7c\nA = b8e49c637829021d32db3a39a0c1e58cdd4c6e4eda7e8e9293be379e9c2e2d184f929d278598a81ae231cfedcf69cce4a6e31cda3c8ac14d753a7311f2436e29795f0dfb60259a0f61a997918ff984aa2284b43a9d64c974059e9682adfffd018305835f74eda8c75fe4877d811c1620f654ec9f7f32d1af5ce59115e2f41785\nE = 80e0febf369d234bf1aaad4f82df2e2ff02882c3184781f6ccdf4f7cd93b6887af86830077c84dfb02109ada05b40970b1c65228b0c19030bd6361c3537fee22a8155c03b4e7007ca006c6daa3659518d05bb81ea0079456d0ef6116df248dffdb0c935f321f5a1034deefd5a9414a0652aa6548de33325b474b9e5a8507a082\nM = d5eb1d14af842a9973274f7463d90cf0ccff19c47d710edbae184478d4f29b02693ed7958bd487054327b9e6d8879e24c9af7730b92f323eeac05558da6c1b952e5dbf13de236050a77628bb5325fe0d14cc5773bf73338759d5ab43c212b414581280f1cee250007e53791b800b61c90de0328acd7bc43fbdda48158939392d\n\nModExp = 4a1efd29c7e78549f5cd4deed1454b37462c7810ee6a8a2493b764dfa479be13b314cf9ff98259517d61865567ef499a511630c0038c97914625df181c6fe07892f329f98b344a78d751e9471483eebaa7977371bf97bb25187ae7e93a9227d6c124ccb4644423c961a11ae59c4354f89d5a95164c23d9aa256e289e9cc0858e\nA = bd86c9211fa6a47a06e5016c46cb8a99e34a043a29e22f8c3196fa7197c26b38927b8d9bc0ddc11a5fa4bcc44deb69dbf37cbe7ebc9a2fad6c74e09ab5a9dd929fa04ab4319b6caad1035739be78ba631fb0748d9e53944836d37ccda6e6a62823c696d8f31139ccd7f2f86b22fa026ecf433cfb1271a3539ac4f1c83aaac059\nE = c40b9972006d28a84c2769a86e526a2b274f73afc7c5c6a2742166757f61b5f5fdbb228afa157af62af989ffe966f232bba9e6beef5403d1690ade31a6410f7f349a35bc4267a129afd647993df7d45cc0e1a1ba4678d7f1b6e8a344d8ff7037679e1f4db25a454e4246f6b55c416567fcfa188e8a3865115851d9edf0aa8902\nM = cf424d7af75ce7eef90cad75ae55ca8810cc7b4703fdb5bce701e7bac07e0c371cae06df2aa8facb55a0faa6793e4d2bd9d7969703743b9be170be82792aeea55e2bc0f7ab7617b276486bf474dee2f4556aab595ff3ef115139cfe5e21ccd4ee05c0e1cf901bd85df86cc17195a783b0be836d00bee82ce064077f9191188f9\n\nModExp = 3137a3049fd4ad2e26d870f5c998cf11bfe82101884a82e85e43facd0928cd7434a2e346ca124619769fa141bbe92ad6f36b99231032ddaec3b349a410f82b5ca36f45e56e5fb85dc63d32053dc90805d3f1854ab385281a71a57726bf97158494e7476057214ca7379ab8b70f5bdc15f70bdad3adf33c3a1f9cd1b6bbbad556\nA = 39a1dc6a4c3f14d9c350ee968d5ce139ef725952c967a2d1bedf48ace22091283525be03807e2e263d2640be77f0525247bcd07149bba50568cec5a082c87d72962cf9e43bcb5cdb1e7e9a650fb53e0ec2fad37f09a9f036c0d7dfa528fef846769f80a9a60854910ca1b4ee05dba82ed2ee018348d6b3e52a764b8ffae61e0\nE = deaee3a3f80c9f684ed7110c0653847ccc7be5ff6d982fd4b49f59b5dd35f7210b1077babbcedbc127df35cd469dc6e569a0f84e58149b5605c94b09fd7f0b098d02b4a04631328b3fae39e6c2fce25334225cab71829abdb9507cb903701559660f2c08c3b743336119d1260a0db27054cad3f28bc1b04b2289baa58fb33965\nM = 938388927d06ed3bb1286c0f06d3054cb0ee16dc7a0bbbf13a45293c09a5f40f1d611b2e1a1b0ec2ef109b508e27af4274954905cae52034f8740a744153b4d22059f0dd262ea51785522098ecacced6da07709ee6b5acc8c4e99331379a7c3de7f4e2d1431e43b19570140955b7bcba118dfbaa552cbfa2be531e8f781166ed\n\nModExp = c15ae334455d9f4d1030cd33e734726a27c63624c2afc576238cce5e0498298a4a0c93090a0d19568b41290303c4b558f3d9dd74f9cde8798710f68569ea0d6fd971ce67ec5b54495031de3d8842b8b49288725bee5c9f72b99054d64986ccd4e18d70d5f33943f08cd694eff538f84438ea993ebaba0910c95b3a694f213510\nA = def633b955a917569df3ba8517455eef0655e7a35985edda27097a063e0d82c7c3a76dc36c5d8a71ba9d540790ddd0ea514aaed98925f9a1808eb288d387aaf9605a9ef8a333ebee7ad7057bca012efd619d5867f02266f65976ef4b16da17468426ac4f99b3e8921707e01b4de20f6f9a068e6a19d872079a27f3a44449db83\nE = a465c47b0d15d48e01bb8b1d8e3b3253e11515f6874dbed6c25818adf1a8fd927124d5593beb367f685c11e46f18415be73ccdf16fa2e93a600b728163d21d232849e5278c3749d903edad3f1c4535a2f55a2ab65e7ebc64888bd2a0527e876ecf38cec3ab1980d08138709fad8eb88ae65d960adc3f0f8e92f784fe96fcb693\nM = e43cb9ac1446154356cdc31ec771c79b0e461e22d95185bbe1a279c0945e3af07903a0cb54d553380716fcdcafb4b7cf5dc6da481dc74a8c583d75ff6c1f8e429182d200246ebc473bb56e173787987c1b7fb2dd23f5b2e438a97bc4a1df628bc044fdd1e80c0cf37030adb7b04784dab827d0dcd64f0dbf37c980612570ce11\n\nModExp = 75c3f79ab7c991b98e65505342a8a563cfb08b5d3ccf8664c7db1de50256b1d17ebf7096dc98c7bb5d7f027a894ae5cbb14dee04d5d445e775ad7e239acc82673b0ac2d819a69c83864f34e73d9a636f05de8279619a067b4c90ad038db5910447e03841d2034635018f08cbcd21efa00994247763a249082594128112f95232\nA = 34def7d76f6f158a359fd12759fb889cdf6af0a24830dc3e84283a1ab4e9b2647a6a36b86482f829b2cdf3e3d6028f9a884b1f64f7262315446bea8b0231828e2f3d990fb103c17f820b39e4b8427c85643ceeca8f5dc8f191d1255768300e859bd7d88c770319ef38269660d221cb3bc061389b6fc0783485ef042b1c7d6fef\nE = c6c46453dd5aac6b37277a446b1d0c69cbe476eeff55b3ac35edb89ba97116b0e7783660f2c7b31b2a2d6c4709d0ab45d01a838100694b0777c9c9c14c959b07c437c73a5eabb7402f1001e802d797a2e7707285834fb6440a1c2f727f7bb84ddb2a49312d32fa0ce620c43872655cb5c394749c9e75d7fa25be00efe50d47d6\nM = fbbab6698a9142095c46b38a732592e4366c1838b84bf40f8c8fc7b630f73380a0d09765562365798f8c8030ed1b6728329d8bb06e882c35a1d59bfe84146a9db2afe42a414014e247390281c782fce806d62adb54778d2bcb49555459429d6ed446af5359657667f6aa19e8e3e0e24ab2bc312b2d90b5cb1ce6f2f15af15d9d\n\nModExp = ba16d7f3f6e162ce248490d164a13c00e7720d8a667e2d3ebeb13f1663e15ef5408d5b56cbc7bc793a8ca787cc50f8e15e0e9d4ee764531d04a9114eea556bb3e206ed7d85267151a056b6e68fbf35e03f2cf829708ffe1de13e95ecfe365aff1eea36340ffcd3892dee659fb1ecbe50f5080e54737c10f9c1ba638b1", - "4ef537e\nA = 9025e6183706105e948b1b0edf922f9011b9e11887d70adb00b26f272b9e76a38f3099084d9cccf12d04b1a99c0f654f8b9ed90c6dff9478c60bf05d58d734ab60eaefa14a22230ec60c90dc1f0704b61eef0bef345785ae0e6a9af7db069cf6bd2b4e0fe58a0ade83c7e46a04b9fe1d24cb9b65c6f80de713e61d70eae5b286\nE = d7e6df5d755284929b986cd9b61c9c2c8843f24c711fbdbae1a468edcae159400943725570726cdc92b3ea94f9f206729516fdda83e31d815b0c7720e7598a91d992273e3bd8ac413b441d8f1dfe5aa7c3bf3ef573adc38292676217467731e6cf440a59611b8110af88d3e62f60209b513b01fbb69a097458ad02096b5e38f0\nM = e4e784aa1fa88625a43ba0185a153a929663920be7fe674a4d33c943d3b898cff051482e7050a070cede53be5e89f31515772c7aea637576f99f82708f89d9e244f6ad3a24a02cbe5c0ff7bcf2dad5491f53db7c3f2698a7c41b44f086652f17bb05fe4c5c0a92433c34086b49d7e1825b28bab6c5a9bd0bc95b53d659afa0d7\n\n\n# RSAZ 512-bit.\n#\n# These are regression tests for code which historically reached the RSAZ-512\n# code. That has since been removed, but the test vectors remain. Note that the\n# lengths of the inputs, especially the *bit* length of |M|, matter a lot.\n\n# Control: No relationship between A and M except that A < M and they're the same number of limbs.\nModExp = 7f34c1cd63377bc3abf2bb5b2d1bf5f06454e1e8040fe19a72245ce9731cbee1bf9e84532300776c8021ed4f3a8de508d85b4cf320bd82065a013754857b50c4\nA = 8e4e67da6ff890643d0599387955996ef6f0c2045eb9944576ddb965ca64cdb6247727ce128ef178d4a84e5a56d2e67eb0fe389ecbf691f9244ae80f4c11b364\nE = be99d8f0650e540b9b191e9cf96f74881b902e32ed169ffd8a1776c3f3e80f0ac765aa14615713e1549f250a20fe4ee48c4e0c6176162fc7842a0dd64d640d1\nM = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\n\n# Same as above except A is negative.\nModExp = 71fa6a4c8ae75368eda8cc6282c26afa69e2af12a97fb9444f16b7dd6c99e0a5d6034cab4248cae4357346b211039f4a2bc4c5a20a297372094162417af703cd\nA = -8e4e67da6ff890643d0599387955996ef6f0c2045eb9944576ddb965ca64cdb6247727ce128ef178d4a84e5a56d2e67eb0fe389ecbf691f9244ae80f4c11b364\nE = be99d8f0650e540b9b191e9cf96f74881b902e32ed169ffd8a1776c3f3e80f0ac765aa14615713e1549f250a20fe4ee48c4e0c6176162fc7842a0dd64d640d1\nM = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\n\n# A == M - 1 == -1 (mod M) and the exponent is odd so A ^ E (mod M) == A.\nModExp = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725490\nA = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725490\nE = be99d8f0650e540b9b191e9cf96f74881b902e32ed169ffd8a1776c3f3e80f0ac765aa14615713e1549f250a20fe4ee48c4e0c6176162fc7842a0dd64d640d1\nM = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\n\n# Same inputs as above except A is negative. Note that A mod M with a \"correct top\" isn't the right length for RSAZ.\nModExp = 1\nA = -f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725490\nE = be99d8f0650e540b9b191e9cf96f74881b902e32ed169ffd8a1776c3f3e80f0ac765aa14615713e1549f250a20fe4ee48c4e0c6176162fc7842a0dd64d640d1\nM = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\n\n# A == M, so A == 0 (mod M) so A ^ E (mod M) == 0. Note that A mod M with a \"correct top\" isn't the right length for RSAZ.\nModExp = 0\nA = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\nE = be99d8f0650e540b9b191e9cf96f74881b902e32ed169ffd8a1776c3f3e80f0ac765aa14615713e1549f250a20fe4ee48c4e0c6176162fc7842a0dd64d640d1\nM = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\n\n# A is negative, and A (mod M) is the right length for RSAZ.\nModExp = 8d76eb0f8c7bc3160cc8bb0e0c3590fbed26c5932f5f525b48045c0bd46dda287ba5483f97c851fb7c12c2e858ee7a4a4d1af745cbfb3eb311fa54bea12cde25\nA = -80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\nE = be99d8f0650e540b9b191e9cf96f74881b902e32ed169ffd8a1776c3f3e80f0ac765aa14615713e1549f250a20fe4ee48c4e0c6176162fc7842a0dd64d640d1\nM = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\n\n\n# RSAZ 1024-bit.\n# Note that the lengths of the inputs, especially the *bit* length of |M|, matter a lot.\n\n# Control: No relationship between A and M except that A < M and they're the same number of limbs.\nModExp = 8984f8c16044f9c0ad7bd72347af90f58e6e003acda92b76e3c7c4a56ea8e918409d8e9b34884d4c89d0b17cb40fe898f2627c084a0f1698e46beccbf6f48eecc281e11ea9e5135adba460ddae157f2c655b5f589ce29b254d43a960a71cede8a08dbb86be4dac22458da232fb1ec2470856827302ed772c9ddafa408c931aa7\nA = 21158da5fe20356825e72b3f5384ec57720d22f727b27ce2f945c8ee311db781add73bf8fae96b775c909bd22fca75c44c2b0584284a5bb1c07f8eefcd6b0a44047a02b185df34f897f11d4fb9a86c9eb841b4cb8d0383441fdc5af3ef385b5e8380f605d73ed41bb42eb2c2a5704d6034b3ad058dafffce83dbbfb6295daaf8\nE = ecdebd112b3b5788669449dcddbd479a203ee9ab72a9bb9c406b97623513bf0ab9a22f1f23634d269e16bfd6d3b64202b71fc355057411967b6ac70f8d9cef0a4e06819a9a18cc06bbe438243fa9759303d98be8a65dc1cb13595ee9b99f138554425d50f6fbc025d8ffa3eaea828d6f3b82a3584146bafde34da257995f0575\nM = ff3a3e023db3bba929ca4ededbace13d0d1264387b5ef62734e177eaf47a78af56b58aacc8ac5d46f5b066bafb95d93d4442bb948653613eec76837b4ffb7991cb080b6c8b403fb09bc817d026e283ee47ab2fc9af274b12f626eda2fe02004a8e27b9ed7d3b614e8955c7e7c2c0700edd079455237c4475fbd41857e206e4b7\n\n# Same as above except A is negative.\nModExp = 75b54540dd6ec1e87c4e77bb93fd50477ea463fdadb5cab05119b34585d18f971617fc1194240ffa6bdfb53e4785f0a451e03f8c3c444aa6080a96af5906eaa508862a4de15b2c55c023b6f278cd04c1e24fd0711244afeda8e3444256e51261ed99fe66beedb52c43c825b4c7a1adc7d4b111e2208ecd495df91e175573ca10\nA = -21158da5fe20356825e72b3f5384ec57720d22f727b27ce2f945c8ee311db781add73bf8fae96b775c909bd22fca75c44c2b0584284a5bb1c07f8eefcd6b0a44047a02b185df34f897f11d4fb9a86c9eb841b4cb8d0383441fdc5af3ef385b5e8380f605d73ed41bb42eb2c2a5704d6034b3ad058dafffce83dbbfb6295daaf8\nE = ecdebd112b3b5788669449dcddbd479a203ee9ab72a9bb9c406b97623513bf0ab9a22f1f23634d269e16bfd6d3b64202b71fc355057411967b6ac70f8d9cef0a4e06819a9a18cc06bbe438243fa9759303d98be8a65dc1cb13595ee9b99f138554425d50f6fbc025d8ffa3eaea828d6f3b82a3584146bafde34da257995f0575\nM = ff3a3e023db3bba929ca4ededbace13d0d1264387b5ef62734e177eaf47a78af56b58aacc8ac5d46f5b066bafb95d93d4442bb948653613eec76837b4ffb7991cb080b6c8b403fb09bc817d026e283ee47ab2fc9af274b12f626eda2fe02004a8e27b9ed7d3b614e8955c7e7c2c0700edd079455237c4475fbd41857e206e4b7\n\n# A == M - 1 == -1 (mod M) and the exponent is odd so A ^ E (mod M) == A.\nModExp = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d964\nA = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d964\nE = 61803d4973ae68cfb2ba6770dbed70d36760fa42c01a16d1482eacf0d01adf7a917bc86ece58a73b920295c1291b90f49167ef856ecad149330e1fd49ec71392fb62d47270b53e6d4f3c8f044b80a5736753364896932abc6d872c4c5e135d1edb200597a93ceb262ff6c99079177cd10808b9ed20c8cd7352d80ac7f6963103\nM = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d965\n\n# Same inputs as above except A is negative. Note that A mod M with a \"correct top\" isn't the right length for RSAZ.\nModExp = 1\nA = -b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd", - "9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d964\nE = 61803d4973ae68cfb2ba6770dbed70d36760fa42c01a16d1482eacf0d01adf7a917bc86ece58a73b920295c1291b90f49167ef856ecad149330e1fd49ec71392fb62d47270b53e6d4f3c8f044b80a5736753364896932abc6d872c4c5e135d1edb200597a93ceb262ff6c99079177cd10808b9ed20c8cd7352d80ac7f6963103\nM = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d965\n\n# A == M, so A == 0 (mod M) so A ^ E (mod M) == 0. Note that A mod M with a \"correct top\" isn't the right length for RSAZ.\nModExp = 0\nA = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d965\nE = 61803d4973ae68cfb2ba6770dbed70d36760fa42c01a16d1482eacf0d01adf7a917bc86ece58a73b920295c1291b90f49167ef856ecad149330e1fd49ec71392fb62d47270b53e6d4f3c8f044b80a5736753364896932abc6d872c4c5e135d1edb200597a93ceb262ff6c99079177cd10808b9ed20c8cd7352d80ac7f6963103\nM = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d965\n\n# A is negative, and A (mod M) is the right length for RSAZ.\nModExp = 9cf810b9e89d5cbc4b79ae64e123ea06d92965e2bab077df97a1b906dc2e1ddcf96a9c4ed14e2cd96309b829ea9cc2a74a7d4b43c5f34d792a7c583201427754b8f78b783608070a84b61f18913e3ced7f7f530972de7764667c54e29d756eea38a93cd1703c676a4587231b0ebfeadddf908e2877a7a84b5bfc370ecf0d158d\nA = -8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\nE = 61803d4973ae68cfb2ba6770dbed70d36760fa42c01a16d1482eacf0d01adf7a917bc86ece58a73b920295c1291b90f49167ef856ecad149330e1fd49ec71392fb62d47270b53e6d4f3c8f044b80a5736753364896932abc6d872c4c5e135d1edb200597a93ceb262ff6c99079177cd10808b9ed20c8cd7352d80ac7f6963103\nM = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d965\n\n# Regression test for CVE-2017-3738.\nModExp = d360792bd8210786607817c3dda64cc38c8d0f25569597cb1f363c7919a0c3587baff01a2283edaeb04fc288ac0ab3f279b2a89ffcb452d8bdf72422a9f9780f4aa702dc964cf033149d3a339883062cab8564aebdbfac0bf68985e522c6fe545b346044690c525ca85d3f4eb3e3c25cdf541545afc84a309e9b1d7807003461\nA = ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2020202020df\nE = 2020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020FF2020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020\nM = ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2020202020ff\n\n\n# Exp tests.\n#\n# These test vectors satisfy A ^ E = Exp.\n\nExp = aa6d7ac431\nA = d0e07\nE = 2\n\nExp = 12d416b110dbb4e467ff0c89a22122f4da8240\nA = 1a18cf6\nE = 6\n\nExp = 49a3b33e23d84f1ce0d5d83f5dcb651d50cf3920f0143da2310d0512a90a06cd8f38977df8a756c30883de38df092000\nA = 2a3acbd2\nE = d\n\nExp = 5b4a0d5a956f885f275712b194459980f24708bfb6393d71bd37dce852ce455724f5ee5030775fb86b4295edc98afaafc097e4d82a97c0078ec0eac763db16549c5145c4cf2d3124f88cf9a5c71da0625afb99b26801786fe49a778415dc025954021753d08691947a208b613f0be5c1\nA = 54b3ae461\nE = 1a\n\nExp = a0ea5f6a4de49beb8fb7f0dab280d6a32c5a3814c9a5153a7944cec0a9028497846a8a89044348721a0bb5f0c3ded3e980574ea321b0cdb0ead4f4e93841ea7478a7f15d9729b646a8165813a0750e8124f5465dda9b105e1bbeff18fd09c09a2e26610d9176d253b877c3a8908a6be521cbe1e472a7a1b7820e4e890f8f28aacd34609c686e76e15b01bd9324a71290812724ea564d11c874a6765b262c3e57d479da0287a76026a1e8fe53da0b02405da1d379eaa30fc65f\nA = fccec0f6df\nE = 25\n\n\n# ModSqrt tests.\n#\n# These test vectors satisfy ModSqrt * ModSqrt = A (mod P) with P a prime.\n# ModSqrt is in [0, (P-1)/2].\n\nModSqrt = 1\nA = 1\nP = 2\n\nModSqrt = 1\nA = 1\nP = 2\n\nModSqrt = 1\nA = 1\nP = 2\n\nModSqrt = 1\nA = -1\nP = 2\n\nModSqrt = 1\nA = -1\nP = 2\n\nModSqrt = 0\nA = 0\nP = 3\n\nModSqrt = 0\nA = -3\nP = 3\n\nModSqrt = 0\nA = -3\nP = 3\n\nModSqrt = 0\nA = 0\nP = 3\n\nModSqrt = 0\nA = 0\nP = 3\n\nModSqrt = 0\nA = 0\nP = 5\n\nModSqrt = 1\nA = -4\nP = 5\n\nModSqrt = 0\nA = -5\nP = 5\n\nModSqrt = 2\nA = 4\nP = 5\n\nModSqrt = 0\nA = -5\nP = 5\n\nModSqrt = 3\nA = -5\nP = 7\n\nModSqrt = 0\nA = 0\nP = 7\n\nModSqrt = 0\nA = 0\nP = 7\n\nModSqrt = 2\nA = 4\nP = 7\n\nModSqrt = 3\nA = -5\nP = 7\n\nModSqrt = 4\nA = 10\nP = b\n\nModSqrt = 0\nA = 0\nP = b\n\nModSqrt = 3\nA = -2\nP = b\n\nModSqrt = 3\nA = -2\nP = b\n\nModSqrt = 2\nA = 4\nP = b\n\nModSqrt = 2\nA = 1e\nP = d\n\nModSqrt = 2\nA = 1e\nP = d\n\nModSqrt = 0\nA = -d\nP = d\n\nModSqrt = 0\nA = -d\nP = d\n\nModSqrt = 3\nA = 9\nP = d\n\nModSqrt = 8\nA = d\nP = 11\n\nModSqrt = 6\nA = df\nP = 11\n\nModSqrt = 4\nA = 10\nP = 11\n\nModSqrt = 5\nA = 90\nP = 11\n\nModSqrt = 3\nA = 80\nP = 11\n\nModSqrt = 9\nA = -e\nP = 13\n\nModSqrt = 7\nA = 7d\nP = 13\n\nModSqrt = 6\nA = 37\nP = 13\n\nModSqrt = 1\nA = 1\nP = 13\n\nModSqrt = 8\nA = 1a\nP = 13\n\nModSqrt = 54d4cf0fafe265056a29016778cea6b712bc66a132fb5e6b6865e9b49e4c97ec\nA = 599c10484b22d0b5a115268c7538ca99b3253a311a4ab1ca11c3665b0bec393a1167d1ad94fb84cb2c7ad7e2c933e8f613bdd08fe1f1aa4a9b0b9de0c8a7c9d4\nP = cfc4ccae35458ab5be1a1bc0664188253301f8702af4f8fb19fed12de0c653b1\n\nModSqrt = 38a7365a15365e911286c1be2a7afe76ef390234d76269e04dee17313f6ea54d\nA = 1c4aabb4d8369710131c664ecf2849e963c1bc31d66e0b939bacf99a870c71f24ed71bdddcf566f3908271fee43fc1ebb51eac7e3153efae641b49d2e796a12a\nP = cfc4ccae35458ab5be1a1bc0664188253301f8702af4f8fb19fed12de0c653b1\n\nModSqrt = 35ab18a560dece04725667f640ca61d1d59f14d191f94c79f58531acd097d444\nA = 685168ae855d60eba220d803f5296459b30a289580668db9ed51bca51cc2d453a937e13819ae34f7a9a143ac96d17420c53919167e46279b562b550be1cd9abc\nP = cfc4ccae35458ab5be1a1bc0664188253301f8702af4f8fb19fed12de0c653b1\n\nModSqrt = 288370029e87024175e5bec0eab0929179f42e16995e7f6194eefc61061e54f4\nA = 2a14ab77c045bdc48220ba9c463e1a4b4049cb01edb53be0937767eb2ec19b7d719855052281250a36a0b76d9a5d967d0756e1ded7a052f7056191ad66bcfc9\nP = cfc4ccae35458ab5be1a1bc0664188253301f8702af4f8fb19fed12de0c653b1\n\nModSqrt = 32255cf01dc943577ec2bcb221b98491d7a1130d046d6c68e95fedff643ce3a4\nA = e26f6dd46a513a1dd3fb14b71be1d4c9e9d79eda1cde10ea4d1eb8abfd4d5857572205e247184dd0cbefa37b5c0bf680ba2bd28c5741f725cfe2aae37419baf\nP = cfc4ccae35458ab5be1a1bc0664188253301f8702af4f8fb19fed12de0c653b1\n\nModSqrt = 5172345e801ada63fbc4782e32583cc3b4fea88b9e6dfd542f3542f8538ade66\nA = 40dafa8342b302bb04b1f3ddb3b9015a8fc1b597857c115b40631c7be9e22de89358fca23b331596ee5ff304dad7811e6d8e8822f7aa533c9e7c882634ea550\nP = a6813d316f9aca30f98b4f864b8b4b8f51493af930bd4d3a1b205a710e99add3\n\nModSqrt = 4dcf63c423bf0e39aca2293d57f6792d023db649d6719fe936446904b9f7e60d\nA = 5bcdb514bbe84261e169203e8017909b60c9bb330400c766ee01b0189378e70e61867a164a12643ddc9e94b61e09e5b158cbe85be228a3cc48f95a552958b8f2\nP = a6813d316f9aca30f98b4f864b8b4b8f51493af930bd4d3a1b205a710e99add3\n\nModSqrt = cf77c5c2d12a500b75cbfb1f3e66ee75d886b9365cf4f8b4d1bd18a6be0f387\nA = 4652ddc2ea7b460d8ec3c9059b8f9b5dae6cac55b51f2ad86fcb336b25235737965cc515e2ff0b54835015b7ebeeda6fadd986471d8cb424d309fc353d1e269\nP = a6813d316f9aca30f98b4f864b8b4b8f51493af930bd4d3a1b205a710e99add3\n\nModSqrt = 1e0549e4c5a260", - "23e9d24fd8c67419960746f82b1ecd113bdac66f570a475d87\nA = 5f4a6d450ab1390d96ab1deaa0ba18f897cb63daf0c9e1ef6c08e804c26b5e842f6c08f13db5d4a6e88f07af2a3cb04fa06fc3e59c410b9356f025ed81acc74\nP = a6813d316f9aca30f98b4f864b8b4b8f51493af930bd4d3a1b205a710e99add3\n\nModSqrt = 144481a781d831c1ca046ca9e322d79ad4d2c6dd9f780bea9d1ced9cd20b7b23\nA = 4c254fabca441017132b9eacd4ca40a336db3e5c09715773fa07af095989a91cc968ff07a9ff56ed06b0ce0c5269f7b2ab68564ecab9f4467a7e96b6cc6b21b7\nP = a6813d316f9aca30f98b4f864b8b4b8f51493af930bd4d3a1b205a710e99add3\n\nModSqrt = 216fecc7667f488a3d2d102a38b46b4860ab858300b8638af4f34e1103fd73ba\nA = 17878f8048227573a9d70f53c0e76ff13fe9f56e9c984c92514d3d13dec23c816661f0618d21371b80dfd885cb59551bdf80046f65f22ea9b89c78645a6e455a\nP = bd37c850cf7d702bac879f3c21a51a5a4df2b8eb0935861e0753a6eb62261a95\n\nModSqrt = 458e5e789ccd2417174f7e30bb31914b9656bd8cf2b9f5a9752a8737a67707bc\nA = 5c7d39a4bb04e69201aa519f80ee7e62ea14ca55e13656d1da3f45367e2fb2d061aa2940708d02ac67d35cd2ccf54a1bf95bcbc759779e692cfdcbb3aa1a05b\nP = bd37c850cf7d702bac879f3c21a51a5a4df2b8eb0935861e0753a6eb62261a95\n\nModSqrt = 543125a16c2bb8b8f8a2c39c497e5224ec77533602d7dbe24002e32dcbd2ef1a\nA = 3413afae333b2ad9ff45c7f3c7e5934b3127e8b1a55225958ee6ccf42423e81559bf070ad3f3353b78c0ffd41475af49f59d268ef78bdae879f5155e8d1cc07\nP = bd37c850cf7d702bac879f3c21a51a5a4df2b8eb0935861e0753a6eb62261a95\n\nModSqrt = 10e16859c67bdb2eaab52a7c847dbf37162eda258a9f6262ebacfe4cbbbc1080\nA = 21ce7905894faf220bdf4a82a2d855994ca2dc9feaecaa53c7f146e1f49934215695e9bb46ba370b7005a90c399674caa8969eb442e7914d90f749774d7fd194\nP = bd37c850cf7d702bac879f3c21a51a5a4df2b8eb0935861e0753a6eb62261a95\n\nModSqrt = 32a00586adc6f6cc2b1a04e1be0ab569fde235e1436c38b6af92bc5ebd60bc1c\nA = 350da4fd8cf03c12f7dd6ac6d3ab801a3413964083e374662aaf878d6838b97d4feb9e52cd307a25b113e101661a865463ee2480c626aa4e2ec437d72e7bae4c\nP = bd37c850cf7d702bac879f3c21a51a5a4df2b8eb0935861e0753a6eb62261a95\n\nModSqrt = 971f75bc7afa8b4b50f1d4b05e52deac7d4836a08d30546f29649bf1ca6a247\nA = 655ed4c5d8d0afb4f9360372ee1ef1303898d2423e585108a3303faedb55064d2ef25666ed4c4d71fe6063fea1f3142b435714b0e30b339dd791d347c884654\nP = 9810151ad4bc9c5d68fc326395b509f2625bfebca1c3801ad4da7539fdbaa6f7\n\nModSqrt = 48fa882b7cb6a29de9e3769f72eb67f1efd4d2af56f0c7e410c610efcbce2065\nA = 14f3503f33b243800eac1defaab33e04c01e80163fb3efd03860970cc016832431ca4fc6d1b760f4f40166b0b8b3c40dbebc81460cc10890172243770338f090\nP = 9810151ad4bc9c5d68fc326395b509f2625bfebca1c3801ad4da7539fdbaa6f7\n\nModSqrt = 236fd7e397ea7f8bc2a288eb7236ca41936fa702b7dccca56c8852e147511f7d\nA = 1bbd0980feac854782813bcde4da85e8a054549a1b515e065da4236528035e756882e29e762cf60453e375cca9dc6ff637f9558bf86646e3b928f68f82af7efe\nP = 9810151ad4bc9c5d68fc326395b509f2625bfebca1c3801ad4da7539fdbaa6f7\n\nModSqrt = 693f0cbe8c81b0afde0cd2f83e53795dcae6b0cc4ba930ab5c752400d787f14\nA = 7b20f9664b23907e152ab8c9a907f72e8670c1c38ab4cd1411ea7c2159c09aa131afe068929b8e6ad1409b74c04975180d1cd0a9fa74e923c3fd451e8da2c34\nP = 9810151ad4bc9c5d68fc326395b509f2625bfebca1c3801ad4da7539fdbaa6f7\n\nModSqrt = 4a086c50b0bad576501ddb6280743b2c9d247841eb7f14d90561432ff7dca6f0\nA = 4367431ec0cd0d7626538b93a090c30fe0c97c18ca03b97ddae304b619112b5b4d02bf0f041fa3fd673f9ef2ceb07eb2079d11c56dd903b1a87e8252a97b8079\nP = 9810151ad4bc9c5d68fc326395b509f2625bfebca1c3801ad4da7539fdbaa6f7\n\nModSqrt = 18f8433fa468d8065157708f1f1e53b8e31d39c6011fbc2bad93de1b5548e19c\nA = 739c032bb4139c199c40f548d37234298772e4ccb9d3ba28412b60ad23b4c465b0787e2382f1c5a4a87af2d20eb978b7dcbe73f2112249477d15c8a85e54a79\nP = adcd56924f73836ebe4dccfe006ad3b1e5076562cd11b161642cab7af2284659\n\nModSqrt = 49e3c8eef5e067cabd51a7c01384ce05ab8f4342f655559d8a689eb7b20e0106\nA = 18400c2cc3e06b99b4e39c77b9af5ff0e9c683f1708321afa4cd5b6988d13b36b1d9eb4379b7902d9ceb40c03f814b2b6a01b90509bbb4532f13ab1571c4d04a\nP = adcd56924f73836ebe4dccfe006ad3b1e5076562cd11b161642cab7af2284659\n\nModSqrt = 35548c530745f440329325cc8a5fbd90c16a7f0788879a4869bc4d4f73acda0e\nA = 181a3c5ab02566e7166c4d6d2f2bd4a8ecc25991a98d270bde80cf4332766a7068b14240bf5f5dcd45e90ef252596da3eb05b11d68b2063f7b3a825742593ca9\nP = adcd56924f73836ebe4dccfe006ad3b1e5076562cd11b161642cab7af2284659\n\nModSqrt = 1ab7046e6af061ade5f9719008fa4d989007e2a579a134a5b9f19ec410984096\nA = 1008a03e211fab0d45856377079bc96b0776c2d4c0175661f3493246cea2ab0a02a706c85314fb707ad9906bedb2cfd577d62092ae08ff21d7b949373ea954c7\nP = adcd56924f73836ebe4dccfe006ad3b1e5076562cd11b161642cab7af2284659\n\nModSqrt = 2be9e3e7515960d90f115b89f60dedc173a73ce163b4036e85b7b6a76fd90852\nA = 392053a9f0100540a8e1a0c353e922068a84dad3a4a8e8962fbc0bee2b6a06e20d08ade16eb1409a16acfcac3db5c43c421505e07035ca308b15c4a6db0864c0\nP = adcd56924f73836ebe4dccfe006ad3b1e5076562cd11b161642cab7af2284659\n\nModSqrt = 5b301bb93bdcf050183107e36258b53b4805918114ea1c2227b0911d5b4dc077\nA = 55e55e5f94dc3d7aabc921f6469d85fa2e1e92a87347c57afad5872306ae69f9fb99297d1e3e793dd9e8632244208154de5da7114fd876383bf1422f7ece024\nP = d43280ac150f725f4a2a1dceb1c79bcac57855a4eba72ae93762d09bcb2444fb\n\nModSqrt = 2df9609e2f5a5156c3260461b2ee52eacdef00bd8b091479813143a6c5283f71\nA = 2099325b7f12fe77353ddf3f2b2c5ef77b49671b150af954cf84e9675e3ecde3e057084641a633d19533b4712ab49924c8b5c31d591abcc88291f51253fa2a7\nP = d43280ac150f725f4a2a1dceb1c79bcac57855a4eba72ae93762d09bcb2444fb\n\nModSqrt = dfab751710e9008e25e422d1199d6fbec4dc7fba35b4da9d225a746eb4126a0\nA = c006af53d4737fb293584df6ffe2e4cb3fd8dc77fb7c1f13b97bb9c249e3ee5fb9feff7488265b3093906c08a4946f142ac7b491937d24bfba6413366ce371d\nP = d43280ac150f725f4a2a1dceb1c79bcac57855a4eba72ae93762d09bcb2444fb\n\nModSqrt = 26bc030008d6c60a09fb0e16093a649fcb40c6c21a8e2da2353ba4b07c4f85d5\nA = 1eaabcfad2ed349ac9356e6f4da0b301266ddde811cb0f817aba8f5c10fb8b8ba9d0ef2dd386b668f16eac296118fdb8cb7afe1b865648c81c2fa3cf21f2711b\nP = d43280ac150f725f4a2a1dceb1c79bcac57855a4eba72ae93762d09bcb2444fb\n\nModSqrt = 35051b1482ec2578f3dc0000a422cb5111e43c37f1ac20b1844d3de2128c4556\nA = 315ff9de178681116f2a5fa78eebf4818e1d680435eacdfaf9d0e5c4fc01fc034b352c82fd52c81ca30d68864952dacc99d08269c9dd7ca99ccf22da98c3840\nP = d43280ac150f725f4a2a1dceb1c79bcac57855a4eba72ae93762d09bcb2444fb\n\nModSqrt = a5474252885cacf004c460a7793ff0b0a2187bb1a9ed700ae3470199faef71f\nA = 19856fc1351c4b02abf573bb2fc6ff92355fa369d62bb8f2260fa772fb1693f509a56cad661930abcac049dd70f4b16bed4a4c172e73e772504c9990ce7f92f\nP = dc315fd52684fba79e577a204de9053b11a5d7a414263fec9eff6ff62188829d\n\nModSqrt = 12daf4722387ecf47de1b0b6b110a062dc5ea2685bc9dbde66b8d15622985029\nA = fb8479787069116abc42abfd7dc0c24d2ad04fe0c04b42a6dff714af715d17e0fd77855f950f264542b06d48e8818de813ddb7975798b7debefcdaa5ff86beb\nP = dc315fd52684fba79e577a204de9053b11a5d7a414263fec9eff6ff62188829d\n\nModSqrt = 397996ed5c0ac6ad32e43c337e9de421b87774cc162bf7ac7bbedf4a9029255e\nA = 5aa04353321bd2de92481be740357f979da464b53aa39111fdbb734cf7af6b3857d1baa08d3a126a3dd34a2fbae2bf2b84e900686c1d31505b390185acef5fe5\nP = dc315fd52684fba79e577a204de9053b11a5d7a414263fec9eff6ff62188829d\n\nModSqrt = 2cf4b844a54ba359dc592ef1b49f43fcfeae84d1087edfefdd0b9174b43c0a3c\nA = 365a8650510bcfd8fa87432f167cf487234c215857403b9270b5eebeafa48cd6da47fd60dc311b94d1d72baad0447c31f0b212d755f46c256e16e5e015e6546e\nP = dc315fd52684fba79e577a204de9053b11a5d7a414263fec9eff6ff62188829d\n\nModSqrt = 9277c73043ff767c3fa606f0cd66b9d854a600c8c18287f191ce277758c3f31\nA = 62cec3901626d03e8df66299a87c54b1f7a55cafc99f0b6bba1b5d51a3d2b7d2171c9135a9d8a5346d436e0136b12e515e703e3cd84ecfe154eb94c6772a6d72\nP = dc315fd52684fba79e577a204de9053b11a5d7a414263fec9eff6ff62188829d\n\nModSqrt = 4189e5a90c1b1abdc1c7c05b3587e6f362e06f927b6cf5f0d271aab3d6f90765\nA = 336b8d0f9dac842c696bc020f49c6aa023842c16f2052eb02f17959006554ca0012042c80c72590f21c6bf5a3714c9cb552aa69730e33db93a56a909b273f39\nP = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951f\n\nModSqrt = 36ccd38cb5a6bd8a73bca55936a2227c503664422c2296faf7e2b1c6a375a43a\nA = fecfd60a376befbe48d2c4f6d070d716d2f403cd5daefbce62b720df44deb605162c8f20f49fd7ec30d4f8e70d803d45b3a44b5d912baa3410d991165d7c507\nP = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951f\n\nModSqrt = 198fc8569be172dc9b71023ed3d42d2ba94bae4099643f6517ab03f540527fdb\nA = 65bebdb00a96fc814ec44b81f98b59fba3c30203928fa5214c51e0a97091645280c947b005847f239758482b9bfc45", - "b066fde340d1fe32fc9c1bf02e1b2d0ec\nP = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951f\n\nModSqrt = 21b7f74c30ded681d6138cf8e6fd798f32a049e94138e982f1845df3dc9e686f\nA = 9a30b791c1ba4f394b4e3dcd5837e474237f4fe8987b255c098a47b2c14c598ec69d2beae444dd4fe9c4ede8173d2b187677cc706a3c28f3b81627d8a5fb6fd\nP = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951f\n\nModSqrt = a1d52989f12f204d3d2167d9b1e6c8a6174c0c786a979a5952383b7b8bd186\nA = 2eee37cf06228a387788188e650bc6d8a2ff402931443f69156a29155eca07dcb45f3aac238d92943c0c25c896098716baa433f25bd696a142f5a69d5d937e81\nP = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951f\n\n\n# NotModSquare tests.\n#\n# These test vectors are such that NotModSquare is not a square modulo P.\n\nNotModSquare = 03\nP = 07\n\nNotModSquare = 05\nP = 07\n\nNotModSquare = 06\nP = 07\n\nNotModSquare = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951e\nP = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951f\n\n\n# ModInv tests.\n#\n# These test vectors satisfy ModInv * A = 1 (mod M) and 0 <= ModInv < M.\n\nModInv = 00\nA = 00\nM = 01\n\nModInv = 00\nA = 01\nM = 01\n\nModInv = 00\nA = 02\nM = 01\n\nModInv = 00\nA = 03\nM = 01\n\nModInv = 64\nA = 54\nM = e3\n\nModInv = 13\nA = 2b\nM = 30\n\nModInv = 2f\nA = 30\nM = 37\n\nModInv = 4\nA = 13\nM = 4b\n\nModInv = 1c47\nA = cd4\nM = 6a21\n\nModInv = 2b97\nA = 8e7\nM = 49c0\n\nModInv = 29b9\nA = fcb\nM = 3092\n\nModInv = a83\nA = 14bf\nM = 41ae\n\nModInv = 18f15fe1\nA = 11b5d53e\nM = 322e92a1\n\nModInv = 32f9453b\nA = 8af6df6\nM = 33d45eb7\n\nModInv = d696369\nA = c5f89dd5\nM = fc09c17c\n\nModInv = 622839d8\nA = 60c2526\nM = 74200493\n\nModInv = fb5a8aee7bbc4ef\nA = 24ebd835a70be4e2\nM = 9c7256574e0c5e93\n\nModInv = 846bc225402419c\nA = 23026003ab1fbdb\nM = 1683cbe32779c59b\n\nModInv = 5ff84f63a78982f9\nA = 4a2420dc733e1a0f\nM = a73c6bfabefa09e6\n\nModInv = 133e74d28ef42b43\nA = 2e9511ae29cdd41\nM = 15234df99f19fcda\n\nModInv = 46ae1fabe9521e4b99b198fc8439609023aa69be2247c0d1e27c2a0ea332f9c5\nA = 6331fec5f01014046788c919ed50dc86ac7a80c085f1b6f645dd179c0f0dc9cd\nM = 8ef409de82318259a8655a39293b1e762fa2cc7e0aeb4c59713a1e1fff6af640\n\nModInv = 444ccea3a7b21677dd294d34de53cc8a5b51e69b37782310a00fc6bcc975709b\nA = 679280bd880994c08322143a4ea8a0825d0466fda1bb6b3eb86fc8e90747512b\nM = e4fecab84b365c63a0dab4244ce3f921a9c87ec64d69a2031939f55782e99a2e\n\nModInv = 1ac7d7a03ceec5f690f567c9d61bf3469c078285bcc5cf00ac944596e887ca17\nA = 1593ef32d9c784f5091bdff952f5c5f592a3aed6ba8ea865efa6d7df87be1805\nM = 1e276882f90c95e0c1976eb079f97af075445b1361c02018d6bd7191162e67b2\n\nModInv = 639108b90dfe946f498be21303058413bbb0e59d0bd6a6115788705abd0666d6\nA = 9258d6238e4923d120b2d1033573ffcac691526ad0842a3b174dccdbb79887bd\nM = ce62909c39371d463aaba3d4b72ea6da49cb9b529e39e1972ef3ccd9a66fe08f\n\nModInv = aebde7654cb17833a106231c4b9e2f519140e85faee1bfb4192830f03f385e773c0f4767e93e874ffdc3b7a6b7e6a710e5619901c739ee8760a26128e8c91ef8cf761d0e505d8b28ae078d17e6071c372893bb7b72538e518ebc57efa70b7615e406756c49729b7c6e74f84aed7a316b6fa748ff4b9f143129d29dad1bff98bb\nA = a29dacaf5487d354280fdd2745b9ace4cd50f2bde41d0ee529bf26a1913244f708085452ff32feab19a7418897990da46a0633f7c8375d583367319091bbbe069b0052c5e48a7daac9fb650db5af768cd2508ec3e2cda7456d4b9ce1c39459627a8b77e038b826cd7e326d0685b0cd0cb50f026f18300dae9f5fd42aa150ee8b\nM = d686f9b86697313251685e995c09b9f1e337ddfaa050bd2df15bf4ca1dc46c5565021314765299c434ea1a6ec42bf92a29a7d1ffff599f4e50b79a82243fb24813060580c770d4c1140aeb2ab2685007e948b6f1f62e8001a0545619477d498132c907774479f6d95899e6251e7136f79ab6d3b7c82e4aca421e7d22fe7db19c\n\nModInv = 1ec872f4f20439e203597ca4de9d1296743f95781b2fe85d5def808558bbadef02a46b8955f47c83e1625f8bb40228eab09cad2a35c9ad62ab77a30e3932872959c5898674162da244a0ec1f68c0ed89f4b0f3572bfdc658ad15bf1b1c6e1176b0784c9935bd3ff1f49bb43753eacee1d8ca1c0b652d39ec727da83984fe3a0f\nA = 2e527b0a1dc32460b2dd94ec446c692989f7b3c7451a5cbeebf69fc0ea9c4871fbe78682d5dc5b66689f7ed889b52161cd9830b589a93d21ab26dbede6c33959f5a0f0d107169e2daaac78bac8cf2d41a1eb1369cb6dc9e865e73bb2e51b886f4e896082db199175e3dde0c4ed826468f238a77bd894245d0918efc9ca84f945\nM = b13133a9ebe0645f987d170c077eea2aa44e85c9ab10386d02867419a590cb182d9826a882306c212dbe75225adde23f80f5b37ca75ed09df20fc277cc7fbbfac8d9ef37a50f6b68ea158f5447283618e64e1426406d26ea85232afb22bf546c75018c1c55cb84c374d58d9d44c0a13ba88ac2e387765cb4c3269e3a983250fa\n\nModInv = 30ffa1876313a69de1e4e6ee132ea1d3a3da32f3b56f5cfb11402b0ad517dce605cf8e91d69fa375dd887fa8507bd8a28b2d5ce745799126e86f416047709f93f07fbd88918a047f13100ea71b1d48f6fc6d12e5c917646df3041b302187af641eaedf4908abc36f12c204e1526a7d80e96e302fb0779c28d7da607243732f26\nA = 31157208bde6b85ebecaa63735947b3b36fa351b5c47e9e1c40c947339b78bf96066e5dbe21bb42629e6fcdb81f5f88db590bfdd5f4c0a6a0c3fc6377e5c1fd8235e46e291c688b6d6ecfb36604891c2a7c9cbcc58c26e44b43beecb9c5044b58bb58e35de3cf1128f3c116534fe4e421a33f83603c3df1ae36ec88092f67f2a\nM = 53408b23d6cb733e6c9bc3d1e2ea2286a5c83cc4e3e7470f8af3a1d9f28727f5b1f8ae348c1678f5d1105dc3edf2de64e65b9c99545c47e64b770b17c8b4ef5cf194b43a0538053e87a6b95ade1439cebf3d34c6aa72a11c1497f58f76011e16c5be087936d88aba7a740113120e939e27bd3ddcb6580c2841aa406566e33c35\n\nModInv = 87355002f305c81ba0dc97ca2234a2bc02528cefde38b94ac5bd95efc7bf4c140899107fff47f0df9e3c6aa70017ebc90610a750f112cd4f475b9c76b204a953444b4e7196ccf17e93fdaed160b7345ca9b397eddf9446e8ea8ee3676102ce70eaafbe9038a34639789e6f2f1e3f352638f2e8a8f5fc56aaea7ec705ee068dd5\nA = 42a25d0bc96f71750f5ac8a51a1605a41b506cca51c9a7ecf80cad713e56f70f1b4b6fa51cbb101f55fd74f318adefb3af04e0c8a7e281055d5a40dd40913c0e1211767c5be915972c73886106dc49325df6c2df49e9eea4536f0343a8e7d332c6159e4f5bdb20d89f90e67597c4a2a632c31b2ef2534080a9ac61f52303990d\nM = d3d3f95d50570351528a76ab1e806bae1968bd420899bdb3d87c823fac439a4354c31f6c888c939784f18fe10a95e6d203b1901caa18937ba6f8be033af10c35fc869cf3d16bef479f280f53b3499e645d0387554623207ca4989e5de00bfeaa5e9ab56474fc60dd4967b100e0832eaaf2fcb2ef82a181567057b880b3afef62\n\n\n# GCD tests.\n#\n# These test vectors satisfy gcd(A, B) = GCD and lcm(A, B) = LCM.\n\nGCD = 0\nA = 0\nB = 0\n# Just to appease the syntax-checker.\nLCM = 0\n\nGCD = 1\nA = 92ff140ac8a659b31dd904161f9213706a08a817ae845e522c3af0c9096699e059b47c8c2f16434b1c5766ebb384b79190f2b2a62c2378f45e116890e7bb407a\nB = 2f532c9e5902b0d68cd2ed69b2083bc226e8b04c549212c425a5287bb171c6a47fcb926c70cc0d34b8d6201c617aee66af865d31fdc8a2eeb986c19da8bb0897\nLCM = 1b2c97003e520b0bdd59d8c35a180b4aa36bce14211590435b990ad8f4c034ce3c77899581cb4ee1a022874203459b6d53859ab1d99ff755efa253fc0e5d8487bb000c13c566e8937f0fe90b95b68bc278610d4f232770b08d1f31bee55a03da47f2d0ebb9e7861c4f16cc22168b68593e9efcde00f54104b4c3e1a0b294d7f6\n\nGCD = a\nA = faaffa431343074f5c5d6f5788500d7bc68b86eb37edf166f699b4d75b76dae2cb7c8f6eccae8f18f6d510ef72f0b9633d5740c0bebb934d3be796bd9a53808e\nB = 2f48ec5aa5511283c2935b15725d30f62244185573203b48c7eb135b2e6db5c115c9446ac78b020574665b06a75eb287e0dbeb5da7c193294699b4c2129d2ac4\nLCM = 4a15f305e9622aa19bd8f39e968bfc16d527a47f7a5219d7b02c242c77ef8b608a4a6141f643ca97cedf07c0f1f3e8879d2568b056718aa15c0756899a08ccbe0a658bae67face96fa110edb91757bfa4828e8ff7c5d71b204f36238b12dd26f17be8ba9771f7068d63e41d423671f898f054b1187605754bc5546f2b02c5ac\n\nGCD = 16\nA = cf0b21bde98b41b479ac8071086687a6707e9efaacd4e5299668ce1be8b13290f27fd32ae68df87c292e8583a09d73ec8e8a04a65a487380dcd7dacca3b6e692\nB = 3be3f563f81d5ad5c1211db7eff430aa345e830ce07b4bde7d4d32dba3ac618d2034351e5435fd6c7f077971fb4a1e83a7396a74fdff7fce1267112851db2582\nLCM = 233a2188de2c017235024b182286f17562b2ee5ab9fdfe4efa2f61c4ff99fa44e1ead5bf6cde05bd7502ce78373c83e3f9dbab0c9bb8620a87c2640bce5d12c685af656df789bb3d0ba1edbaa98cf4f0166d422ab17aa6706f8132264d45b72827d6671a00a9186e723379e3a3bb7902d08865f357c74100059f83800241976\n\nGCD = 1\nA = dd7b7597d7c1eb399b1cea9b3042c14bd6022d31b1d2642a8f82fc32de6eadaf012fbbf349eaec4922a8468740ca73c6090833d6a69a380ed947b39c2f9b0b76\nB = 8e0dc8654e70eec55496038a8d3fff3c2086bc6dbfc0e2dbdf5bd7de03c5aef01a3982556ac3fc34fd5f13368be6cdc252c82367b7462e210f940f847d382dd9\nLCM = 7ae667df4bd4dd35bbec28719a9f1b5e1f396a9ab386c086742a6ab3014a3386d39f35b50624d0c5b4e6b206c2635c7de5ea69e2faa85dd616a7e36622962a07632839857aa49332942feccff2aee1c962e2f4e8ccfd738a5da5bf528b4c5a2440409350f5a17a39d234403e8482ccf838e0d2758ccfb8018198a51dbb407506\n\nGCD = 1\nA = 0", - "\nB = 1\nLCM = 0\n\nGCD = 1\nA = 1\nB = 0\nLCM = 0\n\nGCD = 1\nA = 1\nB = 1\nLCM = 1\n\nGCD = 2b2\nA = dfccaa3549c1b59ab3e114fe87dc5d187719abad58c51724e972741eb895ab79a49f385f61d531ec5c88dbb505ae375093fa848165f71a5ed65e7832a42ade191a\nB = fa58a81f43088da45e659fc1117d0f1cd015aa096c8e5377cf1832191baf7cc28b5c24998b93b64f8900a0973faedb9babaaf1854345f011739da8f1175d9684c\nLCM = 5132f7ab7a982b9dc55114bd96800b7637f9742cf8a7a00a0d69d5e4574fc85792c89a1c52bcfc74b9d7f3f6164819466c46b2d622e280ced7ad1211604084a15dc1fd1951a05c8ce37122c0ec15891d818a70d3763670ea3195098de9b1ca50ea89893a9753fb9ea801541058f44801f7f50967124abfc864a2b01c41f94193c\n\nGCD = 8e\nA = 248d96a8a4cab0a1b194e08c1146868b094597cadbc35531f0ed2d77cba9f15cb5cc7c10e64ce054bf93396d25259d750b3de3aba65073db1fd2b852a6454ac1a\nB = 4c7bad8e1844901fd6a2ce2edc82e698d28ec95d6672ca148d85b49ecc78dd0a8b870e202244210bc98592b99ff6abbd20630f9eee7d46b15ccfae8d08b86799de\nLCM = 13b01f9d9c6c13e90c97e3d95bbce5a835c631b3de3bd4ff5df13ad850f5223dbdf71c53912275d0397df9335ef3a3ba8e4684c6b25962bb7b18bc74144cb5edf0196f79863a7ff032619a71646a92281f7baace7f223d254cb4d05ec19bf8d4c8ce4455a9d770daec89c0d3cf338cbdae39cf982b3c4568f5c9def4e1133d28a\n\nGCD = 3e55\nA = 2fa97382f46676b7a4cc2b8153f17b58792d24660e187d33ce55c81cc193ccb6e1e2b89feea1d5fd8faa36e13bf947fb48635e450a4d1488d0978324194a1f43c6\nB = ab08ad074139963bc18e5d87ba68db64ca6f4c279616c64039b02c55f2375b3bc04114e8e05e1ba92fb6470768f61d123845aea36774c18612736a220934561faf\nLCM = 82c7c377ecda2cb9228604cd287df5eff94edd4a539c3eb3b3fdd4b4a79d2f4eaf2b22f8286272d3dad2e370cfcd9ea4d93ebb3f049c52b8fa23b68a5bf79af989822e2cfb978f68c6a5058f47319dffcb455b089b06ae6db9e5c8a2b6e951d6e118bd2b4cd08b6e5733476a446a57387d940d1289ec00e24315821ed3a5daf2\n\nGCD = a7a\nA = 923706dfed67834a1e7e6c8e8e9f93bfbc0b43ca1f324886cf1f1380fb9b77109275d4b50af1b7689802fe9b3623ac46c7ba0e17e908c20278127b07a5c12d86ec\nB = 64473e878a29021fac1c1ce34a63eae1f4f83ee6851333b67213278b9a4a16f005cba0e8cdb410035bb580062f0e486c1a3a01f4a4edf782495f1dc3ebfa837d86\nLCM = 57785ca45b8873032f1709331436995525eed815c55140582ce57fd852116835deac7ca9d95ce9f280e246ea4d4f1b7140ab7e0dd6dc869de87f1b27372098b155ad0a1828fd387dff514acc92eae708609285edaab900583a786caf95153f71e6e6092c8c5ee727346567e6f58d60a5e01c2fa8ebcf86da9ea46876ecc58e914\n\nGCD = 42\nA = 0\nB = 42\nLCM = 0\n\nGCD = 42\nA = 42\nB = 0\nLCM = 0\n\nGCD = 42\nA = 42\nB = 42\nLCM = 42\n\nGCD = f60d\nA = ef7886c3391407529d5cf2e75ed53e5c3f74439ad2e2dc48a79bc1a5322789b4ced2914b97f8ff4b9910d212243b54001eb8b375365b9a87bd022dd3772c78a9fd63\nB = d1d3ec32fa3103911830d4ec9f629c5f75af7039e307e05bc2977d01446cd2cbeeb8a8435b2170cf4d9197d83948c7b8999d901fe47d3ce7e4d30dc1b2de8af0c6e4\nLCM = cc376ed2dc362c38a45a719b2ed48201dab3e5506e3f1314e57af229dc7f3a6a0dad3d21cfb148c23a0bbb0092d667051aa0b35cff5b5cc61a7c52dec4ed72f6783edf181b3bf0500b79f87bb95abc66e4055f259791e4e5eb897d82de0e128ecf8a091119475351d65b7f320272db190898a02d33f45f03e27c36cb1c45208037dc\n\nGCD = 9370\nA = 1ee02fb1c02100d1937f9749f628c65384ff822e638fdb0f42e27b10ee36e380564d6e861fcad0518f4da0f8636c1b9f5124c0bc2beb3ca891004a14cd7b118ddfe0\nB = 67432fd1482d19c4a1c2a4997eab5dbf9c5421977d1de60b739af94c41a5ad384cd339ebfaa43e5ad6441d5b9aaed5a9f7485025f4b4d5014e1e406d5bd838a44e50\nLCM = 159ff177bdb0ffbd09e2aa7d86de266c5de910c12a48cbe61f6fa446f63a2151194777555cd59903d24cb30965973571fb1f89c26f2b760526f73ded7ee8a34ebcecd1a3374a7559bcdb9ac6e78be17a62b830d6bb3982afdf10cf83d61fd0d588eab17d6abef8e6a7a5763fcb766d9a4d86adf5bb904f2dd6b528b9faec603987a0\n\nGCD = c5f\nA = 5a3a2088b5c759420ed0fb9c4c7685da3725b659c132a710ef01e79435e63d009d2931ea0a9ed9432f3d6b8851730c323efb9db686486614332c6e6ba54d597cf98\nB = 1b1eb33b006a98178bb35bbcf09c5bebd92d9ace79fa34c1567efa8d6cf6361547807cd3f8e7b8cd3ddb6209dccbae4b4c16c8c1ec19741a3a57f61571882b7aed7\nLCM = c5cbbbe9532d30d2a7dd7c1c8a6e69fd4fa4828a844d6afb44f3747fef584f7f1f3b835b006f8747d84f7699e88f6267b634e7aef78d6c7584829537d79514eec7d11219721f91015f5cefdc296261d85dba388729438991a8027de4827cd9eb575622e2912b28c9ce26d441e97880d18db025812cef5de01adeaec1322a9c9858\n\nGCD = e052\nA = 67429f79b2ec3847cfc7e662880ab1d94acdf04284260fcfffd67c2862d59704ed45bcc53700c88a5eea023bc09029e9fd114fc94c227fd47a1faa1a5ef117b09bd2\nB = 39faa7cbdeb78f9028c1d50ab34fbe6924c83a1262596f6b85865d4e19cc258b3c3af1ee2898e39e5bee5839e92eac6753bbbb0253bd576d1839a59748b778846a86\nLCM = 1ab071fb733ef142e94def10b26d69982128561669e58b20b80d39cf7c2759d26b4a65d73b7f940c6e8fc417180ef62d7e52ac24678137bd927cd8d004ad52b02affe176a1ecde903dbc26dcc705678f76dd8cd874c0c3fe737474309767507bbe70dd7fb671bbb3694cedf0dcdaa0c716250ddd6dfec525261572fa3e1387f7b906\n\nGCD = 3523\nA = 0\nB = 3523\nLCM = 0\n\nGCD = 3523\nA = 3523\nB = 0\nLCM = 0\n\nGCD = 3523\nA = 3523\nB = 3523\nLCM = 3523\n\nGCD = f035a941\nA = 16cd5745464dfc426726359312398f3c4486ed8aaeea6386a67598b10f744f336c89cdafcb18e643d55c3a62f4ab2c658a0d19ea3967ea1af3aee22e11f12c6df6e886f7\nB = 74df09f309541d26b4b39e0c01152b8ad05ad2dfe9dd2b6706240e9d9f0c530bfb9e4b1cad3d4a94342aab309e66dd42d9df01b47a45173b507e41826f24eb1e8bcc4459\nLCM = b181771d0e9d6b36fdfcbf01d349c7de6b7e305e1485ea2aa32938aa919a3eee9811e1c3c649068a7572f5d251b424308da31400d81ac4078463f9f71d7efd2e681f92b13a6ab3ca5c9063032dcbdf3d3a9940ce65e54786463bbc06544e1280f25bc7579d264f6f1590cf09d1badbf542ce435a14ab04d25d88ddbac7d22e8cae1c91f\n\nGCD = 33ad1b8f\nA = 1af010429a74e1b612c2fc4d7127436f2a5dafda99015ad15385783bd3af8d81798a57d85038bcf09a2a9e99df713b4d6fc1e3926910fbbf1f006133cb27dc5ebb9cca85\nB = 92a4f45a90965a4ef454f1cdd883d20f0f3be34d43588b5914677c39d577a052d1b25a522be1a656860a540970f99cbc8a3adf3e2139770f664b4b7b9379e13daf7d26c\nLCM = 4c715520ed920718c3b2f62821bc75e3ff9fd184f76c60faf2906ef68d28cd540d3d6c071fa8704edd519709c3b09dfaee12cb02ab01ad0f3af4f5923d5705ce6d18bcab705a97e21896bb5dd8acb36ee8ec98c254a4ddc744297827a33c241f09016a5f109248c83dd41e4cea73ce3eabb28d76678b7e15545b96d22da83c111b6b624\n\nGCD = dc0429aa\nA = ccb423cfb78d7150201a97114b6644e8e0bbbb33cadb0ef5da5d3c521a244ec96e6d1538c64c10c85b2089bdd702d74c505adce9235aa4195068c9077217c0d431de7f96\nB = 710786f3d9022fc3acbf47ac901f62debcfda684a39234644bac630ab2d211111df71c0844b02c969fc5b4c5a15b785c96efd1e403514235dc9356f7faf75a0888de5e5a\nLCM = 6929af911850c55450e2f2c4c9a72adf284fe271cf26e41c66e1a2ee19e30d928ae824f13d4e2a6d7bb12d10411573e04011725d3b6089c28d87738749107d990162b485805f5eedc8f788345bcbb5963641f73c303b2d92f80529902d3c2d7899623958499c8a9133aae49a616c96a2c5482a37947f23af18c3247203ac2d0e760340e6\n\nGCD = 743166058\nA = 16cd476e8031d4624716238a3f85badd97f274cdfd9d53e0bd74de2a6c46d1827cc83057f3889588b6b7ca0640e7d743ed4a6eaf6f9b8df130011ecc72f56ef0af79680\nB = 86eba1fc8d761f22e0f596a03fcb6fe53ad15a03f5b4e37999f60b20966f78ba3280f02d3853f9ace40438ccfaf8faed7ace2f2bf089b2cdd4713f3f293bf602666c39f8\nLCM = 1a7a1b38727324d6ba0290f259b8e2b89c339b2445cada38a5a00ded1468ab069f40678ce76f7f78c7c6f97783cc8a49ef7e2a0c73abbac3abc66d1ce99566ce7f874a8949ca3442051e71967695dc65361184748c1908e1b587dc02ed899a524b34eb30b6f8db302432cfa1a8fbf2c46591e0ab3db7fd32c01b1f86c39832ee9f0c80\n\nGCD = 6612ba2c\nA = 0\nB = 6612ba2c\nLCM = 0\n\nGCD = 6612ba2c\nA = 6612ba2c\nB = 0\nLCM = 0\n\nGCD = 6612ba2c\nA = 6612ba2c\nB = 6612ba2c\nLCM = 6612ba2c\n\nGCD = 2272525aa08ccb20\nA = 11b9e23001e7446f6483fc9977140d91c3d82568dabb1f043a5620544fc3dda233b51009274cdb004fdff3f5c4267d34181d543d913553b6bdb11ce2a9392365fec8f9a3797e1200\nB = 11295529342bfb795f0611d03afb873c70bd16322b2cf9483f357f723b5b19f796a6206cf3ae3982daaeafcd9a68f0ce3355a7eba3fe4e743683709a2dd4b2ff46158bd99ff4d5a0\nLCM = 8d4cbf00d02f6adbaa70484bcd42ea932000843dcb667c69b75142426255f79b6c3b6bf22572597100c06c3277e40bf60c14c1f4a6822d86167812038cf1eefec2b0b19981ad99ad3125ff4a455a4a8344cbc609e1b3a173533db432bd717c72be25e05ed488d3970e7ed17a46353c5e0d91c8428d2fec7a93210759589df042cab028f545e3a00\n\nGCD = 3480bf145713d56f9\nA = 8cf8ef1d4f216c6bcec673208fd93b7561b0eb8303af57113edc5c6ff4e1eeae9ddc3112b943d947653ba2179b7f63505465126d88ad0a0a15b682f5c89aa4a2a51c768cd9fdeaa9\nB = a6fd114023e7d79017c552a9051ca827f3ffa9f31e2ee9d78f8408967064fcdc9466e95cc8fac9a4fa88248987caf7cf57af58400d27abd60d9b79d2fe03fad76b879eceb504d7f\nLCM = 1c05eee73a4f0db210a9007f94a5af88c1cdd2cba456061fd41de1e746d836fa4e0e972812842e0f44f10a61505f5d55760c48ba0d06af78bb6bde7da8b0080b29f82b1161e9c0b5458e05ac090b00f4d78b1cc10cf065124ba610e3aca", - "b092a36fe408525e21c0ddc7c9696ed4e48bd2f70423deecfe62cecc865c6088f265da0e5961d3f3a84f\n\nGCD = 917e74ae941fcaae\nA = 652f8a92d96cbf0a309629011d0fbaceb1266bc2e8243d9e494eead4cf7100c661b537a8bea93dec88cfc68597d88a976c125c3b4de19aba38d4ea9578202e59848d42652518348a\nB = 32e07b71979d57e8344e97c39680a61e07d692d824ae26b682156890792d8a766ee29a4968f461aaced5bf049044fba2f4120b1c1f05985676f975d4582e9e82750d73c532cd07b2\nLCM = 23620c7b897dc26c7717e32f3517ac70bf09fbe08f7255ab010cf4cf946f4e96304c425043452c5d5a0e841d3a3cfd9c2d84d9256f3b5974fe3ebfa9255fe20a710d3e6511606c0d85970381101c7f4986d65ad6a73a71507f146b11f903043cfa805cc0b14d4f3072da98bf22282f7762040406c02d5b3ef9e7587f63bab8b29c61d8e30911aa96\n\nGCD = 2b9adc82005b2697\nA = 19764a84f46045ef1bca571d3cbf49b4545998e64d2e564cc343a53bc7a0bcfbe0baa5383f2b346e224eb9ce1137d9a4f79e8e19f946a493ff08c9b423574d56cbe053155177c37\nB = 1bbd489ad2ab825885cdac571a95ab4924e7446ce06c0f77cf29666a1e20ed5d9bc65e4102e11131d824acad1592075e13024e11f12f8210d86ab52aa60deb250b3930aabd960e5a\nLCM = 1032a0c5fffc0425e6478185db0e5985c645dd929c7ebfeb5c1ee12ee3d7b842cfab8c9aa7ff3131ac41d4988fb928c0073103cea6bb2cc39808f1b0ad79a6d080eac5a0fc6e3853d43f903729549e03dba0a4405500e0096b9c8e00510c1852982baec441ed94efb80a78ed28ed526d055ad34751b831b8749b7c19728bf229357cc5e17eb8e1a\n\nGCD = 8d9d4f30773c4edf\nA = 0\nB = 8d9d4f30773c4edf\nLCM = 0\n\nGCD = 8d9d4f30773c4edf\nA = 8d9d4f30773c4edf\nB = 0\nLCM = 0\n\nGCD = 8d9d4f30773c4edf\nA = 8d9d4f30773c4edf\nB = 8d9d4f30773c4edf\nLCM = 8d9d4f30773c4edf\n\nGCD = 6ebd8eafb9a957a6c3d3d5016be604f9624b0debf04d19cdabccf3612bbd59e00\nA = 34dc66a0ffd5b8b5e0ffc858dfc4655753e59247c4f82a4d2543b1f7bb7be0e24d2bbf27bb0b2b7e56ee22b29bbde7baf0d7bfb96331e27ba029de9ffdff7bdb7dc4da836d0e58a0829367ec84ea256833fd4fe1456ad4dd920557a345e12000\nB = 1f3406a20e20ebf96ccb765f898889a19b7636608fd7dc7c212607b641399543f71111d60e42989de01eaa6ff19a86ea8fbde1a3d368c0d86dc899e8e250fc764090f337958ca493119cbb4ad70cbfae7097d06d4f90ec62fbdd3f0a4496e600\nLCM = ee502c50e3667946e9089d0a9a0382e7fd0b75a17db23b56a0eec997a112c4dbd56d188808f76fe90451e5605550c9559ef14a95014c6eb97e9c1c659b98515c41470142843de60f72fb4c235faa55b0a97d943221003d44e2c28928f0b84bf071256254897ed31a7fd8d174fc962bc1311f67900ac3abcad83a28e259812f1ee229511ab1d82d41f5add34693ba7519babd52eb4ec9de31581f5f2e40a000\n\nGCD = ef7399b217fc6a62b90461e58a44b22e5280d480b148ec4e3b4d106583f8e428\nA = 7025e2fe5f00aec73d90f5ad80d99ca873f71997d58e59937423a5e6ddeb5e1925ed2fd2c36a5a9fc560c9023d6332c5d8a4b333d3315ed419d60b2f98ccf28bbf5bf539284fd070d2690aeaac747a3d6384ee6450903a64c3017de33c969c98\nB = df0ac41dbabce1deeb0bceb1b65b1079850052ecf6534d0cff84a5a7fb5e63baee028d240f4419925154b96eaa69e8fbb1aae5102db7916234f290aa60c5d7e69406f02aeea9fe9384afbff7d878c9ac87cd31f7c35dff243b1441e09baff478\nLCM = 687669343f5208a6b2bb2e2efcac41ec467a438fde288cc5ef7157d130139ba65db9eb53e86a30c870bd769c0e0ab15a50f656cd9626621ae68d85eaff491b98da3ea5812062e4145af11ea5e1da457084911961ef2cd2ac45715f885ba94b4082aa76ffd1f32461f47c845b229d350bf36514c5ce3a7c782418746be342eca2721346ade73a59475f178c4f2448e1326110f5d26a0fef1a7a0c9288489e4dc8\n\nGCD = 84b917557acf24dff70cb282a07fc52548b6fbbe96ca8c46d0397c8e44d30573\nA = 81dbb771713342b33912b03f08649fb2506874b96125a1ac712bc94bfd09b679db7327a824f0a5837046f58af3a8365c89e06ff4d48784f60086a99816e0065a5f6f0f49066b0ff4c972a6b837b63373ca4bb04dcc21e5effb6dfe38271cb0fa\nB = 1da91553c0a2217442f1c502a437bb14d8c385aa595db47b23a97b53927b4493dd19f1bc8baf145bc10052394243089a7b88d19b6f106e64a5ab34acad94538ab504d1c8ebf22ac42048bbd1d4b0294a2e12c09fe2a3bd92756ba7578cb34b39\nLCM = 1d0530f8142754d1ee0249b0c3968d0ae7570e37dadbe4824ab966d655abf04cd6de5eb700eba89d8352dec3ae51f2a10267c32fbd39b788c7c5047fe69da3d7ad505435a6212f44899ba7e983bb780f62bcdee6f94b7dba8af7070a4cc008f351ae8be4579bc4a2e5c659ce000ad9c8cdc83723b32c96aeb0f5f4127f6347353d05525f559a8543cd389ad0af6f9d08a75b8c0b32419c097e6efe8746aee92e\n\nGCD = 66091477ea3b37f115038095814605896e845b20259a772f09405a8818f644aa\nA = cedac27069a68edfd49bd5a859173c8e318ba8be65673d9d2ba13c717568754ed9cbc10bb6c32da3b7238cff8c1352d6325668fd21b4e82620c2e75ee0c4b1aff6fb1e9b948bbdb1af83cecdf356299b50543b72f801b6a58444b176e4369e0\nB = 5f64ca1ba481f42c4c9cf1ffa0e515b52aa9d69ceb97c4a2897f2e9fa87f72bae56ee6c5227f354304994c6a5cc742d9f09b2c058521975f69ca5835bce898cf22b28457cd7e28870df14e663bb46c9be8f6662f4ff34d5c4ae17a888eba504e\nLCM = c163cb28642e19a40aa77887c63180c2c49fc10cda98f6f929c8131752ea30b5283a814a81681b69b9d1762e6c1a9db85f480bc17f998d235fd7e64c1caa70ef170c9e816d3e80f516b29f2c80cfb68bf208b4d5082ef078da4314b3f20c7d6c54b0aeb378096b029a7b61c0a4cd14aeddc01004c53915a4f692d2291752e5af46b23d7fa6dd61f2d56c6f4bf8e6119688abac8fd7aba80e846a7764bb3fca0\n\nGCD = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nA = 0\nB = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nLCM = 0\n\nGCD = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nA = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nB = 0\nLCM = 0\n\nGCD = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nA = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nB = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nLCM = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\n\nGCD = 120451d8307219aa0c96f328ad653ccd462e92423ca93ed8a3dde45bf5cb9b13cdaf9800e4d05dd71c4db6a129fb3280ee4ec96ec5297d881c1a8b5efccbd91fef21f5c5bf5fba42a4c8eaa358f620a074b7a17054527bdaa58d5acaa0dfdc48ecba1a10ebf4d57bb4215de406e6be13fed3fe493b1cd1e2d11a8d4ac03c47756\nA = 3f8179a8e1f0b342475a855c3e1bae402dd41424cf24a0b4d2e263c8efb08bde7d92eae8607fb5e88b1378f0f1bd0733f229a35be6b1383a48d32749d5d6b32427d26323b7ab05bb5781289e96bfbc21971439319b15f6c0fe93fdb35d0b67ec41443c59a081dd3cef047ac797fccb45bece84c0bb0bb7e1797259526d8ec9cc63ba4d32cfc692ccd3d243cb2b53ac216312f3a8e8c0daa09d21b6150d697639a5e52059414a417c607be8ec0eee2e708219cadbaf37a369c4485b01ed87bbc2\nB = 2c474e396a2dd9cd10b9d7313f69d3b4ca123e9fd853edd488339236d14c56453a1381958864a04d2624e81995dabcdd0ccf60db9917813f887de68da075d0ea4440001e18f470e43b38ee3440b49be651d709fbdef980e3e4149913f4ae2681124f54523f4881376ddb533b5219e804cc26f4c2e577be4e02613c4da80ba1215775b0a5178a965ad47bd2befb32493943ded1004ef66347b4983f8d1ba990d4a943505dfce6debcfb322842ed88106cd6dee9aa592ff0d2274bc727a6e1f14c\nLCM = 9c129cf649555bfd2d3d9c64dc6d6f022295e53bca5d2f218adaa66aa60eb4694429b7e83bf81b6df4459c5104023ab9a33f006ffcd8114507baa17e2ef6fe23ebdd4740f66879033da2041f2cb7ba517ad3526ffe75614ea9432c085f71b2d65a736bac7ba42b639e330b82733372083843dcb78b6a273ab20e0d4b7c8998a14048aa15bb20a0a0bd997917107274c89b4cec175fb98043d52e6c555bd9e0036566d052a6d4e7e276d1e8835e1f06e3ca46d47747ba586e95fb1a790d992834b7c3e136141eb8a434e6c12067246ac3c0a81c69e03b1ed28aa0b3173d6eff83d278c2f461a47a416f3f9a5dae3bb410fd18817bd4115e7f1e84b936cc02364\n\nGCD = 95aa569a2c76854300d7660847dd20fe0b8c445fdbcaa98465cee61aee76ad6a438e75a8c573198570ffb62bc07ec3a2be0ae0a1f631670fa88d6f75f3161e8b9a4d44b6801ffc884c7f469c5ed1f27b1edecce9f2977f9e92d1a3b230492fea7e6f2af739dc158a7fbd29856cbedb57b4119e64b27ab09eb1c2df01507d6e7fd\nA = 4c653b5bfec44e9be100c064dffe5d8cd59b0cf4cc56b03eabb4ef87cfda6506c9a756b811907fe9d8b783eb7a0b9e129773bf1da365ddb488d27b16fb983e89345d1ccdb4f06a67a11925c3f266373be5d7b0075189c6f3c2157e2da197058fe0a7bcc50adc34e99e254a29abbe2d5948d3157e1b0c3fca3d641760f7b9862843b63abef0b3d83fd486f4526b30382fda355575da30e9a106718a3921774c4d69f5311f8d737fe618f5236b4763fe1b2ee7f13184db67367d3903c535ff6d7b\nB = 2dcca83c99a28e9fd2f84e78973699baf2f04fd454094730948b22477834a0064817b86e0835e6d7b26e5b0b1dcf4ad91a07ac0780d6522df1fcac758cf5db6c2a5623d7c0f1afefd5718f7b6de639867d07a9ec525991304e9355d1635104bea837f74758d6aa2aab4e4afbb606af1d98de7417505e4710cd0589bdff9a0bf38a857cc59a5f1781043e694fc2337fd84bdeb28b13a222bb09328a81ec409ad586e74236393d27398cc24d412135e34247c589149e134b97f4bd538ac9a3424b\nLCM = 1760c0b0066aa0695767099e87e9388729ea89b8e8c36bddcd04d257591e741613c07b0e69447c0a468c33a745084171e06523d987d8db40a1433bf435325e8a724a0876503b34495170ff3671d42117a2e4f3a75b1d9dd809a34fa0fb26fe50d84f80a9b02e40190e5efb927a5a61a03f13edbce2e666af6c3a2a9bcb84e47e3090008753ff27c4b8cf06480f471379a93f5230923623a83b286b71a555cd5e5347282f66", - "4ed90b14b2c4de84a70375e488211a7b3931119ef3bbe029b712389fe784818a0bf29d80733ce9cc940c547aa1eb3f06d492eb676bf37802283c82ce76156dfaab5c2d5107e08062681b5fa169f6eb68e1ab8bd9b2005e90bd4fd\n\nGCD = 244b9b1290cf5b4ba2f810574c050651489f2d3a2b03e702b76ebfaf4e33de9bbe5da24c919e68d3a72eadd35982b3a89c6b18b38ff7082ac65263e52b6ec75a5717b971c98257b194c828bff0216a99536603b41a396ea2fb50f5ea7cf3edf10bb0d039123e78593ae9ffcbbba02e51e038533e83b6bc73c70551d6467f39809\nA = 41a0b1310669500681cdf888836f6c556758750f562d743ac780dd4c0d161856380e44fdbb1f8a2786bf45be6b0e7f1cb2cd85f6b9e50acc72793d92383c7d7fb796fc74d32e8fac8225bdc19ae47546d9c9c75f5f06ca684f07daccaf89ccf2cddeb7ec255d530c7dd1e71daf44cafdc9d30fbcb1cbaefae3480585f79f4177e3834a5bc91845e2e8cd8aeb27f484e5e5b2c3c076dbb6c23e91303f0a0fdde83cd33a8ea6ed1549e727b4d766c1017c169710fd98e1585d60f66e121f9180b3\nB = 251f5aeaa60b3959285f49540cdaf8e21451110bbddb9933bbbcaea3112f4eb45e435a3ba37c52d2ab79ce997a8f6c829b3aa561f2852924b8effb52396d09d2bf257ebb4fb56c7aa25648f69b06d2cd01e876c9f9c0679de9e6fffa79eb7e603723e5af7de46ee405a5a079229577b5b6fffb8d43e391fe6f4eb89638e64d6eff8026249aaa355a91625eb0bfd14caa81e4c3586aaa2e94fde143a44f223a91e226661d12f55dfcdb4215e5a64e14e968005733be6a71c465de312ca109b34a\nLCM = 431f918b274f3e43f446e4e85567883d6536a0332db662cef088f5a36b0f4b68372048174ba10fee94b9f8f1c2e189c974be2e6e8ae8e2ae108445326d40f63e38d8d4e2e46174589a3cbc9583e0036dc8146e79eee9e96f4436313b3f143dd0f5aceab05243def7f915169c360f55ef123977cf623c5ba432c3259c62fb5e37d5adab0f24b825aa4ada99ec4e83e9ca4698399e1ed633091ce5f9844c540a642cd264201116ed4168aa2105a5159f5df064f845830c469140f766c7319052ce59bd1ad7c3f2d8c30e54f147f6aeb5586c70c984302ba18d854a60aec01b394c7d66fa33fe18fe4a8cfb3238df219294e6e42190a30d28b10049a1b75853a4e\n\nGCD = 206695d52bc391a4db61bf8cb6ea96188333a9c78f477ee76976c2346dad682cf56ca6f176d86ef67d41ff5921b6162b0eca52359975872430dd14c45643eacdf028d830770714c033fd150669705851b2f02de932322d271d565d26768530c3f6cb84f0b3356f970b9070b26c050ead0417152c324c8ffe266d4e8b5b7bef3a\nA = 1114eb9f1a9d5947eb1399e57f5c980833489685023ed2fe537fe1276c1e026b9a19e6fff55aa889d6c4e977b6e6f3111e2ad463138637b50f42cf32e57d83f282de9e72f813e5969195159a666d74dcd689bd527c60199ae327f7bd548ac36868fea5fdf6f35d19b921e7c10b6448ca480de6826478cd0642d72f05af3f8e65ce42409fbd49f56e81946e89c8e83962c4edc0ed54600600a305e52d081aed3c351e450e11f8fb0ce5754c92cf765b71393b2b7a89c95df79b9ea1b3cb600862\nB = 1d8f3179ca7b5cc7119360c10de939ffa57c9043da2f2b0ca3009c9bdad9f19ed16e3c2c197bef4b527fa1bf2bbab98b77e26c329911db68bd63d3d0fbfc727a977395b9ad067106de3094d68e097830858c5ccfa505fc25e972bdee6f347e7d1163efacd3d29a791ec2a94ffeed467884ae04896efc5e7e5f43d8d76c147e3c9951a1999173bc4e5767d51268b92cc68487ba1295372143b538711e0a62bf0ac111cc750ca4dd6c318c9cbe106d7fc492261404b86a1ba728e2d25b1976dc42\nLCM = f9570211f694141bfb096560551080cbe02a80271b4505591aaea9e3b99ea1d5ac1c1f2378fd72799e117ac2a73381b1ad26314e39972164d93971479ee3ba21a4d98cef0bd299d540ce5826995dcee0de420dff73d30b23cbf3188c625c7696df517535bc5675d71faa00807efbebdca547933f4a37849d1c014484a77da6df0670c4974bcc91eb5f5fe5faf9dd095ef195ec32ad9eeebf0e63288b4032ed9e70b888afc642f4ff96f0b4c0a68787301c12e4527fe79bdfe72dd3844ab5e094a9295df6616f24d1b9eeebc2116177dacf91969dda73667bc421ef3ccd8d5c23dddc283f5d36568d31f2654926be67f78e181075bdc148f2b39c630b141ae8a\n\nGCD = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nA = 0\nB = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nLCM = 0\n\nGCD = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nA = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nB = 0\nLCM = 0\n\nGCD = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nA = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nB = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nLCM = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\n\nGCD = 2\nA = 14e95a85e59ade9ef39e2f400c65db18702fa5fc485b9bba479a5282b2206129160e54f73ef4917983c17b4c5ebff7be112a886de069706eee29ba902515cb038\nB = ddcfff1d39c90c599f55495bf71c1e7597c6b08b7430707f360c6a6e5137bbc7b403c6d9e2c34f3d2f29d5d32b869346853c2de239cc35381bdfb4a01569211a\nLCM = 90f38564ee72e55d362c04599e7d74f068c75f541b84e97abba2841f1a9f66b06b5c9009f6a4c2e319fced85270588de03ccebddbd9279aaecb13bdc1dbea7f42acaee751cb7da83779b8785cc86f41b94b13b54964208ca287d981634778d1096f20e76ca636c0717fd27e0800c43f599a5eded807421b502eaf9990a8c8ed8\n\nGCD = 4\nA = 3c719c1c363cdeb7b57c2aabb71f425da4c3e6d3e447204d555e7cf0f3d372bdda906f36078045044978dafc20171767c8b1464d52dfdf3e2ba8a4906da033a8\nB = 30fe0ef151ac51404e128c064d836b191921769dc02d9b09889ed40eb68d15bfdd2edea33580a1a4d7dcee918fefd5c776cbe80ca6131aa080d3989b5e77e1b24\nLCM = 2e4526157bbd765b0486d90bcd4728f890bc6dbd9a855c67ca5cb2d6b48f8e74e1d99485999e04b193afca58dbf282610185d6c0272007744ff26e00dbdc813929b47940b137dc56ba974da07d54a1c50ec4a5c2b26e83f47cf17f4ccce8c3687e8d1e91d7c491a599f3d057c73473723ce9eee52c20fe8ae1595447552a7ee8\n\nGCD = 10\nA = 44e04071d09119ea9783a53df35de4a989200133bb20280fdca6003d3ca63fdd9350ad1a1673d444d2f7c7be639824681643ec4f77535c626bd3ee8fa100e0bb0\nB = ca927a5a3124ce89accd6ac41a8441d352a5d42feb7f62687a5ebc0e181cc2679888ecc2d38516bdc3b3443550efccac81e53044ae9341ecace2598fe5ce67780\nLCM = 36805ba9b2412a0cb3fe4ed9bdabfa55515c9d615a3d0af268c45c5f6098d2de4a583f3791f1e3883c55d51ce23c5658fd0e8faa9a3709a1cfbd6a61dbab861690f27c86664f084c86cfd4a183b24aaadf59a6f8cbec04f1b0ded8a59b188cb46ae920052e3e099a570540dbc00f7d4a571eef08aa70d2d189a1804bf04e94a80\n\nGCD = 100\nA = 73725032b214a677687c811031555b0c51c1703f10d59b97a4d732b7feaec5726cb3882193419d3f057583b2bc02b297d76bb689977936febaae92638fdfc46a00\nB = 979f4c10f4dc60ad15068cedd62ff0ab293aeaa1d6935763aed41fe3e445de2e366e8661eadf345201529310f4b805c5800b99f351fddab95d7f313e3bb429d900\nLCM = 4460439b4be72f533e9c7232f7e99c48328b457969364c951868ceab56cb2cbbeda8be2e8e3cae45c0758048468b841fdb246b2086d19b59d17b389333166ab82ed785860620d53c44f7aaaff4625ee70fb8072df10fb4d1acb142eadc02978ff2bb07cea9f434e35424b3323a7bda3a1a57aa60c75e49ebb2f59fb653aa77da00\n\nGCD = 100000000\nA = f8b4f19e09f5862d79fb2931c4d616a1b8e0dd44781ca52902c8035166c8fca52d33a56ff484c365ec1257de7fa8ed2786163cfc051d5223b4aad859a049e8ba00000000\nB = 6e54cb41b454b080e68a2c3dd0fa79f516eb80239af2be8250ca9cd377ba501aabafc09146fad4402bdc7a49f2c3eec815e25f4c0a223f58e36709eefd92410500000000\nLCM = 6b3020a880ddeff9d17d3dc234da8771962de3322cd15ba7b1e4b1dd4a6a2a802a16c49653865c6fdf6c207cbe0940f8d81ef4cb0e159385fd709d515ee99d109ad9ad680031cbae4eab2ed62944babdade4e3036426b18920022f737897c7d751dce98d626cdda761fec48ad87a377fb70f97a0a15aa3d10d865785719cc5a200000000\n", + "b4e0523ca726bfbe969b89fd754f674ce99118c3f2d1c5d81fdc7c54e02b60262b241d53c040e99e45826eca37a804668e690e1afc1ca42c9a15d84d4954425f0b7642fc0bd9d7b24e2618d2dcc9b729d944badacfddaf\n\nModMul = ccd6f75b5f24b7c5ce2ce755fa89c2450c6a7d96ce8c8791e659eab84577a7695e3b2caa7c980fb23f60634233e9798499c28b0338c1f1a326d0ca89fd41f2fd88b759f317889832966b551a950043ec7a4b6152d3e2cbfb40e88458e70ab783b96f12d271f828d5b39e198ccaf8665411d85026282dbead5d24cd01b6c8a8e9\nA = 095d72c08c097ba488c5e439c655a192eafb6380073d8c2664668eddb4060744e16e57fb4edb9ae10a0cefcdc28a894f689a128379db279d48a2e20849d685939b7803bcf46cebf5c533fb0dd35b080593de5472e3fe5db951b8bff9b4cb8f039cc638a5ee8cdd703719f8000e6a9f63beed5f2fcd52ff293ea05a251bb4ab81\nB = 7878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878\nM = d78af684e71db0c39cff4e64fb9db567132cb9c50cc98009feb820b26f2ded9b91b9b5e2b83ae0ae4eb4e0523ca726bfbe969b89fd754f674ce99118c3f2d1c5d81fdc7c54e02b60262b241d53c040e99e45826eca37a804668e690e1afc1ca42c9a15d84d4954425f0b7642fc0bd9d7b24e2618d2dcc9b729d944badacfddaf\n\n\n# ModSquare tests.\n#\n# These test vectors satisfy A * A = ModSquare (mod M) and 0 <= ModSquare < M.\n\n# Regression test for CVE-2017-3732.\nModSquare = fffffffdfffffd01000009000002f6fffdf403000312000402f3fff5f602fe080a0005fdfafffa00010001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000002000002fefffff7fffffd07000109fdfffef3fffdfd06000405ff00fdfbfffe00010001\nA = ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000ffffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff00000000\nM = ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000ffffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff\n\n# Regression test for CVE-2017-3736.\nModSquare = fe06fe0b06160c09\nA = fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8f8f8f800000000000010000000006c000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffffffffffff8f8f8f800000000000010000000006c000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffffff00fcfdfc\n# A in Montgomery form is fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8ffeadbcfc4dae7fff908e92820306b9544d954000000006c000000000000000000000000000000000000000000000000000000000000000000ff030202fffff8ffebdbcfc4dae7fff908e92820306b9544d954000000006c000000ff0302030000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01fc00ff02ffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00fcfdfcffffffffff000000000000000000ff0302030000000000ffffffffffffffffff00fcfdfdff030202ff00000000ffffffffffffffffff00fcfdfcffffffffff\nM = fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8f8f8f800000000000010000000006c000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffffffffffff8f8f8f800000000000010000000006c000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffffffff\n\n\n# ModExp tests.\n#\n# These test vectors satisfy A ^ E = ModExp (mod M) and 0 <= ModExp < M.\n\nModExp = 00\nA = -01\nE = 01\nM = 01\n\nModExp = 01\nA = -02\nE = 01\nM = 03\n\nModExp = 01\nA = -01\nE = 02\nM = 03\n\nModExp = 01\nA = -02\nE = 02\nM = 03\n\nModExp = 00\nA = -03\nE = 02\nM = 03\n\nModExp = 02\nA = -04\nE = 01\nM = 03\n\nModExp = 01\nA = -04\nE = 02\nM = 03\n\n# Regression test for carry propagation bug in sqr8x_reduction.\nModExp = 19324b647d967d644b3219\nA = 050505050505\nE = 02\nM = 414141414141414141414127414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001\n\n# Cover the E = 0 case for small numbers.\nModExp = 01\nA = 86b49\nE = 00\nM = 30d26ecb\n\nModExp = 00\nA = 00\nE = 00\nM = 01\n\nModExp = 208f8aa0\nA = 86b49\nE = 2\nM = 30d26ecb\n\nModExp = 27308229\nA = 17591bb\nE = 6\nM = 30d26ecb\n\nModExp = 2bdf498f\nA = 21292626\nE = d\nM = 30d26ecb\n\nModExp = 11317167\nA = 4a655df24\nE = 10\nM = 30d26ecb\n\nModExp = 2e1b88e\nA = da6b761a86\nE = 35\nM = 30d26ecb\n\nModExp = 20a12ec3\nA = ea811\nE = 2\nM = 23bc042f\n\nModExp = c42ced\nA = 1011a6a\nE = 4\nM = 23bc042f\n\nModExp = 4637d79\nA = 28d9a601\nE = 8\nM = 23bc042f\n\nModExp = 20e5669b\nA = 72fe6bc20\nE = 11\nM = 23bc042f\n\nModExp = 142ab9e3\nA = 9a07b9363c\nE = 29\nM = 23bc042f\n\nModExp = 14c64646\nA = 822df\nE = 3\nM = 30915765\n\nModExp = 160e35a2\nA = 15ea542\nE = 5\nM = 30915765\n\nModExp = 2f23a488\nA = 34d2e02e\nE = e\nM = 30915765\n\nModExp = 28e67f93\nA = 636a32703\nE = 14\nM = 30915765\n\nModExp = 29bfeaa5\nA = c8646998e6\nE = 2c\nM = 30915765\n\nModExp = 30959e22\nA = 81dad\nE = 3\nM = 326dd68d\n\nModE", + "xp = 1a1da4fa\nA = 116adb9\nE = 5\nM = 326dd68d\n\nModExp = 272bf0d8\nA = 2d21ef08\nE = 8\nM = 326dd68d\n\nModExp = 29f5054b\nA = 76989850a\nE = 16\nM = 326dd68d\n\nModExp = e6c7b77\nA = b88ee70d2a\nE = 3e\nM = 326dd68d\n\nModExp = 369605e1\nA = cf26f\nE = 2\nM = 3ce082eb\n\nModExp = 168a3c5d\nA = 1f82caf\nE = 5\nM = 3ce082eb\n\nModExp = 125c4bb8\nA = 2e9c4c07\nE = 9\nM = 3ce082eb\n\nModExp = 1c5fe761\nA = 523ab37f1\nE = 14\nM = 3ce082eb\n\nModExp = 21703009\nA = dc832165e8\nE = 20\nM = 3ce082eb\n\nModExp = 1228d1e\nA = a5555\nE = 3\nM = 24665b27\n\nModExp = 5226af4\nA = 1077bd6\nE = 4\nM = 24665b27\n\nModExp = 1b14eac1\nA = 2db3a834\nE = f\nM = 24665b27\n\nModExp = 161727bc\nA = 6bd962cb6\nE = 19\nM = 24665b27\n\nModExp = 10d61d0d\nA = c10caed407\nE = 28\nM = 24665b27\n\nModExp = 233da406\nA = b125f\nE = 3\nM = 33509981\n\nModExp = 24032799\nA = 1656b7c\nE = 6\nM = 33509981\n\nModExp = 129ecebe\nA = 2e671504\nE = a\nM = 33509981\n\nModExp = 20c20bac\nA = 4d7a2de44\nE = 1f\nM = 33509981\n\nModExp = 2e3ce9d3\nA = c53b3def4d\nE = 31\nM = 33509981\n\nModExp = 12fadfd6\nA = b4cf8\nE = 2\nM = 36e9d4ae\n\nModExp = 457ac85\nA = 1b1c7e9\nE = 7\nM = 36e9d4ae\n\nModExp = 31debef4\nA = 3a973028\nE = d\nM = 36e9d4ae\n\nModExp = 2333ad93\nA = 552b97c45\nE = 11\nM = 36e9d4ae\n\nModExp = 99ba1fb\nA = 8bfb949cbb\nE = 28\nM = 36e9d4ae\n\nModExp = 27b691de\nA = 93492\nE = 3\nM = 298fdb16\n\nModExp = 3c2b70f\nA = 14e7b0d\nE = 4\nM = 298fdb16\n\nModExp = 1486cda7\nA = 29acff81\nE = c\nM = 298fdb16\n\nModExp = 11725275\nA = 507489205\nE = 13\nM = 298fdb16\n\nModExp = 24d14627\nA = e71c55606d\nE = 35\nM = 298fdb16\n\nModExp = 222b8d14\nA = 9b1a0\nE = 3\nM = 3db59d12\n\nModExp = 3b8bd47d\nA = 13f4e8d\nE = 7\nM = 3db59d12\n\nModExp = 17e72356\nA = 334774ce\nE = a\nM = 3db59d12\n\nModExp = 306447ca\nA = 47079ddd2\nE = 12\nM = 3db59d12\n\nModExp = 90bef3b\nA = a75d62616d\nE = 37\nM = 3db59d12\n\nModExp = 1\nA = cddd44f47e84b3276cc36a5c0d742cc703e61c4756168601fbb1b6eb598c161019562344dd56ab6f603d920a12c360b285e6496a3605a2f8d691c3598233ee9366b5f2692554893bdeb67b7bdaf35ab7273ac593145e26bed82c70ba5793bf4bc5cac4c80b01785d1496beede493806e4f4aa89fd8d41de80dd6d0a3e2742678\nE = 0\nM = c95943186c7567fe8cd1bb4f07e7c659475fd9f38217571af20dfe7e4666d86286bc5b2bb013197f9b1c452c69a95bb7e450cf6e45d46e452282d5d2826978e06c52c7ca204869e8d1b1fac4911e3aef92c7b2d7551ebd8c6fe0365fad49e275cc2949a124385cadc4ace24671c4fe86a849de07c6fafacb312f55e9f3c79dcb\n\nModExp = 0\nA = 0\nE = 8de689aef79eba6b20d7debb8d146541348df2f259dff6c3bfabf5517c8caf0473866a03ddbd03fc354bb00beda35e67f342d684896bf8dbb79238a6929692b1a87f58a2dcba596fe1a0514e3019baffe1b580fc810bd9774c00ab0f37af78619b30f273e3bfb95daac34e74566f84bb8809be7650dec75a20be61b4f904ed4e\nM = c95943186c7567fe8cd1bb4f07e7c659475fd9f38217571af20dfe7e4666d86286bc5b2bb013197f9b1c452c69a95bb7e450cf6e45d46e452282d5d2826978e06c52c7ca204869e8d1b1fac4911e3aef92c7b2d7551ebd8c6fe0365fad49e275cc2949a124385cadc4ace24671c4fe86a849de07c6fafacb312f55e9f3c79dcb\n\nModExp = 5150fb769d5c5d341aaf56639a7bcc77c415fe46439938a2190283409692f29cd080bfe3433005d98d24718a03a3553c8560c5e9c8ed0f53b8945eb18290e1c1a83d919302510f66dd89b58acc2de79ad54b8a30d3e1019d4d222556beefca0821b094ecf104b5e4cfce69d2d520d2abf54f3e393d25ed3d27e8c2e3ca2e5ff9\nA = ead8c5a451541c50cab74de530c89376d9a55c723e0cac3c84b25f0093c08a2961e49ab48966361c42c9f99111587252d98395b76788400d75c66ef208ea2767a28d6f8dc3a859f39c95765d57f139e7fc14f47c908c62df051e7216d379f52028843b4d82ef49133cce8fe671ae179423ac8da5be43b01caaf425cd969300cd\nE = 8de689aef79eba6b20d7debb8d146541348df2f259dff6c3bfabf5517c8caf0473866a03ddbd03fc354bb00beda35e67f342d684896bf8dbb79238a6929692b1a87f58a2dcba596fe1a0514e3019baffe1b580fc810bd9774c00ab0f37af78619b30f273e3bfb95daac34e74566f84bb8809be7650dec75a20be61b4f904ed4e\nM = c95943186c7567fe8cd1bb4f07e7c659475fd9f38217571af20dfe7e4666d86286bc5b2bb013197f9b1c452c69a95bb7e450cf6e45d46e452282d5d2826978e06c52c7ca204869e8d1b1fac4911e3aef92c7b2d7551ebd8c6fe0365fad49e275cc2949a124385cadc4ace24671c4fe86a849de07c6fafacb312f55e9f3c79dcb\n\nModExp = 1\nA = 935561297d1d90255aef891e2e30aa09935409de3d4a5abc340ac9a9b7dce33e9f5ce407f3a67ec30e0dc30481070823f8542463e46828d9cafb672a506d6753688cbad3d2761079f770c726c0b957071a30876c4d448e884b647833befbcd6b582787bf769d63cf55e68c7b869a0b86374f8920516cf5d528f348b6057450a1\nE = 0\nM = dcc24236a1bb94c71d9ec162a6aa4697b932717e82b667cad08b6bd1bbcbddf7cd167b7458de2b0b780486b39574e749d6405f9ede774a021d6b547271523e9e84a6fdd3a98315607ccf93356f54daa9c75e1e311e1672d0dc163be13f9ed6762f7dd301f5b0a1bb2398b608f40ac357ae34fc8a87d4fef3b961cbdb806d9061\n\nModExp = 0\nA = 0\nE = bb552be12c02ae8b9e90c8beb5689ffefe3378d2c30f12a6d14496250ecce30317c642857535a741642c3df689a8d71a276d247ed482b07b50135357da6143ac2f5c74f6c739c5ff6ada21e1ab35439f6445a1019d6b607950bffb0357c6009a2bfc88cd7f4f883dc591d4eb45b1d787e85aba5c10ee4fe05ea47bf556aec94d\nM = dcc24236a1bb94c71d9ec162a6aa4697b932717e82b667cad08b6bd1bbcbddf7cd167b7458de2b0b780486b39574e749d6405f9ede774a021d6b547271523e9e84a6fdd3a98315607ccf93356f54daa9c75e1e311e1672d0dc163be13f9ed6762f7dd301f5b0a1bb2398b608f40ac357ae34fc8a87d4fef3b961cbdb806d9061\n\nModExp = bbad67352704a6321809f742826bf3d1c31c0ad057bf81432abeb30dc9913c896c03e69eb1cde6b78ffcb320c4625bd38ef23a08d6c64dc86aec951b72d74b097e209ce63092959894614e3865a6153ec0ff6fda639e44071a33763f6b18edc1c22094c3f844f04a86d414c4cb618e9812991c61289360c7ba60f190f75038d0\nA = 855144760f2be2f2038d8ff628f03a902ae2e07736f2695ec980f84a1781665ab65e2b4e53d31856f431a32fd58d8a7727acee54cc54a62161b035c0293714ca294e2161ea4a48660bf084b885f504ad23ea338030460310bd19186be9030ab5136f09fe6a9223962bce385aaaf9c39fe6ed6d005fa96163fe15cdfa08fc914d\nE = bb552be12c02ae8b9e90c8beb5689ffefe3378d2c30f12a6d14496250ecce30317c642857535a741642c3df689a8d71a276d247ed482b07b50135357da6143ac2f5c74f6c739c5ff6ada21e1ab35439f6445a1019d6b607950bffb0357c6009a2bfc88cd7f4f883dc591d4eb45b1d787e85aba5c10ee4fe05ea47bf556aec94d\nM = dcc24236a1bb94c71d9ec162a6aa4697b932717e82b667cad08b6bd1bbcbddf7cd167b7458de2b0b780486b39574e749d6405f9ede774a021d6b547271523e9e84a6fdd3a98315607ccf93356f54daa9c75e1e311e1672d0dc163be13f9ed6762f7dd301f5b0a1bb2398b608f40ac357ae34fc8a87d4fef3b961cbdb806d9061\n\nModExp = 1\nA = 9d92629c1ab181c50c31619e8acd0d235a1f5fc7a0bef4d4fd54b4f1968d45921f8522efe88e69c6c14c576c564592b9feb00d1554b88b038934eaf4a8ce81a2582732387490181ef158360c8b2d9ccb326ffe043f776a50cb8202837f08ca743b562eefa007150ab7012c341b16248478d4775c02ad71ea13d5e82b71e2d600\nE = 0\nM = cd607549668469b792f495c141e500871880b0611c8004293a561ec7f9ab6561f8a9b90872742386adafb5cd1890e8204ae12aec529cca0a9e382c96439137f09de9973b12c8492c62847e107deabb7dd946ffbb9d0ac73b462c481092bd65326a17f21d8d6527c47a5dba50aaa20c7048b8788a49eb3ea5f29bd5cfce24eb3b\n\nModExp = 0\nA = 0\nE = 9f43dcb641f3ecf4dbc97450f2bdf3b7ec6a2f3e8e96bb1df2bf34b8d2d78e1a9018d04d960ffd0e932cfc60d3b9b923e3f9f29b3f3d61cae3a9f7245078143475c7fcb896ff200f7d94c4f2708bb42750e37c185a31c876814e4f06a00771707654e1da2fb69c16b6500b16385e3b933e2276ad3569977473f699b1c7926c3b\nM = cd607549668469b792f495c141e500871880b0611c8004293a561ec7f9ab6561f8a9b90872742386adafb5cd1890e8204ae12aec529cca0a9e382c96439137f09de9973b12c8492c62847e107deabb7dd946ffbb9d0ac73b462c481092bd65326a17f21d8d6527c47a5dba50aaa20c7048b8788a49eb3ea5f29bd5cfce24eb3b\n\nModExp = 24eaead5b57883c2f454928f8edd470a344bfe07a953194f7d635d705ef13ddfc64140c8ad6f363d4c828e7c7891a6b6d4df37335de4552c319dafd1c06d1f743240082a3535df4da1475d3eea3fead20e40815fd5a0876c881c162ab65a1eda494280c258901ca953d1d039a998bf0e9aa09273bbef4865f3054663b72d75ff\nA = a31618b4532f53729ba22efb2221432fab1dbb70853d6a1159b42fd19fc949965c709b209de106a652aa422d88922ce51dae47f7f6deaf0055202e13db79ee84fc3d3c6f4c003ef96597c49d6895fa53c22ac9e4819f7048146b5272f6279424fdb389819a0b251c823c76f4bebf4f1246de455aafe82a0d34454f5039e90839\nE = 9f43dcb641f3ecf4dbc97450f2bdf3b7ec6a2f3e8e96bb1df2bf34b8d2d78e1a9018d04d960ffd0e932cfc60d3b9b923e3f9f29b3f3d61cae3a9f7245078143475c7fcb896ff200f7d94c4f2708bb42750e37c185a31c876814e4f06a00771707654e1da2fb69c16b6500b16385e3b933e2276ad3569977473f699b1c7926c3b\nM = cd607549668469b792f495c141e500871880b0611c8004293a561ec7f9ab6561f8a9b90872742386adafb5cd1890e8204ae12aec529cca0a9e382c96439137f09de9973b12c8492c62847e107deabb7dd946ffbb9d0ac73b462c481092bd65326a17f21d8d6527c47a5dba50aaa20c7048b8788a49eb3ea5f29bd5cfce24eb3b\n\nModExp = 1\nA = a8558e7f455b27c0c46d7d0862eb409cdefbeca945e0284b5bf425", + "b7ac0f3d316bc365594cc1639decffc621214d61479bc75135120d4ac09ea8b742ad7ec1822091b62b1c6f564fe5e2f4f5b7def92cbaaa9a898549207ab01b91c2324fbd306a87f7d6379b6fb6493c5fca76729767f136120da9c90bdc7d364f7d242d5acc\nE = 0\nM = 88f3c87ac5e3272a21b8a858da640d6939fb8113a95412c38663a0f352686d69a5d7927e60b484b9fcb8ef12978fe25ff2ebc9b61c5450e04222ef20ba3cbbdc5ec45581ce0f58e10be7bb9de7fa08752303a7a1db23b2ac9c6692ec63bf09ecd6639e06c5491ba568ea886620d71da32d329615f0e1443a75d09ae35b8a2d7f\n\nModExp = 0\nA = 0\nE = a5524b41dfc6b570df1d8f6633ac7777c1131abe3a99c6166b0d29d3b8883c41b00a0c53cdd6f42820bf05c810b6ec53e77a8c1b9344ea0c91d4f410a2f204c369f3db33bf8c88217fc2cf802a9d9bce8119242d8e781875b85431be170076498c0963574ee423551aec9557e2fc672ab1ab5d0cbb1c400535df9481e7934d8f\nM = 88f3c87ac5e3272a21b8a858da640d6939fb8113a95412c38663a0f352686d69a5d7927e60b484b9fcb8ef12978fe25ff2ebc9b61c5450e04222ef20ba3cbbdc5ec45581ce0f58e10be7bb9de7fa08752303a7a1db23b2ac9c6692ec63bf09ecd6639e06c5491ba568ea886620d71da32d329615f0e1443a75d09ae35b8a2d7f\n\nModExp = 292f0b39ca0f1c850b1a00cffd2d54924fcd5fc7e7504c9d593e6c0ff74760b1f4bdd81679fe06c50248336f3108c593fa111072ee87d0fcc89a63243a1dc89044503663eee9bc18f51c3e0193d9108303e12ac90ff78f6ec752a4386af09c42db524a7cbe9a3d4fcccd56c34d283bcc9debc17158b5fe8df0c1888a9841bf8f\nA = b4fde2908745ff92cc5826a27dcfdda09e8fffee681844fa4c7f1354d946d5d84e0e0c7a4a4cb20943d9c73dd707ca47d796945d6f6b55933b615e2c522f5dfc33e0652917b4809bab86f4fa56b32b746c177764895492d0a6a699812b2827fe701d40ef7effd78ea8efe1cac15ff74a295a09614bf04cae1a5017872ba22efe\nE = a5524b41dfc6b570df1d8f6633ac7777c1131abe3a99c6166b0d29d3b8883c41b00a0c53cdd6f42820bf05c810b6ec53e77a8c1b9344ea0c91d4f410a2f204c369f3db33bf8c88217fc2cf802a9d9bce8119242d8e781875b85431be170076498c0963574ee423551aec9557e2fc672ab1ab5d0cbb1c400535df9481e7934d8f\nM = 88f3c87ac5e3272a21b8a858da640d6939fb8113a95412c38663a0f352686d69a5d7927e60b484b9fcb8ef12978fe25ff2ebc9b61c5450e04222ef20ba3cbbdc5ec45581ce0f58e10be7bb9de7fa08752303a7a1db23b2ac9c6692ec63bf09ecd6639e06c5491ba568ea886620d71da32d329615f0e1443a75d09ae35b8a2d7f\n\nModExp = 1\nA = e2845c572b46496ac158a731f612fd40ef626fa7134755c25b1b7614f4d7b29164e6142ddb7985e4c7ebc575855ff901e95927fe98a5aea2ad3a4720c75782323bea1518b2c57790f44efd9411be4e95b3896bad1e73c59658290b309e5a7eb5ef8be08125063e57336b80f17eacee88966d12bbaaa15a25929c82e027cf696f\nE = 0\nM = cf0dee80177869a532f0c6c3a0bda3aad79bdb6b70b6c227b32d75c26e394a90c1f2a6c2bb841ba9f6556b15654a79d8b1dd0c90709a093497bf40be0807cdbb378a74de5893c25067224d3ea8d37387ed6c4a981138853cb89caa9ce6cd0f6a1e95de24d558e90960f93844db4d01e372650350d45a9d34a36042b4d4b9e78d\n\nModExp = 0\nA = 0\nE = a55703a72ca3f6074b939ed3d748196a684a3c8e411c2b39a9beb98993b6eb7ea3fa16f41bc5b5c3710b91c0fc74a8072793052f872f61695db3a2df872eaa427a110f1a8d568c85d58bd350d0df8eced7a10be80f7567360c1a8047b9c44aa2967cd0d9dd2caea2c1492358c2db4f0214da343fdf2e34272865dc5c63be2ae4\nM = cf0dee80177869a532f0c6c3a0bda3aad79bdb6b70b6c227b32d75c26e394a90c1f2a6c2bb841ba9f6556b15654a79d8b1dd0c90709a093497bf40be0807cdbb378a74de5893c25067224d3ea8d37387ed6c4a981138853cb89caa9ce6cd0f6a1e95de24d558e90960f93844db4d01e372650350d45a9d34a36042b4d4b9e78d\n\nModExp = c90e4c69df92e26549b016950b59080947f5403430698e128477782480dd70be96bed2b9042dd8c708eb432e02710555b97af11ce6fa9b53395022851c32d1f53f04237fb0763563b440ca6e81a50d909d907d9c26b7d3c420dbf88f7dadd488666848135f8cdc608dcfb0691989289fb54379c2e84c262f9765f68c012ca1b9\nA = 882ea1b9b6c79a3b1bdfd284658cb6227ad825e0178cab713c7413c2ec34f03cfaec470c4f5c521f5e9899a2123878ff0f5b36a4196c08ad1b04d03746c4bfb5d126f5eefbfe172627d6732710a8ac8890cedbd4fdef69a19f2b3253a5aa0e5dd5484f72d59b17bdd1dad3db209a3ab839368ed3975069685911d7b35e41a9e6\nE = a55703a72ca3f6074b939ed3d748196a684a3c8e411c2b39a9beb98993b6eb7ea3fa16f41bc5b5c3710b91c0fc74a8072793052f872f61695db3a2df872eaa427a110f1a8d568c85d58bd350d0df8eced7a10be80f7567360c1a8047b9c44aa2967cd0d9dd2caea2c1492358c2db4f0214da343fdf2e34272865dc5c63be2ae4\nM = cf0dee80177869a532f0c6c3a0bda3aad79bdb6b70b6c227b32d75c26e394a90c1f2a6c2bb841ba9f6556b15654a79d8b1dd0c90709a093497bf40be0807cdbb378a74de5893c25067224d3ea8d37387ed6c4a981138853cb89caa9ce6cd0f6a1e95de24d558e90960f93844db4d01e372650350d45a9d34a36042b4d4b9e78d\n\nModExp = 1\nA = d7a99e65b8af86b1c51d851f0447e43cd4f343cb0ada7236283e69aa7ebd383826acc9809e5dbc4002d0f2430022cb026458189db3805ce2de1142a31ba71a6c064ab51f0059eb4b931b8bcbaef023c38d57aa5f3e14f5df77e547fc028702071b58bd57338be1e1e4f98d3553484e4de359cefa29c5f58d3fa5d823f389dbef\nE = 0\nM = 8315dacf124bd473c578946347e83d1b20c750a7d9533d6215591be40bc78bcca77821f8c8f95375bbd6372515ada63d22bed2fa49bd6fabb0040c538d08db25b09d2fda02a93ab086cd1c27df93c37ee9c6a0527d089179b8f92b5dc3acf5ef1c75906fb80b03f5c2442a7a4088640f66376575ecfa4c697c1a571397ee5a0d\n\nModExp = 0\nA = 0\nE = 95793fe33696f53e37498b2b65aaf27079e27acf1da97dda2c3e0803e8a02139f574e04ee03f7d1ddd029f528e3f3644515ad6f10f0beac2767f23d9cd8a8b9b6c6e376e36b64a0ae2711d7d31a5a75011641935b503110edbefe9f0ff2da27b5c5f6bb8cc151fdc86f67191bb99160c6cacc86ca368d5bdfafd3f3ff5161b1e\nM = 8315dacf124bd473c578946347e83d1b20c750a7d9533d6215591be40bc78bcca77821f8c8f95375bbd6372515ada63d22bed2fa49bd6fabb0040c538d08db25b09d2fda02a93ab086cd1c27df93c37ee9c6a0527d089179b8f92b5dc3acf5ef1c75906fb80b03f5c2442a7a4088640f66376575ecfa4c697c1a571397ee5a0d\n\nModExp = 186c50ae259aa0fd31859cbcfea534e626a254de33956d5d719334bb32e7cf37cf199a21f079a5b90497228994d05efe19ccd8c769cd81f896286e8ae557cacd1630a928c629ecdfece29ab3697794aa707734e007318fa7029b050bb09ebbe6986187c6ca843f55266d275620b3f0fec0ad5f847ce8b314d929d128b33a249e\nA = 9d5e345793faddca9867f23eeddf6816c1e837f7a2cf96fa077212514acb6be87ac01a237d8f2f1d07d27a8ddd1b0ae0d97e1bda4f205a89435017284cdedea3e407b1b940d6f52112b6359b3e86e4c83074b17c210ae2c8856b42b169b4a7a6dfa65b368a7959496cf9bb1ee93d019dbd79101830e3f5ed08604ab90890b914\nE = 95793fe33696f53e37498b2b65aaf27079e27acf1da97dda2c3e0803e8a02139f574e04ee03f7d1ddd029f528e3f3644515ad6f10f0beac2767f23d9cd8a8b9b6c6e376e36b64a0ae2711d7d31a5a75011641935b503110edbefe9f0ff2da27b5c5f6bb8cc151fdc86f67191bb99160c6cacc86ca368d5bdfafd3f3ff5161b1e\nM = 8315dacf124bd473c578946347e83d1b20c750a7d9533d6215591be40bc78bcca77821f8c8f95375bbd6372515ada63d22bed2fa49bd6fabb0040c538d08db25b09d2fda02a93ab086cd1c27df93c37ee9c6a0527d089179b8f92b5dc3acf5ef1c75906fb80b03f5c2442a7a4088640f66376575ecfa4c697c1a571397ee5a0d\n\nModExp = 1\nA = e6a079bdf7b0638d50b183475e9ddfd5cbdebfb29f5fae8e9be402a0bd36085737b556492ea7fb4b1000ae9ce59db66098129b757cfb29224275fdaa46b8b7eb18a93ca7d3e446dc38c734b683d7ba7927b008d993aab01f44239d3c76be76d1503908e9b5e73b36c43ae0771368b01f39c042693bd92c4fc50810f059e1b332\nE = 0\nM = 81dd561d5d5327fc5ed7c9236b5fb21ef713c6d5e36264ba65ccc801b8eb107b714aad65bb503bb1f4721c0a6f97e5ab89300f049f42a4616ae43d29c089c286687484d18629c1be1b5befbdd0b3cfc86b1d28add89df4cc5e68dac3f56f2490a9068ca9c634ec258c030ec5023baa9133fd2af32fd1112895f9da549d410247\n\nModExp = 0\nA = 0\nE = f0460c5ca9b3a5c2d1b93c201d020dc43e1c81d1daba432e2cd310902da23eb81a5172b0b357484eb8fa2c04c270893b8198c8ad35453405dadaf05195b3aeb5ec0ccacecb4b6227ca43b27b97e240a4148a472670ed60f304302f757495fd4a91af0fe09800db0c3043a6ae213bee6703ad80523ca433d99ca0eab1e0b7c929\nM = 81dd561d5d5327fc5ed7c9236b5fb21ef713c6d5e36264ba65ccc801b8eb107b714aad65bb503bb1f4721c0a6f97e5ab89300f049f42a4616ae43d29c089c286687484d18629c1be1b5befbdd0b3cfc86b1d28add89df4cc5e68dac3f56f2490a9068ca9c634ec258c030ec5023baa9133fd2af32fd1112895f9da549d410247\n\nModExp = 60719701a2dc0bcde281a93ce0b8421d1a718adee43c1b5d9fe9e697a48ab3db4f9f33c73cff305ab6b6c300c149b05c6b289dce4580860dc56bc59de81ac074ecebdc65aa3ca040b44e5b3c80ddba1658d78b9abbc4c77e5f171f5582e70ab4438a8e1e2f062d618c4ad09c70c73b5b5fbc9f8f0bbdf1d530a933b705f85af8\nA = e1b400cd3b1f2f1c6b437adfdb970d2c8108f1b39bdbb13582179552011c6c97cba6bff2c463212b7f62776aa3e3aff9f175990e79395e819c144350b0a23d61638d500ecc97726b098e1af334aece23a851c718612442c04eb7b3805a24cc8f5b90042145eb5e5d6a408092832b6bbeb8a621419a9282fb5c075f41c7f1fdc1\nE = f0460c5ca9b3a5c2d1b93c201d020dc43e1c81d1daba432e2cd310902da23eb81a5172b0b357484eb8fa2c04c270893b8198c8ad35453405dadaf05195b3aeb5ec0ccacecb4b6227ca43b27b97e240a4148a472670ed60f304302f757495fd4a91af0fe09800db0c3043a6ae213bee6703ad80523ca433d99ca0eab1e0b7c929\nM =", + " 81dd561d5d5327fc5ed7c9236b5fb21ef713c6d5e36264ba65ccc801b8eb107b714aad65bb503bb1f4721c0a6f97e5ab89300f049f42a4616ae43d29c089c286687484d18629c1be1b5befbdd0b3cfc86b1d28add89df4cc5e68dac3f56f2490a9068ca9c634ec258c030ec5023baa9133fd2af32fd1112895f9da549d410247\n\nModExp = 1\nA = 9dd1e6f2d3ff24096b54e0ebf0f10e283e484a1cbafc0431adda1296ed97692f3ba99440fd4f67c96dd8bab850e1123361c99362df9ea205ff8e90d1b329459f54730992d5a360e46fcc5f5a909e691abb9a06613d6991bd7c2aa609f0d7b441d7ded0c07b8c394327672d38a905efb2d76aa3be5bb14d0c002aa37e287aee79\nE = 0\nM = fda6f9d8588e3614f5a68ce867a5619f6ddbb8d64450ff402e1c4f1a08b518f79dca21e5983c207c5b7324c16895a1e9f1282fc6cf60b0645f6b02b652ed5b129e67c939e854ab492dec30ea878c3edde10a4b7d1d14c57100c6cbcc5fc085a0d7308715ed132fb917251919c727487fedb66500d5610b0014a43419acfbb92f\n\nModExp = 0\nA = 0\nE = 8622c37631e428402343dccf8ed09d47b3f4201e95058910289a62707c3ce0b7113c390056cc4796cc9893e471b12cb3f63f900f3356ffd25c8b2fed6f6a7fba2c684eb241ca706c76cecbf72473d8a58c02338e40714b5610465cc319f0a529a7aa3898d9e638b247abd1380c6e8f7fa210c9f1a1a2164db6db83a6bba79436\nM = fda6f9d8588e3614f5a68ce867a5619f6ddbb8d64450ff402e1c4f1a08b518f79dca21e5983c207c5b7324c16895a1e9f1282fc6cf60b0645f6b02b652ed5b129e67c939e854ab492dec30ea878c3edde10a4b7d1d14c57100c6cbcc5fc085a0d7308715ed132fb917251919c727487fedb66500d5610b0014a43419acfbb92f\n\nModExp = 86fb0b8dc161c41de2adb0f3ddcc8ad49c1efd729a52793a3ac987d4011c9c1dadb18657dca718df75c8ddcc49d60f152c46ab85ae9076ee7bfd405679a7da3a5195a1bbfd7d2b998c7b135ea91f8c445cbafe1276fa502c2a85477716829a2e0d24ba02623405a3654bed8f355bc7ccdb67c3f9a01e249e358b60d7699498a9\nA = 816610e6018ca47074d55750dd16a281019dbf95dc752605794cbb8ea8d75775317ce685737859728320b529fb3b4414b40bf3a93d08d8994a21ae54682cc1c357eb529837a7b0129a0843eebd9341c9bee3a8ae30475bdbff517e885a0c9f2b6a680643bd981efb53bf9dd49f3dc3cb757e117895fb34b1b4336d9bf8384558\nE = 8622c37631e428402343dccf8ed09d47b3f4201e95058910289a62707c3ce0b7113c390056cc4796cc9893e471b12cb3f63f900f3356ffd25c8b2fed6f6a7fba2c684eb241ca706c76cecbf72473d8a58c02338e40714b5610465cc319f0a529a7aa3898d9e638b247abd1380c6e8f7fa210c9f1a1a2164db6db83a6bba79436\nM = fda6f9d8588e3614f5a68ce867a5619f6ddbb8d64450ff402e1c4f1a08b518f79dca21e5983c207c5b7324c16895a1e9f1282fc6cf60b0645f6b02b652ed5b129e67c939e854ab492dec30ea878c3edde10a4b7d1d14c57100c6cbcc5fc085a0d7308715ed132fb917251919c727487fedb66500d5610b0014a43419acfbb92f\n\nModExp = 1\nA = 9edfce4691f46eadaa2043c7b1092b831ed50f3429f0bca02f985c0b77c686d951be84d772ae4b55f08935bed6e3206c8441574f215736b5c1c1b7595b3b789b55cf56db83741b10144d6767ba2b97b23a5e83504c60e06ab22834b0145655aa0463108317a379cbfc8a93de8a66925a999b8b02bf88dd85fb9898cefe9c95c8\nE = 0\nM = dcb68f6aa530ae9b31d078e2e82670adcc98228e7cf1aa59f81e66426ef14b1591b833d889463564c75b5fd5551ea295a0da581dd80f62c7008ff0f26a1c9f4f756431d48198af157149be8698336b306b0a8b8635d3fc2c4c2194ecc4d2af31ca1892917cc2e621d702eaaeed0d9a0c3dca575451eb8bc5487e313988cae745\n\nModExp = 0\nA = 0\nE = a3be10ef04535fca6784e5dbf3733d677dedd50fabbc3a860496628950b4747a328c2ce0d903cbe1e700f0af30f59fb917202257815097a2b516df5d0a82642faeffdfc3b7883766c78fc4be5901ebef891a9ca27f3bcf00960729e659bb3fddd54a19ce628e95ab86e4c7a168588bc9f67b05dd21a583acd8dc36e615945648\nM = dcb68f6aa530ae9b31d078e2e82670adcc98228e7cf1aa59f81e66426ef14b1591b833d889463564c75b5fd5551ea295a0da581dd80f62c7008ff0f26a1c9f4f756431d48198af157149be8698336b306b0a8b8635d3fc2c4c2194ecc4d2af31ca1892917cc2e621d702eaaeed0d9a0c3dca575451eb8bc5487e313988cae745\n\nModExp = 442866609915aa6f1bae9dfb59e721e1b63f42c0f75fbf0a88344120fbbd7aacf15208fb7c9d8bb8477d553cbd826d7e685ad764a8423e81c2131c040ee83a03cab8d5ce50866a941b48c78e9f1330794d908562d4141cfbf26e8c80c69551339eec41e37e2b37b54330f7bd75748f8d26d56ab9eb3b0c127540484c6445a7fa\nA = 8ff65e2cbcbcd8697cc3ce9a26855d6422ac7eb4e66500648c08be697e005cc3c854a54cfab91d43489cd60be8b516a9b3c9688e5e009a1689c6b164a133859a5464ef422c86344fef42cc477c9df27768377c126a066d1b62f593b7f6d6e906feaee16addb7cfbfc043d741b7dc81a87c17f167b7b8ef1b1fb3dfd1eb14102d\nE = a3be10ef04535fca6784e5dbf3733d677dedd50fabbc3a860496628950b4747a328c2ce0d903cbe1e700f0af30f59fb917202257815097a2b516df5d0a82642faeffdfc3b7883766c78fc4be5901ebef891a9ca27f3bcf00960729e659bb3fddd54a19ce628e95ab86e4c7a168588bc9f67b05dd21a583acd8dc36e615945648\nM = dcb68f6aa530ae9b31d078e2e82670adcc98228e7cf1aa59f81e66426ef14b1591b833d889463564c75b5fd5551ea295a0da581dd80f62c7008ff0f26a1c9f4f756431d48198af157149be8698336b306b0a8b8635d3fc2c4c2194ecc4d2af31ca1892917cc2e621d702eaaeed0d9a0c3dca575451eb8bc5487e313988cae745\n\nModExp = 1\nA = fe9f77f7d0475e00ec964c0effb9b8e079c32e376ce77a9c40ce4018c3df44a77b4f294d9565502b2b79accb30cb58dda6d15e1543b6d4a53296543ed11c7f51baab60283ef03fae37dfeacb431392487ec2839551a933895c4dbf18844f7b375d3e6f558d3c39993cea1bbf7fb743a6a07bd3753c03eb7298811476d7f3ff1d\nE = 0\nM = e7a96cf6fa930f73c8bdc2726bbba246001a9d27f39cc2b978c99dc6f15af0e8aaf26b565302f1112e607e2df4066948baba931b89cd9bbdea2072e05b9a4968fdf282c43d997987c3a3a0434e925a679ac81f316b7a7b724b79be3d6888b66f4512759bf66cfaaa88b9513dd27a44aaea75437268a014c4eb50ba2e50093511\n\nModExp = 0\nA = 0\nE = a0bc148ed50a9b54036bb8fa1f214979052ebd47db8b347af3bb03b806bb457b468ba34781f8a25f289a7a90af4903dc14809a166df2f4c3527de2ea6911cb1afb9071a4afbb522a7d50634d66fd584c73f32d05217dc9f7f16394c68a692a953492ca85f89cc11da95fd8cac6231647923ced48a1b3b0ee68c010286d452836\nM = e7a96cf6fa930f73c8bdc2726bbba246001a9d27f39cc2b978c99dc6f15af0e8aaf26b565302f1112e607e2df4066948baba931b89cd9bbdea2072e05b9a4968fdf282c43d997987c3a3a0434e925a679ac81f316b7a7b724b79be3d6888b66f4512759bf66cfaaa88b9513dd27a44aaea75437268a014c4eb50ba2e50093511\n\nModExp = 91fd879d02f95a9f40fcd1037726f73892caf84e9b43b4aa4126d9062a0d22c464e7af2fbd91aa849612d99d9519b724a7fb1cb018fffdcff321d883ab2519953c9f174f09dd8f13ac87339887385966eb4a94842276637b2c36c0a5036b1d3bbea438bc6efd4b4851c7ec06879d60694df894717569bcd31c4b13d80df6cbca\nA = cdec5edc1cb3ea974342b85aabc0f9385cf877ca328747d40dd4d297623ad69ab6582653faeed5aef225208305135cfbee32e066cb43e18afacea3a32acc8aabbc49617ac33e741651924ae56dd6aa044a12a1ea50fef573b5befb2f4b21b9cf83ab2aaa6fd153580a0761666ade8fb94f202a3c3dc4f33297eabb4564374168\nE = a0bc148ed50a9b54036bb8fa1f214979052ebd47db8b347af3bb03b806bb457b468ba34781f8a25f289a7a90af4903dc14809a166df2f4c3527de2ea6911cb1afb9071a4afbb522a7d50634d66fd584c73f32d05217dc9f7f16394c68a692a953492ca85f89cc11da95fd8cac6231647923ced48a1b3b0ee68c010286d452836\nM = e7a96cf6fa930f73c8bdc2726bbba246001a9d27f39cc2b978c99dc6f15af0e8aaf26b565302f1112e607e2df4066948baba931b89cd9bbdea2072e05b9a4968fdf282c43d997987c3a3a0434e925a679ac81f316b7a7b724b79be3d6888b66f4512759bf66cfaaa88b9513dd27a44aaea75437268a014c4eb50ba2e50093511\n\n# Craft inputs whose Montgomery representation is 1, i.e., shorter than M, in\n# order to test the const time precomputation scattering/gathering.\n\nModExp = 9442d2eca2905ad796383947b14ddfcc341f5be8fec079135c36f6f0d9b8b2212f43e08bf29c46167ff0fe16b247cd365df4417d96cc31c94db1cf44b73b0ee3ebcc4920d9b0d003b68e49c1df91e61bc7758a8a1d2d6192ff4e1590b1a792f8be3a1b83db3ad9667d14398d873faf5d885ec3a2bef955026fae6dbf64daea2b\nA = 3a4b4c57e62c5e9d1a9065191f8268fed9d5f6f424d071acef66f0662b8210f4c029ed991512e40c9c912043c816d2c4c5b53fa0e5c253e16808aad4225130dafbbb89fd4f30cdfc1c2f2179b636a7ddc4be579795820b4b9377637bd8a21a0ef5a90d0e0f865321eee23d9be2a3b7320b4012d02941b892df2c40bdc85c1898\nE = a2c56ea1362511cac0301918e15a9afe7d37edd438a5c3538d258ea01f0a6df758de07111e868b3ad8fc89b629b4955d78a1b3af902be1806410ddde25ccc6a196ba5949395c1ad5d8725b18815dc1cd5ac1c7dd17773f571e3f2e628255af14476e0494be23a4a4dfd18e23142f33d7a59c236fec61660e360d9676a747c69f\nM = ede35a3a7afac817d413373a2032abbc067b1493f709ae6e1282ee5469743391d891b904938857168802b7872d3cd7ac18ab249a9e540a86f970b1d0f310a4cc29df1cc9d4063d98c554f1a32f4ca5eba3523cdfb142e0fc609907c7a92bb0187009d97ec471db3545f42dd5fd29c07b7816085d09477ba31fcf90084660116d\n\nModExp = a7f5844fa9e7202d4b70ee252c9846e63d3d091b0387768ded872cec53458e19df0d9b4960226e269b8ca5dd4c4eda423a67b6dbb48235c08c12c6c7c78db47287756d3ed9cecb9232f7d18d5d80b9676cb68ba4a290c97e220beb1a069976b5e6022a4c1e5ddbeec86b62dda24ffea1deda37695c9f61a8817218e6370c0679\nA = 7d6d0cc947ceb949cdc4e9e1044f5deca5bb05a491041e0d85bc4b92a0944a57c72845fad91e", + "59010c61ad1712bd2f612d53a846a044632262a9f2e3373b062fde2484e0c165ff947f2469f743ab6e2e5e13c640fc4029b1c9213eb8473c674e7f9e95a4a5c5636d4656c1e696962340d77b322daba47d6fc894f2a2cd9e0afc\nE = b78012afe806e2344d004c739c97324256850980ac97d88c4ed9a838517639ca112e235978d21a176c33f5a68703aba0f2a05501bbe3fc8d49a000fbf530cdb431581dfaf8683cb15a2aee5e239cbc542827100da3b47babf4a16ca7c588aff9912e674abb449e0b767a15e415f4e7f2bbd6380d7131da3df8d49b13bfd35ce3\nM = b72d5c55bd2998472f1965e75a51be6155c1ba04656da8f66bcb34db36a7b1db66a89d1d05b1bde10206acf85be7b474ab689220faf1bb52ab39d8dc00512dd4e26df1179c11b973e1274db85a88c7cc2a17113abdffe58cb930ddc5f3ccc4d68b4e65c913730509f7ce5656e8bbaba9b1be177ab9f766678f018fea05da9cdf\n\nModExp = 465ff295786a88496828fdc763e9292d557957544e9322b7996807b87fdbfa7a11614bffeec557ca831c4824c8e4ca3b1a1c7f3f4f95ec3fd6a86b73bb13d78b73af2b3c7e76954d0cc03bcb0cd606867ebb3765a8b3d0108cbe4f343a14016be9c33f6d200f0dc547e7d6b02bfab1e79dcdf9c9835a814cc6c855a12ebeb66d\nA = 89ad02bea3e9ab839a6e23f20122409daba52c68e1e893034b30d321c0305434a6af940015e3fa5ca9c35230da34beeb1ed4fbce6c1da3a8bfe3f3ae172276c1d1723b47ee61e6f8fcfdafad102d6f7ee2a79f510c7edb93096205a40a6c9e665b88b18f39a979e2e61286d939952a6f02fe8148b7515bb25f4252337cb6e60d\nE = cbd6ac628cc7afa3c61bee9c22a06a395087ec1811fe9681b55216700c435996c815e7cec8aaa90016dd2382d0306a5414630124e14f3d396a4ba02ee17851bf720f1607ff813e4bbddf01338983db12f59bd6371a738eee3eeb716f21051d6174d2d6c77602942b9edaac18d4b3a723096c0d00dd23a8a605c585022f311560\nM = fa7a3e40364c8a8d0f14f0213a3f3e035222ca0ea19d46d10ba41580e5dd2805c8a133f3856d7d5d97f922ea540e5eb0d10ad04dfdbb74f518f58da0099a6fc2b3f3def92985176e07fc78aff2faebccca10a429794e5f15ff92f75fe90f527c60ddea8093a9078c703c372ca09f7aeb27ade02f3595308c61dd9c44e62fd101\n\nModExp = cf08bf00261402102e9fe03f3074471dcf0e9b3c96d4d1503f099f24ec85e1901b023e9e048c1ad042244f5f70b38b25a99f4c0a7b57d5844bb0d0137367f45f4ce2cc7746105b77414768cb97648dc5721149aed2d4c682408cc0d50d26dd0bd77e848911f8625c727cac5f32e63bcb548f41a57d718d772f23983a42f603bd\nA = a419646a6631c2c69b18f7aa65011825eb31692eecaee9d74f92d92203811b68e9764bda31a1585bdf69b6273fc6f9f508c395ac081336506525dad88473512f08a205621ac8b16e9864c7a7c5a4f17435de00d0b32badec6ce4897e3e1076c562b6d9523f63d0b2079eaa416cb090471657763f24931d955d1fa2720c80a9c9\nE = d5a6f4a1842aaee39805356dc8d0d678ee03b2c81277345beccb2742f899132feb43271f95968a01ae68aa8277201851992dc0aa7a71c90aae71b124d873ee264ea400fb131be0fc6c4ce8c04c45f6bdaca89ac743635caf6158983d257e21cef6800d7f990e912ba21bbfb8fb779afa4abd19e07e7e07eee9908493d1ca502c\nM = e739689b6cc6def1d45fb1a2ab551643beeb303f4aaa4da47ee5e4948510f8445b4c40e99ae8354dede60b2ba6694e93bc4d573b7e8adf871b7a9a9636eb7d70f2e49328e2d7978143b177cee8374ef01bd1ee2d95862765883f5e7971668b53ef0ff41b6539faf63c397522b0bdce916388e72e26c8d3d2e58dadeb9eb5d479\n\nModExp = 827e6312ec3b14600203bb83f5b277ded197b2967363630ef673240df05edd3ba8ab2b11c86251a612206569c6c33952b31e264f129909bfe723bd0ee1624b36cfcfaa893a6ec8b5a1f7de79f83e79b459a3350f89f412ad1cfd6bc4c2a7a29272c783d6ecceeb1398fa17041835643f4debef9b5e87b098d104bb8912dddf7c\nA = b8e49c637829021d32db3a39a0c1e58cdd4c6e4eda7e8e9293be379e9c2e2d184f929d278598a81ae231cfedcf69cce4a6e31cda3c8ac14d753a7311f2436e29795f0dfb60259a0f61a997918ff984aa2284b43a9d64c974059e9682adfffd018305835f74eda8c75fe4877d811c1620f654ec9f7f32d1af5ce59115e2f41785\nE = 80e0febf369d234bf1aaad4f82df2e2ff02882c3184781f6ccdf4f7cd93b6887af86830077c84dfb02109ada05b40970b1c65228b0c19030bd6361c3537fee22a8155c03b4e7007ca006c6daa3659518d05bb81ea0079456d0ef6116df248dffdb0c935f321f5a1034deefd5a9414a0652aa6548de33325b474b9e5a8507a082\nM = d5eb1d14af842a9973274f7463d90cf0ccff19c47d710edbae184478d4f29b02693ed7958bd487054327b9e6d8879e24c9af7730b92f323eeac05558da6c1b952e5dbf13de236050a77628bb5325fe0d14cc5773bf73338759d5ab43c212b414581280f1cee250007e53791b800b61c90de0328acd7bc43fbdda48158939392d\n\nModExp = 4a1efd29c7e78549f5cd4deed1454b37462c7810ee6a8a2493b764dfa479be13b314cf9ff98259517d61865567ef499a511630c0038c97914625df181c6fe07892f329f98b344a78d751e9471483eebaa7977371bf97bb25187ae7e93a9227d6c124ccb4644423c961a11ae59c4354f89d5a95164c23d9aa256e289e9cc0858e\nA = bd86c9211fa6a47a06e5016c46cb8a99e34a043a29e22f8c3196fa7197c26b38927b8d9bc0ddc11a5fa4bcc44deb69dbf37cbe7ebc9a2fad6c74e09ab5a9dd929fa04ab4319b6caad1035739be78ba631fb0748d9e53944836d37ccda6e6a62823c696d8f31139ccd7f2f86b22fa026ecf433cfb1271a3539ac4f1c83aaac059\nE = c40b9972006d28a84c2769a86e526a2b274f73afc7c5c6a2742166757f61b5f5fdbb228afa157af62af989ffe966f232bba9e6beef5403d1690ade31a6410f7f349a35bc4267a129afd647993df7d45cc0e1a1ba4678d7f1b6e8a344d8ff7037679e1f4db25a454e4246f6b55c416567fcfa188e8a3865115851d9edf0aa8902\nM = cf424d7af75ce7eef90cad75ae55ca8810cc7b4703fdb5bce701e7bac07e0c371cae06df2aa8facb55a0faa6793e4d2bd9d7969703743b9be170be82792aeea55e2bc0f7ab7617b276486bf474dee2f4556aab595ff3ef115139cfe5e21ccd4ee05c0e1cf901bd85df86cc17195a783b0be836d00bee82ce064077f9191188f9\n\nModExp = 3137a3049fd4ad2e26d870f5c998cf11bfe82101884a82e85e43facd0928cd7434a2e346ca124619769fa141bbe92ad6f36b99231032ddaec3b349a410f82b5ca36f45e56e5fb85dc63d32053dc90805d3f1854ab385281a71a57726bf97158494e7476057214ca7379ab8b70f5bdc15f70bdad3adf33c3a1f9cd1b6bbbad556\nA = 39a1dc6a4c3f14d9c350ee968d5ce139ef725952c967a2d1bedf48ace22091283525be03807e2e263d2640be77f0525247bcd07149bba50568cec5a082c87d72962cf9e43bcb5cdb1e7e9a650fb53e0ec2fad37f09a9f036c0d7dfa528fef846769f80a9a60854910ca1b4ee05dba82ed2ee018348d6b3e52a764b8ffae61e0\nE = deaee3a3f80c9f684ed7110c0653847ccc7be5ff6d982fd4b49f59b5dd35f7210b1077babbcedbc127df35cd469dc6e569a0f84e58149b5605c94b09fd7f0b098d02b4a04631328b3fae39e6c2fce25334225cab71829abdb9507cb903701559660f2c08c3b743336119d1260a0db27054cad3f28bc1b04b2289baa58fb33965\nM = 938388927d06ed3bb1286c0f06d3054cb0ee16dc7a0bbbf13a45293c09a5f40f1d611b2e1a1b0ec2ef109b508e27af4274954905cae52034f8740a744153b4d22059f0dd262ea51785522098ecacced6da07709ee6b5acc8c4e99331379a7c3de7f4e2d1431e43b19570140955b7bcba118dfbaa552cbfa2be531e8f781166ed\n\nModExp = c15ae334455d9f4d1030cd33e734726a27c63624c2afc576238cce5e0498298a4a0c93090a0d19568b41290303c4b558f3d9dd74f9cde8798710f68569ea0d6fd971ce67ec5b54495031de3d8842b8b49288725bee5c9f72b99054d64986ccd4e18d70d5f33943f08cd694eff538f84438ea993ebaba0910c95b3a694f213510\nA = def633b955a917569df3ba8517455eef0655e7a35985edda27097a063e0d82c7c3a76dc36c5d8a71ba9d540790ddd0ea514aaed98925f9a1808eb288d387aaf9605a9ef8a333ebee7ad7057bca012efd619d5867f02266f65976ef4b16da17468426ac4f99b3e8921707e01b4de20f6f9a068e6a19d872079a27f3a44449db83\nE = a465c47b0d15d48e01bb8b1d8e3b3253e11515f6874dbed6c25818adf1a8fd927124d5593beb367f685c11e46f18415be73ccdf16fa2e93a600b728163d21d232849e5278c3749d903edad3f1c4535a2f55a2ab65e7ebc64888bd2a0527e876ecf38cec3ab1980d08138709fad8eb88ae65d960adc3f0f8e92f784fe96fcb693\nM = e43cb9ac1446154356cdc31ec771c79b0e461e22d95185bbe1a279c0945e3af07903a0cb54d553380716fcdcafb4b7cf5dc6da481dc74a8c583d75ff6c1f8e429182d200246ebc473bb56e173787987c1b7fb2dd23f5b2e438a97bc4a1df628bc044fdd1e80c0cf37030adb7b04784dab827d0dcd64f0dbf37c980612570ce11\n\nModExp = 75c3f79ab7c991b98e65505342a8a563cfb08b5d3ccf8664c7db1de50256b1d17ebf7096dc98c7bb5d7f027a894ae5cbb14dee04d5d445e775ad7e239acc82673b0ac2d819a69c83864f34e73d9a636f05de8279619a067b4c90ad038db5910447e03841d2034635018f08cbcd21efa00994247763a249082594128112f95232\nA = 34def7d76f6f158a359fd12759fb889cdf6af0a24830dc3e84283a1ab4e9b2647a6a36b86482f829b2cdf3e3d6028f9a884b1f64f7262315446bea8b0231828e2f3d990fb103c17f820b39e4b8427c85643ceeca8f5dc8f191d1255768300e859bd7d88c770319ef38269660d221cb3bc061389b6fc0783485ef042b1c7d6fef\nE = c6c46453dd5aac6b37277a446b1d0c69cbe476eeff55b3ac35edb89ba97116b0e7783660f2c7b31b2a2d6c4709d0ab45d01a838100694b0777c9c9c14c959b07c437c73a5eabb7402f1001e802d797a2e7707285834fb6440a1c2f727f7bb84ddb2a49312d32fa0ce620c43872655cb5c394749c9e75d7fa25be00efe50d47d6\nM = fbbab6698a9142095c46b38a732592e4366c1838b84bf40f8c8fc7b630f73380a0d09765562365798f8c8030ed1b6728329d8bb06e882c35a1d59bfe84146a9db2afe42a414014e247390281c782fce806d62adb54778d2bcb49555459429d6ed446af5359657667f6aa19e8e3e0e24ab2bc312b2d90b5cb1ce6f2f15af15d9d\n\nModExp = ba16d7f3f6e162ce248490d164a13c00e7720d8a667e2d3ebeb13f1663e15ef5408d5b56cbc7bc793a8ca787cc50f8e15e0e9d4ee764531d04a9114eea556bb3e2", + "06ed7d85267151a056b6e68fbf35e03f2cf829708ffe1de13e95ecfe365aff1eea36340ffcd3892dee659fb1ecbe50f5080e54737c10f9c1ba638b14ef537e\nA = 9025e6183706105e948b1b0edf922f9011b9e11887d70adb00b26f272b9e76a38f3099084d9cccf12d04b1a99c0f654f8b9ed90c6dff9478c60bf05d58d734ab60eaefa14a22230ec60c90dc1f0704b61eef0bef345785ae0e6a9af7db069cf6bd2b4e0fe58a0ade83c7e46a04b9fe1d24cb9b65c6f80de713e61d70eae5b286\nE = d7e6df5d755284929b986cd9b61c9c2c8843f24c711fbdbae1a468edcae159400943725570726cdc92b3ea94f9f206729516fdda83e31d815b0c7720e7598a91d992273e3bd8ac413b441d8f1dfe5aa7c3bf3ef573adc38292676217467731e6cf440a59611b8110af88d3e62f60209b513b01fbb69a097458ad02096b5e38f0\nM = e4e784aa1fa88625a43ba0185a153a929663920be7fe674a4d33c943d3b898cff051482e7050a070cede53be5e89f31515772c7aea637576f99f82708f89d9e244f6ad3a24a02cbe5c0ff7bcf2dad5491f53db7c3f2698a7c41b44f086652f17bb05fe4c5c0a92433c34086b49d7e1825b28bab6c5a9bd0bc95b53d659afa0d7\n\n\n# RSAZ 512-bit.\n#\n# These are regression tests for code which historically reached the RSAZ-512\n# code. That has since been removed, but the test vectors remain. Note that the\n# lengths of the inputs, especially the *bit* length of |M|, matter a lot.\n\n# Control: No relationship between A and M except that A < M and they're the same number of limbs.\nModExp = 7f34c1cd63377bc3abf2bb5b2d1bf5f06454e1e8040fe19a72245ce9731cbee1bf9e84532300776c8021ed4f3a8de508d85b4cf320bd82065a013754857b50c4\nA = 8e4e67da6ff890643d0599387955996ef6f0c2045eb9944576ddb965ca64cdb6247727ce128ef178d4a84e5a56d2e67eb0fe389ecbf691f9244ae80f4c11b364\nE = be99d8f0650e540b9b191e9cf96f74881b902e32ed169ffd8a1776c3f3e80f0ac765aa14615713e1549f250a20fe4ee48c4e0c6176162fc7842a0dd64d640d1\nM = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\n\n# Same as above except A is negative.\nModExp = 71fa6a4c8ae75368eda8cc6282c26afa69e2af12a97fb9444f16b7dd6c99e0a5d6034cab4248cae4357346b211039f4a2bc4c5a20a297372094162417af703cd\nA = -8e4e67da6ff890643d0599387955996ef6f0c2045eb9944576ddb965ca64cdb6247727ce128ef178d4a84e5a56d2e67eb0fe389ecbf691f9244ae80f4c11b364\nE = be99d8f0650e540b9b191e9cf96f74881b902e32ed169ffd8a1776c3f3e80f0ac765aa14615713e1549f250a20fe4ee48c4e0c6176162fc7842a0dd64d640d1\nM = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\n\n# A == M - 1 == -1 (mod M) and the exponent is odd so A ^ E (mod M) == A.\nModExp = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725490\nA = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725490\nE = be99d8f0650e540b9b191e9cf96f74881b902e32ed169ffd8a1776c3f3e80f0ac765aa14615713e1549f250a20fe4ee48c4e0c6176162fc7842a0dd64d640d1\nM = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\n\n# Same inputs as above except A is negative. Note that A mod M with a \"correct top\" isn't the right length for RSAZ.\nModExp = 1\nA = -f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725490\nE = be99d8f0650e540b9b191e9cf96f74881b902e32ed169ffd8a1776c3f3e80f0ac765aa14615713e1549f250a20fe4ee48c4e0c6176162fc7842a0dd64d640d1\nM = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\n\n# A == M, so A == 0 (mod M) so A ^ E (mod M) == 0. Note that A mod M with a \"correct top\" isn't the right length for RSAZ.\nModExp = 0\nA = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\nE = be99d8f0650e540b9b191e9cf96f74881b902e32ed169ffd8a1776c3f3e80f0ac765aa14615713e1549f250a20fe4ee48c4e0c6176162fc7842a0dd64d640d1\nM = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\n\n# A is negative, and A (mod M) is the right length for RSAZ.\nModExp = 8d76eb0f8c7bc3160cc8bb0e0c3590fbed26c5932f5f525b48045c0bd46dda287ba5483f97c851fb7c12c2e858ee7a4a4d1af745cbfb3eb311fa54bea12cde25\nA = -80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\nE = be99d8f0650e540b9b191e9cf96f74881b902e32ed169ffd8a1776c3f3e80f0ac765aa14615713e1549f250a20fe4ee48c4e0c6176162fc7842a0dd64d640d1\nM = f12f2c19ee1ecf2c999b87bdafde60eace3790faad8f9adec13b14c6dfb69f8795a1d0fe65494250b59534014b918453042012952ae6f5786342999600725491\n\n\n# RSAZ 1024-bit.\n# Note that the lengths of the inputs, especially the *bit* length of |M|, matter a lot.\n\n# Control: No relationship between A and M except that A < M and they're the same number of limbs.\nModExp = 8984f8c16044f9c0ad7bd72347af90f58e6e003acda92b76e3c7c4a56ea8e918409d8e9b34884d4c89d0b17cb40fe898f2627c084a0f1698e46beccbf6f48eecc281e11ea9e5135adba460ddae157f2c655b5f589ce29b254d43a960a71cede8a08dbb86be4dac22458da232fb1ec2470856827302ed772c9ddafa408c931aa7\nA = 21158da5fe20356825e72b3f5384ec57720d22f727b27ce2f945c8ee311db781add73bf8fae96b775c909bd22fca75c44c2b0584284a5bb1c07f8eefcd6b0a44047a02b185df34f897f11d4fb9a86c9eb841b4cb8d0383441fdc5af3ef385b5e8380f605d73ed41bb42eb2c2a5704d6034b3ad058dafffce83dbbfb6295daaf8\nE = ecdebd112b3b5788669449dcddbd479a203ee9ab72a9bb9c406b97623513bf0ab9a22f1f23634d269e16bfd6d3b64202b71fc355057411967b6ac70f8d9cef0a4e06819a9a18cc06bbe438243fa9759303d98be8a65dc1cb13595ee9b99f138554425d50f6fbc025d8ffa3eaea828d6f3b82a3584146bafde34da257995f0575\nM = ff3a3e023db3bba929ca4ededbace13d0d1264387b5ef62734e177eaf47a78af56b58aacc8ac5d46f5b066bafb95d93d4442bb948653613eec76837b4ffb7991cb080b6c8b403fb09bc817d026e283ee47ab2fc9af274b12f626eda2fe02004a8e27b9ed7d3b614e8955c7e7c2c0700edd079455237c4475fbd41857e206e4b7\n\n# Same as above except A is negative.\nModExp = 75b54540dd6ec1e87c4e77bb93fd50477ea463fdadb5cab05119b34585d18f971617fc1194240ffa6bdfb53e4785f0a451e03f8c3c444aa6080a96af5906eaa508862a4de15b2c55c023b6f278cd04c1e24fd0711244afeda8e3444256e51261ed99fe66beedb52c43c825b4c7a1adc7d4b111e2208ecd495df91e175573ca10\nA = -21158da5fe20356825e72b3f5384ec57720d22f727b27ce2f945c8ee311db781add73bf8fae96b775c909bd22fca75c44c2b0584284a5bb1c07f8eefcd6b0a44047a02b185df34f897f11d4fb9a86c9eb841b4cb8d0383441fdc5af3ef385b5e8380f605d73ed41bb42eb2c2a5704d6034b3ad058dafffce83dbbfb6295daaf8\nE = ecdebd112b3b5788669449dcddbd479a203ee9ab72a9bb9c406b97623513bf0ab9a22f1f23634d269e16bfd6d3b64202b71fc355057411967b6ac70f8d9cef0a4e06819a9a18cc06bbe438243fa9759303d98be8a65dc1cb13595ee9b99f138554425d50f6fbc025d8ffa3eaea828d6f3b82a3584146bafde34da257995f0575\nM = ff3a3e023db3bba929ca4ededbace13d0d1264387b5ef62734e177eaf47a78af56b58aacc8ac5d46f5b066bafb95d93d4442bb948653613eec76837b4ffb7991cb080b6c8b403fb09bc817d026e283ee47ab2fc9af274b12f626eda2fe02004a8e27b9ed7d3b614e8955c7e7c2c0700edd079455237c4475fbd41857e206e4b7\n\n# A == M - 1 == -1 (mod M) and the exponent is odd so A ^ E (mod M) == A.\nModExp = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d964\nA = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d964\nE = 61803d4973ae68cfb2ba6770dbed70d36760fa42c01a16d1482eacf0d01adf7a917bc86ece58a73b920295c1291b90f49167ef856ecad149330e1fd49ec71392fb62d47270b53e6d4f3c8f044b80a5736753364896932abc6d872c4c5e135d1edb200597a93ceb262ff6c99079177cd10808b9ed20c8cd7352d80ac7f6963103\nM = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d965\n\n# Same inputs as above except A is negative. Note that A mod ", + "M with a \"correct top\" isn't the right length for RSAZ.\nModExp = 1\nA = -b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d964\nE = 61803d4973ae68cfb2ba6770dbed70d36760fa42c01a16d1482eacf0d01adf7a917bc86ece58a73b920295c1291b90f49167ef856ecad149330e1fd49ec71392fb62d47270b53e6d4f3c8f044b80a5736753364896932abc6d872c4c5e135d1edb200597a93ceb262ff6c99079177cd10808b9ed20c8cd7352d80ac7f6963103\nM = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d965\n\n# A == M, so A == 0 (mod M) so A ^ E (mod M) == 0. Note that A mod M with a \"correct top\" isn't the right length for RSAZ.\nModExp = 0\nA = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d965\nE = 61803d4973ae68cfb2ba6770dbed70d36760fa42c01a16d1482eacf0d01adf7a917bc86ece58a73b920295c1291b90f49167ef856ecad149330e1fd49ec71392fb62d47270b53e6d4f3c8f044b80a5736753364896932abc6d872c4c5e135d1edb200597a93ceb262ff6c99079177cd10808b9ed20c8cd7352d80ac7f6963103\nM = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d965\n\n# A is negative, and A (mod M) is the right length for RSAZ.\nModExp = 9cf810b9e89d5cbc4b79ae64e123ea06d92965e2bab077df97a1b906dc2e1ddcf96a9c4ed14e2cd96309b829ea9cc2a74a7d4b43c5f34d792a7c583201427754b8f78b783608070a84b61f18913e3ced7f7f530972de7764667c54e29d756eea38a93cd1703c676a4587231b0ebfeadddf908e2877a7a84b5bfc370ecf0d158d\nA = -8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\nE = 61803d4973ae68cfb2ba6770dbed70d36760fa42c01a16d1482eacf0d01adf7a917bc86ece58a73b920295c1291b90f49167ef856ecad149330e1fd49ec71392fb62d47270b53e6d4f3c8f044b80a5736753364896932abc6d872c4c5e135d1edb200597a93ceb262ff6c99079177cd10808b9ed20c8cd7352d80ac7f6963103\nM = b5d257b2c50b050d42f0852eff5cfa2571157c500cd0bd9aa0b2ccdd89c531c9609d520eb81d928fb52b06da25dc713561aa0bd365ee56db9e62ac6787a85936990f44438363560f7af9e0c16f378e5b83f658252390d849401817624da97ec613a1b855fd901847352f434a777e4e32af0cb4033c7547fb6437d067fcd3d965\n\n# Regression test for CVE-2017-3738.\nModExp = d360792bd8210786607817c3dda64cc38c8d0f25569597cb1f363c7919a0c3587baff01a2283edaeb04fc288ac0ab3f279b2a89ffcb452d8bdf72422a9f9780f4aa702dc964cf033149d3a339883062cab8564aebdbfac0bf68985e522c6fe545b346044690c525ca85d3f4eb3e3c25cdf541545afc84a309e9b1d7807003461\nA = ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2020202020df\nE = 2020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020FF2020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020\nM = ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2020202020ff\n\n\n# Exp tests.\n#\n# These test vectors satisfy A ^ E = Exp.\n\nExp = aa6d7ac431\nA = d0e07\nE = 2\n\nExp = 12d416b110dbb4e467ff0c89a22122f4da8240\nA = 1a18cf6\nE = 6\n\nExp = 49a3b33e23d84f1ce0d5d83f5dcb651d50cf3920f0143da2310d0512a90a06cd8f38977df8a756c30883de38df092000\nA = 2a3acbd2\nE = d\n\nExp = 5b4a0d5a956f885f275712b194459980f24708bfb6393d71bd37dce852ce455724f5ee5030775fb86b4295edc98afaafc097e4d82a97c0078ec0eac763db16549c5145c4cf2d3124f88cf9a5c71da0625afb99b26801786fe49a778415dc025954021753d08691947a208b613f0be5c1\nA = 54b3ae461\nE = 1a\n\nExp = a0ea5f6a4de49beb8fb7f0dab280d6a32c5a3814c9a5153a7944cec0a9028497846a8a89044348721a0bb5f0c3ded3e980574ea321b0cdb0ead4f4e93841ea7478a7f15d9729b646a8165813a0750e8124f5465dda9b105e1bbeff18fd09c09a2e26610d9176d253b877c3a8908a6be521cbe1e472a7a1b7820e4e890f8f28aacd34609c686e76e15b01bd9324a71290812724ea564d11c874a6765b262c3e57d479da0287a76026a1e8fe53da0b02405da1d379eaa30fc65f\nA = fccec0f6df\nE = 25\n\n\n# ModSqrt tests.\n#\n# These test vectors satisfy ModSqrt * ModSqrt = A (mod P) with P a prime.\n# ModSqrt is in [0, (P-1)/2].\n\nModSqrt = 1\nA = 1\nP = 2\n\nModSqrt = 1\nA = 1\nP = 2\n\nModSqrt = 1\nA = 1\nP = 2\n\nModSqrt = 1\nA = -1\nP = 2\n\nModSqrt = 1\nA = -1\nP = 2\n\nModSqrt = 0\nA = 0\nP = 3\n\nModSqrt = 0\nA = -3\nP = 3\n\nModSqrt = 0\nA = -3\nP = 3\n\nModSqrt = 0\nA = 0\nP = 3\n\nModSqrt = 0\nA = 0\nP = 3\n\nModSqrt = 0\nA = 0\nP = 5\n\nModSqrt = 1\nA = -4\nP = 5\n\nModSqrt = 0\nA = -5\nP = 5\n\nModSqrt = 2\nA = 4\nP = 5\n\nModSqrt = 0\nA = -5\nP = 5\n\nModSqrt = 3\nA = -5\nP = 7\n\nModSqrt = 0\nA = 0\nP = 7\n\nModSqrt = 0\nA = 0\nP = 7\n\nModSqrt = 2\nA = 4\nP = 7\n\nModSqrt = 3\nA = -5\nP = 7\n\nModSqrt = 4\nA = 10\nP = b\n\nModSqrt = 0\nA = 0\nP = b\n\nModSqrt = 3\nA = -2\nP = b\n\nModSqrt = 3\nA = -2\nP = b\n\nModSqrt = 2\nA = 4\nP = b\n\nModSqrt = 2\nA = 1e\nP = d\n\nModSqrt = 2\nA = 1e\nP = d\n\nModSqrt = 0\nA = -d\nP = d\n\nModSqrt = 0\nA = -d\nP = d\n\nModSqrt = 3\nA = 9\nP = d\n\nModSqrt = 8\nA = d\nP = 11\n\nModSqrt = 6\nA = df\nP = 11\n\nModSqrt = 4\nA = 10\nP = 11\n\nModSqrt = 5\nA = 90\nP = 11\n\nModSqrt = 3\nA = 80\nP = 11\n\nModSqrt = 9\nA = -e\nP = 13\n\nModSqrt = 7\nA = 7d\nP = 13\n\nModSqrt = 6\nA = 37\nP = 13\n\nModSqrt = 1\nA = 1\nP = 13\n\nModSqrt = 8\nA = 1a\nP = 13\n\nModSqrt = 54d4cf0fafe265056a29016778cea6b712bc66a132fb5e6b6865e9b49e4c97ec\nA = 599c10484b22d0b5a115268c7538ca99b3253a311a4ab1ca11c3665b0bec393a1167d1ad94fb84cb2c7ad7e2c933e8f613bdd08fe1f1aa4a9b0b9de0c8a7c9d4\nP = cfc4ccae35458ab5be1a1bc0664188253301f8702af4f8fb19fed12de0c653b1\n\nModSqrt = 38a7365a15365e911286c1be2a7afe76ef390234d76269e04dee17313f6ea54d\nA = 1c4aabb4d8369710131c664ecf2849e963c1bc31d66e0b939bacf99a870c71f24ed71bdddcf566f3908271fee43fc1ebb51eac7e3153efae641b49d2e796a12a\nP = cfc4ccae35458ab5be1a1bc0664188253301f8702af4f8fb19fed12de0c653b1\n\nModSqrt = 35ab18a560dece04725667f640ca61d1d59f14d191f94c79f58531acd097d444\nA = 685168ae855d60eba220d803f5296459b30a289580668db9ed51bca51cc2d453a937e13819ae34f7a9a143ac96d17420c53919167e46279b562b550be1cd9abc\nP = cfc4ccae35458ab5be1a1bc0664188253301f8702af4f8fb19fed12de0c653b1\n\nModSqrt = 288370029e87024175e5bec0eab0929179f42e16995e7f6194eefc61061e54f4\nA = 2a14ab77c045bdc48220ba9c463e1a4b4049cb01edb53be0937767eb2ec19b7d719855052281250a36a0b76d9a5d967d0756e1ded7a052f7056191ad66bcfc9\nP = cfc4ccae35458ab5be1a1bc0664188253301f8702af4f8fb19fed12de0c653b1\n\nModSqrt = 32255cf01dc943577ec2bcb221b98491d7a1130d046d6c68e95fedff643ce3a4\nA = e26f6dd46a513a1dd3fb14b71be1d4c9e9d79eda1cde10ea4d1eb8abfd4d5857572205e247184dd0cbefa37b5c0bf680ba2bd28c5741f725cfe2aae37419baf\nP = cfc4ccae35458ab5be1a1bc0664188253301f8702af4f8fb19fed12de0c653b1\n\nModSqrt = 5172345e801ada63fbc4782e32583cc3b4fea88b9e6dfd542f3542f8538ade66\nA = 40dafa8342b302bb04b1f3ddb3b9015a8fc1b597857c115b40631c7be9e22de89358fca23b331596ee5ff304dad7811e6d8e8822f7aa533c9e7c882634ea550\nP = a6813d316f9aca30f98b4f864b8b4b8f51493af930bd4d3a1b205a710e99add3\n\nModSqrt = 4dcf63c423bf0e39aca2293d57f6792d023db649d6719fe936446904b9f7e60d\nA = 5bcdb514bbe84261e169203e8017909b60c9bb330400c766ee01b0189378e70e61867a164a12643ddc9e94b61e09e5b158cbe85be228a3cc48f95a552958b8f2\nP = a6813d316f9aca30f98b4f864b8b4b8f51493af930bd4d3a1b205a710e99add3\n\nModSqrt = cf77c5c2d12a500b75cbfb1f3e66ee75d886b9365cf4f8b4d1bd18a6be0f387\nA = 4652ddc2ea7b460d8ec3c9059b8f9b5dae6cac55b51f2ad86fcb336b25235737965cc515e2ff0b54835015b7ebeeda6fadd9864", + "71d8cb424d309fc353d1e269\nP = a6813d316f9aca30f98b4f864b8b4b8f51493af930bd4d3a1b205a710e99add3\n\nModSqrt = 1e0549e4c5a26023e9d24fd8c67419960746f82b1ecd113bdac66f570a475d87\nA = 5f4a6d450ab1390d96ab1deaa0ba18f897cb63daf0c9e1ef6c08e804c26b5e842f6c08f13db5d4a6e88f07af2a3cb04fa06fc3e59c410b9356f025ed81acc74\nP = a6813d316f9aca30f98b4f864b8b4b8f51493af930bd4d3a1b205a710e99add3\n\nModSqrt = 144481a781d831c1ca046ca9e322d79ad4d2c6dd9f780bea9d1ced9cd20b7b23\nA = 4c254fabca441017132b9eacd4ca40a336db3e5c09715773fa07af095989a91cc968ff07a9ff56ed06b0ce0c5269f7b2ab68564ecab9f4467a7e96b6cc6b21b7\nP = a6813d316f9aca30f98b4f864b8b4b8f51493af930bd4d3a1b205a710e99add3\n\nModSqrt = 216fecc7667f488a3d2d102a38b46b4860ab858300b8638af4f34e1103fd73ba\nA = 17878f8048227573a9d70f53c0e76ff13fe9f56e9c984c92514d3d13dec23c816661f0618d21371b80dfd885cb59551bdf80046f65f22ea9b89c78645a6e455a\nP = bd37c850cf7d702bac879f3c21a51a5a4df2b8eb0935861e0753a6eb62261a95\n\nModSqrt = 458e5e789ccd2417174f7e30bb31914b9656bd8cf2b9f5a9752a8737a67707bc\nA = 5c7d39a4bb04e69201aa519f80ee7e62ea14ca55e13656d1da3f45367e2fb2d061aa2940708d02ac67d35cd2ccf54a1bf95bcbc759779e692cfdcbb3aa1a05b\nP = bd37c850cf7d702bac879f3c21a51a5a4df2b8eb0935861e0753a6eb62261a95\n\nModSqrt = 543125a16c2bb8b8f8a2c39c497e5224ec77533602d7dbe24002e32dcbd2ef1a\nA = 3413afae333b2ad9ff45c7f3c7e5934b3127e8b1a55225958ee6ccf42423e81559bf070ad3f3353b78c0ffd41475af49f59d268ef78bdae879f5155e8d1cc07\nP = bd37c850cf7d702bac879f3c21a51a5a4df2b8eb0935861e0753a6eb62261a95\n\nModSqrt = 10e16859c67bdb2eaab52a7c847dbf37162eda258a9f6262ebacfe4cbbbc1080\nA = 21ce7905894faf220bdf4a82a2d855994ca2dc9feaecaa53c7f146e1f49934215695e9bb46ba370b7005a90c399674caa8969eb442e7914d90f749774d7fd194\nP = bd37c850cf7d702bac879f3c21a51a5a4df2b8eb0935861e0753a6eb62261a95\n\nModSqrt = 32a00586adc6f6cc2b1a04e1be0ab569fde235e1436c38b6af92bc5ebd60bc1c\nA = 350da4fd8cf03c12f7dd6ac6d3ab801a3413964083e374662aaf878d6838b97d4feb9e52cd307a25b113e101661a865463ee2480c626aa4e2ec437d72e7bae4c\nP = bd37c850cf7d702bac879f3c21a51a5a4df2b8eb0935861e0753a6eb62261a95\n\nModSqrt = 971f75bc7afa8b4b50f1d4b05e52deac7d4836a08d30546f29649bf1ca6a247\nA = 655ed4c5d8d0afb4f9360372ee1ef1303898d2423e585108a3303faedb55064d2ef25666ed4c4d71fe6063fea1f3142b435714b0e30b339dd791d347c884654\nP = 9810151ad4bc9c5d68fc326395b509f2625bfebca1c3801ad4da7539fdbaa6f7\n\nModSqrt = 48fa882b7cb6a29de9e3769f72eb67f1efd4d2af56f0c7e410c610efcbce2065\nA = 14f3503f33b243800eac1defaab33e04c01e80163fb3efd03860970cc016832431ca4fc6d1b760f4f40166b0b8b3c40dbebc81460cc10890172243770338f090\nP = 9810151ad4bc9c5d68fc326395b509f2625bfebca1c3801ad4da7539fdbaa6f7\n\nModSqrt = 236fd7e397ea7f8bc2a288eb7236ca41936fa702b7dccca56c8852e147511f7d\nA = 1bbd0980feac854782813bcde4da85e8a054549a1b515e065da4236528035e756882e29e762cf60453e375cca9dc6ff637f9558bf86646e3b928f68f82af7efe\nP = 9810151ad4bc9c5d68fc326395b509f2625bfebca1c3801ad4da7539fdbaa6f7\n\nModSqrt = 693f0cbe8c81b0afde0cd2f83e53795dcae6b0cc4ba930ab5c752400d787f14\nA = 7b20f9664b23907e152ab8c9a907f72e8670c1c38ab4cd1411ea7c2159c09aa131afe068929b8e6ad1409b74c04975180d1cd0a9fa74e923c3fd451e8da2c34\nP = 9810151ad4bc9c5d68fc326395b509f2625bfebca1c3801ad4da7539fdbaa6f7\n\nModSqrt = 4a086c50b0bad576501ddb6280743b2c9d247841eb7f14d90561432ff7dca6f0\nA = 4367431ec0cd0d7626538b93a090c30fe0c97c18ca03b97ddae304b619112b5b4d02bf0f041fa3fd673f9ef2ceb07eb2079d11c56dd903b1a87e8252a97b8079\nP = 9810151ad4bc9c5d68fc326395b509f2625bfebca1c3801ad4da7539fdbaa6f7\n\nModSqrt = 18f8433fa468d8065157708f1f1e53b8e31d39c6011fbc2bad93de1b5548e19c\nA = 739c032bb4139c199c40f548d37234298772e4ccb9d3ba28412b60ad23b4c465b0787e2382f1c5a4a87af2d20eb978b7dcbe73f2112249477d15c8a85e54a79\nP = adcd56924f73836ebe4dccfe006ad3b1e5076562cd11b161642cab7af2284659\n\nModSqrt = 49e3c8eef5e067cabd51a7c01384ce05ab8f4342f655559d8a689eb7b20e0106\nA = 18400c2cc3e06b99b4e39c77b9af5ff0e9c683f1708321afa4cd5b6988d13b36b1d9eb4379b7902d9ceb40c03f814b2b6a01b90509bbb4532f13ab1571c4d04a\nP = adcd56924f73836ebe4dccfe006ad3b1e5076562cd11b161642cab7af2284659\n\nModSqrt = 35548c530745f440329325cc8a5fbd90c16a7f0788879a4869bc4d4f73acda0e\nA = 181a3c5ab02566e7166c4d6d2f2bd4a8ecc25991a98d270bde80cf4332766a7068b14240bf5f5dcd45e90ef252596da3eb05b11d68b2063f7b3a825742593ca9\nP = adcd56924f73836ebe4dccfe006ad3b1e5076562cd11b161642cab7af2284659\n\nModSqrt = 1ab7046e6af061ade5f9719008fa4d989007e2a579a134a5b9f19ec410984096\nA = 1008a03e211fab0d45856377079bc96b0776c2d4c0175661f3493246cea2ab0a02a706c85314fb707ad9906bedb2cfd577d62092ae08ff21d7b949373ea954c7\nP = adcd56924f73836ebe4dccfe006ad3b1e5076562cd11b161642cab7af2284659\n\nModSqrt = 2be9e3e7515960d90f115b89f60dedc173a73ce163b4036e85b7b6a76fd90852\nA = 392053a9f0100540a8e1a0c353e922068a84dad3a4a8e8962fbc0bee2b6a06e20d08ade16eb1409a16acfcac3db5c43c421505e07035ca308b15c4a6db0864c0\nP = adcd56924f73836ebe4dccfe006ad3b1e5076562cd11b161642cab7af2284659\n\nModSqrt = 5b301bb93bdcf050183107e36258b53b4805918114ea1c2227b0911d5b4dc077\nA = 55e55e5f94dc3d7aabc921f6469d85fa2e1e92a87347c57afad5872306ae69f9fb99297d1e3e793dd9e8632244208154de5da7114fd876383bf1422f7ece024\nP = d43280ac150f725f4a2a1dceb1c79bcac57855a4eba72ae93762d09bcb2444fb\n\nModSqrt = 2df9609e2f5a5156c3260461b2ee52eacdef00bd8b091479813143a6c5283f71\nA = 2099325b7f12fe77353ddf3f2b2c5ef77b49671b150af954cf84e9675e3ecde3e057084641a633d19533b4712ab49924c8b5c31d591abcc88291f51253fa2a7\nP = d43280ac150f725f4a2a1dceb1c79bcac57855a4eba72ae93762d09bcb2444fb\n\nModSqrt = dfab751710e9008e25e422d1199d6fbec4dc7fba35b4da9d225a746eb4126a0\nA = c006af53d4737fb293584df6ffe2e4cb3fd8dc77fb7c1f13b97bb9c249e3ee5fb9feff7488265b3093906c08a4946f142ac7b491937d24bfba6413366ce371d\nP = d43280ac150f725f4a2a1dceb1c79bcac57855a4eba72ae93762d09bcb2444fb\n\nModSqrt = 26bc030008d6c60a09fb0e16093a649fcb40c6c21a8e2da2353ba4b07c4f85d5\nA = 1eaabcfad2ed349ac9356e6f4da0b301266ddde811cb0f817aba8f5c10fb8b8ba9d0ef2dd386b668f16eac296118fdb8cb7afe1b865648c81c2fa3cf21f2711b\nP = d43280ac150f725f4a2a1dceb1c79bcac57855a4eba72ae93762d09bcb2444fb\n\nModSqrt = 35051b1482ec2578f3dc0000a422cb5111e43c37f1ac20b1844d3de2128c4556\nA = 315ff9de178681116f2a5fa78eebf4818e1d680435eacdfaf9d0e5c4fc01fc034b352c82fd52c81ca30d68864952dacc99d08269c9dd7ca99ccf22da98c3840\nP = d43280ac150f725f4a2a1dceb1c79bcac57855a4eba72ae93762d09bcb2444fb\n\nModSqrt = a5474252885cacf004c460a7793ff0b0a2187bb1a9ed700ae3470199faef71f\nA = 19856fc1351c4b02abf573bb2fc6ff92355fa369d62bb8f2260fa772fb1693f509a56cad661930abcac049dd70f4b16bed4a4c172e73e772504c9990ce7f92f\nP = dc315fd52684fba79e577a204de9053b11a5d7a414263fec9eff6ff62188829d\n\nModSqrt = 12daf4722387ecf47de1b0b6b110a062dc5ea2685bc9dbde66b8d15622985029\nA = fb8479787069116abc42abfd7dc0c24d2ad04fe0c04b42a6dff714af715d17e0fd77855f950f264542b06d48e8818de813ddb7975798b7debefcdaa5ff86beb\nP = dc315fd52684fba79e577a204de9053b11a5d7a414263fec9eff6ff62188829d\n\nModSqrt = 397996ed5c0ac6ad32e43c337e9de421b87774cc162bf7ac7bbedf4a9029255e\nA = 5aa04353321bd2de92481be740357f979da464b53aa39111fdbb734cf7af6b3857d1baa08d3a126a3dd34a2fbae2bf2b84e900686c1d31505b390185acef5fe5\nP = dc315fd52684fba79e577a204de9053b11a5d7a414263fec9eff6ff62188829d\n\nModSqrt = 2cf4b844a54ba359dc592ef1b49f43fcfeae84d1087edfefdd0b9174b43c0a3c\nA = 365a8650510bcfd8fa87432f167cf487234c215857403b9270b5eebeafa48cd6da47fd60dc311b94d1d72baad0447c31f0b212d755f46c256e16e5e015e6546e\nP = dc315fd52684fba79e577a204de9053b11a5d7a414263fec9eff6ff62188829d\n\nModSqrt = 9277c73043ff767c3fa606f0cd66b9d854a600c8c18287f191ce277758c3f31\nA = 62cec3901626d03e8df66299a87c54b1f7a55cafc99f0b6bba1b5d51a3d2b7d2171c9135a9d8a5346d436e0136b12e515e703e3cd84ecfe154eb94c6772a6d72\nP = dc315fd52684fba79e577a204de9053b11a5d7a414263fec9eff6ff62188829d\n\nModSqrt = 4189e5a90c1b1abdc1c7c05b3587e6f362e06f927b6cf5f0d271aab3d6f90765\nA = 336b8d0f9dac842c696bc020f49c6aa023842c16f2052eb02f17959006554ca0012042c80c72590f21c6bf5a3714c9cb552aa69730e33db93a56a909b273f39\nP = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951f\n\nModSqrt = 36ccd38cb5a6bd8a73bca55936a2227c503664422c2296faf7e2b1c6a375a43a\nA = fecfd60a376befbe48d2c4f6d070d716d2f403cd5daefbce62b720df44deb605162c8f20f49fd7ec30d4f8e70d803d45b3a44b5d912baa3410d991165d7c507\nP = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951f\n\nModSqrt = 198fc8569be172dc9b71023ed3d42d2ba94bae409964", + "3f6517ab03f540527fdb\nA = 65bebdb00a96fc814ec44b81f98b59fba3c30203928fa5214c51e0a97091645280c947b005847f239758482b9bfc45b066fde340d1fe32fc9c1bf02e1b2d0ec\nP = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951f\n\nModSqrt = 21b7f74c30ded681d6138cf8e6fd798f32a049e94138e982f1845df3dc9e686f\nA = 9a30b791c1ba4f394b4e3dcd5837e474237f4fe8987b255c098a47b2c14c598ec69d2beae444dd4fe9c4ede8173d2b187677cc706a3c28f3b81627d8a5fb6fd\nP = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951f\n\nModSqrt = a1d52989f12f204d3d2167d9b1e6c8a6174c0c786a979a5952383b7b8bd186\nA = 2eee37cf06228a387788188e650bc6d8a2ff402931443f69156a29155eca07dcb45f3aac238d92943c0c25c896098716baa433f25bd696a142f5a69d5d937e81\nP = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951f\n\n\n# NotModSquare tests.\n#\n# These test vectors are such that NotModSquare is not a square modulo P.\n\nNotModSquare = 03\nP = 07\n\nNotModSquare = 05\nP = 07\n\nNotModSquare = 06\nP = 07\n\nNotModSquare = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951e\nP = 9df9d6cc20b8540411af4e5357ef2b0353cb1f2ab5ffc3e246b41c32f71e951f\n\n\n# ModInv tests.\n#\n# These test vectors satisfy ModInv * A = 1 (mod M) and 0 <= ModInv < M.\n\nModInv = 00\nA = 00\nM = 01\n\nModInv = 00\nA = 01\nM = 01\n\nModInv = 00\nA = 02\nM = 01\n\nModInv = 00\nA = 03\nM = 01\n\nModInv = 64\nA = 54\nM = e3\n\nModInv = 13\nA = 2b\nM = 30\n\nModInv = 2f\nA = 30\nM = 37\n\nModInv = 4\nA = 13\nM = 4b\n\nModInv = 1c47\nA = cd4\nM = 6a21\n\nModInv = 2b97\nA = 8e7\nM = 49c0\n\nModInv = 29b9\nA = fcb\nM = 3092\n\nModInv = a83\nA = 14bf\nM = 41ae\n\nModInv = 18f15fe1\nA = 11b5d53e\nM = 322e92a1\n\nModInv = 32f9453b\nA = 8af6df6\nM = 33d45eb7\n\nModInv = d696369\nA = c5f89dd5\nM = fc09c17c\n\nModInv = 622839d8\nA = 60c2526\nM = 74200493\n\nModInv = fb5a8aee7bbc4ef\nA = 24ebd835a70be4e2\nM = 9c7256574e0c5e93\n\nModInv = 846bc225402419c\nA = 23026003ab1fbdb\nM = 1683cbe32779c59b\n\nModInv = 5ff84f63a78982f9\nA = 4a2420dc733e1a0f\nM = a73c6bfabefa09e6\n\nModInv = 133e74d28ef42b43\nA = 2e9511ae29cdd41\nM = 15234df99f19fcda\n\nModInv = 46ae1fabe9521e4b99b198fc8439609023aa69be2247c0d1e27c2a0ea332f9c5\nA = 6331fec5f01014046788c919ed50dc86ac7a80c085f1b6f645dd179c0f0dc9cd\nM = 8ef409de82318259a8655a39293b1e762fa2cc7e0aeb4c59713a1e1fff6af640\n\nModInv = 444ccea3a7b21677dd294d34de53cc8a5b51e69b37782310a00fc6bcc975709b\nA = 679280bd880994c08322143a4ea8a0825d0466fda1bb6b3eb86fc8e90747512b\nM = e4fecab84b365c63a0dab4244ce3f921a9c87ec64d69a2031939f55782e99a2e\n\nModInv = 1ac7d7a03ceec5f690f567c9d61bf3469c078285bcc5cf00ac944596e887ca17\nA = 1593ef32d9c784f5091bdff952f5c5f592a3aed6ba8ea865efa6d7df87be1805\nM = 1e276882f90c95e0c1976eb079f97af075445b1361c02018d6bd7191162e67b2\n\nModInv = 639108b90dfe946f498be21303058413bbb0e59d0bd6a6115788705abd0666d6\nA = 9258d6238e4923d120b2d1033573ffcac691526ad0842a3b174dccdbb79887bd\nM = ce62909c39371d463aaba3d4b72ea6da49cb9b529e39e1972ef3ccd9a66fe08f\n\nModInv = aebde7654cb17833a106231c4b9e2f519140e85faee1bfb4192830f03f385e773c0f4767e93e874ffdc3b7a6b7e6a710e5619901c739ee8760a26128e8c91ef8cf761d0e505d8b28ae078d17e6071c372893bb7b72538e518ebc57efa70b7615e406756c49729b7c6e74f84aed7a316b6fa748ff4b9f143129d29dad1bff98bb\nA = a29dacaf5487d354280fdd2745b9ace4cd50f2bde41d0ee529bf26a1913244f708085452ff32feab19a7418897990da46a0633f7c8375d583367319091bbbe069b0052c5e48a7daac9fb650db5af768cd2508ec3e2cda7456d4b9ce1c39459627a8b77e038b826cd7e326d0685b0cd0cb50f026f18300dae9f5fd42aa150ee8b\nM = d686f9b86697313251685e995c09b9f1e337ddfaa050bd2df15bf4ca1dc46c5565021314765299c434ea1a6ec42bf92a29a7d1ffff599f4e50b79a82243fb24813060580c770d4c1140aeb2ab2685007e948b6f1f62e8001a0545619477d498132c907774479f6d95899e6251e7136f79ab6d3b7c82e4aca421e7d22fe7db19c\n\nModInv = 1ec872f4f20439e203597ca4de9d1296743f95781b2fe85d5def808558bbadef02a46b8955f47c83e1625f8bb40228eab09cad2a35c9ad62ab77a30e3932872959c5898674162da244a0ec1f68c0ed89f4b0f3572bfdc658ad15bf1b1c6e1176b0784c9935bd3ff1f49bb43753eacee1d8ca1c0b652d39ec727da83984fe3a0f\nA = 2e527b0a1dc32460b2dd94ec446c692989f7b3c7451a5cbeebf69fc0ea9c4871fbe78682d5dc5b66689f7ed889b52161cd9830b589a93d21ab26dbede6c33959f5a0f0d107169e2daaac78bac8cf2d41a1eb1369cb6dc9e865e73bb2e51b886f4e896082db199175e3dde0c4ed826468f238a77bd894245d0918efc9ca84f945\nM = b13133a9ebe0645f987d170c077eea2aa44e85c9ab10386d02867419a590cb182d9826a882306c212dbe75225adde23f80f5b37ca75ed09df20fc277cc7fbbfac8d9ef37a50f6b68ea158f5447283618e64e1426406d26ea85232afb22bf546c75018c1c55cb84c374d58d9d44c0a13ba88ac2e387765cb4c3269e3a983250fa\n\nModInv = 30ffa1876313a69de1e4e6ee132ea1d3a3da32f3b56f5cfb11402b0ad517dce605cf8e91d69fa375dd887fa8507bd8a28b2d5ce745799126e86f416047709f93f07fbd88918a047f13100ea71b1d48f6fc6d12e5c917646df3041b302187af641eaedf4908abc36f12c204e1526a7d80e96e302fb0779c28d7da607243732f26\nA = 31157208bde6b85ebecaa63735947b3b36fa351b5c47e9e1c40c947339b78bf96066e5dbe21bb42629e6fcdb81f5f88db590bfdd5f4c0a6a0c3fc6377e5c1fd8235e46e291c688b6d6ecfb36604891c2a7c9cbcc58c26e44b43beecb9c5044b58bb58e35de3cf1128f3c116534fe4e421a33f83603c3df1ae36ec88092f67f2a\nM = 53408b23d6cb733e6c9bc3d1e2ea2286a5c83cc4e3e7470f8af3a1d9f28727f5b1f8ae348c1678f5d1105dc3edf2de64e65b9c99545c47e64b770b17c8b4ef5cf194b43a0538053e87a6b95ade1439cebf3d34c6aa72a11c1497f58f76011e16c5be087936d88aba7a740113120e939e27bd3ddcb6580c2841aa406566e33c35\n\nModInv = 87355002f305c81ba0dc97ca2234a2bc02528cefde38b94ac5bd95efc7bf4c140899107fff47f0df9e3c6aa70017ebc90610a750f112cd4f475b9c76b204a953444b4e7196ccf17e93fdaed160b7345ca9b397eddf9446e8ea8ee3676102ce70eaafbe9038a34639789e6f2f1e3f352638f2e8a8f5fc56aaea7ec705ee068dd5\nA = 42a25d0bc96f71750f5ac8a51a1605a41b506cca51c9a7ecf80cad713e56f70f1b4b6fa51cbb101f55fd74f318adefb3af04e0c8a7e281055d5a40dd40913c0e1211767c5be915972c73886106dc49325df6c2df49e9eea4536f0343a8e7d332c6159e4f5bdb20d89f90e67597c4a2a632c31b2ef2534080a9ac61f52303990d\nM = d3d3f95d50570351528a76ab1e806bae1968bd420899bdb3d87c823fac439a4354c31f6c888c939784f18fe10a95e6d203b1901caa18937ba6f8be033af10c35fc869cf3d16bef479f280f53b3499e645d0387554623207ca4989e5de00bfeaa5e9ab56474fc60dd4967b100e0832eaaf2fcb2ef82a181567057b880b3afef62\n\n\n# GCD tests.\n#\n# These test vectors satisfy gcd(A, B) = GCD and lcm(A, B) = LCM.\n\nGCD = 0\nA = 0\nB = 0\n# Just to appease the syntax-checker.\nLCM = 0\n\nGCD = 1\nA = 92ff140ac8a659b31dd904161f9213706a08a817ae845e522c3af0c9096699e059b47c8c2f16434b1c5766ebb384b79190f2b2a62c2378f45e116890e7bb407a\nB = 2f532c9e5902b0d68cd2ed69b2083bc226e8b04c549212c425a5287bb171c6a47fcb926c70cc0d34b8d6201c617aee66af865d31fdc8a2eeb986c19da8bb0897\nLCM = 1b2c97003e520b0bdd59d8c35a180b4aa36bce14211590435b990ad8f4c034ce3c77899581cb4ee1a022874203459b6d53859ab1d99ff755efa253fc0e5d8487bb000c13c566e8937f0fe90b95b68bc278610d4f232770b08d1f31bee55a03da47f2d0ebb9e7861c4f16cc22168b68593e9efcde00f54104b4c3e1a0b294d7f6\n\nGCD = a\nA = faaffa431343074f5c5d6f5788500d7bc68b86eb37edf166f699b4d75b76dae2cb7c8f6eccae8f18f6d510ef72f0b9633d5740c0bebb934d3be796bd9a53808e\nB = 2f48ec5aa5511283c2935b15725d30f62244185573203b48c7eb135b2e6db5c115c9446ac78b020574665b06a75eb287e0dbeb5da7c193294699b4c2129d2ac4\nLCM = 4a15f305e9622aa19bd8f39e968bfc16d527a47f7a5219d7b02c242c77ef8b608a4a6141f643ca97cedf07c0f1f3e8879d2568b056718aa15c0756899a08ccbe0a658bae67face96fa110edb91757bfa4828e8ff7c5d71b204f36238b12dd26f17be8ba9771f7068d63e41d423671f898f054b1187605754bc5546f2b02c5ac\n\nGCD = 16\nA = cf0b21bde98b41b479ac8071086687a6707e9efaacd4e5299668ce1be8b13290f27fd32ae68df87c292e8583a09d73ec8e8a04a65a487380dcd7dacca3b6e692\nB = 3be3f563f81d5ad5c1211db7eff430aa345e830ce07b4bde7d4d32dba3ac618d2034351e5435fd6c7f077971fb4a1e83a7396a74fdff7fce1267112851db2582\nLCM = 233a2188de2c017235024b182286f17562b2ee5ab9fdfe4efa2f61c4ff99fa44e1ead5bf6cde05bd7502ce78373c83e3f9dbab0c9bb8620a87c2640bce5d12c685af656df789bb3d0ba1edbaa98cf4f0166d422ab17aa6706f8132264d45b72827d6671a00a9186e723379e3a3bb7902d08865f357c74100059f83800241976\n\nGCD = 1\nA = dd7b7597d7c1eb399b1cea9b3042c14bd6022d31b1d2642a8f82fc32de6eadaf012fbbf349eaec4922a8468740ca73c6090833d6a69a380ed947b39c2f9b0b76\nB = 8e0dc8654e70eec55496038a8d3fff3c2086bc6dbfc0e2dbdf5bd7de03c5aef01a3982556ac3fc34fd5f13368be6cdc252c82367b7462e210f940f847d382dd9\nLCM = 7ae667df4bd4dd35bbec28719a9f1b5e1f396a9ab386c086742a6ab3014a3386d39f35b50624d0c5b4e6b206c2635c7de5ea69e2faa85dd616a7e36622962a07632839857aa49332942feccf", + "f2aee1c962e2f4e8ccfd738a5da5bf528b4c5a2440409350f5a17a39d234403e8482ccf838e0d2758ccfb8018198a51dbb407506\n\nGCD = 1\nA = 0\nB = 1\nLCM = 0\n\nGCD = 1\nA = 1\nB = 0\nLCM = 0\n\nGCD = 1\nA = 1\nB = 1\nLCM = 1\n\nGCD = 2b2\nA = dfccaa3549c1b59ab3e114fe87dc5d187719abad58c51724e972741eb895ab79a49f385f61d531ec5c88dbb505ae375093fa848165f71a5ed65e7832a42ade191a\nB = fa58a81f43088da45e659fc1117d0f1cd015aa096c8e5377cf1832191baf7cc28b5c24998b93b64f8900a0973faedb9babaaf1854345f011739da8f1175d9684c\nLCM = 5132f7ab7a982b9dc55114bd96800b7637f9742cf8a7a00a0d69d5e4574fc85792c89a1c52bcfc74b9d7f3f6164819466c46b2d622e280ced7ad1211604084a15dc1fd1951a05c8ce37122c0ec15891d818a70d3763670ea3195098de9b1ca50ea89893a9753fb9ea801541058f44801f7f50967124abfc864a2b01c41f94193c\n\nGCD = 8e\nA = 248d96a8a4cab0a1b194e08c1146868b094597cadbc35531f0ed2d77cba9f15cb5cc7c10e64ce054bf93396d25259d750b3de3aba65073db1fd2b852a6454ac1a\nB = 4c7bad8e1844901fd6a2ce2edc82e698d28ec95d6672ca148d85b49ecc78dd0a8b870e202244210bc98592b99ff6abbd20630f9eee7d46b15ccfae8d08b86799de\nLCM = 13b01f9d9c6c13e90c97e3d95bbce5a835c631b3de3bd4ff5df13ad850f5223dbdf71c53912275d0397df9335ef3a3ba8e4684c6b25962bb7b18bc74144cb5edf0196f79863a7ff032619a71646a92281f7baace7f223d254cb4d05ec19bf8d4c8ce4455a9d770daec89c0d3cf338cbdae39cf982b3c4568f5c9def4e1133d28a\n\nGCD = 3e55\nA = 2fa97382f46676b7a4cc2b8153f17b58792d24660e187d33ce55c81cc193ccb6e1e2b89feea1d5fd8faa36e13bf947fb48635e450a4d1488d0978324194a1f43c6\nB = ab08ad074139963bc18e5d87ba68db64ca6f4c279616c64039b02c55f2375b3bc04114e8e05e1ba92fb6470768f61d123845aea36774c18612736a220934561faf\nLCM = 82c7c377ecda2cb9228604cd287df5eff94edd4a539c3eb3b3fdd4b4a79d2f4eaf2b22f8286272d3dad2e370cfcd9ea4d93ebb3f049c52b8fa23b68a5bf79af989822e2cfb978f68c6a5058f47319dffcb455b089b06ae6db9e5c8a2b6e951d6e118bd2b4cd08b6e5733476a446a57387d940d1289ec00e24315821ed3a5daf2\n\nGCD = a7a\nA = 923706dfed67834a1e7e6c8e8e9f93bfbc0b43ca1f324886cf1f1380fb9b77109275d4b50af1b7689802fe9b3623ac46c7ba0e17e908c20278127b07a5c12d86ec\nB = 64473e878a29021fac1c1ce34a63eae1f4f83ee6851333b67213278b9a4a16f005cba0e8cdb410035bb580062f0e486c1a3a01f4a4edf782495f1dc3ebfa837d86\nLCM = 57785ca45b8873032f1709331436995525eed815c55140582ce57fd852116835deac7ca9d95ce9f280e246ea4d4f1b7140ab7e0dd6dc869de87f1b27372098b155ad0a1828fd387dff514acc92eae708609285edaab900583a786caf95153f71e6e6092c8c5ee727346567e6f58d60a5e01c2fa8ebcf86da9ea46876ecc58e914\n\nGCD = 42\nA = 0\nB = 42\nLCM = 0\n\nGCD = 42\nA = 42\nB = 0\nLCM = 0\n\nGCD = 42\nA = 42\nB = 42\nLCM = 42\n\nGCD = f60d\nA = ef7886c3391407529d5cf2e75ed53e5c3f74439ad2e2dc48a79bc1a5322789b4ced2914b97f8ff4b9910d212243b54001eb8b375365b9a87bd022dd3772c78a9fd63\nB = d1d3ec32fa3103911830d4ec9f629c5f75af7039e307e05bc2977d01446cd2cbeeb8a8435b2170cf4d9197d83948c7b8999d901fe47d3ce7e4d30dc1b2de8af0c6e4\nLCM = cc376ed2dc362c38a45a719b2ed48201dab3e5506e3f1314e57af229dc7f3a6a0dad3d21cfb148c23a0bbb0092d667051aa0b35cff5b5cc61a7c52dec4ed72f6783edf181b3bf0500b79f87bb95abc66e4055f259791e4e5eb897d82de0e128ecf8a091119475351d65b7f320272db190898a02d33f45f03e27c36cb1c45208037dc\n\nGCD = 9370\nA = 1ee02fb1c02100d1937f9749f628c65384ff822e638fdb0f42e27b10ee36e380564d6e861fcad0518f4da0f8636c1b9f5124c0bc2beb3ca891004a14cd7b118ddfe0\nB = 67432fd1482d19c4a1c2a4997eab5dbf9c5421977d1de60b739af94c41a5ad384cd339ebfaa43e5ad6441d5b9aaed5a9f7485025f4b4d5014e1e406d5bd838a44e50\nLCM = 159ff177bdb0ffbd09e2aa7d86de266c5de910c12a48cbe61f6fa446f63a2151194777555cd59903d24cb30965973571fb1f89c26f2b760526f73ded7ee8a34ebcecd1a3374a7559bcdb9ac6e78be17a62b830d6bb3982afdf10cf83d61fd0d588eab17d6abef8e6a7a5763fcb766d9a4d86adf5bb904f2dd6b528b9faec603987a0\n\nGCD = c5f\nA = 5a3a2088b5c759420ed0fb9c4c7685da3725b659c132a710ef01e79435e63d009d2931ea0a9ed9432f3d6b8851730c323efb9db686486614332c6e6ba54d597cf98\nB = 1b1eb33b006a98178bb35bbcf09c5bebd92d9ace79fa34c1567efa8d6cf6361547807cd3f8e7b8cd3ddb6209dccbae4b4c16c8c1ec19741a3a57f61571882b7aed7\nLCM = c5cbbbe9532d30d2a7dd7c1c8a6e69fd4fa4828a844d6afb44f3747fef584f7f1f3b835b006f8747d84f7699e88f6267b634e7aef78d6c7584829537d79514eec7d11219721f91015f5cefdc296261d85dba388729438991a8027de4827cd9eb575622e2912b28c9ce26d441e97880d18db025812cef5de01adeaec1322a9c9858\n\nGCD = e052\nA = 67429f79b2ec3847cfc7e662880ab1d94acdf04284260fcfffd67c2862d59704ed45bcc53700c88a5eea023bc09029e9fd114fc94c227fd47a1faa1a5ef117b09bd2\nB = 39faa7cbdeb78f9028c1d50ab34fbe6924c83a1262596f6b85865d4e19cc258b3c3af1ee2898e39e5bee5839e92eac6753bbbb0253bd576d1839a59748b778846a86\nLCM = 1ab071fb733ef142e94def10b26d69982128561669e58b20b80d39cf7c2759d26b4a65d73b7f940c6e8fc417180ef62d7e52ac24678137bd927cd8d004ad52b02affe176a1ecde903dbc26dcc705678f76dd8cd874c0c3fe737474309767507bbe70dd7fb671bbb3694cedf0dcdaa0c716250ddd6dfec525261572fa3e1387f7b906\n\nGCD = 3523\nA = 0\nB = 3523\nLCM = 0\n\nGCD = 3523\nA = 3523\nB = 0\nLCM = 0\n\nGCD = 3523\nA = 3523\nB = 3523\nLCM = 3523\n\nGCD = f035a941\nA = 16cd5745464dfc426726359312398f3c4486ed8aaeea6386a67598b10f744f336c89cdafcb18e643d55c3a62f4ab2c658a0d19ea3967ea1af3aee22e11f12c6df6e886f7\nB = 74df09f309541d26b4b39e0c01152b8ad05ad2dfe9dd2b6706240e9d9f0c530bfb9e4b1cad3d4a94342aab309e66dd42d9df01b47a45173b507e41826f24eb1e8bcc4459\nLCM = b181771d0e9d6b36fdfcbf01d349c7de6b7e305e1485ea2aa32938aa919a3eee9811e1c3c649068a7572f5d251b424308da31400d81ac4078463f9f71d7efd2e681f92b13a6ab3ca5c9063032dcbdf3d3a9940ce65e54786463bbc06544e1280f25bc7579d264f6f1590cf09d1badbf542ce435a14ab04d25d88ddbac7d22e8cae1c91f\n\nGCD = 33ad1b8f\nA = 1af010429a74e1b612c2fc4d7127436f2a5dafda99015ad15385783bd3af8d81798a57d85038bcf09a2a9e99df713b4d6fc1e3926910fbbf1f006133cb27dc5ebb9cca85\nB = 92a4f45a90965a4ef454f1cdd883d20f0f3be34d43588b5914677c39d577a052d1b25a522be1a656860a540970f99cbc8a3adf3e2139770f664b4b7b9379e13daf7d26c\nLCM = 4c715520ed920718c3b2f62821bc75e3ff9fd184f76c60faf2906ef68d28cd540d3d6c071fa8704edd519709c3b09dfaee12cb02ab01ad0f3af4f5923d5705ce6d18bcab705a97e21896bb5dd8acb36ee8ec98c254a4ddc744297827a33c241f09016a5f109248c83dd41e4cea73ce3eabb28d76678b7e15545b96d22da83c111b6b624\n\nGCD = dc0429aa\nA = ccb423cfb78d7150201a97114b6644e8e0bbbb33cadb0ef5da5d3c521a244ec96e6d1538c64c10c85b2089bdd702d74c505adce9235aa4195068c9077217c0d431de7f96\nB = 710786f3d9022fc3acbf47ac901f62debcfda684a39234644bac630ab2d211111df71c0844b02c969fc5b4c5a15b785c96efd1e403514235dc9356f7faf75a0888de5e5a\nLCM = 6929af911850c55450e2f2c4c9a72adf284fe271cf26e41c66e1a2ee19e30d928ae824f13d4e2a6d7bb12d10411573e04011725d3b6089c28d87738749107d990162b485805f5eedc8f788345bcbb5963641f73c303b2d92f80529902d3c2d7899623958499c8a9133aae49a616c96a2c5482a37947f23af18c3247203ac2d0e760340e6\n\nGCD = 743166058\nA = 16cd476e8031d4624716238a3f85badd97f274cdfd9d53e0bd74de2a6c46d1827cc83057f3889588b6b7ca0640e7d743ed4a6eaf6f9b8df130011ecc72f56ef0af79680\nB = 86eba1fc8d761f22e0f596a03fcb6fe53ad15a03f5b4e37999f60b20966f78ba3280f02d3853f9ace40438ccfaf8faed7ace2f2bf089b2cdd4713f3f293bf602666c39f8\nLCM = 1a7a1b38727324d6ba0290f259b8e2b89c339b2445cada38a5a00ded1468ab069f40678ce76f7f78c7c6f97783cc8a49ef7e2a0c73abbac3abc66d1ce99566ce7f874a8949ca3442051e71967695dc65361184748c1908e1b587dc02ed899a524b34eb30b6f8db302432cfa1a8fbf2c46591e0ab3db7fd32c01b1f86c39832ee9f0c80\n\nGCD = 6612ba2c\nA = 0\nB = 6612ba2c\nLCM = 0\n\nGCD = 6612ba2c\nA = 6612ba2c\nB = 0\nLCM = 0\n\nGCD = 6612ba2c\nA = 6612ba2c\nB = 6612ba2c\nLCM = 6612ba2c\n\nGCD = 2272525aa08ccb20\nA = 11b9e23001e7446f6483fc9977140d91c3d82568dabb1f043a5620544fc3dda233b51009274cdb004fdff3f5c4267d34181d543d913553b6bdb11ce2a9392365fec8f9a3797e1200\nB = 11295529342bfb795f0611d03afb873c70bd16322b2cf9483f357f723b5b19f796a6206cf3ae3982daaeafcd9a68f0ce3355a7eba3fe4e743683709a2dd4b2ff46158bd99ff4d5a0\nLCM = 8d4cbf00d02f6adbaa70484bcd42ea932000843dcb667c69b75142426255f79b6c3b6bf22572597100c06c3277e40bf60c14c1f4a6822d86167812038cf1eefec2b0b19981ad99ad3125ff4a455a4a8344cbc609e1b3a173533db432bd717c72be25e05ed488d3970e7ed17a46353c5e0d91c8428d2fec7a93210759589df042cab028f545e3a00\n\nGCD = 3480bf145713d56f9\nA = 8cf8ef1d4f216c6bcec673208fd93b7561b0eb8303af57113edc5c6ff4e1eeae9ddc3112b943d947653ba2179b7f63505465126d88ad0a0a15b682f5c89aa4a2a51c768cd9fdeaa9\nB = a6fd114023e7d79017c552a9051ca827f3ffa9f31e2ee9d78f8408967064fcdc9466e95cc8fac9a4fa88248987caf7cf57af58400d27abd60d9b79d2fe03fad76b879eceb504d7f\nLCM = 1c05eee73a4f0db210a9007f94a5af88c1cdd2cba456061fd41de1e746d836fa4e0e", + "972812842e0f44f10a61505f5d55760c48ba0d06af78bb6bde7da8b0080b29f82b1161e9c0b5458e05ac090b00f4d78b1cc10cf065124ba610e3acab092a36fe408525e21c0ddc7c9696ed4e48bd2f70423deecfe62cecc865c6088f265da0e5961d3f3a84f\n\nGCD = 917e74ae941fcaae\nA = 652f8a92d96cbf0a309629011d0fbaceb1266bc2e8243d9e494eead4cf7100c661b537a8bea93dec88cfc68597d88a976c125c3b4de19aba38d4ea9578202e59848d42652518348a\nB = 32e07b71979d57e8344e97c39680a61e07d692d824ae26b682156890792d8a766ee29a4968f461aaced5bf049044fba2f4120b1c1f05985676f975d4582e9e82750d73c532cd07b2\nLCM = 23620c7b897dc26c7717e32f3517ac70bf09fbe08f7255ab010cf4cf946f4e96304c425043452c5d5a0e841d3a3cfd9c2d84d9256f3b5974fe3ebfa9255fe20a710d3e6511606c0d85970381101c7f4986d65ad6a73a71507f146b11f903043cfa805cc0b14d4f3072da98bf22282f7762040406c02d5b3ef9e7587f63bab8b29c61d8e30911aa96\n\nGCD = 2b9adc82005b2697\nA = 19764a84f46045ef1bca571d3cbf49b4545998e64d2e564cc343a53bc7a0bcfbe0baa5383f2b346e224eb9ce1137d9a4f79e8e19f946a493ff08c9b423574d56cbe053155177c37\nB = 1bbd489ad2ab825885cdac571a95ab4924e7446ce06c0f77cf29666a1e20ed5d9bc65e4102e11131d824acad1592075e13024e11f12f8210d86ab52aa60deb250b3930aabd960e5a\nLCM = 1032a0c5fffc0425e6478185db0e5985c645dd929c7ebfeb5c1ee12ee3d7b842cfab8c9aa7ff3131ac41d4988fb928c0073103cea6bb2cc39808f1b0ad79a6d080eac5a0fc6e3853d43f903729549e03dba0a4405500e0096b9c8e00510c1852982baec441ed94efb80a78ed28ed526d055ad34751b831b8749b7c19728bf229357cc5e17eb8e1a\n\nGCD = 8d9d4f30773c4edf\nA = 0\nB = 8d9d4f30773c4edf\nLCM = 0\n\nGCD = 8d9d4f30773c4edf\nA = 8d9d4f30773c4edf\nB = 0\nLCM = 0\n\nGCD = 8d9d4f30773c4edf\nA = 8d9d4f30773c4edf\nB = 8d9d4f30773c4edf\nLCM = 8d9d4f30773c4edf\n\nGCD = 6ebd8eafb9a957a6c3d3d5016be604f9624b0debf04d19cdabccf3612bbd59e00\nA = 34dc66a0ffd5b8b5e0ffc858dfc4655753e59247c4f82a4d2543b1f7bb7be0e24d2bbf27bb0b2b7e56ee22b29bbde7baf0d7bfb96331e27ba029de9ffdff7bdb7dc4da836d0e58a0829367ec84ea256833fd4fe1456ad4dd920557a345e12000\nB = 1f3406a20e20ebf96ccb765f898889a19b7636608fd7dc7c212607b641399543f71111d60e42989de01eaa6ff19a86ea8fbde1a3d368c0d86dc899e8e250fc764090f337958ca493119cbb4ad70cbfae7097d06d4f90ec62fbdd3f0a4496e600\nLCM = ee502c50e3667946e9089d0a9a0382e7fd0b75a17db23b56a0eec997a112c4dbd56d188808f76fe90451e5605550c9559ef14a95014c6eb97e9c1c659b98515c41470142843de60f72fb4c235faa55b0a97d943221003d44e2c28928f0b84bf071256254897ed31a7fd8d174fc962bc1311f67900ac3abcad83a28e259812f1ee229511ab1d82d41f5add34693ba7519babd52eb4ec9de31581f5f2e40a000\n\nGCD = ef7399b217fc6a62b90461e58a44b22e5280d480b148ec4e3b4d106583f8e428\nA = 7025e2fe5f00aec73d90f5ad80d99ca873f71997d58e59937423a5e6ddeb5e1925ed2fd2c36a5a9fc560c9023d6332c5d8a4b333d3315ed419d60b2f98ccf28bbf5bf539284fd070d2690aeaac747a3d6384ee6450903a64c3017de33c969c98\nB = df0ac41dbabce1deeb0bceb1b65b1079850052ecf6534d0cff84a5a7fb5e63baee028d240f4419925154b96eaa69e8fbb1aae5102db7916234f290aa60c5d7e69406f02aeea9fe9384afbff7d878c9ac87cd31f7c35dff243b1441e09baff478\nLCM = 687669343f5208a6b2bb2e2efcac41ec467a438fde288cc5ef7157d130139ba65db9eb53e86a30c870bd769c0e0ab15a50f656cd9626621ae68d85eaff491b98da3ea5812062e4145af11ea5e1da457084911961ef2cd2ac45715f885ba94b4082aa76ffd1f32461f47c845b229d350bf36514c5ce3a7c782418746be342eca2721346ade73a59475f178c4f2448e1326110f5d26a0fef1a7a0c9288489e4dc8\n\nGCD = 84b917557acf24dff70cb282a07fc52548b6fbbe96ca8c46d0397c8e44d30573\nA = 81dbb771713342b33912b03f08649fb2506874b96125a1ac712bc94bfd09b679db7327a824f0a5837046f58af3a8365c89e06ff4d48784f60086a99816e0065a5f6f0f49066b0ff4c972a6b837b63373ca4bb04dcc21e5effb6dfe38271cb0fa\nB = 1da91553c0a2217442f1c502a437bb14d8c385aa595db47b23a97b53927b4493dd19f1bc8baf145bc10052394243089a7b88d19b6f106e64a5ab34acad94538ab504d1c8ebf22ac42048bbd1d4b0294a2e12c09fe2a3bd92756ba7578cb34b39\nLCM = 1d0530f8142754d1ee0249b0c3968d0ae7570e37dadbe4824ab966d655abf04cd6de5eb700eba89d8352dec3ae51f2a10267c32fbd39b788c7c5047fe69da3d7ad505435a6212f44899ba7e983bb780f62bcdee6f94b7dba8af7070a4cc008f351ae8be4579bc4a2e5c659ce000ad9c8cdc83723b32c96aeb0f5f4127f6347353d05525f559a8543cd389ad0af6f9d08a75b8c0b32419c097e6efe8746aee92e\n\nGCD = 66091477ea3b37f115038095814605896e845b20259a772f09405a8818f644aa\nA = cedac27069a68edfd49bd5a859173c8e318ba8be65673d9d2ba13c717568754ed9cbc10bb6c32da3b7238cff8c1352d6325668fd21b4e82620c2e75ee0c4b1aff6fb1e9b948bbdb1af83cecdf356299b50543b72f801b6a58444b176e4369e0\nB = 5f64ca1ba481f42c4c9cf1ffa0e515b52aa9d69ceb97c4a2897f2e9fa87f72bae56ee6c5227f354304994c6a5cc742d9f09b2c058521975f69ca5835bce898cf22b28457cd7e28870df14e663bb46c9be8f6662f4ff34d5c4ae17a888eba504e\nLCM = c163cb28642e19a40aa77887c63180c2c49fc10cda98f6f929c8131752ea30b5283a814a81681b69b9d1762e6c1a9db85f480bc17f998d235fd7e64c1caa70ef170c9e816d3e80f516b29f2c80cfb68bf208b4d5082ef078da4314b3f20c7d6c54b0aeb378096b029a7b61c0a4cd14aeddc01004c53915a4f692d2291752e5af46b23d7fa6dd61f2d56c6f4bf8e6119688abac8fd7aba80e846a7764bb3fca0\n\nGCD = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nA = 0\nB = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nLCM = 0\n\nGCD = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nA = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nB = 0\nLCM = 0\n\nGCD = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nA = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nB = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\nLCM = bb80bf51757ba696c700fa4e4c0132b3151d2bf9ebff8382f808ded78be67182\n\nGCD = 120451d8307219aa0c96f328ad653ccd462e92423ca93ed8a3dde45bf5cb9b13cdaf9800e4d05dd71c4db6a129fb3280ee4ec96ec5297d881c1a8b5efccbd91fef21f5c5bf5fba42a4c8eaa358f620a074b7a17054527bdaa58d5acaa0dfdc48ecba1a10ebf4d57bb4215de406e6be13fed3fe493b1cd1e2d11a8d4ac03c47756\nA = 3f8179a8e1f0b342475a855c3e1bae402dd41424cf24a0b4d2e263c8efb08bde7d92eae8607fb5e88b1378f0f1bd0733f229a35be6b1383a48d32749d5d6b32427d26323b7ab05bb5781289e96bfbc21971439319b15f6c0fe93fdb35d0b67ec41443c59a081dd3cef047ac797fccb45bece84c0bb0bb7e1797259526d8ec9cc63ba4d32cfc692ccd3d243cb2b53ac216312f3a8e8c0daa09d21b6150d697639a5e52059414a417c607be8ec0eee2e708219cadbaf37a369c4485b01ed87bbc2\nB = 2c474e396a2dd9cd10b9d7313f69d3b4ca123e9fd853edd488339236d14c56453a1381958864a04d2624e81995dabcdd0ccf60db9917813f887de68da075d0ea4440001e18f470e43b38ee3440b49be651d709fbdef980e3e4149913f4ae2681124f54523f4881376ddb533b5219e804cc26f4c2e577be4e02613c4da80ba1215775b0a5178a965ad47bd2befb32493943ded1004ef66347b4983f8d1ba990d4a943505dfce6debcfb322842ed88106cd6dee9aa592ff0d2274bc727a6e1f14c\nLCM = 9c129cf649555bfd2d3d9c64dc6d6f022295e53bca5d2f218adaa66aa60eb4694429b7e83bf81b6df4459c5104023ab9a33f006ffcd8114507baa17e2ef6fe23ebdd4740f66879033da2041f2cb7ba517ad3526ffe75614ea9432c085f71b2d65a736bac7ba42b639e330b82733372083843dcb78b6a273ab20e0d4b7c8998a14048aa15bb20a0a0bd997917107274c89b4cec175fb98043d52e6c555bd9e0036566d052a6d4e7e276d1e8835e1f06e3ca46d47747ba586e95fb1a790d992834b7c3e136141eb8a434e6c12067246ac3c0a81c69e03b1ed28aa0b3173d6eff83d278c2f461a47a416f3f9a5dae3bb410fd18817bd4115e7f1e84b936cc02364\n\nGCD = 95aa569a2c76854300d7660847dd20fe0b8c445fdbcaa98465cee61aee76ad6a438e75a8c573198570ffb62bc07ec3a2be0ae0a1f631670fa88d6f75f3161e8b9a4d44b6801ffc884c7f469c5ed1f27b1edecce9f2977f9e92d1a3b230492fea7e6f2af739dc158a7fbd29856cbedb57b4119e64b27ab09eb1c2df01507d6e7fd\nA = 4c653b5bfec44e9be100c064dffe5d8cd59b0cf4cc56b03eabb4ef87cfda6506c9a756b811907fe9d8b783eb7a0b9e129773bf1da365ddb488d27b16fb983e89345d1ccdb4f06a67a11925c3f266373be5d7b0075189c6f3c2157e2da197058fe0a7bcc50adc34e99e254a29abbe2d5948d3157e1b0c3fca3d641760f7b9862843b63abef0b3d83fd486f4526b30382fda355575da30e9a106718a3921774c4d69f5311f8d737fe618f5236b4763fe1b2ee7f13184db67367d3903c535ff6d7b\nB = 2dcca83c99a28e9fd2f84e78973699baf2f04fd454094730948b22477834a0064817b86e0835e6d7b26e5b0b1dcf4ad91a07ac0780d6522df1fcac758cf5db6c2a5623d7c0f1afefd5718f7b6de639867d07a9ec525991304e9355d1635104bea837f74758d6aa2aab4e4afbb606af1d98de7417505e4710cd0589bdff9a0bf38a857cc59a5f1781043e694fc2337fd84bdeb28b13a222bb09328a81ec409ad586e74236393d27398cc24d412135e34247c589149e134b97f4bd538ac9a3424b\nLCM = 1760c0b0066aa0695767099e87e9388729ea89b8e8c36bddcd04d257591e741613c07b0e69447c0a468c33a745084171e06523d987d8db40a1433bf435325e8a724a0876503b34495170ff3671d42117a2e4f3a75b1d9dd809a34fa0fb26fe50d84f80a9b02e40190e5", + "efb927a5a61a03f13edbce2e666af6c3a2a9bcb84e47e3090008753ff27c4b8cf06480f471379a93f5230923623a83b286b71a555cd5e5347282f664ed90b14b2c4de84a70375e488211a7b3931119ef3bbe029b712389fe784818a0bf29d80733ce9cc940c547aa1eb3f06d492eb676bf37802283c82ce76156dfaab5c2d5107e08062681b5fa169f6eb68e1ab8bd9b2005e90bd4fd\n\nGCD = 244b9b1290cf5b4ba2f810574c050651489f2d3a2b03e702b76ebfaf4e33de9bbe5da24c919e68d3a72eadd35982b3a89c6b18b38ff7082ac65263e52b6ec75a5717b971c98257b194c828bff0216a99536603b41a396ea2fb50f5ea7cf3edf10bb0d039123e78593ae9ffcbbba02e51e038533e83b6bc73c70551d6467f39809\nA = 41a0b1310669500681cdf888836f6c556758750f562d743ac780dd4c0d161856380e44fdbb1f8a2786bf45be6b0e7f1cb2cd85f6b9e50acc72793d92383c7d7fb796fc74d32e8fac8225bdc19ae47546d9c9c75f5f06ca684f07daccaf89ccf2cddeb7ec255d530c7dd1e71daf44cafdc9d30fbcb1cbaefae3480585f79f4177e3834a5bc91845e2e8cd8aeb27f484e5e5b2c3c076dbb6c23e91303f0a0fdde83cd33a8ea6ed1549e727b4d766c1017c169710fd98e1585d60f66e121f9180b3\nB = 251f5aeaa60b3959285f49540cdaf8e21451110bbddb9933bbbcaea3112f4eb45e435a3ba37c52d2ab79ce997a8f6c829b3aa561f2852924b8effb52396d09d2bf257ebb4fb56c7aa25648f69b06d2cd01e876c9f9c0679de9e6fffa79eb7e603723e5af7de46ee405a5a079229577b5b6fffb8d43e391fe6f4eb89638e64d6eff8026249aaa355a91625eb0bfd14caa81e4c3586aaa2e94fde143a44f223a91e226661d12f55dfcdb4215e5a64e14e968005733be6a71c465de312ca109b34a\nLCM = 431f918b274f3e43f446e4e85567883d6536a0332db662cef088f5a36b0f4b68372048174ba10fee94b9f8f1c2e189c974be2e6e8ae8e2ae108445326d40f63e38d8d4e2e46174589a3cbc9583e0036dc8146e79eee9e96f4436313b3f143dd0f5aceab05243def7f915169c360f55ef123977cf623c5ba432c3259c62fb5e37d5adab0f24b825aa4ada99ec4e83e9ca4698399e1ed633091ce5f9844c540a642cd264201116ed4168aa2105a5159f5df064f845830c469140f766c7319052ce59bd1ad7c3f2d8c30e54f147f6aeb5586c70c984302ba18d854a60aec01b394c7d66fa33fe18fe4a8cfb3238df219294e6e42190a30d28b10049a1b75853a4e\n\nGCD = 206695d52bc391a4db61bf8cb6ea96188333a9c78f477ee76976c2346dad682cf56ca6f176d86ef67d41ff5921b6162b0eca52359975872430dd14c45643eacdf028d830770714c033fd150669705851b2f02de932322d271d565d26768530c3f6cb84f0b3356f970b9070b26c050ead0417152c324c8ffe266d4e8b5b7bef3a\nA = 1114eb9f1a9d5947eb1399e57f5c980833489685023ed2fe537fe1276c1e026b9a19e6fff55aa889d6c4e977b6e6f3111e2ad463138637b50f42cf32e57d83f282de9e72f813e5969195159a666d74dcd689bd527c60199ae327f7bd548ac36868fea5fdf6f35d19b921e7c10b6448ca480de6826478cd0642d72f05af3f8e65ce42409fbd49f56e81946e89c8e83962c4edc0ed54600600a305e52d081aed3c351e450e11f8fb0ce5754c92cf765b71393b2b7a89c95df79b9ea1b3cb600862\nB = 1d8f3179ca7b5cc7119360c10de939ffa57c9043da2f2b0ca3009c9bdad9f19ed16e3c2c197bef4b527fa1bf2bbab98b77e26c329911db68bd63d3d0fbfc727a977395b9ad067106de3094d68e097830858c5ccfa505fc25e972bdee6f347e7d1163efacd3d29a791ec2a94ffeed467884ae04896efc5e7e5f43d8d76c147e3c9951a1999173bc4e5767d51268b92cc68487ba1295372143b538711e0a62bf0ac111cc750ca4dd6c318c9cbe106d7fc492261404b86a1ba728e2d25b1976dc42\nLCM = f9570211f694141bfb096560551080cbe02a80271b4505591aaea9e3b99ea1d5ac1c1f2378fd72799e117ac2a73381b1ad26314e39972164d93971479ee3ba21a4d98cef0bd299d540ce5826995dcee0de420dff73d30b23cbf3188c625c7696df517535bc5675d71faa00807efbebdca547933f4a37849d1c014484a77da6df0670c4974bcc91eb5f5fe5faf9dd095ef195ec32ad9eeebf0e63288b4032ed9e70b888afc642f4ff96f0b4c0a68787301c12e4527fe79bdfe72dd3844ab5e094a9295df6616f24d1b9eeebc2116177dacf91969dda73667bc421ef3ccd8d5c23dddc283f5d36568d31f2654926be67f78e181075bdc148f2b39c630b141ae8a\n\nGCD = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nA = 0\nB = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nLCM = 0\n\nGCD = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nA = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nB = 0\nLCM = 0\n\nGCD = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nA = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nB = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\nLCM = 3d319c42d872f21131ce5ff3ab8bec94339308e620316dda218e85fedcd511cd62f0b2f3448d5e58fd3520ae8118abd54ead9ad9e8ec3890365c6b2cca2172d4b8839b2d2c5ab02f65180826cb0cd5c9798f5d6261efe6e6ec31dea047da7c486b0590359e6f333557f67ceebf9ea9cd5dd986a999a8c88bdbd0ca21816b2423\n\nGCD = 2\nA = 14e95a85e59ade9ef39e2f400c65db18702fa5fc485b9bba479a5282b2206129160e54f73ef4917983c17b4c5ebff7be112a886de069706eee29ba902515cb038\nB = ddcfff1d39c90c599f55495bf71c1e7597c6b08b7430707f360c6a6e5137bbc7b403c6d9e2c34f3d2f29d5d32b869346853c2de239cc35381bdfb4a01569211a\nLCM = 90f38564ee72e55d362c04599e7d74f068c75f541b84e97abba2841f1a9f66b06b5c9009f6a4c2e319fced85270588de03ccebddbd9279aaecb13bdc1dbea7f42acaee751cb7da83779b8785cc86f41b94b13b54964208ca287d981634778d1096f20e76ca636c0717fd27e0800c43f599a5eded807421b502eaf9990a8c8ed8\n\nGCD = 4\nA = 3c719c1c363cdeb7b57c2aabb71f425da4c3e6d3e447204d555e7cf0f3d372bdda906f36078045044978dafc20171767c8b1464d52dfdf3e2ba8a4906da033a8\nB = 30fe0ef151ac51404e128c064d836b191921769dc02d9b09889ed40eb68d15bfdd2edea33580a1a4d7dcee918fefd5c776cbe80ca6131aa080d3989b5e77e1b24\nLCM = 2e4526157bbd765b0486d90bcd4728f890bc6dbd9a855c67ca5cb2d6b48f8e74e1d99485999e04b193afca58dbf282610185d6c0272007744ff26e00dbdc813929b47940b137dc56ba974da07d54a1c50ec4a5c2b26e83f47cf17f4ccce8c3687e8d1e91d7c491a599f3d057c73473723ce9eee52c20fe8ae1595447552a7ee8\n\nGCD = 10\nA = 44e04071d09119ea9783a53df35de4a989200133bb20280fdca6003d3ca63fdd9350ad1a1673d444d2f7c7be639824681643ec4f77535c626bd3ee8fa100e0bb0\nB = ca927a5a3124ce89accd6ac41a8441d352a5d42feb7f62687a5ebc0e181cc2679888ecc2d38516bdc3b3443550efccac81e53044ae9341ecace2598fe5ce67780\nLCM = 36805ba9b2412a0cb3fe4ed9bdabfa55515c9d615a3d0af268c45c5f6098d2de4a583f3791f1e3883c55d51ce23c5658fd0e8faa9a3709a1cfbd6a61dbab861690f27c86664f084c86cfd4a183b24aaadf59a6f8cbec04f1b0ded8a59b188cb46ae920052e3e099a570540dbc00f7d4a571eef08aa70d2d189a1804bf04e94a80\n\nGCD = 100\nA = 73725032b214a677687c811031555b0c51c1703f10d59b97a4d732b7feaec5726cb3882193419d3f057583b2bc02b297d76bb689977936febaae92638fdfc46a00\nB = 979f4c10f4dc60ad15068cedd62ff0ab293aeaa1d6935763aed41fe3e445de2e366e8661eadf345201529310f4b805c5800b99f351fddab95d7f313e3bb429d900\nLCM = 4460439b4be72f533e9c7232f7e99c48328b457969364c951868ceab56cb2cbbeda8be2e8e3cae45c0758048468b841fdb246b2086d19b59d17b389333166ab82ed785860620d53c44f7aaaff4625ee70fb8072df10fb4d1acb142eadc02978ff2bb07cea9f434e35424b3323a7bda3a1a57aa60c75e49ebb2f59fb653aa77da00\n\nGCD = 100000000\nA = f8b4f19e09f5862d79fb2931c4d616a1b8e0dd44781ca52902c8035166c8fca52d33a56ff484c365ec1257de7fa8ed2786163cfc051d5223b4aad859a049e8ba00000000\nB = 6e54cb41b454b080e68a2c3dd0fa79f516eb80239af2be8250ca9cd377ba501aabafc09146fad4402bdc7a49f2c3eec815e25f4c0a223f58e36709eefd92410500000000\nLCM = 6b3020a880ddeff9d17d3dc234da8771962de3322cd15ba7b1e4b1dd4a6a2a802a16c49653865c6fdf6c207cbe0940f8d81ef4cb0e159385fd709d515ee99d109ad9ad680031cbae4eab2ed62944babdade4e3036426", + "b18920022f737897c7d751dce98d626cdda761fec48ad87a377fb70f97a0a15aa3d10d865785719cc5a200000000\n", }; -static const size_t kLen37 = 909286; +static const size_t kLen37 = 909405; static const char *kData38[] = { "# This file contains multiples of the base point for various curves. The point\n# at infinity is represented as X = 0, Y = 0.\n#\n# This file is generated by make_ec_scalar_base_mult_tests.go\n\nCurve = P-224\n# N = -64\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c29fd\nX = d9174b3ca6b093dee706b10e1d90309aa58aebf6c9006a37f3716fde\nY = 5091be99fda790ff9e6ecd2ac66b734f157f46402bf194d3bd8c194d\n\nCurve = P-224\n# N = -63\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c29fe\nX = 2e74dd665404a8900c8e3d4f822b7a9b6dcb64940ef5f5671caba7ef\nY = f58bc45165c62d4c2c2ad7a8fb7e8f03322ce8ea5dc9c29f77625b14\n\nCurve = P-224\n# N = -62\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c29ff\nX = c671c49a40fdb37ee1afb59c55915461d0c4b2a67cbe4f1f0c747c97\nY = 467fdfe495f8d2f97b00b4f8b83abdf40dc6c1b666fc5edc29225ed6\n\nCurve = P-224\n# N = -61\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a00\nX = 2396b9ee84e06252585475f54b390553185c05702db27913a80911b8\nY = 5bb2feab11a9448a5a11ae2b51e4132f0da82d7866b1b971dd85edd2\n\nCurve = P-224\n# N = -60\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a01\nX = 8c64ebb538c109bbd60fd54cf7ff47216d30ecefbac0824c6e50b291\nY = bfd6736f43c5ebb33959c9ec4444f5ea6c86e645b03dbed955ae402b\n\nCurve = P-224\n# N = -59\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a02\nX = 79fb86be63eed9cf12d44df82123ac91042f888b91b1b916bd3c107e\nY = 4bac5537dc8a32199840b52e4c4002733b7941c69c711c8248e8e33e\n\nCurve = P-224\n# N = -58\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a03\nX = eb81ac109e13fe579100edba2dd5389945b3fdf247b4036b018acf60\nY = 778b905f5bd3254728b9105ad7e4c53794201298b40d5fd166a75467\n\nCurve = P-224\n# N = -57\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a04\nX = 868ef00d187fef3010c81e77e214a828b4f9227cf5761d7eed89d916\nY = dae0eef456786c9592faebd46cf44d711fe16fa66b63bf7e8f70d911\n\nCurve = P-224\n# N = -56\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a05\nX = 7cdfaa27e1972788b9891be32d4491c5a9f7187a05c7d40107b7f0fc\nY = 46bb23e1eed098c6ac43e6c7e6a48c9e1e9c8169ef82488581f3782a\n\nCurve = P-224\n# N = -55\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a06\nX = a3168f507cc5ca03ec9507ff1fbe5ca00f3a1410948250749639b32a\nY = 7d83b007949ca192bbd2a691c208fe5e0adacbee0d5bc807cfc44a9e\n\nCurve = P-224\n# N = -54\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a07\nX = e095d7363877c57e22ad1a708b7775ae804cceacecf2e2df16618035\nY = b58fa951b3d1ce053b38a7cb072e69f64d281efc8cc9f1f42bbfde5e\n\nCurve = P-224\n# N = -53\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a08\nX = df5d3ed85b75fb433d057198debdd036cd9f11f339a4d607eb424932\nY = a61a1c0ab289b7658439375678b7a2e99b0c292297dbedf22eb912e9\n\nCurve = P-224\n# N = -52\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a09\nX = 6e53e26a8b7b28a7c7a61dd4d53d509514edad71188245929589c788\nY = f85f23a7c85fd7efc006d3eb13480eb0f6f647fdea5b59d06366d558\n\nCurve = P-224\n# N = -51\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a0a\nX = 5b4ce687825f6a00f83cd3bbc77c67dc14d91bd78d4e47f7e2ce7b0f\nY = 6a86b2451d4be8409dec03799f680c806bc355e798591857fb8eddd6\n\nCurve = P-224\n# N = -50\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a0b\nX = bce605150a1d4d750c5a043fb4136726f99b4a41f35d3b3832ea583f\nY = 768e2427050ad575667f8784b7fe8c6b2ae7873a7ff11ded64a13b0c\n\nCurve = P-224\n# N = -49\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a0c\nX = f18721e462d2340c4a88e00130d86691386ba2a83d1fb1dc8b927cca\nY = b31f4d99a118d1c2c19f0815a89a921305d8d52005b64dd249b6a8e9\n\nCurve = P-224\n# N = -48\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a0d\nX = f087c8764bb082e669a8afbc5db571971898ccc2c5d4baf73cd35e9d\nY = 72edb9b8154237917e7a05581d1cb2048d4d31c4ab90d005c9b67e4a\n\nCurve = P-224\n# N = -47\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a0e\nX = eca965fd046c7fd242e29ba1a178b71b1ec6e7af6a5b88232a285c92\nY = 3e526a6b5ecbd24f9308de03fdb757a51a564ebc5872dbef7886cc7c\n\nCurve = P-224\n# N = -46\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a0f\nX = 71f8a2cdf405c7ee499dbd7216a07e5aa61b8faa4fd20b516d2761d4\nY = 7a3008d5e50050b0ab427b36d15de75c0c190f7eb0b6a130106354f7\n\nCurve = P-224\n# N = -45\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a10\nX = cc96733b052b2f04f1cebb4cb8afb448a21c09821d6288b86cb8a17a\nY = 159e86c0c38e8f7fc210036054941444c90054fd2047a4eb0dbdbc6e\n\nCurve = P-224\n# N = -44\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a11\nX = d20981b43d053ca0ca30994a5586e7f2342c479b07c6c367d0025900\nY = 572b87044e041001d988793e9ae35378f7b9121a0d7abc1941b7cf8d\n\nCurve = P-224\n# N = -43\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a12\nX = 2f9a6dce655ee5d9f00b398e756defe1499b98df1e2edac8a784ad75\nY = bd851fc17271dca923b803a4a4554a949bfc20f14f26feacc2649762\n\nCurve = P-224\n# N = -42\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a13\nX = 0a8b3acff07b4e49ed1d6cd0e8cebbb0ac9f5bc5ec7d65e0adf7b21c\nY = 6aea047a1d6c9ea9df67e58538a8c88be591728e6c0d1443063199a4\n\nCurve = P-224\n# N = -41\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a14\nX = c772baaa90a968d497e0adbf116453e4f8c21c0acbea0ee34502317c\nY = de20e75207355906ed957ac40260148fda74b9acf699fa06caf08a62\n\nCurve = P-224\n# N = -40\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a15\nX = 5e4cdfc6fc36ea0cd69a38a7485a317a0aeded6b5f6cd80072826385\nY = 14afef7672ca22afe13292524ab55dfeef828e7e1e6abd8aadb9f27f\n\nCurve = P-224\n# N = -39\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a16\nX = 9a89bcce6f9b400618997c1184c5099a154a07954cb15d5c9f4492ca\nY = f48eba6a110031e81a8e50a0c3e5c141e3a66d12ef040e2cd36c4fcd\n\nCurve = P-224\n# N = -38\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a17\nX = 68eee585a12332d41aef6f91a587bc3ca57329508fcc9f5bb3907516\nY = df09fa68ba98511870b892e5f59c02792aed884376ecc9b081641901\n\nCurve = P-224\n# N = -37\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a18\nX = 9810b8218ec461154d317a954df66f5f81e51dc07ed7421b17d0b8aa\nY = e166fda56ccb98bbfa8423bcacbcacc05ddac7e88ff0ce13c805a10a\n\nCurve = P-224\n# N = -36\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a19\nX = 6116976ec4511b1b9ee2b839378ff122c2bdb3f58823a82a68aef8e1\nY = 99b4990881ca11762f616528685fbf94eb1708fa1ae25f010d070beb\n\nCurve = P-224\n# N = -35\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a1a\nX = da200dcda742573ca097e34bb87b356b84541f765cf38d2bf07471b0\nY = ef05917f8f13fc686a8a0b6b544b0a1ed3488f1dff476a9a9c7cc19e\n\nCurve = P-224\n# N = -34\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a1b\nX = f8188c7623f76642286b8e9e4d4c5d58b8eaf7265b3b0e816076e7e4\nY = bc6fc80b788a058da4873e54acc733db09105a6775bfb3faa6c549af\n\nCurve = P-224\n# N = -33\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a1c\nX = 224c4a62c8b1028606603cce1d451409b23d680bb063a8e6875d3b5c\nY = ca97069c235efeb00a05729df91171d17605320950a1cea2e49fd119\n\nCurve = P-224\n# N = -32\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a1d\nX = b700a5c3bb6379de6caea37ff7a47ca909bec01a603c5ec5e1d1e794\nY = 39e4c2c2e0968ef8a7cd7cabbfd37d0d2335579e72145109b23ce46a\n\nCurve = P-224\n# N = -31\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a1e\nX = 0ecf1b60836e92b7af968bccd69ff8300d55a42b0e855a4ff3546eab\nY = 4bd76a3b0d1e95b063d22f890c68ebfd2327e3af12611c8f66bc1d21\n\nCurve = P-224\n# N = -30\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a1f\nX = 599b7e7e639bc335eb891295f0d8f4d8d8c76e588f0767741ab07558\nY = a5aa7d10418290c0f35d3e4fccd02e4b3bc48ac8a87ad052e4cdcc14\n\nCurve = P-224\n# N = -29\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a20\nX = f63f9d855262e9b691f9bb848c78859508a8c1e6fb3246212e146e5c\nY = f75d5db787bfb5cb199828b1040e7ccd9a20d198d9f82a81001cf9e4\n\nCurve = P-224\n# N = -28\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a21\nX = 1243a602d84f3ea7cf4a56f86ccb93395c1d609af98d6474d8e7afb1\nY = 42c598ef4d24cb1f640cafc463a244dc4a26c694bf7b4737c8c6ec7c\n\nCurve = P-224\n# N = -27\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a22\nX = 1989153b5f6636b610854bcc50afc929e914c03da51a4a8239f4865b\nY = 46c7e1923864a71fbbc324ff6e9b7c842baf5973e6e6d0ed9abd8695\n\nCurve = P-224\n# N = -26\nN = ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a23\nX = 263ed2217", @@ -2616,9 +2617,9 @@ "000000000000001000000000000000000000000\n\nTest = Negate\nA = 00000000003fffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffeffc00001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 00000000007fffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffeff800001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffeff000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0000000001ffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffefe000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0000000003ffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffefc000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffef8000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffef0000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 000000001fffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffee0000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 000000003fffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffec0000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffe80000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffe00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 00000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffd00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 00000003ffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffffb00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 00000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffff700000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = ffffffef00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0000001fffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = ffffffdf00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0000003fffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = ffffffbf00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = ffffff7f00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffeff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffdff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 000003ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffffbff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffff7ff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = ffffefff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 00001fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = ffffdfff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 00003fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = ffffbfff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 00007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = ffff7fff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffeffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffdffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0003ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fffbffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fff7ffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = ffefffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 001fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = ffdfffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 003fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = ffbfffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = ff7fffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = feffffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 01ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fdffffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = fbffffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = f7ffffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = efffffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = dfffffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = bfffffff00000001000000000000000000000001000000000000000000000000\n\nTest = Negate\nA = 7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nB = 7fffffff00000001000000000000000000000001000000000000000000000000\n\n\n# Montgomery multiplication tests.\n#\n# The following tests satisfy A * B * 2^-256 = Result (mod P).\n\nTest = MulMont\nA = e762f095431b732ce33c4f4a6f41068ff7f78e37aad940166667d193bfc58039\nB = a43df383dd5df14d7c16737b781261473f9ffb76ee29562fbb5e5d390b882fb5\nResult = cf637a47dc5fb82aed80ed4c66b682a94bf0b76a2878acf483aad86c0db7cc19\n\nTest = MulMont\nA = 2e519e860cb3f8f32fc351861b022e9fc7bb073ca8767efb3d1027dd32a38bcb\nB = 466d035e4238d6a30613dd227b0daeacd6a8634fa60f5150d42dd20601794be4\nResult = 486e1abe0f79e107f8beca6e4653872f63a24dedb005def6aae75a2a51e73c76\n\nTest = MulMont\nA = 1763859541b5e2edee019c66699d0e12e349e6ee586d618ac20c679d2fa8cadd\nB = 56125872de888c5656dec17fbf9678d915ff9815da897df81f03fd9aa4f93654\nResult = 71ce584135a0aba8222ca0021bcefac5811d19100627f96726cf195ff2ac4aad\n\nTest = MulMont\nA = ea3be6295098e4995b93267dbd58f24fd9c18f7e89e9e5aeafdc34ca54e8ec4e\nB = 2735658978d620a4f76bffe94d9cd7d683b3bfd533aa6bb2b94f52122e83f7fc\nResult = 362f7ab3a12effe9bad069b84a7df5f108503c2457f83ddb05b57f19e6457989\n\nTest = MulMont\nA = f607f087ec5015b533df8802771dc60ef1487d86ce405e5bb18f8f06ca483f13\nB = 73ac532eb3f2356a96e668f167a1626a0f7b1fd2cd84ba6deeebd01af1d3897d\nResult = ce7045e69da157e62fb42508880f5734531c36948c704aedec42afa75cb9c2eb\n\nTest = MulMont\nA = 80ce8eb07601fd8e19ba08a9d21081b0324fd459f9c489ac7c871d406133c813\nB = 7ad28cef45b137ecc5426a44b6bce6d4329f5bd2b5e55d46edd5fbb295678a1b\nResult = 04068f8461d17b34c8d9c3eecf61dbaef9cd5a952bbcd9f84bb2044f2439da60\n\nTest = MulMont\nA = 17429caf63689e143c8ca77df69a11cbc02c272daadd75a66f3fa5f88828367e\nB = 5725bedc56a4b16e0f0ae55fa0beb1fdf3ff132ccb9803bab678d4ac7915d88c\nResult = a1da0fa68947e906287ea164b213bc7e80649b2ac3f97f203549d3b270de05a1\n\nTest = MulMont\nA = e7da43c0", "e0fa7adeb972901bef3160c848e9651bfc810968afdb0cd598830370\nB = 08f03060cac1d3c15eea69623d5fb01da465b209e3e5e90fbb51053a1c5700eb\nResult = cda4ffaf8b1c3ac0d44bae6ea5154de11e14931747a65396531302c0cb1ed537\n\nTest = MulMont\nA = c7375c2b6666713cb33cfb741268fd3ccf703bcaa0b9b27f84a8cb970655da9c\nB = b0796ee4bb88b9bad895d9c25c34f43a3941e9585bda8e86ff4fa0bbb391ac61\nResult = fd1d557a9fb0031e462121bf7ca31804acfcfce822bb6ee6631b54c575380617\n\nTest = MulMont\nA = 72a87b13eb4a2e248214aa591c586df65790f9f750a1641b47581a4ee09be7e9\nB = 38e602844b9aaf737e8b1261110b86ba22806ccbbbfdc5305075429d7ce4f002\nResult = cb2d63ee829de8801759f0229d4c07139bacd804f0c815d35004747c65bffdf2\n\n# Test cases where A == B to test squaring.\n\nTest = MulMont\nA = 0000000000000000000000000000000000000000000000000000000000000000\nB = 0000000000000000000000000000000000000000000000000000000000000000\nResult = 0000000000000000000000000000000000000000000000000000000000000000\n\nTest = MulMont\nA = 579e9ce1ad00639b8b64d49546ff4f9c30ad12eaebe9e2ed91e97d55c3c5d847\nB = 579e9ce1ad00639b8b64d49546ff4f9c30ad12eaebe9e2ed91e97d55c3c5d847\nResult = 10c5e60c2d480d5d53f50c24fb771fd2dec208db04624dfd05d2847ca173a9aa\n\nTest = MulMont\nA = 501947209b121bcdedce8c895ee2ba310f2e561e97998eb8f3b99d1f924f36c1\nB = 501947209b121bcdedce8c895ee2ba310f2e561e97998eb8f3b99d1f924f36c1\nResult = 54d6d64566619b215910f1b9e467b22ef205ca3aaad37a00fcbd906357f9c179\n\nTest = MulMont\nA = e84ab9202722498baa2c9158f40d47b1f03df4d13976b0aec916a937e99f3a89\nB = e84ab9202722498baa2c9158f40d47b1f03df4d13976b0aec916a937e99f3a89\nResult = 9af01fa6947a60679b6f87efe9b6fba97baf5d55a19d5e91dd5da1da10caeebf\n\nTest = MulMont\nA = add67c61d8479570f45a59e9b04974f970b0c4c6c046056fea1bdf3f0e7d3152\nB = add67c61d8479570f45a59e9b04974f970b0c4c6c046056fea1bdf3f0e7d3152\nResult = c0c68b4327e3fe7e0522167a54b25aaa6f76085ce4f6550479c89f3f1c39dd18\n\nTest = MulMont\nA = 434ef0db5640a3ea63125f815bc3cb3c92d06dbc3b5cb484e01b5247b3b4bfe5\nB = 434ef0db5640a3ea63125f815bc3cb3c92d06dbc3b5cb484e01b5247b3b4bfe5\nResult = b5105d16b858279247ed31362a90260978d64e0492e84bffa7a0e13ee1541544\n\nTest = MulMont\nA = b1db42aa4b259d9c6104599aff622114f10c327d02c5640b74cf1742adff332d\nB = b1db42aa4b259d9c6104599aff622114f10c327d02c5640b74cf1742adff332d\nResult = 0c175e7f96fc62059864c561d99a8d90978c72757ba305cd8862ed6a5fadad59\n\nTest = MulMont\nA = 7610271796be25416b652badd3119938974b20d4fc92244aea76d23b80d178f0\nB = 7610271796be25416b652badd3119938974b20d4fc92244aea76d23b80d178f0\nResult = 67d76e4a7c8355bb362481a76a63b365ad79767cc672b174130e833d41ca5709\n\nTest = MulMont\nA = 3480d60b0ccafca89c86f22f78380cead81310241f27a815e6fd21c2060caed8\nB = 3480d60b0ccafca89c86f22f78380cead81310241f27a815e6fd21c2060caed8\nResult = 68bfb2652d3bf03d17b20b2c52c68e847b0006047ba4ea81d4b85af2e0a21f72\n\nTest = MulMont\nA = 8ad6fa8bf3fe56ece1d0970636c1429ed5dfc2441c3194928a6348b69490b537\nB = 8ad6fa8bf3fe56ece1d0970636c1429ed5dfc2441c3194928a6348b69490b537\nResult = f5cdccf29e09928722137fb5a5ec035d7f39580838e19b892a7a972866330318\n\nTest = MulMont\nA = 71c328ce472ae74b5028b21f9d1997e0f7dbcee979a8f9fdecfa5d37d359c835\nB = 71c328ce472ae74b5028b21f9d1997e0f7dbcee979a8f9fdecfa5d37d359c835\nResult = c3472fafd01fc3ed93a91ab65411cb852bd5839603a02ca6cdfbadcb9ac474a0\n\n\n# Montgomery conversion tests.\n#\n# The following tests satisfy A * 2^-256 = Result (mod P).\n\nTest = FromMont\nA = 0585a3dada9bb283fd8db4fc46c106d28f95b8cf159a405891196dbb9ce0b5cf\nResult = d198d054d25a069c40cdeeb968a5562a67c3ef659297169e4be872f234897dc0\n\nTest = FromMont\nA = 9ff49a4a3f810fd34ca6f37fb1b3c40e61bc0492227e91e41cbe06bd58ba65b8\nResult = 326a061b2047d9ba4eddaba9b1fe253d5b2a24e268e3f8810767bef8cda07643\n\nTest = FromMont\nA = 05a69f8f646494be65affbd44d0536ca098d6f3640e80b5e48764ab78928cf58\nResult = 5a6f9c7025d4063480c400fe6f271cf3a3d2c43f9e1ceac21a88208c28329731\n\nTest = FromMont\nA = 256481a9e52d692719330a6f1208d9eca4ddd919aee06e234cbbde77d245501b\nResult = fe9fc86a2ff61a0c981d5e86c5472248e071e9639521c5be43947bfffc7d5858\n\nTest = FromMont\nA = 2062ef333cadefc36ced52a2ea7e4215b1fca29283baa1e3be76e321f1b213f0\nResult = 961ce39c3bf1d699b4b61ded8a5beae6eb6185d21f1df435b079b1f6a79dc738\n\nTest = FromMont\nA = 97241c3651a8f9d2fc02730f15c3e09e48d2e645cfe927385cb81d3f454414fb\nResult = 2114225803efe7b6c7fbb290cb946da4e78697aad5624c2d3fe9fb568460b93c\n\nTest = FromMont\nA = 1aae0ad2c8ac988e11beda32ca7257f4d4de41f4b74452fa46f0a3bafb39262a\nResult = 77c884131c34a2c3acce8a69dc5cf55987b7999c70586a9ef3c0dfb634900296\n\nTest = FromMont\nA = 034de033e2d38cf8bec8a994414b64a2fce7c83c5d81efc3d21448225071e85d\nResult = 984fecbde84f393133fb602777b4395c56449d2cbbd7d8ae428b2ee6f82a2956\n\nTest = FromMont\nA = d2b296c2004b2761b6781311c924cbf5ff56dcc0900ed5cd24f5dd2e07f32633\nResult = ddcff6e031b859a814ce8f37b71c10cd5fb642af54af72deabb95adcb99307b1\n\nTest = FromMont\nA = 8f525e6af50a62fc176dec75bdf48f70ba8ab97323ba78c643ef07f6457ba070\nResult = 8fa95d57aae2fff79045654501478f7a394b27b8b54113a25ac74662606f767c\n\n\n# Point adding tests.\n#\n# The following tests satisfy Result = A + B, where Result is in affine\n# coordinates and A and B are in Jacobian coordinates in the Montgomery domain.\n\n# \xe2\x88\x9e + \xe2\x88\x9e = \xe2\x88\x9e.\nTest = PointAdd\nA.X = 0000000000000000000000000000000000000000000000000000000000000000\nA.Y = 0000000000000000000000000000000000000000000000000000000000000000\nA.Z = 0000000000000000000000000000000000000000000000000000000000000000\nB.X = 0000000000000000000000000000000000000000000000000000000000000000\nB.Y = 0000000000000000000000000000000000000000000000000000000000000000\nB.Z = 0000000000000000000000000000000000000000000000000000000000000000\nResult.X = 0000000000000000000000000000000000000000000000000000000000000000\nResult.Y = 0000000000000000000000000000000000000000000000000000000000000000\n\n# \xe2\x88\x9e + \xe2\x88\x9e = \xe2\x88\x9e, with an alternate representation of \xe2\x88\x9e.\nTest = PointAdd\nA.X = 2b11cb945c8cf152ffa4c9c2b1c965b019b35d0b7626919ef0ae6cb9d232f8af\nA.Y = 6d333da42e30f7011245b6281015ded14e0f100968e758a1b6c3c083afc14ea0\nA.Z = 0000000000000000000000000000000000000000000000000000000000000000\nB.X = 2b11cb945c8cf152ffa4c9c2b1c965b019b35d0b7626919ef0ae6cb9d232f8af\nB.Y = 6d333da42e30f7011245b6281015ded14e0f100968e758a1b6c3c083afc14ea0\nB.Z = 0000000000000000000000000000000000000000000000000000000000000000\nResult.X = 0000000000000000000000000000000000000000000000000000000000000000\nResult.Y = 0000000000000000000000000000000000000000000000000000000000000000\n\n# g + \xe2\x88\x9e = g.\nTest = PointAdd\nA.X = 18905f76a53755c679fb732b7762251075ba95fc5fedb60179e730d418a9143c\nA.Y = 8571ff1825885d85d2e88688dd21f3258b4ab8e4ba19e45cddf25357ce95560a\nA.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nB.X = 0000000000000000000000000000000000000000000000000000000000000000\nB.Y = 0000000000000000000000000000000000000000000000000000000000000000\nB.Z = 0000000000000000000000000000000000000000000000000000000000000000\nResult.X = 18905f76a53755c679fb732b7762251075ba95fc5fedb60179e730d418a9143c\nResult.Y = 8571ff1825885d85d2e88688dd21f3258b4ab8e4ba19e45cddf25357ce95560a\n\n# g + \xe2\x88\x9e = g, with an alternate representation of \xe2\x88\x9e.\nTest = PointAdd\nA.X = 18905f76a53755c679fb732b7762251075ba95fc5fedb60179e730d418a9143c\nA.Y = 8571ff1825885d85d2e88688dd21f3258b4ab8e4ba19e45cddf25357ce95560a\nA.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nB.X = 2b11cb945c8cf152ffa4c9c2b1c965b019b35d0b7626919ef0ae6cb9d232f8af\nB.Y = 6d333da42e30f7011245b6281015ded14e0f100968e758a1b6c3c083afc14ea0\nB.Z = 0000000000000000000000000000000000000000000000000000000000000000\nResult.X = 18905f76a53755c679fb732b7762251075ba95fc5fedb60179e730d418a9143c\nResult.Y = 8571ff1825885d85d2e88688dd21f3258b4ab8e4ba19e45cddf25357ce95560a\n\n# g + -g = \xe2\x88\x9e.\nTest = PointAdd\nA.X = 18905f76a53755c679fb732b7762251075ba95fc5fedb60179e730d418a9143c\nA.Y = 8571ff1825885d85d2e88688dd21f3258b4ab8e4ba19e45cddf25357ce95560a\nA.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nB.X = 18905f76a53755c679fb732b7762251075ba95fc5fedb60179e730d418a9143c\nB.Y = 7a8e00e6da77a27b2d17797722de0cda74b5471c45e61ba3220daca8316aa9f5\nB.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nResult.X = 0000000000000000000000000000000000000000000000000000000000000000\nResult.Y = 00000000000000000000000000000000000", "00000000000000000000000000000\n\nTest = PointAdd\nA.X = bcba3eebf2b0af1174a4b874b155b4dc74bd5fb57c70214561aaabb105635580\nA.Y = 1dc33ce74f651305dd89263c1d314edd2773ef6dd043742a6f47f29542b9eb07\nA.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nB.X = f9e0b98b1a87b6c49c4cc5fc47efd157e5f12cf5543d71cfa38187a3793d6791\nB.Y = 3b2de94df438554381037c9f9d2c21991c6975d83c0acd42ef1a8419a040436f\nB.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nResult.X = 6bd7b4e06d7862f749901a398417e941618c11c48dffcce719e4026220b77477\nResult.Y = 1e2ffd71e8c206acc19032d26a53ea275fefea51a2c90e4dd3c8b7c6acc51ab6\n\nTest = PointAdd\nA.X = d71c6da129f6e867bf525563e1d8bdbd2f90a9bac7de867a6ea2317a5d6cb507\nA.Y = 125e0cc1ba0c93caa19edb419a764f88d955289c4c6e77d02d90e4e31d47c9a2\nA.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nB.X = 334c2200ec08896808ab12a76820ff674fcdccff6d85afa2e586b31fc944de33\nB.Y = b5ee8cfa25896d4075588c60926a2582a099c7a5acbcfec78fba457c4886301c\nB.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nResult.X = 93e9d4e6f7736f80da1b00d221024ccfd17f2927d6b505a5bcefe0801fe6f0a9\nResult.Y = 4824eeb2d5da27d57e1d50c2dae000acdcddcbaf534d8b7e7d97854ed3dc939e\n\nTest = PointAdd\nA.X = 0daba41be2b418e7d160a363e6cbdcbff5d433f96b0d5be3812c0a7adfab8ed4\nA.Y = 3ae4dd97c4d2987a63df16c5fb8c494164e14b93eeebd5585d74bd26e2201499\nA.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nB.X = 87135fb06383ec8b282fdc028eb38fd447ac1ecc76922e37f0cc454febb11aee\nB.Y = 98ab966087531eb3eea1e5e36189271a02f7ee8e381f9c78d6f346a301f96f81\nB.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nResult.X = 2e096c2fabf06a5b838c7e07fda436d068dd1c4e3ff4f5704f89ab9df6b4be5b\nResult.Y = 59ca6304321ae1e41bfa30f52e7ef27fceeade8507f20837654383d70e8a41df\n\nTest = PointAdd\nA.X = 356db98c21c2169899b9b296edcacb7d531524f2572913b75edb7b73196f5682\nA.Y = 47a26c52b1b2f229109e8aca7f5b4af768baf053a15ff8f58051c7e4e1b7f818\nA.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nB.X = 56956f6d3bbbd4aece299f29bb4c537355f312f391c207c6ec6efe646362b288\nB.Y = a69fc73c0636c9928764cc9d6e1482577b6ca06f277c098f571108356a858cab\nB.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nResult.X = ca0ddd995a77173a1438473bf82734cb3a09fafe7050bda9bd592a1cf078fa38\nResult.Y = 379da87952d36c5396b934a2ce8b003ee8fc4155b3b488f2f550734e2a82ce7d\n\nTest = PointAdd\nA.X = 13764cccab4addf5cf4ef5fb4af60a93e08fa3a0a72653abf013e3427abbf82c\nA.Y = c3dc524745368a0dc4948f897402f4b5a280acbf74f5ea9180d038a483d4090a\nA.Z = 2903a04d6615ec23cd63ba46287be2e7a8eeee030bed49e7a94769386a46f209\nB.X = a5c5921f9a8c569f661693bfae1b167937987c2fe951956ef0e34c426965c648\nB.Y = f8a299605e690a78e583371e59cf2b848d475afc35bb1448981c53ad8c0a6581\nB.Z = 9c3fde73f1899a76eb40f055fce02ab9c1b1ce7d43b54c54f93ffe56830e3f83\nResult.X = 4073318e85bc2d7637fd0129fa8eb86b6ca20334542795f3bb1de54b90a16b69\nResult.Y = 9a1b1e7435d98287b244d2337f8bf0e9c87b40677bf1ea2a9dedbd07c5241ee0\n\nTest = PointAdd\nA.X = f72706b81fca2b1530238bdc2c0c454b5116ee54fdf156bc62bffea73f0645af\nA.Y = c6e66d9ae8fc5e164e6a985f866aae41f3c4e4281a0eea9173e4e77cb29e4bc7\nA.Z = 6a84f9c37634b8aefdae477e9efec66f20d2f6159575f40c7b21a1e0732e8c49\nB.X = bcf21b020cb8fb4b2ef7f639240d221dd96fc08d7fa575c2e7037fc84d8f03b2\nB.Y = abc500f82f06f0d69a920c8d80eef9dd2310cd09e0d89d80fc7397aa4e361dd1\nB.Z = 5031c46be15f9d4fa9a347be998c07f9cc7f754999fe0f9c3c8b38e0d85dda9f\nResult.X = 401b010df4dd21ed96f7c8babb401db74b3b6ee7f55c498803203855b5911de9\nResult.Y = 05e585cca569bc22855f7df32b20a4a45315a1ca5d98d2b94792eb748ec8744b\n\nTest = PointAdd\nA.X = 7b44b52e9fb1bc58c81a2adc9bfedcc42bba3cb34ec666e51cba8050d48fdb37\nA.Y = 2b7e629fef7b4e175f5eb30c421e60f26fefdf5f9fed743cad4a8e638c18696a\nA.Z = 68f31acd92bed56a4556e954b0c51f9f8f3b797bc853d1b2b01b228657bd317f\nB.X = 3d293c36fd065d1f054eb218932d60feb00d1bd4bee0236cb9788d9723df9571\nB.Y = c8b893b8e9ff935f2e060227334e32ba144f4046b1bd4961f4479ad3fef1c7d2\nB.Z = 9c072deacfe5c025c763efebb4feab79e954c47d3e86ef4abfbd1901f50d8495\nResult.X = 245582d32415c77a2e3abbf844cf1a40c31466c1418cd279747e5394744509be\nResult.Y = 5c2f80f947d2df7fb1f829d05c6175f6fce7cd2d7f79fd7aa865f930e910e9fd\n\nTest = PointAdd\nA.X = 75ab91b8a46a5a1abf827cb209373b28cbb8f83a06adf6a9b10ac76e22493ecc\nA.Y = abd989a78d1bcee7e63920d7e637f9763901da408a9d8c731e4e65a6fc52e1a1\nA.Z = 188a24145243ca066c35870e5a8835532ad512fbdcf5f5ae4033b262fa9aa6b8\nB.X = 5d6e885ec19069b2aa51a2723c98da1f03e8dbc344fe1de0bdb42910ba8bfe96\nB.Y = a1f86e66eacc38db7e47154a324a16031705b4803addf074037d3320b50dbef8\nB.Z = 5cff900a783687049a7d497b1f8cd837c479a61f3fef4b7ced180ea82770bc75\nResult.X = a4029333b9b9db434eea002bd6d4e0d9f3e5317c685511a30ecae351fc60d164\nResult.Y = 8e9302c77bc6f560c9bec473ef1ffb76b357c0d4794192696bda8e99651798ee\n\nTest = PointAdd\nA.X = 8d1867f890abaa26b634d5d5cdeb0f4abc7ebd16d807479f837fcece592dc0eb\nA.Y = fc68c801999c12070eddeb3169219c491f9e8fe29cdc4e3cb698ee8471934076\nA.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nB.X = 8d1867f890abaa26b634d5d5cdeb0f4abc7ebd16d807479f837fcece592dc0eb\nB.Y = fc68c801999c12070eddeb3169219c491f9e8fe29cdc4e3cb698ee8471934076\nB.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nResult.X = 8da53dc540c1450c73082ad3b799d0d18a69a747fcd81f847e9e60484dcf579a\nResult.Y = c20c398e99e0513a452b5e9b6331863d1ac3eee6fcf73021f505a0b62daf6f80\n\nTest = PointAdd\nA.X = 328b983f6490312e37e8eeb2121cd622cf85dbcf78af93df74fbca961ce3bfa2\nA.Y = 1c8a0aea2f2e540770644f48c41810bf7f9e1a782b2f6397712b17c88109fbce\nA.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nB.X = 328b983f6490312e37e8eeb2121cd622cf85dbcf78af93df74fbca961ce3bfa2\nB.Y = 1c8a0aea2f2e540770644f48c41810bf7f9e1a782b2f6397712b17c88109fbce\nB.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nResult.X = b6f3c548944862dfdea2314ca6d6a88780b08da41becf58384af80544aca4966\nResult.Y = 95afecb4ad3195485a2aad3cd14008c9a7c1e0c02656c3c2b7cd5f2e7f3a4474\n\nTest = PointAdd\nA.X = 3ae6b24cadd6a14612d24a1c094a35c6be56db8f53a6d526e0ede03923918443\nA.Y = de8a23105c5f5c88b77dbde74e30a56f8865d78a5ce9060cff9f2927dbd196b6\nA.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nB.X = 3ae6b24cadd6a14612d24a1c094a35c6be56db8f53a6d526e0ede03923918443\nB.Y = de8a23105c5f5c88b77dbde74e30a56f8865d78a5ce9060cff9f2927dbd196b6\nB.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nResult.X = 6f125b512c3c736f39781fcd89adb653e515b4ce1e1204505f08d0a8480052ef\nResult.Y = e1acfccf1b9950067adf0f06e0d9703a8b1ac1bbdbb35b08df28cd56c24ae5a0\n\nTest = PointAdd\nA.X = f317c6c02d9a6ff0799b3b4a22f83c95324831baad336ecd0c631ea04a5e11c8\nA.Y = b624e8057d411031f41b30cd02f56c24e89262e885007b7a1ed1861feb7ffcda\nA.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nB.X = f317c6c02d9a6ff0799b3b4a22f83c95324831baad336ecd0c631ea04a5e11c8\nB.Y = b624e8057d411031f41b30cd02f56c24e89262e885007b7a1ed1861feb7ffcda\nB.Z = 00000000fffffffeffffffffffffffffffffffff000000000000000000000001\nResult.X = e805208c74602e54482d113f16fcf6e4600436f8af49705cdd05ecfb0e6d45fd\nResult.Y = baded898bfead1b4eb3ab3bbd0129837efc85823dabe82718a975bd603f96d9e\n\nTest = PointAdd\nA.X = 3a6802aeaebc67046a1e75152822fa8bab04c11ae2b816f42c073daee3f13274\nA.Y = d6522c882d18e32bc5ea1fa59efbce8ce2369f2154dcc00e6fb17500f50f8ebf\nA.Z = bea747d5bb1c6ee865249d7a22378f3c760916e163497f4b6ef4da8adcb5dfab\nB.X = 3a6802aeaebc67046a1e75152822fa8bab04c11ae2b816f42c073daee3f13274\nB.Y = d6522c882d18e32bc5ea1fa59efbce8ce2369f2154dcc00e6fb17500f50f8ebf\nB.Z = bea747d5bb1c6ee865249d7a22378f3c760916e163497f4b6ef4da8adcb5dfab\nResult.X = 5a2891dca746889d413d8dc1a69b715954baf692689fc32d9aa10b7431a5c149\nResult.Y = 91db7288536b4f6d78e5a787ecbb5094f6834515038cb070a7fa4870af8045f0\n\nTest = PointAdd\nA.X = c76ddbcb15bc63f82807804536a0d25fd7a639c71adf953ad6cc8f68d915f485\nA.Y = e3a4f830809f5e91b68699c05fa9faa7c3d1f9d1b1c982c282508fa18d695537\nA.Z = eb372f19c7b9466a116363ad9114a89ad287523da318d915f59ed5e558bd824e\nB.X = c76ddbcb15bc63f82807804536a0d25fd7a639c71adf953ad6cc8f68d915f485\nB.Y = e3a4f830809f5e91b68699c05fa9faa7c3d1f9d1b1c982c282508fa18d695537\nB.Z = eb372f19c7b9466a116363ad9114a89ad287523da318d915f", - "59ed5e558bd824e\nResult.X = c5485a3509f55c7cc33d098fb0bfe1b198a9f26ce0ebc29bec5baa29ef6f74a2\nResult.Y = 60e949a551aa94afc9a3efe411a3c63ecb851ef1738ed24c88f86cf85ec01020\n\nTest = PointAdd\nA.X = ca72936509631f09d2a3ac14fb786daabb15520ef01de4298c7fd71653e89194\nA.Y = 02aeb6b6f04cd8125887baa18e6e79ba2b0acfa9a2443e9eea36ca7715eb8eb3\nA.Z = 8b4ef1a52fa42c711445e0463003f2ed38ace6583bf08198e9a0b938b4589479\nB.X = ca72936509631f09d2a3ac14fb786daabb15520ef01de4298c7fd71653e89194\nB.Y = 02aeb6b6f04cd8125887baa18e6e79ba2b0acfa9a2443e9eea36ca7715eb8eb3\nB.Z = 8b4ef1a52fa42c711445e0463003f2ed38ace6583bf08198e9a0b938b4589479\nResult.X = 8d3b35c5661faafa83510ab9b3f1642bb121e7686ed4ae61323ddee2c7247f93\nResult.Y = 1a22ef5df156ca80235fe3cd1ca3152e21a3e17b2a34dd93b2003e3274a8a2fb\n\nTest = PointAdd\nA.X = db7b023fbe056819027fa09c5a2a0d777a53fb78c00bf4f31f46b63a7494bbfe\nA.Y = 59affcbf4628d572ee56b95087d30e765bb518b123e879b25df9960dab706a32\nA.Z = 1f7c7226d78e51478c683bbb6afe01abc2225dbfc773d0806d30ff5f827b76c8\nB.X = db7b023fbe056819027fa09c5a2a0d777a53fb78c00bf4f31f46b63a7494bbfe\nB.Y = 59affcbf4628d572ee56b95087d30e765bb518b123e879b25df9960dab706a32\nB.Z = 1f7c7226d78e51478c683bbb6afe01abc2225dbfc773d0806d30ff5f827b76c8\nResult.X = fba400ae656ec3103c5c5f531d2a0f7368031e01a48a91f1a4f3138d294b13be\nResult.Y = 160e358ad1f059eb62722df01a7440048a1db21ecaea8698efa9677db6e9ff97\n", + "59ed5e558bd824e\nResult.X = c5485a3509f55c7cc33d098fb0bfe1b198a9f26ce0ebc29bec5baa29ef6f74a2\nResult.Y = 60e949a551aa94afc9a3efe411a3c63ecb851ef1738ed24c88f86cf85ec01020\n\nTest = PointAdd\nA.X = ca72936509631f09d2a3ac14fb786daabb15520ef01de4298c7fd71653e89194\nA.Y = 02aeb6b6f04cd8125887baa18e6e79ba2b0acfa9a2443e9eea36ca7715eb8eb3\nA.Z = 8b4ef1a52fa42c711445e0463003f2ed38ace6583bf08198e9a0b938b4589479\nB.X = ca72936509631f09d2a3ac14fb786daabb15520ef01de4298c7fd71653e89194\nB.Y = 02aeb6b6f04cd8125887baa18e6e79ba2b0acfa9a2443e9eea36ca7715eb8eb3\nB.Z = 8b4ef1a52fa42c711445e0463003f2ed38ace6583bf08198e9a0b938b4589479\nResult.X = 8d3b35c5661faafa83510ab9b3f1642bb121e7686ed4ae61323ddee2c7247f93\nResult.Y = 1a22ef5df156ca80235fe3cd1ca3152e21a3e17b2a34dd93b2003e3274a8a2fb\n\nTest = PointAdd\nA.X = db7b023fbe056819027fa09c5a2a0d777a53fb78c00bf4f31f46b63a7494bbfe\nA.Y = 59affcbf4628d572ee56b95087d30e765bb518b123e879b25df9960dab706a32\nA.Z = 1f7c7226d78e51478c683bbb6afe01abc2225dbfc773d0806d30ff5f827b76c8\nB.X = db7b023fbe056819027fa09c5a2a0d777a53fb78c00bf4f31f46b63a7494bbfe\nB.Y = 59affcbf4628d572ee56b95087d30e765bb518b123e879b25df9960dab706a32\nB.Z = 1f7c7226d78e51478c683bbb6afe01abc2225dbfc773d0806d30ff5f827b76c8\nResult.X = fba400ae656ec3103c5c5f531d2a0f7368031e01a48a91f1a4f3138d294b13be\nResult.Y = 160e358ad1f059eb62722df01a7440048a1db21ecaea8698efa9677db6e9ff97\n\n\n# Scalar montgomery multiplication tests.\n#\n# The following tests satisfy A * B * 2^-256 = Result (mod N).\n\nTest = OrdMulMont\nA = 0000000000000000000000000000000000000000000000000000000000000000\nB = b4e9b0aea84aa5ed86964a22881a4d0e58f88e9225f30990c18751e7d4b9ec95\nResult = 0000000000000000000000000000000000000000000000000000000000000000\n\nTest = OrdMulMont\nA = 00000000ffffffff00000000000000004319055258e8617b0c46353d039cdaaf\nB = 5d24e62244973fbd829573d5a579b4e89a6512933a2c3d255bbdbc1c89028323\nResult = 5d24e62244973fbd829573d5a579b4e89a6512933a2c3d255bbdbc1c89028323\n\nTest = OrdMulMont\nA = ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550\nB = abafdc695e4c2c850f8fc60f1efdbf7406a3cd2c6c59bb7e608985723896c187\nResult = 917b1214c7b31a7ee7e53be0b41a139e435ff576b51ec6af1e1a944412bea38b\n\nTest = OrdMulMont\nA = cf0f01b83670a1c79154ea16f3574ca2d4c688a3c3b6017795cbe54854418904\nB = c5ec4d3b00fb2e11fb3b1aa09e60f7d187f7c515977d1343dab9745961fcbb43\nResult = 7aaddcee32e3b340af5ad06f854284cbbce5a1ab919e9b7771c3b0e937093438\n\nTest = OrdMulMont\nA = 50023f9913879ac4020bc45a89a0ea89082db6265b96b851af29969dd8a9661c\nB = 7c165b1cba80808db114441563aa0fbfba41b9e8acff77312a2dd2138b74ef89\nResult = 3d2ca1705d8d38cbc76a5409c6535044733cafcb95d12654af1d14de177978b5\n\nTest = OrdMulMont\nA = 4d5341ea735e53d2e4f2934755642adee209bd0e5a1506206513227f3c48b270\nB = 6e48f2b60eb8fb86760134abaf3d61692557862924069c599ceb31309ea18704\nResult = 37cde3e35c814d4287bd345b910d687983929907b7a08afa2acd8596832ea86c\n\nTest = OrdMulMont\nA = 33d06c3f5a595a41a6f9c4356f8ab2b8c550d4c64b806eab5560af247c5fa9ed\nB = 0e52f34adf5754343bcf3529d652620da3c05b5dd9cdcddfb08b674a1ad21a09\nResult = 9dc64d7b4c1bc33b930e0daee2a24fc41f770378659ee71b846d2239b0fea8ea\n\nTest = OrdMulMont\nA = 8f211780cce4f93b7193b9378e6f83e1147fb3602b052eef782de8cc833e54ab\nB = e1e4f7f1feb15be64292cff86b47cd9730bcb15b133340022b824d591a660cdf\nResult = dfa2b683b1ae23027c7c109e0abb40a1366eda027ad2cad1a09061a57bee391f\n\nTest = OrdMulMont\nA = 803c279c7e4c11a5568290c0a5789ceab6860f51a942bf646501a45e1ec0a6bf\nB = c0a1145a12037129c571f5f939bf16ea0b8b480f08ec774c045d059841f7d5ed\nResult = ab48fa3b4aa692a7c077cc55ee3c3fff895118a23728c2fa5f361b30730d955a\n\nTest = OrdMulMont\nA = 0e5c95158297d75dbf0b02c3090730f65bf14704495b14837dd907af569407f1\nB = 5a03e3787c8772b2fb7ab07d7fe7fe653a58bdae7fde3174c6ed305e524f5728\nResult = 71296d305dcf9ce39010ea4f4bbf9f7c1064a413597bdc7574c13dea3fa514dc\n\nTest = OrdMulMont\nA = 366299be07886f7846fc74231db624b169360e3c8f60196a1afc9f2101e03922\nB = d6d7c830a6edb6861868b964519a6b68f6f24f7c09d66003f3f88eadd1e00158\nResult = 0b89596bf5054ebe95a39dab6e975b58190160610b09b2a4f93331ecc0e79fd3\n\nTest = OrdMulMont\nA = 8f36f0ef275a72192c3b7388e84df2b8acf66fc53aaf556e3be05c76b3f782c0\nB = 704e519363d44e8df8d91f5f347eb61e8d3e85c8fc1b82980c370a379b2bc81c\nResult = b70a392e3ce5e85b5efbbded9b8c16a3068ba9b93b4cbed9a9a71dffaad6b58a\n\nTest = OrdMulMont\nA = bf4466ef4dea9f06f0f3b4f14e01140a774262c7e0706584f4d7dac19be46d58\nB = 4af12d528b2cef0f6714961bca2ab682f8abaa97600ea8181f71563d56f8a9f5\nResult = 7b6827c0881b9846e32499e13277efb07917cf4b8c8c72bfb3daa8c1786a8e15\n\n\n# Test cases where A == B to test squaring.\n\nTest = OrdMulMont\nA = 0000000000000000000000000000000000000000000000000000000000000000\nB = 0000000000000000000000000000000000000000000000000000000000000000\nResult = 0000000000000000000000000000000000000000000000000000000000000000\n\nTest = OrdMulMont\nA = 00000000ffffffff00000000000000004319055258e8617b0c46353d039cdaaf\nB = 00000000ffffffff00000000000000004319055258e8617b0c46353d039cdaaf\nResult = 00000000ffffffff00000000000000004319055258e8617b0c46353d039cdaaf\n\nTest = OrdMulMont\nA = ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550\nB = ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550\nResult = 60d066334905c1e907f8b6041e607725badef3e243566fafce1bc8f79c197c79\n\nTest = OrdMulMont\nA = da43b8dd7fe8830a4fe8980ec585ccbe903a2965a695cdff398200b74b2ede41\nB = da43b8dd7fe8830a4fe8980ec585ccbe903a2965a695cdff398200b74b2ede41\nResult = 5ec68604412205b380e26ee4e4081eccc10ac7d1417b09cd534f8517b0de81ec\n\nTest = OrdMulMont\nA = a82a2b8bdbf8a37dc7cb5799691494a8c9fbf649686a4d250dc30697feb0fa47\nB = a82a2b8bdbf8a37dc7cb5799691494a8c9fbf649686a4d250dc30697feb0fa47\nResult = 552c094a8841621d6cc26b3b54ce5da5664283888445196a6433d3cfdcad3aee\n\nTest = OrdMulMont\nA = d785006e250410d9dcc6d7740795a7374c25b00b9c9a37b8285694a07307eacd\nB = d785006e250410d9dcc6d7740795a7374c25b00b9c9a37b8285694a07307eacd\nResult = 971aaa9e70ad082cf43725f2e65bc73f4bf762459cee13167545072ec7bdcaf8\n\nTest = OrdMulMont\nA = 69d6d9f5417e87d603a3fb6acafa0d1f974abf94ca57ce58d718a0ad5d02a496\nB = 69d6d9f5417e87d603a3fb6acafa0d1f974abf94ca57ce58d718a0ad5d02a496\nResult = eb3284e5799fbe93171f08e6de9f792cd17f036b3a17671b0310e49b48e589b3\n\nTest = OrdMulMont\nA = 1c28f742c3e26e74901d0425f2eb4d5272524668d2405875b32cf6433f212900\nB = 1c28f742c3e26e74901d0425f2eb4d5272524668d2405875b32cf6433f212900\nResult = 74f70a95399b7ad061a2200fa50528d68eee4654341c8158101e1e3f8f16e642\n\nTest = OrdMulMont\nA = 026b2f69f0259d221920b2f358b378a79826f0332ee36afa257765043e3d6732\nB = 026b2f69f0259d221920b2f358b378a79826f0332ee36afa257765043e3d6732\nResult = e1e9cfa4724995bb50971ca22f3c028cd31cb51fbef8a37c31f10fd1d468f13b\n\nTest = OrdMulMont\nA = 376ed4fadcc1c6c4160a0c9c2ab7c62260367968b08d304d47c65f25625d7d60\nB = 376ed4fadcc1c6c4160a0c9c2ab7c62260367968b08d304d47c65f25625d7d60\nResult = b9ccb67f377e1278f1d2eeda26e5eed76f32406c9deed9764fc0aa346d91e02b\n\nTest = OrdMulMont\nA = 50f66867d0a4ef389678d760d2a4db886583b4c068d0e240f7ddf3472c871304\nB = 50f66867d0a4ef389678d760d2a4db886583b4c068d0e240f7ddf3472c871304\nResult = 82c3467bc5f7ca8b45f4ee61546745e2f53755a02e87f65f572418d60e471c8b\n\nTest = OrdMulMont\nA = 5b8bd82b37206d2b727f19ad2d02f63773470074dde7d43d2a77c448ddf2f978\nB = 5b8bd82b37206d2b727f19ad2d02f63773470074dde7d43d2a77c448ddf2f978\nResult = dbf3c2fc67a0688c3b5ff12cab1739d50b6093c5d98943d388652b1207e4a0f2\n\nTest = OrdMulMont\nA = bed7b3a4dada0e16984eb59ee239005ab212e5b1772cdd5d240c8ee268f65c81\nB = bed7b3a4dada0e16984eb59ee239005ab212e5b1772cdd5d240c8ee268f65c81\nResult = 9232aa2759ca9c5efbaefb0cf45cc6bc9c89def8c25e5c169fe623f30787df36\n", }; -static const size_t kLen39 = 58702; +static const size_t kLen39 = 64863; static const char *kData40[] = { "# Tests from NIST CAVP 186-4 ECDSA2VS Test Vectors, Signature Generation Test\n# http://csrc.nist.gov/groups/STM/cavp/documents/dss/186-3ecdsatestvectors.zip\n#\n# NIST's files provide message and digest pairs. Since this is a low-level test,\n# the digests have been extracted. P-521 test vectors were fixed to have the\n# right number of leading zeros.\n\nCurve = P-224\nPrivate = 16797b5c0c7ed5461e2ff1b88e6eafa03c0f46bf072000dfc830d615\nX = 605495756e6e88f1d07ae5f98787af9b4da8a641d1a9492a12174eab\nY = f5cc733b17decc806ef1df861a42505d0af9ef7c3df3959b8dfc6669\nDigest = 07eb2a50bf70eee87467600614a490e7600437d077ec651a27e65e67\nK = d9a5a7328117f48b4b8dd8c17dae722e756b3ff64bd29a527137eec0\nR = 2fc2cff8cdd4866b1d74e45b07d333af46b7af0888049d0fdbc7b0d6\nS = 8d9cc4c8ea93e0fd9d6431b9a1fd99b88f281793396321b11dac41eb\n\nCurve = P-224\nPrivate = cf020a1ff36c28511191482ed1e5259c60d383606c581948c3fbe2c5\nX = fa21f85b99d3dc18c6d53351fbcb1e2d029c00fa7d1663a3dd94695e\nY = e9e79578f8988b168edff1a8b34a5ed9598cc20acd1f0aed36715d88\nDigest = bde0fbb390fb05d0b75df5bd0d0a4ea29516125f19830e3b0c93b641\nK = c780d047454824af98677cf310117e5f9e99627d02414f136aed8e83\nR = 45145f06b566ec9fd0fee1b6c6551a4535c7a3bbfc0fede45f4f5038\nS = 7302dff12545b069cf27df49b26e4781270585463656f2834917c3ca\n\nCurve = P-224\nPrivate = dde6f173fa9f307d206ce46b4f02851ebce9638a989330249fd30b73\nX = fc21a99b060afb0d9dbf3250ea3c4da10be94ce627a65874d8e4a630\nY = e8373ab7190890326aac4aacca3eba89e15d1086a05434dd033fd3f3\nDigest = c2c03fe07e10538f6a38d5831b5dda9ce7478b3ed31323d60617dc95\nK = 6629366a156840477df4875cfba4f8faa809e394893e1f5525326d07\nR = 41f8e2b1ae5add7c24da8725a067585a3ad6d5a9ed9580beb226f23a\nS = a5d71bff02dce997305dd337128046f36714398f4ef6647599712fae\n\nCurve = P-224\nPrivate = aeee9071248f077590ac647794b678ad371f8e0f1e14e9fbff49671e\nX = fad0a34991bbf89982ad9cf89337b4bd2565f84d5bdd004289fc1cc3\nY = 5d8b6764f28c8163a12855a5c266efeb9388df4994b85a8b4f1bd3bc\nDigest = 5d52747226f37a5afcd94d1b95867c0111bcb34402dad12bee76c1b7\nK = 1d35d027cd5a569e25c5768c48ed0c2b127c0f99cb4e52ea094fe689\nR = 2258184ef9f0fa698735379972ce9adf034af76017668bfcdab978de\nS = 866fb8e505dea6c909c2c9143ec869d1bac2282cf12366130ff2146c\n\nCurve = P-224\nPrivate = 29c204b2954e1406a015020f9d6b3d7c00658298feb2d17440b2c1a4\nX = 0e0fc15e775a75d45f872e5021b554cc0579da19125e1a49299c7630\nY = cb64fe462d025ae2a1394746bdbf8251f7ca5a1d6bb13e0edf6b7b09\nDigest = a1ab56bd011b7e6c7e066f25333d08cf81ac0d9c1abfa09f004ab52f\nK = 39547c10bb947d69f6c3af701f2528e011a1e80a6d04cc5a37466c02\nR = 86622c376d326cdf679bcabf8eb034bf49f0c188f3fc3afd0006325d\nS = 26613d3b33c70e635d7a998f254a5b15d2a3642bf321e8cff08f1e84\n\nCurve = P-224\nPrivate = 8986a97b24be042a1547642f19678de4e281a68f1e794e343dabb131\nX = 2c070e68e8478341938f3d5026a1fe01e778cdffbebbdd7a4cd29209\nY = cde21c9c7c6590ba300715a7adac278385a5175b6b4ea749c4b6a681\nDigest = 8ef4d8a368fad480bac518d625e97206adcafa87c52aef3d179cbfa9\nK = 509712f9c0f3370f6a09154159975945f0107dd1cee7327c68eaa90b\nR = 57afda5139b180de96373c3d649700682e37efd56ae182335f081013\nS = eb6cd58650cfb26dfdf21de32fa17464a6efc46830eedc16977342e6\n\nCurve = P-224\nPrivate = d9aa95e14cb34980cfddadddfa92bde1310acaff249f73ff5b09a974\nX = 3a0d4b8e5fad1ea1abb8d3fb742cd45cd0b76d136e5bbb33206ad120\nY = c90ac83276b2fa3757b0f226cd7360a313bc96fd8329c76a7306cc7d\nDigest = 28fabbac167f3d6a20c2f5a4bcee527c96be04bdd2c596f09d8fbab7\nK = 1f1739af68a3cee7c5f09e9e09d6485d9cd64cc4085bc2bc89795aaf\nR = 09bbdd003532d025d7c3204c00747cd52ecdfbc7ce3dde8ffbea23e1\nS = 1e745e80948779a5cc8dc5cb193beebb550ec9c2647f4948bf58ba7d\n\nCurve = P-224\nPrivate = 380fb6154ad3d2e755a17df1f047f84712d4ec9e47d34d4054ea29a8\nX = 4772c27cca3348b1801ae87b01cb564c8cf9b81c23cc74468a907927\nY = de9d253935b09617a1655c42d385bf48504e06fa386f5fa533a21dcb\nDigest = 50dd74b5af40978e809cee3eb41195402ebb5056e4437f753f9a9d0d\nK = 14dbdffa326ba2f3d64f79ff966d9ee6c1aba0d51e9a8e59f5686dc1\nR = ff6d52a09ca4c3b82da0440864d6717e1be0b50b6dcf5e1d74c0ff56\nS = 09490be77bc834c1efaa23410dcbf800e6fae40d62a737214c5a4418\n\nCurve = P-224\nPrivate = 6b98ec50d6b7f7ebc3a2183ff9388f75e924243827ddded8721186e2\nX = 1f249911b125348e6e0a473479105cc4b8cfb4fa32d897810fc69ffe\nY = a17db03b9877d1b6328329061ea67aec5a38a884362e9e5b7d7642dc\nDigest = 9fee01807ab6c43a794abf6dcd6118915252ca7d3a31a1ff96b88a8d\nK = ab3a41fedc77d1f96f3103cc7dce215bf45054a755cf101735fef503\nR = 70ccc0824542e296d17a79320d422f1edcf9253840dafe4427033f40\nS = e3823699c355b61ab1894be3371765fae2b720405a7ce5e790ca8c00\n\nCurve = P-224\nPrivate = 8dda0ef4170bf73077d685e7709f6f747ced08eb4cde98ef06ab7bd7\nX = 7df67b960ee7a2cb62b22932457360ab1e046c1ec84b91ae65642003\nY = c764ca9fc1b0cc2233fa57bdcfedaab0131fb7b5f557d6ca57f4afe0\nDigest = c349032f84384b913bd5d19b9211ddce221d66a45e8a051878254117\nK = 9ef6ebd178a76402968bc8ec8b257174a04fb5e2d65c1ab34ab039b9\nR = eef9e8428105704133e0f19636c89e570485e577786df2b09f99602a\nS = 8c01f0162891e4b9536243cb86a6e5c177323cca09777366caf2693c\n\nCurve = P-224\nPrivate = 3dbe18cd88fa49febfcb60f0369a67b2379a466d906ac46a8b8d522b\nX = b10150fd797eb870d377f1dbfa197f7d0f0ad29965af573ec13cc42a\nY = 17b63ccefbe27fb2a1139e5757b1082aeaa564f478c23a8f631eed5c\nDigest = 63fe0d82cf5edf972e97316666a0914432e420f80b4f78ceb92afd1d\nK = 385803b262ee2ee875838b3a645a745d2e199ae112ef73a25d68d15f\nR = 1d293b697f297af77872582eb7f543dc250ec79ad453300d264a3b70\nS = 517a91b89c4859fcc10834242e710c5f0fed90ac938aa5ccdb7c66de\n\nCurve = P-224\nPrivate = c906b667f38c5135ea96c95722c713dbd125d61156a546f49ddaadc6\nX = 3c9b4ef1748a1925578658d3af51995b989ad760790157b25fe09826\nY = 55648f4ff4edfb899e9a13bd8d20f5c24b35dc6a6a4e42ed5983b4a0\nDigest = 9b44ee16e576c50c0b6b37ac1437bf8f013a745615012451e54a12f2\nK = b04d78d8ac40fefadb99f389a06d93f6b5b72198c1be02dbff6195f0\nR = 4bdd3c84647bad93dcaffd1b54eb87fc61a5704b19d7e6d756d11ad0\nS = fdd81e5dca54158514f44ba2330271eff4c618330328451e2d93b9fb\n\nCurve = P-224\nPrivate = 3456745fbd51eac9b8095cd687b112f93d1b58352dbe02c66bb9b0cc\nX = f0acdfbc75a748a4a0ac55281754b5c4a364b7d61c5390b334daae10\nY = 86587a6768f235bf523fbfc6e062c7401ac2b0242cfe4e5fb34f4057\nDigest = 3c89c15dee194b3223e7b53a8a5845d4873a12a2f1581d5413359828\nK = 854b20c61bcdf7a89959dbf0985880bb14b628f01c65ef4f6446f1c1\nR = a2601fbb9fe89f39814735febb349143baa934170ffb91c6448a7823\nS = bf90f9305616020a0e34ef30803fc15fa97dffc0948452bbf6cb5f66\n\nCurve = P-224\nPrivate = 2c522af64baaca7b7a08044312f5e265ec6e09b2272f462cc705e4c3\nX = 5fad3c047074b5de1960247d0cc216b4e3fb7f3b9cd960575c8479fc\nY = e4fc9c7f05ff0b040eb171fdd2a1dfe2572c564c2003a08c3179a422\nDigest = 2b7faf36fdf0e393ddeb9fc875dd99f670e3d538fd0462395ea06c8f\nK = 9267763383f8db55eed5b1ca8f4937dc2e0ca6175066dc3d4a4586af\nR = 422e2e9fe535eb62f11f5f8ce87cf2e9ec65e61c06737cf6a0019ae6\nS = 116cfcf0965b7bc63aecade71d189d7e98a0434b124f2afbe3ccf0a9\n\nCurve = P-224\nPrivate = 3eff7d07edda14e8beba397accfee060dbe2a41587a703bbe0a0b912\nX = 6dd84f4d66f362844e41a7913c40b4aad5fa9ba56bb44c2d2ed9efac\nY = 15f65ebcdf2fd9f8035385a330bdabec0f1cd9cc7bc31d2fadbe7cda\nDigest = 5b24b6157c0d1edf3a40c22a0745d23bdb59379e5e5e776ed040288d\nK = 7bb48839d7717bab1fdde89bf4f7b4509d1c2c12510925e13655dead\nR = 127051d85326049115f307af2bc426f6c2d08f4774a0b496fb6982b1\nS = 6857e84418c1d1179333b4e5307e92abade0b74f7521ad78044bf597\n\nCurve = P-224\nPrivate = 888fc992893bdd8aa02c80768832605d020b81ae0b25474154ec89aa\nX = 4c741e4d20103670b7161ae72271082155838418084335338ac38fa4\nY = db7919151ac28587b72bad7ab180ec8e95ab9e2c8d81d9b9d7e2e383\nDigest = 00c6fc53c1986d19a8a8b580ee553dc1240745d760647d1c0adf442c133c7f56\nK = 06f7a56007825433c4c61153df1a135eee2f38ec687b492ed40d9c90\nR = 0909c9b9cae8d2790e29db6afdb45c04f5b072c4c20410c7dc9b6772\nS = 298f4fcae1fe271da1e0345d11d07a1fca43f58af4c113b909eedea0\n\nCurve = P-224\nPrivate = 5b5a3e186e7d5b9b0fbdfc74a05e0a3d85dc4be4c87269190c839972\nX = 897089f4ef05b943eeac06589f0e09ccc571a6add3eb1610a2fc830f\nY = 62ba3f6b3e6f0f062058b93e6f25b6041246c5be13584a41cae7e244\nDigest = fb5dd3b8d280fe7c4838f01b2a5c28493ed3084f46b40642600ba39e43fbff7b\nK = 5b6f7eca2bcc5899fce41b8169d48cd57cf0c4a1b66a30a150072676\nR = f12c9985d454ffbc899ebbbb6cf43e3debcac7f19029f8f2f35cce31\nS = 12fcb848adbd8b1b4c72b2b54a04d936e4a5f480ae2a3ea2e3c1baae\n\nCurve = P-224\nPrivate = f60b3a4d4e31c7005a3d2d0f91cb096d016a8ddb5ab10ecb2a549170\nX = 40a4ab1e6a9f84b4dedb81795e6a7124d1cfdfd",
diff --git a/third_party/boringssl/ios-aarch64/crypto/fipsmodule/ghashv8-armx64.S b/third_party/boringssl/ios-aarch64/crypto/fipsmodule/ghashv8-armx64.S index cdf64e6..c38134f 100644 --- a/third_party/boringssl/ios-aarch64/crypto/fipsmodule/ghashv8-armx64.S +++ b/third_party/boringssl/ios-aarch64/crypto/fipsmodule/ghashv8-armx64.S
@@ -105,13 +105,13 @@ //loaded value would have //to be rotated in order to //make it appear as in - //alorithm specification + //algorithm specification subs x3,x3,#32 //see if x3 is 32 or larger mov x12,#16 //x12 is used as post- //increment for input pointer; //as loop is modulo-scheduled //x12 is zeroed just in time - //to preclude oversteping + //to preclude overstepping //inp[len], which means that //last block[s] are actually //loaded twice, but last
diff --git a/third_party/boringssl/ios-arm/crypto/fipsmodule/ghashv8-armx32.S b/third_party/boringssl/ios-arm/crypto/fipsmodule/ghashv8-armx32.S index af268926..cbe8eb8b 100644 --- a/third_party/boringssl/ios-arm/crypto/fipsmodule/ghashv8-armx32.S +++ b/third_party/boringssl/ios-arm/crypto/fipsmodule/ghashv8-armx32.S
@@ -114,13 +114,13 @@ @ loaded value would have @ to be rotated in order to @ make it appear as in - @ alorithm specification + @ algorithm specification subs r3,r3,#32 @ see if r3 is 32 or larger mov r12,#16 @ r12 is used as post- @ increment for input pointer; @ as loop is modulo-scheduled @ r12 is zeroed just in time - @ to preclude oversteping + @ to preclude overstepping @ inp[len], which means that @ last block[s] are actually @ loaded twice, but last
diff --git a/third_party/boringssl/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S b/third_party/boringssl/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S index bc59946..fd0d153 100644 --- a/third_party/boringssl/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S +++ b/third_party/boringssl/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S
@@ -106,13 +106,13 @@ //loaded value would have //to be rotated in order to //make it appear as in - //alorithm specification + //algorithm specification subs x3,x3,#32 //see if x3 is 32 or larger mov x12,#16 //x12 is used as post- //increment for input pointer; //as loop is modulo-scheduled //x12 is zeroed just in time - //to preclude oversteping + //to preclude overstepping //inp[len], which means that //last block[s] are actually //loaded twice, but last
diff --git a/third_party/boringssl/linux-arm/crypto/fipsmodule/ghashv8-armx32.S b/third_party/boringssl/linux-arm/crypto/fipsmodule/ghashv8-armx32.S index e83a9c7..94377c5 100644 --- a/third_party/boringssl/linux-arm/crypto/fipsmodule/ghashv8-armx32.S +++ b/third_party/boringssl/linux-arm/crypto/fipsmodule/ghashv8-armx32.S
@@ -109,13 +109,13 @@ @ loaded value would have @ to be rotated in order to @ make it appear as in - @ alorithm specification + @ algorithm specification subs r3,r3,#32 @ see if r3 is 32 or larger mov r12,#16 @ r12 is used as post- @ increment for input pointer; @ as loop is modulo-scheduled @ r12 is zeroed just in time - @ to preclude oversteping + @ to preclude overstepping @ inp[len], which means that @ last block[s] are actually @ loaded twice, but last
diff --git a/third_party/boringssl/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S b/third_party/boringssl/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S index 21e5471..7422d2a 100644 --- a/third_party/boringssl/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S +++ b/third_party/boringssl/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S
@@ -18,6 +18,12 @@ .quad 0x0000000000000001, 0xffffffff00000000, 0xffffffffffffffff, 0x00000000fffffffe +.Lord: +.quad 0xf3b9cac2fc632551, 0xbce6faada7179e84, 0xffffffffffffffff, 0xffffffff00000000 +.LordK: +.quad 0xccd1c8aaee00bc4f + + .globl ecp_nistz256_neg .hidden ecp_nistz256_neg @@ -81,6 +87,633 @@ +.globl ecp_nistz256_ord_mul_mont +.hidden ecp_nistz256_ord_mul_mont +.type ecp_nistz256_ord_mul_mont,@function +.align 32 +ecp_nistz256_ord_mul_mont: +.cfi_startproc + pushq %rbp +.cfi_adjust_cfa_offset 8 +.cfi_offset %rbp,-16 + pushq %rbx +.cfi_adjust_cfa_offset 8 +.cfi_offset %rbx,-24 + pushq %r12 +.cfi_adjust_cfa_offset 8 +.cfi_offset %r12,-32 + pushq %r13 +.cfi_adjust_cfa_offset 8 +.cfi_offset %r13,-40 + pushq %r14 +.cfi_adjust_cfa_offset 8 +.cfi_offset %r14,-48 + pushq %r15 +.cfi_adjust_cfa_offset 8 +.cfi_offset %r15,-56 +.Lord_mul_body: + + movq 0(%rdx),%rax + movq %rdx,%rbx + leaq .Lord(%rip),%r14 + movq .LordK(%rip),%r15 + + + movq %rax,%rcx + mulq 0(%rsi) + movq %rax,%r8 + movq %rcx,%rax + movq %rdx,%r9 + + mulq 8(%rsi) + addq %rax,%r9 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%r10 + + mulq 16(%rsi) + addq %rax,%r10 + movq %rcx,%rax + adcq $0,%rdx + + movq %r8,%r13 + imulq %r15,%r8 + + movq %rdx,%r11 + mulq 24(%rsi) + addq %rax,%r11 + movq %r8,%rax + adcq $0,%rdx + movq %rdx,%r12 + + + mulq 0(%r14) + movq %r8,%rbp + addq %rax,%r13 + movq %r8,%rax + adcq $0,%rdx + movq %rdx,%rcx + + subq %r8,%r10 + sbbq $0,%r8 + + mulq 8(%r14) + addq %rcx,%r9 + adcq $0,%rdx + addq %rax,%r9 + movq %rbp,%rax + adcq %rdx,%r10 + movq %rbp,%rdx + adcq $0,%r8 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r11 + movq 8(%rbx),%rax + sbbq %rdx,%rbp + + addq %r8,%r11 + adcq %rbp,%r12 + adcq $0,%r13 + + + movq %rax,%rcx + mulq 0(%rsi) + addq %rax,%r9 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%rbp + + mulq 8(%rsi) + addq %rbp,%r10 + adcq $0,%rdx + addq %rax,%r10 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%rbp + + mulq 16(%rsi) + addq %rbp,%r11 + adcq $0,%rdx + addq %rax,%r11 + movq %rcx,%rax + adcq $0,%rdx + + movq %r9,%rcx + imulq %r15,%r9 + + movq %rdx,%rbp + mulq 24(%rsi) + addq %rbp,%r12 + adcq $0,%rdx + xorq %r8,%r8 + addq %rax,%r12 + movq %r9,%rax + adcq %rdx,%r13 + adcq $0,%r8 + + + mulq 0(%r14) + movq %r9,%rbp + addq %rax,%rcx + movq %r9,%rax + adcq %rdx,%rcx + + subq %r9,%r11 + sbbq $0,%r9 + + mulq 8(%r14) + addq %rcx,%r10 + adcq $0,%rdx + addq %rax,%r10 + movq %rbp,%rax + adcq %rdx,%r11 + movq %rbp,%rdx + adcq $0,%r9 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r12 + movq 16(%rbx),%rax + sbbq %rdx,%rbp + + addq %r9,%r12 + adcq %rbp,%r13 + adcq $0,%r8 + + + movq %rax,%rcx + mulq 0(%rsi) + addq %rax,%r10 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%rbp + + mulq 8(%rsi) + addq %rbp,%r11 + adcq $0,%rdx + addq %rax,%r11 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%rbp + + mulq 16(%rsi) + addq %rbp,%r12 + adcq $0,%rdx + addq %rax,%r12 + movq %rcx,%rax + adcq $0,%rdx + + movq %r10,%rcx + imulq %r15,%r10 + + movq %rdx,%rbp + mulq 24(%rsi) + addq %rbp,%r13 + adcq $0,%rdx + xorq %r9,%r9 + addq %rax,%r13 + movq %r10,%rax + adcq %rdx,%r8 + adcq $0,%r9 + + + mulq 0(%r14) + movq %r10,%rbp + addq %rax,%rcx + movq %r10,%rax + adcq %rdx,%rcx + + subq %r10,%r12 + sbbq $0,%r10 + + mulq 8(%r14) + addq %rcx,%r11 + adcq $0,%rdx + addq %rax,%r11 + movq %rbp,%rax + adcq %rdx,%r12 + movq %rbp,%rdx + adcq $0,%r10 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r13 + movq 24(%rbx),%rax + sbbq %rdx,%rbp + + addq %r10,%r13 + adcq %rbp,%r8 + adcq $0,%r9 + + + movq %rax,%rcx + mulq 0(%rsi) + addq %rax,%r11 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%rbp + + mulq 8(%rsi) + addq %rbp,%r12 + adcq $0,%rdx + addq %rax,%r12 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%rbp + + mulq 16(%rsi) + addq %rbp,%r13 + adcq $0,%rdx + addq %rax,%r13 + movq %rcx,%rax + adcq $0,%rdx + + movq %r11,%rcx + imulq %r15,%r11 + + movq %rdx,%rbp + mulq 24(%rsi) + addq %rbp,%r8 + adcq $0,%rdx + xorq %r10,%r10 + addq %rax,%r8 + movq %r11,%rax + adcq %rdx,%r9 + adcq $0,%r10 + + + mulq 0(%r14) + movq %r11,%rbp + addq %rax,%rcx + movq %r11,%rax + adcq %rdx,%rcx + + subq %r11,%r13 + sbbq $0,%r11 + + mulq 8(%r14) + addq %rcx,%r12 + adcq $0,%rdx + addq %rax,%r12 + movq %rbp,%rax + adcq %rdx,%r13 + movq %rbp,%rdx + adcq $0,%r11 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r8 + sbbq %rdx,%rbp + + addq %r11,%r8 + adcq %rbp,%r9 + adcq $0,%r10 + + + movq %r12,%rsi + subq 0(%r14),%r12 + movq %r13,%r11 + sbbq 8(%r14),%r13 + movq %r8,%rcx + sbbq 16(%r14),%r8 + movq %r9,%rbp + sbbq 24(%r14),%r9 + sbbq $0,%r10 + + cmovcq %rsi,%r12 + cmovcq %r11,%r13 + cmovcq %rcx,%r8 + cmovcq %rbp,%r9 + + movq %r12,0(%rdi) + movq %r13,8(%rdi) + movq %r8,16(%rdi) + movq %r9,24(%rdi) + + movq 0(%rsp),%r15 +.cfi_restore %r15 + movq 8(%rsp),%r14 +.cfi_restore %r14 + movq 16(%rsp),%r13 +.cfi_restore %r13 + movq 24(%rsp),%r12 +.cfi_restore %r12 + movq 32(%rsp),%rbx +.cfi_restore %rbx + movq 40(%rsp),%rbp +.cfi_restore %rbp + leaq 48(%rsp),%rsp +.cfi_adjust_cfa_offset -48 +.Lord_mul_epilogue: + .byte 0xf3,0xc3 +.cfi_endproc +.size ecp_nistz256_ord_mul_mont,.-ecp_nistz256_ord_mul_mont + + + + + + + +.globl ecp_nistz256_ord_sqr_mont +.hidden ecp_nistz256_ord_sqr_mont +.type ecp_nistz256_ord_sqr_mont,@function +.align 32 +ecp_nistz256_ord_sqr_mont: +.cfi_startproc + pushq %rbp +.cfi_adjust_cfa_offset 8 +.cfi_offset %rbp,-16 + pushq %rbx +.cfi_adjust_cfa_offset 8 +.cfi_offset %rbx,-24 + pushq %r12 +.cfi_adjust_cfa_offset 8 +.cfi_offset %r12,-32 + pushq %r13 +.cfi_adjust_cfa_offset 8 +.cfi_offset %r13,-40 + pushq %r14 +.cfi_adjust_cfa_offset 8 +.cfi_offset %r14,-48 + pushq %r15 +.cfi_adjust_cfa_offset 8 +.cfi_offset %r15,-56 +.Lord_sqr_body: + + movq 0(%rsi),%r8 + movq 8(%rsi),%rax + movq 16(%rsi),%r14 + movq 24(%rsi),%r15 + leaq .Lord(%rip),%rsi + movq %rdx,%rbx + jmp .Loop_ord_sqr + +.align 32 +.Loop_ord_sqr: + + movq %rax,%rbp + mulq %r8 + movq %rax,%r9 +.byte 102,72,15,110,205 + movq %r14,%rax + movq %rdx,%r10 + + mulq %r8 + addq %rax,%r10 + movq %r15,%rax +.byte 102,73,15,110,214 + adcq $0,%rdx + movq %rdx,%r11 + + mulq %r8 + addq %rax,%r11 + movq %r15,%rax +.byte 102,73,15,110,223 + adcq $0,%rdx + movq %rdx,%r12 + + + mulq %r14 + movq %rax,%r13 + movq %r14,%rax + movq %rdx,%r14 + + + mulq %rbp + addq %rax,%r11 + movq %r15,%rax + adcq $0,%rdx + movq %rdx,%r15 + + mulq %rbp + addq %rax,%r12 + adcq $0,%rdx + + addq %r15,%r12 + adcq %rdx,%r13 + adcq $0,%r14 + + + xorq %r15,%r15 + movq %r8,%rax + addq %r9,%r9 + adcq %r10,%r10 + adcq %r11,%r11 + adcq %r12,%r12 + adcq %r13,%r13 + adcq %r14,%r14 + adcq $0,%r15 + + + mulq %rax + movq %rax,%r8 +.byte 102,72,15,126,200 + movq %rdx,%rbp + + mulq %rax + addq %rbp,%r9 + adcq %rax,%r10 +.byte 102,72,15,126,208 + adcq $0,%rdx + movq %rdx,%rbp + + mulq %rax + addq %rbp,%r11 + adcq %rax,%r12 +.byte 102,72,15,126,216 + adcq $0,%rdx + movq %rdx,%rbp + + movq %r8,%rcx + imulq 32(%rsi),%r8 + + mulq %rax + addq %rbp,%r13 + adcq %rax,%r14 + movq 0(%rsi),%rax + adcq %rdx,%r15 + + + mulq %r8 + movq %r8,%rbp + addq %rax,%rcx + movq 8(%rsi),%rax + adcq %rdx,%rcx + + subq %r8,%r10 + sbbq $0,%rbp + + mulq %r8 + addq %rcx,%r9 + adcq $0,%rdx + addq %rax,%r9 + movq %r8,%rax + adcq %rdx,%r10 + movq %r8,%rdx + adcq $0,%rbp + + movq %r9,%rcx + imulq 32(%rsi),%r9 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r11 + movq 0(%rsi),%rax + sbbq %rdx,%r8 + + addq %rbp,%r11 + adcq $0,%r8 + + + mulq %r9 + movq %r9,%rbp + addq %rax,%rcx + movq 8(%rsi),%rax + adcq %rdx,%rcx + + subq %r9,%r11 + sbbq $0,%rbp + + mulq %r9 + addq %rcx,%r10 + adcq $0,%rdx + addq %rax,%r10 + movq %r9,%rax + adcq %rdx,%r11 + movq %r9,%rdx + adcq $0,%rbp + + movq %r10,%rcx + imulq 32(%rsi),%r10 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r8 + movq 0(%rsi),%rax + sbbq %rdx,%r9 + + addq %rbp,%r8 + adcq $0,%r9 + + + mulq %r10 + movq %r10,%rbp + addq %rax,%rcx + movq 8(%rsi),%rax + adcq %rdx,%rcx + + subq %r10,%r8 + sbbq $0,%rbp + + mulq %r10 + addq %rcx,%r11 + adcq $0,%rdx + addq %rax,%r11 + movq %r10,%rax + adcq %rdx,%r8 + movq %r10,%rdx + adcq $0,%rbp + + movq %r11,%rcx + imulq 32(%rsi),%r11 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r9 + movq 0(%rsi),%rax + sbbq %rdx,%r10 + + addq %rbp,%r9 + adcq $0,%r10 + + + mulq %r11 + movq %r11,%rbp + addq %rax,%rcx + movq 8(%rsi),%rax + adcq %rdx,%rcx + + subq %r11,%r9 + sbbq $0,%rbp + + mulq %r11 + addq %rcx,%r8 + adcq $0,%rdx + addq %rax,%r8 + movq %r11,%rax + adcq %rdx,%r9 + movq %r11,%rdx + adcq $0,%rbp + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r10 + sbbq %rdx,%r11 + + addq %rbp,%r10 + adcq $0,%r11 + + + xorq %rdx,%rdx + addq %r12,%r8 + adcq %r13,%r9 + movq %r8,%r12 + adcq %r14,%r10 + adcq %r15,%r11 + movq %r9,%rax + adcq $0,%rdx + + + subq 0(%rsi),%r8 + movq %r10,%r14 + sbbq 8(%rsi),%r9 + sbbq 16(%rsi),%r10 + movq %r11,%r15 + sbbq 24(%rsi),%r11 + sbbq $0,%rdx + + cmovcq %r12,%r8 + cmovncq %r9,%rax + cmovncq %r10,%r14 + cmovncq %r11,%r15 + + decq %rbx + jnz .Loop_ord_sqr + + movq %r8,0(%rdi) + movq %rax,8(%rdi) + pxor %xmm1,%xmm1 + movq %r14,16(%rdi) + pxor %xmm2,%xmm2 + movq %r15,24(%rdi) + pxor %xmm3,%xmm3 + + movq 0(%rsp),%r15 +.cfi_restore %r15 + movq 8(%rsp),%r14 +.cfi_restore %r14 + movq 16(%rsp),%r13 +.cfi_restore %r13 + movq 24(%rsp),%r12 +.cfi_restore %r12 + movq 32(%rsp),%rbx +.cfi_restore %rbx + movq 40(%rsp),%rbp +.cfi_restore %rbp + leaq 48(%rsp),%rsp +.cfi_adjust_cfa_offset -48 +.Lord_sqr_epilogue: + .byte 0xf3,0xc3 +.cfi_endproc +.size ecp_nistz256_ord_sqr_mont,.-ecp_nistz256_ord_sqr_mont + + + + + + .globl ecp_nistz256_mul_mont .hidden ecp_nistz256_mul_mont .type ecp_nistz256_mul_mont,@function
diff --git a/third_party/boringssl/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S b/third_party/boringssl/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S index 8295346..bc66e99 100644 --- a/third_party/boringssl/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S +++ b/third_party/boringssl/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S
@@ -17,6 +17,12 @@ .quad 0x0000000000000001, 0xffffffff00000000, 0xffffffffffffffff, 0x00000000fffffffe +L$ord: +.quad 0xf3b9cac2fc632551, 0xbce6faada7179e84, 0xffffffffffffffff, 0xffffffff00000000 +L$ordK: +.quad 0xccd1c8aaee00bc4f + + .globl _ecp_nistz256_neg .private_extern _ecp_nistz256_neg @@ -78,6 +84,621 @@ +.globl _ecp_nistz256_ord_mul_mont +.private_extern _ecp_nistz256_ord_mul_mont + +.p2align 5 +_ecp_nistz256_ord_mul_mont: + + pushq %rbp + + pushq %rbx + + pushq %r12 + + pushq %r13 + + pushq %r14 + + pushq %r15 + +L$ord_mul_body: + + movq 0(%rdx),%rax + movq %rdx,%rbx + leaq L$ord(%rip),%r14 + movq L$ordK(%rip),%r15 + + + movq %rax,%rcx + mulq 0(%rsi) + movq %rax,%r8 + movq %rcx,%rax + movq %rdx,%r9 + + mulq 8(%rsi) + addq %rax,%r9 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%r10 + + mulq 16(%rsi) + addq %rax,%r10 + movq %rcx,%rax + adcq $0,%rdx + + movq %r8,%r13 + imulq %r15,%r8 + + movq %rdx,%r11 + mulq 24(%rsi) + addq %rax,%r11 + movq %r8,%rax + adcq $0,%rdx + movq %rdx,%r12 + + + mulq 0(%r14) + movq %r8,%rbp + addq %rax,%r13 + movq %r8,%rax + adcq $0,%rdx + movq %rdx,%rcx + + subq %r8,%r10 + sbbq $0,%r8 + + mulq 8(%r14) + addq %rcx,%r9 + adcq $0,%rdx + addq %rax,%r9 + movq %rbp,%rax + adcq %rdx,%r10 + movq %rbp,%rdx + adcq $0,%r8 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r11 + movq 8(%rbx),%rax + sbbq %rdx,%rbp + + addq %r8,%r11 + adcq %rbp,%r12 + adcq $0,%r13 + + + movq %rax,%rcx + mulq 0(%rsi) + addq %rax,%r9 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%rbp + + mulq 8(%rsi) + addq %rbp,%r10 + adcq $0,%rdx + addq %rax,%r10 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%rbp + + mulq 16(%rsi) + addq %rbp,%r11 + adcq $0,%rdx + addq %rax,%r11 + movq %rcx,%rax + adcq $0,%rdx + + movq %r9,%rcx + imulq %r15,%r9 + + movq %rdx,%rbp + mulq 24(%rsi) + addq %rbp,%r12 + adcq $0,%rdx + xorq %r8,%r8 + addq %rax,%r12 + movq %r9,%rax + adcq %rdx,%r13 + adcq $0,%r8 + + + mulq 0(%r14) + movq %r9,%rbp + addq %rax,%rcx + movq %r9,%rax + adcq %rdx,%rcx + + subq %r9,%r11 + sbbq $0,%r9 + + mulq 8(%r14) + addq %rcx,%r10 + adcq $0,%rdx + addq %rax,%r10 + movq %rbp,%rax + adcq %rdx,%r11 + movq %rbp,%rdx + adcq $0,%r9 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r12 + movq 16(%rbx),%rax + sbbq %rdx,%rbp + + addq %r9,%r12 + adcq %rbp,%r13 + adcq $0,%r8 + + + movq %rax,%rcx + mulq 0(%rsi) + addq %rax,%r10 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%rbp + + mulq 8(%rsi) + addq %rbp,%r11 + adcq $0,%rdx + addq %rax,%r11 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%rbp + + mulq 16(%rsi) + addq %rbp,%r12 + adcq $0,%rdx + addq %rax,%r12 + movq %rcx,%rax + adcq $0,%rdx + + movq %r10,%rcx + imulq %r15,%r10 + + movq %rdx,%rbp + mulq 24(%rsi) + addq %rbp,%r13 + adcq $0,%rdx + xorq %r9,%r9 + addq %rax,%r13 + movq %r10,%rax + adcq %rdx,%r8 + adcq $0,%r9 + + + mulq 0(%r14) + movq %r10,%rbp + addq %rax,%rcx + movq %r10,%rax + adcq %rdx,%rcx + + subq %r10,%r12 + sbbq $0,%r10 + + mulq 8(%r14) + addq %rcx,%r11 + adcq $0,%rdx + addq %rax,%r11 + movq %rbp,%rax + adcq %rdx,%r12 + movq %rbp,%rdx + adcq $0,%r10 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r13 + movq 24(%rbx),%rax + sbbq %rdx,%rbp + + addq %r10,%r13 + adcq %rbp,%r8 + adcq $0,%r9 + + + movq %rax,%rcx + mulq 0(%rsi) + addq %rax,%r11 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%rbp + + mulq 8(%rsi) + addq %rbp,%r12 + adcq $0,%rdx + addq %rax,%r12 + movq %rcx,%rax + adcq $0,%rdx + movq %rdx,%rbp + + mulq 16(%rsi) + addq %rbp,%r13 + adcq $0,%rdx + addq %rax,%r13 + movq %rcx,%rax + adcq $0,%rdx + + movq %r11,%rcx + imulq %r15,%r11 + + movq %rdx,%rbp + mulq 24(%rsi) + addq %rbp,%r8 + adcq $0,%rdx + xorq %r10,%r10 + addq %rax,%r8 + movq %r11,%rax + adcq %rdx,%r9 + adcq $0,%r10 + + + mulq 0(%r14) + movq %r11,%rbp + addq %rax,%rcx + movq %r11,%rax + adcq %rdx,%rcx + + subq %r11,%r13 + sbbq $0,%r11 + + mulq 8(%r14) + addq %rcx,%r12 + adcq $0,%rdx + addq %rax,%r12 + movq %rbp,%rax + adcq %rdx,%r13 + movq %rbp,%rdx + adcq $0,%r11 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r8 + sbbq %rdx,%rbp + + addq %r11,%r8 + adcq %rbp,%r9 + adcq $0,%r10 + + + movq %r12,%rsi + subq 0(%r14),%r12 + movq %r13,%r11 + sbbq 8(%r14),%r13 + movq %r8,%rcx + sbbq 16(%r14),%r8 + movq %r9,%rbp + sbbq 24(%r14),%r9 + sbbq $0,%r10 + + cmovcq %rsi,%r12 + cmovcq %r11,%r13 + cmovcq %rcx,%r8 + cmovcq %rbp,%r9 + + movq %r12,0(%rdi) + movq %r13,8(%rdi) + movq %r8,16(%rdi) + movq %r9,24(%rdi) + + movq 0(%rsp),%r15 + + movq 8(%rsp),%r14 + + movq 16(%rsp),%r13 + + movq 24(%rsp),%r12 + + movq 32(%rsp),%rbx + + movq 40(%rsp),%rbp + + leaq 48(%rsp),%rsp + +L$ord_mul_epilogue: + .byte 0xf3,0xc3 + + + + + + + + + +.globl _ecp_nistz256_ord_sqr_mont +.private_extern _ecp_nistz256_ord_sqr_mont + +.p2align 5 +_ecp_nistz256_ord_sqr_mont: + + pushq %rbp + + pushq %rbx + + pushq %r12 + + pushq %r13 + + pushq %r14 + + pushq %r15 + +L$ord_sqr_body: + + movq 0(%rsi),%r8 + movq 8(%rsi),%rax + movq 16(%rsi),%r14 + movq 24(%rsi),%r15 + leaq L$ord(%rip),%rsi + movq %rdx,%rbx + jmp L$oop_ord_sqr + +.p2align 5 +L$oop_ord_sqr: + + movq %rax,%rbp + mulq %r8 + movq %rax,%r9 +.byte 102,72,15,110,205 + movq %r14,%rax + movq %rdx,%r10 + + mulq %r8 + addq %rax,%r10 + movq %r15,%rax +.byte 102,73,15,110,214 + adcq $0,%rdx + movq %rdx,%r11 + + mulq %r8 + addq %rax,%r11 + movq %r15,%rax +.byte 102,73,15,110,223 + adcq $0,%rdx + movq %rdx,%r12 + + + mulq %r14 + movq %rax,%r13 + movq %r14,%rax + movq %rdx,%r14 + + + mulq %rbp + addq %rax,%r11 + movq %r15,%rax + adcq $0,%rdx + movq %rdx,%r15 + + mulq %rbp + addq %rax,%r12 + adcq $0,%rdx + + addq %r15,%r12 + adcq %rdx,%r13 + adcq $0,%r14 + + + xorq %r15,%r15 + movq %r8,%rax + addq %r9,%r9 + adcq %r10,%r10 + adcq %r11,%r11 + adcq %r12,%r12 + adcq %r13,%r13 + adcq %r14,%r14 + adcq $0,%r15 + + + mulq %rax + movq %rax,%r8 +.byte 102,72,15,126,200 + movq %rdx,%rbp + + mulq %rax + addq %rbp,%r9 + adcq %rax,%r10 +.byte 102,72,15,126,208 + adcq $0,%rdx + movq %rdx,%rbp + + mulq %rax + addq %rbp,%r11 + adcq %rax,%r12 +.byte 102,72,15,126,216 + adcq $0,%rdx + movq %rdx,%rbp + + movq %r8,%rcx + imulq 32(%rsi),%r8 + + mulq %rax + addq %rbp,%r13 + adcq %rax,%r14 + movq 0(%rsi),%rax + adcq %rdx,%r15 + + + mulq %r8 + movq %r8,%rbp + addq %rax,%rcx + movq 8(%rsi),%rax + adcq %rdx,%rcx + + subq %r8,%r10 + sbbq $0,%rbp + + mulq %r8 + addq %rcx,%r9 + adcq $0,%rdx + addq %rax,%r9 + movq %r8,%rax + adcq %rdx,%r10 + movq %r8,%rdx + adcq $0,%rbp + + movq %r9,%rcx + imulq 32(%rsi),%r9 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r11 + movq 0(%rsi),%rax + sbbq %rdx,%r8 + + addq %rbp,%r11 + adcq $0,%r8 + + + mulq %r9 + movq %r9,%rbp + addq %rax,%rcx + movq 8(%rsi),%rax + adcq %rdx,%rcx + + subq %r9,%r11 + sbbq $0,%rbp + + mulq %r9 + addq %rcx,%r10 + adcq $0,%rdx + addq %rax,%r10 + movq %r9,%rax + adcq %rdx,%r11 + movq %r9,%rdx + adcq $0,%rbp + + movq %r10,%rcx + imulq 32(%rsi),%r10 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r8 + movq 0(%rsi),%rax + sbbq %rdx,%r9 + + addq %rbp,%r8 + adcq $0,%r9 + + + mulq %r10 + movq %r10,%rbp + addq %rax,%rcx + movq 8(%rsi),%rax + adcq %rdx,%rcx + + subq %r10,%r8 + sbbq $0,%rbp + + mulq %r10 + addq %rcx,%r11 + adcq $0,%rdx + addq %rax,%r11 + movq %r10,%rax + adcq %rdx,%r8 + movq %r10,%rdx + adcq $0,%rbp + + movq %r11,%rcx + imulq 32(%rsi),%r11 + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r9 + movq 0(%rsi),%rax + sbbq %rdx,%r10 + + addq %rbp,%r9 + adcq $0,%r10 + + + mulq %r11 + movq %r11,%rbp + addq %rax,%rcx + movq 8(%rsi),%rax + adcq %rdx,%rcx + + subq %r11,%r9 + sbbq $0,%rbp + + mulq %r11 + addq %rcx,%r8 + adcq $0,%rdx + addq %rax,%r8 + movq %r11,%rax + adcq %rdx,%r9 + movq %r11,%rdx + adcq $0,%rbp + + shlq $32,%rax + shrq $32,%rdx + subq %rax,%r10 + sbbq %rdx,%r11 + + addq %rbp,%r10 + adcq $0,%r11 + + + xorq %rdx,%rdx + addq %r12,%r8 + adcq %r13,%r9 + movq %r8,%r12 + adcq %r14,%r10 + adcq %r15,%r11 + movq %r9,%rax + adcq $0,%rdx + + + subq 0(%rsi),%r8 + movq %r10,%r14 + sbbq 8(%rsi),%r9 + sbbq 16(%rsi),%r10 + movq %r11,%r15 + sbbq 24(%rsi),%r11 + sbbq $0,%rdx + + cmovcq %r12,%r8 + cmovncq %r9,%rax + cmovncq %r10,%r14 + cmovncq %r11,%r15 + + decq %rbx + jnz L$oop_ord_sqr + + movq %r8,0(%rdi) + movq %rax,8(%rdi) + pxor %xmm1,%xmm1 + movq %r14,16(%rdi) + pxor %xmm2,%xmm2 + movq %r15,24(%rdi) + pxor %xmm3,%xmm3 + + movq 0(%rsp),%r15 + + movq 8(%rsp),%r14 + + movq 16(%rsp),%r13 + + movq 24(%rsp),%r12 + + movq 32(%rsp),%rbx + + movq 40(%rsp),%rbp + + leaq 48(%rsp),%rsp + +L$ord_sqr_epilogue: + .byte 0xf3,0xc3 + + + + + + + + .globl _ecp_nistz256_mul_mont .private_extern _ecp_nistz256_mul_mont
diff --git a/third_party/boringssl/win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm b/third_party/boringssl/win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm index ec48141..888a87f 100644 --- a/third_party/boringssl/win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm +++ b/third_party/boringssl/win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm
@@ -21,6 +21,12 @@ DQ 0x0000000000000001,0xffffffff00000000,0xffffffffffffffff,0x00000000fffffffe +$L$ord: + DQ 0xf3b9cac2fc632551,0xbce6faada7179e84,0xffffffffffffffff,0xffffffff00000000 +$L$ordK: + DQ 0xccd1c8aaee00bc4f + + global ecp_nistz256_neg @@ -91,6 +97,641 @@ +global ecp_nistz256_ord_mul_mont + +ALIGN 32 +ecp_nistz256_ord_mul_mont: + mov QWORD[8+rsp],rdi ;WIN64 prologue + mov QWORD[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_ecp_nistz256_ord_mul_mont: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + + push rbp + + push rbx + + push r12 + + push r13 + + push r14 + + push r15 + +$L$ord_mul_body: + + mov rax,QWORD[rdx] + mov rbx,rdx + lea r14,[$L$ord] + mov r15,QWORD[$L$ordK] + + + mov rcx,rax + mul QWORD[rsi] + mov r8,rax + mov rax,rcx + mov r9,rdx + + mul QWORD[8+rsi] + add r9,rax + mov rax,rcx + adc rdx,0 + mov r10,rdx + + mul QWORD[16+rsi] + add r10,rax + mov rax,rcx + adc rdx,0 + + mov r13,r8 + imul r8,r15 + + mov r11,rdx + mul QWORD[24+rsi] + add r11,rax + mov rax,r8 + adc rdx,0 + mov r12,rdx + + + mul QWORD[r14] + mov rbp,r8 + add r13,rax + mov rax,r8 + adc rdx,0 + mov rcx,rdx + + sub r10,r8 + sbb r8,0 + + mul QWORD[8+r14] + add r9,rcx + adc rdx,0 + add r9,rax + mov rax,rbp + adc r10,rdx + mov rdx,rbp + adc r8,0 + + shl rax,32 + shr rdx,32 + sub r11,rax + mov rax,QWORD[8+rbx] + sbb rbp,rdx + + add r11,r8 + adc r12,rbp + adc r13,0 + + + mov rcx,rax + mul QWORD[rsi] + add r9,rax + mov rax,rcx + adc rdx,0 + mov rbp,rdx + + mul QWORD[8+rsi] + add r10,rbp + adc rdx,0 + add r10,rax + mov rax,rcx + adc rdx,0 + mov rbp,rdx + + mul QWORD[16+rsi] + add r11,rbp + adc rdx,0 + add r11,rax + mov rax,rcx + adc rdx,0 + + mov rcx,r9 + imul r9,r15 + + mov rbp,rdx + mul QWORD[24+rsi] + add r12,rbp + adc rdx,0 + xor r8,r8 + add r12,rax + mov rax,r9 + adc r13,rdx + adc r8,0 + + + mul QWORD[r14] + mov rbp,r9 + add rcx,rax + mov rax,r9 + adc rcx,rdx + + sub r11,r9 + sbb r9,0 + + mul QWORD[8+r14] + add r10,rcx + adc rdx,0 + add r10,rax + mov rax,rbp + adc r11,rdx + mov rdx,rbp + adc r9,0 + + shl rax,32 + shr rdx,32 + sub r12,rax + mov rax,QWORD[16+rbx] + sbb rbp,rdx + + add r12,r9 + adc r13,rbp + adc r8,0 + + + mov rcx,rax + mul QWORD[rsi] + add r10,rax + mov rax,rcx + adc rdx,0 + mov rbp,rdx + + mul QWORD[8+rsi] + add r11,rbp + adc rdx,0 + add r11,rax + mov rax,rcx + adc rdx,0 + mov rbp,rdx + + mul QWORD[16+rsi] + add r12,rbp + adc rdx,0 + add r12,rax + mov rax,rcx + adc rdx,0 + + mov rcx,r10 + imul r10,r15 + + mov rbp,rdx + mul QWORD[24+rsi] + add r13,rbp + adc rdx,0 + xor r9,r9 + add r13,rax + mov rax,r10 + adc r8,rdx + adc r9,0 + + + mul QWORD[r14] + mov rbp,r10 + add rcx,rax + mov rax,r10 + adc rcx,rdx + + sub r12,r10 + sbb r10,0 + + mul QWORD[8+r14] + add r11,rcx + adc rdx,0 + add r11,rax + mov rax,rbp + adc r12,rdx + mov rdx,rbp + adc r10,0 + + shl rax,32 + shr rdx,32 + sub r13,rax + mov rax,QWORD[24+rbx] + sbb rbp,rdx + + add r13,r10 + adc r8,rbp + adc r9,0 + + + mov rcx,rax + mul QWORD[rsi] + add r11,rax + mov rax,rcx + adc rdx,0 + mov rbp,rdx + + mul QWORD[8+rsi] + add r12,rbp + adc rdx,0 + add r12,rax + mov rax,rcx + adc rdx,0 + mov rbp,rdx + + mul QWORD[16+rsi] + add r13,rbp + adc rdx,0 + add r13,rax + mov rax,rcx + adc rdx,0 + + mov rcx,r11 + imul r11,r15 + + mov rbp,rdx + mul QWORD[24+rsi] + add r8,rbp + adc rdx,0 + xor r10,r10 + add r8,rax + mov rax,r11 + adc r9,rdx + adc r10,0 + + + mul QWORD[r14] + mov rbp,r11 + add rcx,rax + mov rax,r11 + adc rcx,rdx + + sub r13,r11 + sbb r11,0 + + mul QWORD[8+r14] + add r12,rcx + adc rdx,0 + add r12,rax + mov rax,rbp + adc r13,rdx + mov rdx,rbp + adc r11,0 + + shl rax,32 + shr rdx,32 + sub r8,rax + sbb rbp,rdx + + add r8,r11 + adc r9,rbp + adc r10,0 + + + mov rsi,r12 + sub r12,QWORD[r14] + mov r11,r13 + sbb r13,QWORD[8+r14] + mov rcx,r8 + sbb r8,QWORD[16+r14] + mov rbp,r9 + sbb r9,QWORD[24+r14] + sbb r10,0 + + cmovc r12,rsi + cmovc r13,r11 + cmovc r8,rcx + cmovc r9,rbp + + mov QWORD[rdi],r12 + mov QWORD[8+rdi],r13 + mov QWORD[16+rdi],r8 + mov QWORD[24+rdi],r9 + + mov r15,QWORD[rsp] + + mov r14,QWORD[8+rsp] + + mov r13,QWORD[16+rsp] + + mov r12,QWORD[24+rsp] + + mov rbx,QWORD[32+rsp] + + mov rbp,QWORD[40+rsp] + + lea rsp,[48+rsp] + +$L$ord_mul_epilogue: + mov rdi,QWORD[8+rsp] ;WIN64 epilogue + mov rsi,QWORD[16+rsp] + DB 0F3h,0C3h ;repret + +$L$SEH_end_ecp_nistz256_ord_mul_mont: + + + + + + + +global ecp_nistz256_ord_sqr_mont + +ALIGN 32 +ecp_nistz256_ord_sqr_mont: + mov QWORD[8+rsp],rdi ;WIN64 prologue + mov QWORD[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_ecp_nistz256_ord_sqr_mont: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + + push rbp + + push rbx + + push r12 + + push r13 + + push r14 + + push r15 + +$L$ord_sqr_body: + + mov r8,QWORD[rsi] + mov rax,QWORD[8+rsi] + mov r14,QWORD[16+rsi] + mov r15,QWORD[24+rsi] + lea rsi,[$L$ord] + mov rbx,rdx + jmp NEAR $L$oop_ord_sqr + +ALIGN 32 +$L$oop_ord_sqr: + + mov rbp,rax + mul r8 + mov r9,rax +DB 102,72,15,110,205 + mov rax,r14 + mov r10,rdx + + mul r8 + add r10,rax + mov rax,r15 +DB 102,73,15,110,214 + adc rdx,0 + mov r11,rdx + + mul r8 + add r11,rax + mov rax,r15 +DB 102,73,15,110,223 + adc rdx,0 + mov r12,rdx + + + mul r14 + mov r13,rax + mov rax,r14 + mov r14,rdx + + + mul rbp + add r11,rax + mov rax,r15 + adc rdx,0 + mov r15,rdx + + mul rbp + add r12,rax + adc rdx,0 + + add r12,r15 + adc r13,rdx + adc r14,0 + + + xor r15,r15 + mov rax,r8 + add r9,r9 + adc r10,r10 + adc r11,r11 + adc r12,r12 + adc r13,r13 + adc r14,r14 + adc r15,0 + + + mul rax + mov r8,rax +DB 102,72,15,126,200 + mov rbp,rdx + + mul rax + add r9,rbp + adc r10,rax +DB 102,72,15,126,208 + adc rdx,0 + mov rbp,rdx + + mul rax + add r11,rbp + adc r12,rax +DB 102,72,15,126,216 + adc rdx,0 + mov rbp,rdx + + mov rcx,r8 + imul r8,QWORD[32+rsi] + + mul rax + add r13,rbp + adc r14,rax + mov rax,QWORD[rsi] + adc r15,rdx + + + mul r8 + mov rbp,r8 + add rcx,rax + mov rax,QWORD[8+rsi] + adc rcx,rdx + + sub r10,r8 + sbb rbp,0 + + mul r8 + add r9,rcx + adc rdx,0 + add r9,rax + mov rax,r8 + adc r10,rdx + mov rdx,r8 + adc rbp,0 + + mov rcx,r9 + imul r9,QWORD[32+rsi] + + shl rax,32 + shr rdx,32 + sub r11,rax + mov rax,QWORD[rsi] + sbb r8,rdx + + add r11,rbp + adc r8,0 + + + mul r9 + mov rbp,r9 + add rcx,rax + mov rax,QWORD[8+rsi] + adc rcx,rdx + + sub r11,r9 + sbb rbp,0 + + mul r9 + add r10,rcx + adc rdx,0 + add r10,rax + mov rax,r9 + adc r11,rdx + mov rdx,r9 + adc rbp,0 + + mov rcx,r10 + imul r10,QWORD[32+rsi] + + shl rax,32 + shr rdx,32 + sub r8,rax + mov rax,QWORD[rsi] + sbb r9,rdx + + add r8,rbp + adc r9,0 + + + mul r10 + mov rbp,r10 + add rcx,rax + mov rax,QWORD[8+rsi] + adc rcx,rdx + + sub r8,r10 + sbb rbp,0 + + mul r10 + add r11,rcx + adc rdx,0 + add r11,rax + mov rax,r10 + adc r8,rdx + mov rdx,r10 + adc rbp,0 + + mov rcx,r11 + imul r11,QWORD[32+rsi] + + shl rax,32 + shr rdx,32 + sub r9,rax + mov rax,QWORD[rsi] + sbb r10,rdx + + add r9,rbp + adc r10,0 + + + mul r11 + mov rbp,r11 + add rcx,rax + mov rax,QWORD[8+rsi] + adc rcx,rdx + + sub r9,r11 + sbb rbp,0 + + mul r11 + add r8,rcx + adc rdx,0 + add r8,rax + mov rax,r11 + adc r9,rdx + mov rdx,r11 + adc rbp,0 + + shl rax,32 + shr rdx,32 + sub r10,rax + sbb r11,rdx + + add r10,rbp + adc r11,0 + + + xor rdx,rdx + add r8,r12 + adc r9,r13 + mov r12,r8 + adc r10,r14 + adc r11,r15 + mov rax,r9 + adc rdx,0 + + + sub r8,QWORD[rsi] + mov r14,r10 + sbb r9,QWORD[8+rsi] + sbb r10,QWORD[16+rsi] + mov r15,r11 + sbb r11,QWORD[24+rsi] + sbb rdx,0 + + cmovc r8,r12 + cmovnc rax,r9 + cmovnc r14,r10 + cmovnc r15,r11 + + dec rbx + jnz NEAR $L$oop_ord_sqr + + mov QWORD[rdi],r8 + mov QWORD[8+rdi],rax + pxor xmm1,xmm1 + mov QWORD[16+rdi],r14 + pxor xmm2,xmm2 + mov QWORD[24+rdi],r15 + pxor xmm3,xmm3 + + mov r15,QWORD[rsp] + + mov r14,QWORD[8+rsp] + + mov r13,QWORD[16+rsp] + + mov r12,QWORD[24+rsp] + + mov rbx,QWORD[32+rsp] + + mov rbp,QWORD[40+rsp] + + lea rsp,[48+rsp] + +$L$ord_sqr_epilogue: + mov rdi,QWORD[8+rsp] ;WIN64 epilogue + mov rsi,QWORD[16+rsp] + DB 0F3h,0C3h ;repret + +$L$SEH_end_ecp_nistz256_ord_sqr_mont: + + + + + + global ecp_nistz256_mul_mont ALIGN 32 @@ -2191,6 +2832,13 @@ DD $L$SEH_end_ecp_nistz256_neg wrt ..imagebase DD $L$SEH_info_ecp_nistz256_neg wrt ..imagebase + DD $L$SEH_begin_ecp_nistz256_ord_mul_mont wrt ..imagebase + DD $L$SEH_end_ecp_nistz256_ord_mul_mont wrt ..imagebase + DD $L$SEH_info_ecp_nistz256_ord_mul_mont wrt ..imagebase + + DD $L$SEH_begin_ecp_nistz256_ord_sqr_mont wrt ..imagebase + DD $L$SEH_end_ecp_nistz256_ord_sqr_mont wrt ..imagebase + DD $L$SEH_info_ecp_nistz256_ord_sqr_mont wrt ..imagebase DD $L$SEH_begin_ecp_nistz256_mul_mont wrt ..imagebase DD $L$SEH_end_ecp_nistz256_mul_mont wrt ..imagebase DD $L$SEH_info_ecp_nistz256_mul_mont wrt ..imagebase @@ -2231,6 +2879,16 @@ DB 9,0,0,0 DD short_handler wrt ..imagebase DD $L$neg_body wrt ..imagebase,$L$neg_epilogue wrt ..imagebase +$L$SEH_info_ecp_nistz256_ord_mul_mont: +DB 9,0,0,0 + DD full_handler wrt ..imagebase + DD $L$ord_mul_body wrt ..imagebase,$L$ord_mul_epilogue wrt ..imagebase + DD 48,0 +$L$SEH_info_ecp_nistz256_ord_sqr_mont: +DB 9,0,0,0 + DD full_handler wrt ..imagebase + DD $L$ord_sqr_body wrt ..imagebase,$L$ord_sqr_epilogue wrt ..imagebase + DD 48,0 $L$SEH_info_ecp_nistz256_mul_mont: DB 9,0,0,0 DD full_handler wrt ..imagebase
diff --git a/third_party/feed/BUILD.gn b/third_party/feed/BUILD.gn index 6cadc0d..6f87e278 100644 --- a/third_party/feed/BUILD.gn +++ b/third_party/feed/BUILD.gn
@@ -14,11 +14,18 @@ custom_package = "com.google.android.libraries.feed.piet" } +android_resources("basicstream_resources") { + resource_dirs = [ "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/viewholders/res" ] + custom_package = + "com.google.android.libraries.feed.basicstream.internal.viewholders" +} + android_library("feed_lib_java") { chromium_code = false java_files = feed_lib_java_sources deps = [ + ":basicstream_resources", ":feed_lib_proto_java", ":piet_resources", "//third_party/android_tools:android_support_annotations_java",
diff --git a/third_party/feed/README.chromium b/third_party/feed/README.chromium index b5cb7c5..9084ed8 100644 --- a/third_party/feed/README.chromium +++ b/third_party/feed/README.chromium
@@ -2,7 +2,7 @@ Short name: feed URL: https://chromium.googlesource.com/feed Version: 0 -Revision: a8ecfb5b2201743e69e4e2961571308975212ce2 +Revision: 1160f3e7bcb05b8bda84edbb2c0f31395b230c3c License: Apache 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/feed/java_sources.gni b/third_party/feed/java_sources.gni index bb5036d..63a202b 100644 --- a/third_party/feed/java_sources.gni +++ b/third_party/feed/java_sources.gni
@@ -26,7 +26,6 @@ "src/src/main/java/com/google/android/libraries/feed/api/scope/FeedProcessScope.java", "src/src/main/java/com/google/android/libraries/feed/api/scope/FeedStreamScope.java", "src/src/main/java/com/google/android/libraries/feed/api/sessionmanager/SessionManager.java", - "src/src/main/java/com/google/android/libraries/feed/api/sessionmanager/SessionMutation.java", "src/src/main/java/com/google/android/libraries/feed/api/store/ContentMutation.java", "src/src/main/java/com/google/android/libraries/feed/api/store/SemanticPropertiesMutation.java", "src/src/main/java/com/google/android/libraries/feed/api/store/SessionMutation.java", @@ -38,13 +37,19 @@ "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/StreamActionApiImpl.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/StreamRecyclerViewAdapter.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/contentmodels/ContentModel.java", + "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/contentmodels/ContinuationContentModel.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/contentmodels/PietContentModel.java", + "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/CardDriver.java", + "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/ClusterDriver.java", + "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/ContentDriver.java", + "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/ContinuationDriver.java", + "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/FeatureDriver.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/drivers/StreamDriver.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/piet/PietAssetProvider.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/piet/PietCustomElementProvider.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/piet/PietHostBindingProvider.java", - "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/piet/PietSharedStateSupplier.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/util/TokenHandler.java", + "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/viewholders/ContinuationViewHolder.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/viewholders/PietViewHolder.java", "src/src/main/java/com/google/android/libraries/feed/basicstream/internal/viewholders/ViewHolderType.java", "src/src/main/java/com/google/android/libraries/feed/common/Result.java", @@ -86,7 +91,6 @@ "src/src/main/java/com/google/android/libraries/feed/feedsessionmanager/internal/Session.java", "src/src/main/java/com/google/android/libraries/feed/feedsessionmanager/internal/SessionFactory.java", "src/src/main/java/com/google/android/libraries/feed/feedsessionmanager/internal/SessionImpl.java", - "src/src/main/java/com/google/android/libraries/feed/feedsessionmanager/internal/SessionMutationImpl.java", "src/src/main/java/com/google/android/libraries/feed/feedstore/ContentGc.java", "src/src/main/java/com/google/android/libraries/feed/feedstore/FeedStore.java", "src/src/main/java/com/google/android/libraries/feed/feedstore/internal/FeedContentMutation.java", @@ -99,6 +103,7 @@ "src/src/main/java/com/google/android/libraries/feed/host/config/DebugBehavior.java", "src/src/main/java/com/google/android/libraries/feed/host/imageloader/ImageLoaderApi.java", "src/src/main/java/com/google/android/libraries/feed/host/logging/LoggingApi.java", + "src/src/main/java/com/google/android/libraries/feed/host/network/HttpHeader.java", "src/src/main/java/com/google/android/libraries/feed/host/network/HttpRequest.java", "src/src/main/java/com/google/android/libraries/feed/host/network/HttpResponse.java", "src/src/main/java/com/google/android/libraries/feed/host/network/NetworkClient.java", @@ -120,6 +125,7 @@ "src/src/main/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryJournalStorage.java", "src/src/main/java/com/google/android/libraries/feed/hostimpl/storage/PersistentContentStorage.java", "src/src/main/java/com/google/android/libraries/feed/hostimpl/storage/PersistentJournalStorage.java", + "src/src/main/java/com/google/android/libraries/feed/mocknetworkclient/MockPushServer.java", "src/src/main/java/com/google/android/libraries/feed/mocknetworkclient/MockServerNetworkClient.java", "src/src/main/java/com/google/android/libraries/feed/piet/AdapterFactory.java", "src/src/main/java/com/google/android/libraries/feed/piet/AdapterParameters.java", @@ -132,7 +138,6 @@ "src/src/main/java/com/google/android/libraries/feed/piet/ElementListAdapter.java", "src/src/main/java/com/google/android/libraries/feed/piet/FrameAdapter.java", "src/src/main/java/com/google/android/libraries/feed/piet/FrameContext.java", - "src/src/main/java/com/google/android/libraries/feed/piet/FrameModelBinder.java", "src/src/main/java/com/google/android/libraries/feed/piet/GridRowAdapter.java", "src/src/main/java/com/google/android/libraries/feed/piet/ImageElementAdapter.java", "src/src/main/java/com/google/android/libraries/feed/piet/KeyedRecyclerPool.java",
diff --git a/third_party/feed/proto_sources.gni b/third_party/feed/proto_sources.gni index 86e1730..65db584 100644 --- a/third_party/feed/proto_sources.gni +++ b/third_party/feed/proto_sources.gni
@@ -21,6 +21,7 @@ "src/src/main/proto/search/now/proto/ui/piet/styles.proto", "src/src/main/proto/search/now/proto/ui/piet/text.proto", "src/src/main/proto/search/now/proto/ui/stream/stream_structure.proto", + "src/src/main/proto/search/now/proto/wire/feed/action_type.proto", "src/src/main/proto/search/now/proto/wire/feed/client_info.proto", "src/src/main/proto/search/now/proto/wire/feed/content_id.proto", "src/src/main/proto/search/now/proto/wire/feed/data_operation.proto",
diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py index 7fa9f04..ebc32371 100755 --- a/tools/gn/bootstrap/bootstrap.py +++ b/tools/gn/bootstrap/bootstrap.py
@@ -525,8 +525,11 @@ 'base/location.cc', 'base/logging.cc', 'base/md5.cc', + 'base/memory/platform_shared_memory_region.cc', + 'base/memory/read_only_shared_memory_region.cc', 'base/memory/ref_counted.cc', 'base/memory/ref_counted_memory.cc', + 'base/memory/shared_memory_mapping.cc', 'base/memory/shared_memory_handle.cc', 'base/memory/shared_memory_tracker.cc', 'base/memory/weak_ptr.cc', @@ -663,6 +666,19 @@ 'base/vlog.cc', ]) + if is_win: + static_libraries['base']['sources'].extend([ + 'base/memory/platform_shared_memory_region_win.cc' + ]) + elif is_mac: + static_libraries['base']['sources'].extend([ + 'base/memory/platform_shared_memory_region_mac.cc' + ]) + elif is_posix: + static_libraries['base']['sources'].extend([ + 'base/memory/platform_shared_memory_region_posix.cc' + ]) + if is_posix: static_libraries['base']['sources'].extend([ 'base/base_paths_posix.cc',
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 6093920..7e05d45 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -3047,6 +3047,7 @@ <int value="198" label="SYNC_COMPOSITOR_NO_FUTURE_FRAME"/> <int value="199" label="SYNC_COMPOSITOR_NO_BEGIN_FRAME"/> <int value="200" label="WEBUI_BAD_HOST_ACCESS"/> + <int value="201" label="RFMF_BLOB_URL_TOKEN_FOR_NON_BLOB_URL"/> </enum> <enum name="BadMessageReasonExtensions"> @@ -13061,6 +13062,8 @@ label="CertificateTransparencyEnforcementDisabledForLegacyCas"/> <int value="437" label="MediaRouterCastAllowAllIPs"/> <int value="438" label="DeviceSamlLoginAuthenticationType"/> + <int value="439" label="WebUsbAskForUrls"/> + <int value="440" label="WebUsbBlockedForUrls"/> </enum> <enum name="EnterprisePolicyInvalidations">
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 042d55e..dc6b0ed8 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -987,6 +987,7 @@ <histogram name="Android.DownloadManager.ForegroundServiceLifecycle" enum="DownloadNotificationForegroundLifecycle"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary> Records instances where the foreground undergoes a lifecycle change (when the foreground starts, changes pinned notification, or stops). @@ -1056,6 +1057,7 @@ <histogram name="Android.DownloadManager.NotificationInteraction" enum="DownloadNotificationInteractions"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary> Records instances where a user interacts with a download notification (ie. clicks on, pauses, resumes, cancels). @@ -1065,6 +1067,7 @@ <histogram name="Android.DownloadManager.NotificationLaunch" enum="DownloadNotificationLaunchType"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary> Records instances when a notification is being launched for the first time or relaunched due to the need to dissociate the notification from the @@ -1075,6 +1078,7 @@ <histogram name="Android.DownloadManager.NotificationsCount.ForegroundDisabled" units="notifications"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary> Records the number of notifications that are already existing (presumably displayed) when a new notification is being launched to help understand the @@ -1086,6 +1090,7 @@ <histogram name="Android.DownloadManager.NotificationsCount.ForegroundEnabled" units="notifications"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary> Records the number of notifications that are already existing (presumably displayed) when a new notification is being launched to help understand the @@ -1149,6 +1154,7 @@ <histogram name="Android.DownloadManager.ServiceStopped.DownloadForeground" enum="DownloadNotificationServiceStopped"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary> Records instances of DownloadForegroundService stops. The number of expected stops (stopped) and unexpected stops (task removed, low memory, @@ -1164,6 +1170,7 @@ <histogram name="Android.DownloadManager.ServiceStopped.DownloadNotification" enum="DownloadNotificationServiceStopped"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary> Records instances of DownloadNotificationService stops. The number of expected stops (stopped) and unexpected stops (task removed, low memory, @@ -12766,6 +12773,18 @@ </summary> </histogram> +<histogram name="ContextualSuggestions.PageViewTime" units="ms"> + <owner>fgorski@chromium.org</owner> + <summary> + Android: The length of a visit on a page. Reported for HTTP and HTTPS pages + provided there was something visible printed to the screen. Selecting a tab + or loading a new URL in current tab starts timing a visit. Switching to a + different tab, closing the tab or loading a new URL finishes timing and + reports the time if the page did a visually non-empty paint or finished + loading. + </summary> +</histogram> + <histogram name="ContextualSuggestions.Preference.State" enum="BooleanEnabled"> <owner>huayinz@chromium.org</owner> <owner>twellington@chromium.org</owner> @@ -18656,6 +18675,7 @@ <histogram name="Download.ContentType.Audio" enum="DownloadAudioType"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary>Types of audio files that are downloaded.</summary> </histogram> @@ -18666,11 +18686,13 @@ <histogram name="Download.ContentType.Text" enum="DownloadTextType"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary>Types of text files that are downloaded.</summary> </histogram> <histogram name="Download.ContentType.Video" enum="DownloadVideoType"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary>Types of video files that are downloaded.</summary> </histogram> @@ -106763,6 +106785,15 @@ </summary> </histogram> +<histogram name="Windows.NativeWindowVisibility" units="windows"> + <owner>fdoray@chromium.org</owner> + <summary> + The number of Chrome browser windows in a given visibility state. This is + computed using ComputeNativeWindowOcclusionStatus() and is recorded every 10 + minutes. + </summary> +</histogram> + <histogram name="Windows.ParentProcessNameHash" enum="ProcessNameHash"> <owner>wfh@chromium.org</owner> <summary> @@ -111797,6 +111828,17 @@ name="Net.ResourceDispatcherHost.PeakOutstandingRequests"/> </histogram_suffixes> +<histogram_suffixes name="NativeWindowVisibility" separator="."> + <suffix name="Hidden" + label="The native window is not visible because it is in a minimized + window"/> + <suffix name="Occluded" + label="The native window is fully covered by other windows"/> + <suffix name="Visible" + label="The native window is visible or partially visible."/> + <affected-histogram name="Windows.NativeWindowVisibility"/> +</histogram_suffixes> + <histogram_suffixes name="NatType" separator="."> <suffix name="NoNAT"/> <suffix name="NonSymNAT"/>
diff --git a/tools/metrics/ukm/ukm.xml b/tools/metrics/ukm/ukm.xml index d28c930..f675207 100644 --- a/tools/metrics/ukm/ukm.xml +++ b/tools/metrics/ukm/ukm.xml
@@ -745,6 +745,7 @@ <event name="Download.Started"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary> Metrics taken when a download begins. It has one Download.Ended and none to multiple Download.Interrupted/Download.Resumed events associated with it. @@ -769,6 +770,7 @@ <event name="Download.Completed"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary> Metrics taken when a download completes. Its parent event is Download.Started. @@ -800,6 +802,7 @@ <event name="Download.Interrupted"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary> Metrics taken when a download is interrupted. Its parent event is Download.Started. @@ -844,6 +847,7 @@ <event name="Download.Resumed"> <owner>jming@chromium.org</owner> + <owner>xingliu@chromium.org</owner> <summary> Metrics taken when a download is resumed. Its parent event is Download.Started.
diff --git a/ui/accessibility/BUILD.gn b/ui/accessibility/BUILD.gn index 6345941..85604a5 100644 --- a/ui/accessibility/BUILD.gn +++ b/ui/accessibility/BUILD.gn
@@ -197,7 +197,6 @@ ":test_support", "//base", "//base/test:test_support", - "//mojo/common", "//mojo/edk", "//mojo/edk/test:test_support", "//mojo/public/cpp/test_support:test_utils",
diff --git a/ui/accessibility/platform/ax_platform_node_mac.mm b/ui/accessibility/platform/ax_platform_node_mac.mm index 6c12a5c..a6aa459 100644 --- a/ui/accessibility/platform/ax_platform_node_mac.mm +++ b/ui/accessibility/platform/ax_platform_node_mac.mm
@@ -18,6 +18,16 @@ #import "ui/gfx/mac/coordinate_conversion.h" #include "ui/strings/grit/ui_strings.h" +@interface AXPlatformNodeCocoa (Private) +// Helper function for string attributes that don't require extra processing. +- (NSString*)getStringAttribute:(ax::mojom::StringAttribute)attribute; +// Returns AXValue, or nil if AXValue isn't an NSString. +- (NSString*)getAXValueAsString; +// Returns the text that should be announced for an event with type |eventType|, +// or nil if it shouldn't be announced. +- (NSString*)announcementTextForEvent:(ax::mojom::Event)eventType; +@end + namespace { using RoleMap = std::map<ax::mojom::Role, NSString*>; @@ -231,6 +241,17 @@ } void NotifyMacEvent(AXPlatformNodeCocoa* target, ax::mojom::Event event_type) { + NSString* announcement_text = [target announcementTextForEvent:event_type]; + if (announcement_text) { + NSDictionary* notification_info = @{ + NSAccessibilityAnnouncementKey : announcement_text, + NSAccessibilityPriorityKey : @(NSAccessibilityPriorityHigh) + }; + NSAccessibilityPostNotificationWithUserInfo( + [NSApp mainWindow], NSAccessibilityAnnouncementRequestedNotification, + notification_info); + return; + } NSAccessibilityPostNotification( target, [AXPlatformNodeCocoa nativeNotificationFromAXEvent:event_type]); } @@ -252,13 +273,6 @@ } // namespace -@interface AXPlatformNodeCocoa () -// Helper function for string attributes that don't require extra processing. -- (NSString*)getStringAttribute:(ax::mojom::StringAttribute)attribute; -// Returns AXValue, or nil if AXValue isn't an NSString. -- (NSString*)getAXValueAsString; -@end - @implementation AXPlatformNodeCocoa { ui::AXPlatformNodeBase* node_; // Weak. Retains us. } @@ -317,6 +331,25 @@ return [value isKindOfClass:[NSString class]] ? value : nil; } +- (NSString*)announcementTextForEvent:(ax::mojom::Event)eventType { + if (eventType == ax::mojom::Event::kAlert && + node_->GetData().role == ax::mojom::Role::kAlert) { + // If there's no explicitly set accessible name, fall back to + // the inner text. + NSString* name = + [self getStringAttribute:ax::mojom::StringAttribute::kName]; + return [name length] > 0 ? name + : base::SysUTF16ToNSString(node_->GetText()); + } else if (eventType == ax::mojom::Event::kLiveRegionChanged && + node_->GetData().HasStringAttribute( + ax::mojom::StringAttribute::kContainerLiveStatus)) { + // Live regions announce their inner text. + return base::SysUTF16ToNSString(node_->GetText()); + } + // Only alerts and live regions have something to announce. + return nil; +} + // NSAccessibility informal protocol implementation. - (BOOL)accessibilityIsIgnored {
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc index 95234e5..093e1cca 100644 --- a/ui/app_list/views/app_list_view.cc +++ b/ui/app_list/views/app_list_view.cc
@@ -197,25 +197,6 @@ DISALLOW_COPY_AND_ASSIGN(StateAnimationMetricsReporter); }; -// An animation observer to decide whether to ignore scroll events. -class ScrollAnimationObserver : public ui::ImplicitAnimationObserver { - public: - explicit ScrollAnimationObserver(base::WeakPtr<AppListView> view) - : view_(view) {} - ~ScrollAnimationObserver() override = default; - - private: - // ui::ImplicitAnimationObserver: - void OnImplicitAnimationsCompleted() override { - if (view_) - view_->SetIsIgnoringScrollEvents(false); - } - - base::WeakPtr<AppListView> view_; - - DISALLOW_COPY_AND_ASSIGN(ScrollAnimationObserver); -}; - } // namespace // An animation observer to hide the view at the end of the animation. @@ -272,9 +253,6 @@ // Enable arrow key in FocusManager. Arrow left/right and up/down triggers // the same focus movement as tab/shift+tab. views::FocusManager::set_arrow_key_traversal_enabled(true); - - scroll_animation_observer_.reset( - new ScrollAnimationObserver(weak_ptr_factory_.GetWeakPtr())); } AppListView::~AppListView() { @@ -1086,7 +1064,7 @@ // Ignore 0-offset events to prevent spurious dismissal, see crbug.com/806338 // The system generates 0-offset ET_SCROLL_FLING_CANCEL events during simple // touchpad mouse moves. Those may be passed via mojo APIs and handled here. - if (offset == 0 || is_in_drag() || is_ignoring_scroll_events_) + if (offset == 0 || is_in_drag() || ShouldIgnoreScrollEvents()) return false; if (app_list_state_ != AppListViewState::PEEKING && @@ -1213,7 +1191,6 @@ ui::LayerAnimator* animator = layer->GetAnimator(); animator->StopAnimating(); ui::ScopedLayerAnimationSettings settings(animator); - settings.AddObserver(scroll_animation_observer_.get()); settings.SetTransitionDuration( base::TimeDelta::FromMilliseconds(animation_duration)); settings.SetTweenType(gfx::Tween::EASE_OUT); @@ -1222,8 +1199,6 @@ settings.SetAnimationMetricsReporter(state_animation_metrics_reporter_.get()); layer->SetTransform(gfx::Transform()); - - SetIsIgnoringScrollEvents(true); } void AppListView::StartCloseAnimation(base::TimeDelta animation_duration) { @@ -1315,11 +1290,6 @@ return GetDisplayNearestView().bounds().bottom(); } -void AppListView::SetIsIgnoringScrollEvents(bool is_ignoring) { - DCHECK_NE(is_ignoring_scroll_events_, is_ignoring); - is_ignoring_scroll_events_ = is_ignoring; -} - bool AppListView::IsHomeLauncherEnabledInTabletMode() const { return is_tablet_mode_ && is_home_launcher_enabled_; } @@ -1459,4 +1429,12 @@ number_of_apps_in_folders); } +bool AppListView::ShouldIgnoreScrollEvents() { + // When the app list is doing state change animation or the apps grid view is + // in transition, ignore the scroll events to prevent triggering extra state + // changes or transtions. + return fullscreen_widget_->GetLayer()->GetAnimator()->is_animating() || + GetRootAppsGridView()->pagination_model()->has_transition(); +} + } // namespace app_list
diff --git a/ui/app_list/views/app_list_view.h b/ui/app_list/views/app_list_view.h index 50ac3f1..6e48a1d 100644 --- a/ui/app_list/views/app_list_view.h +++ b/ui/app_list/views/app_list_view.h
@@ -31,7 +31,6 @@ namespace ui { class AnimationMetricsReporter; -class ImplicitAnimationObserver; } namespace app_list { @@ -219,9 +218,6 @@ bool drag_started_from_peeking() const { return drag_started_from_peeking_; } - void SetIsIgnoringScrollEvents(bool is_ignoring); - bool is_ignoring_scroll_events() const { return is_ignoring_scroll_events_; } - void set_onscreen_keyboard_shown(bool onscreen_keyboard_shown) { onscreen_keyboard_shown_ = onscreen_keyboard_shown; } @@ -323,6 +319,9 @@ // histograms. void RecordFolderMetrics(); + // Returns true if scroll events should be ignored. + bool ShouldIgnoreScrollEvents(); + AppListViewDelegate* delegate_; // Weak. Owned by AppListService. AppListModel* const model_; // Not Owned. SearchModel* const search_model_; // Not Owned. @@ -398,18 +397,12 @@ const std::unique_ptr<ui::AnimationMetricsReporter> state_animation_metrics_reporter_; - // Whether to ignore the scroll events. - bool is_ignoring_scroll_events_ = false; - // Whether the on-screen keyboard is shown. bool onscreen_keyboard_shown_ = false; // Whether the home launcher feature is enabled. const bool is_home_launcher_enabled_; - // Observes the completion of scroll animation. - std::unique_ptr<ui::ImplicitAnimationObserver> scroll_animation_observer_; - // TODO(b/77637813): Remove when pulling Assistant out of the launcher. // Reference to AshAssistantController. Owned by Shell. AssistantController* assistant_controller_ = nullptr;
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc index ff0f4adb..37e11c8 100644 --- a/ui/app_list/views/apps_grid_view.cc +++ b/ui/app_list/views/apps_grid_view.cc
@@ -2299,7 +2299,6 @@ } void AppsGridView::TransitionStarted() { - contents_view_->app_list_view()->SetIsIgnoringScrollEvents(true); CancelContextMenusOnCurrentPage(); pagination_animation_start_frame_number_ = GetCompositorActivatedFrameCount(layer()->GetCompositor()); @@ -2315,7 +2314,6 @@ } void AppsGridView::TransitionEnded() { - contents_view_->app_list_view()->SetIsIgnoringScrollEvents(false); const base::TimeDelta duration = pagination_model_.GetTransitionAnimationSlideDuration();
diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn index c1eaaf3e..e6aa8fcb 100644 --- a/ui/aura/BUILD.gn +++ b/ui/aura/BUILD.gn
@@ -389,7 +389,6 @@ ":test_support", "//base/test:test_support", "//components/viz/client", - "//mojo/common", "//mojo/edk", "//net", "//services/ui/common:task_runner_test_base",
diff --git a/ui/aura/DEPS b/ui/aura/DEPS index 0302ae3..a6548b4 100644 --- a/ui/aura/DEPS +++ b/ui/aura/DEPS
@@ -7,7 +7,6 @@ "+components/viz/client", "+components/viz/common", "+components/viz/host", - "+mojo/common", "+mojo/public/cpp", "+net/base/filename_util.h", "+services/service_manager/public/cpp",
diff --git a/ui/base/accelerators/mojo/DEPS b/ui/base/accelerators/mojo/DEPS index 6cbc2015..8949f97 100644 --- a/ui/base/accelerators/mojo/DEPS +++ b/ui/base/accelerators/mojo/DEPS
@@ -1,4 +1,3 @@ include_rules = [ - "+mojo/common", "+mojo/public/cpp/base", ]
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc index bc8da0f0..a53d53d 100644 --- a/ui/base/resource/resource_bundle.cc +++ b/ui/base/resource/resource_bundle.cc
@@ -247,6 +247,18 @@ } #endif // !defined(OS_ANDROID) +void ResourceBundle::AddDataPack(std::unique_ptr<DataPack> data_pack) { +#if DCHECK_IS_ON() + data_pack->CheckForDuplicateResources(data_packs_); +#endif + + if (GetScaleForScaleFactor(data_pack->GetScaleFactor()) > + GetScaleForScaleFactor(max_scale_factor_)) + max_scale_factor_ = data_pack->GetScaleFactor(); + + data_packs_.push_back(std::move(data_pack)); +} + void ResourceBundle::AddDataPackFromPath(const base::FilePath& path, ScaleFactor scale_factor) { AddDataPackFromPathInternal(path, scale_factor, false); @@ -805,18 +817,6 @@ } } -void ResourceBundle::AddDataPack(std::unique_ptr<DataPack> data_pack) { -#if DCHECK_IS_ON() - data_pack->CheckForDuplicateResources(data_packs_); -#endif - - if (GetScaleForScaleFactor(data_pack->GetScaleFactor()) > - GetScaleForScaleFactor(max_scale_factor_)) - max_scale_factor_ = data_pack->GetScaleFactor(); - - data_packs_.push_back(std::move(data_pack)); -} - void ResourceBundle::InitDefaultFontList() { #if defined(OS_CHROMEOS) std::string font_family = base::UTF16ToUTF8(
diff --git a/ui/base/resource/resource_bundle.h b/ui/base/resource/resource_bundle.h index 413b61a..422d84b 100644 --- a/ui/base/resource/resource_bundle.h +++ b/ui/base/resource/resource_bundle.h
@@ -158,6 +158,10 @@ // Check if the .pak for the given locale exists. bool LocaleDataPakExists(const std::string& locale); + // Inserts |data_pack| to |data_pack_| and updates |max_scale_factor_| + // accordingly. + void AddDataPack(std::unique_ptr<DataPack> data_pack); + // Registers additional data pack files with this ResourceBundle. When // looking for a DataResource, we will search these files after searching the // main module. |path| should be the complete path to the pack file if known @@ -337,10 +341,6 @@ ScaleFactor scale_factor, bool optional); - // Inserts |data_pack| to |data_pack_| and updates |max_scale_factor_| - // accordingly. - void AddDataPack(std::unique_ptr<DataPack> data_pack); - // Try to load the locale specific strings from an external data module. // Returns the locale that is loaded. std::string LoadLocaleResources(const std::string& pref_locale);
diff --git a/ui/base/resource/resource_bundle_android.cc b/ui/base/resource/resource_bundle_android.cc index 2ebf50ba..3ea38cf 100644 --- a/ui/base/resource/resource_bundle_android.cc +++ b/ui/base/resource/resource_bundle_android.cc
@@ -11,7 +11,6 @@ #include "base/path_service.h" #include "jni/ResourceBundle_jni.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/resource/data_pack.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_paths.h" @@ -176,6 +175,21 @@ } } +std::unique_ptr<DataPack> GetDataPackFromPackFile( + const char* path_within_apk, + const base::FilePath& disk_file_path) { + if (LoadFromApkOrFile(path_within_apk, &disk_file_path, &g_resources_pack_fd, + &g_resources_pack_region)) { + std::unique_ptr<DataPack> data_pack = + std::make_unique<DataPack>(SCALE_FACTOR_NONE); + if (data_pack->LoadFromFileRegion(base::File(g_resources_pack_fd), + g_resources_pack_region)) { + return data_pack; + } + } + return nullptr; +} + int GetMainAndroidPackFd(base::MemoryMappedFile::Region* out_region) { DCHECK_GE(g_resources_pack_fd, 0); *out_region = g_resources_pack_region;
diff --git a/ui/base/resource/resource_bundle_android.h b/ui/base/resource/resource_bundle_android.h index 57059b0..2913731 100644 --- a/ui/base/resource/resource_bundle_android.h +++ b/ui/base/resource/resource_bundle_android.h
@@ -9,6 +9,7 @@ #include <string> #include "base/files/memory_mapped_file.h" +#include "ui/base/resource/data_pack.h" #include "ui/base/ui_base_export.h" namespace ui { @@ -19,6 +20,10 @@ const char* path_within_apk, const base::FilePath& disk_file_path); +UI_BASE_EXPORT std::unique_ptr<DataPack> GetDataPackFromPackFile( + const char* path_within_apk, + const base::FilePath& disk_file_path); + // Returns the file descriptor and region for resources.pak. UI_BASE_EXPORT int GetMainAndroidPackFd( base::MemoryMappedFile::Region* out_region);
diff --git a/ui/events/mojo/DEPS b/ui/events/mojo/DEPS index 20e5cd0..c58363c 100644 --- a/ui/events/mojo/DEPS +++ b/ui/events/mojo/DEPS
@@ -1,5 +1,4 @@ include_rules = [ - "+mojo/common", "+mojo/public", "+services/ui/public/interfaces", "+ui/events",
diff --git a/ui/events/x/events_x_utils.cc b/ui/events/x/events_x_utils.cc index 6ad9ba9..86fbd19 100644 --- a/ui/events/x/events_x_utils.cc +++ b/ui/events/x/events_x_utils.cc
@@ -426,8 +426,11 @@ return devices->IsTouchpadXInputEvent(xev) ? ET_SCROLL : ET_MOUSEWHEEL; } - if (devices->GetScrollClassEventDetail(xev) != SCROLL_TYPE_NO_SCROLL) - return ET_MOUSEWHEEL; + if (devices->GetScrollClassEventDetail(xev) != + SCROLL_TYPE_NO_SCROLL) { + return devices->IsTouchpadXInputEvent(xev) ? ET_SCROLL + : ET_MOUSEWHEEL; + } if (devices->IsCMTMetricsEvent(xev)) return ET_UMA_DATA; if (GetButtonMaskForX2Event(xievent)) @@ -753,22 +756,22 @@ float* x_offset_ordinal, float* y_offset_ordinal, int* finger_count) { - if (DeviceDataManagerX11::GetInstance()->IsScrollEvent(xev)) { - // Temp values to prevent passing NULLs to DeviceDataManager. - float x_offset_, y_offset_; - float x_offset_ordinal_, y_offset_ordinal_; - int finger_count_; - if (!x_offset) - x_offset = &x_offset_; - if (!y_offset) - y_offset = &y_offset_; - if (!x_offset_ordinal) - x_offset_ordinal = &x_offset_ordinal_; - if (!y_offset_ordinal) - y_offset_ordinal = &y_offset_ordinal_; - if (!finger_count) - finger_count = &finger_count_; + // Temp values to prevent passing NULLs to DeviceDataManager. + float x_scroll_offset, y_scroll_offset; + float x_scroll_offset_ordinal, y_scroll_offset_ordinal; + int finger; + if (!x_offset) + x_offset = &x_scroll_offset; + if (!y_offset) + y_offset = &y_scroll_offset; + if (!x_offset_ordinal) + x_offset_ordinal = &x_scroll_offset_ordinal; + if (!y_offset_ordinal) + y_offset_ordinal = &y_scroll_offset_ordinal; + if (!finger_count) + finger_count = &finger; + if (DeviceDataManagerX11::GetInstance()->IsScrollEvent(xev)) { DeviceDataManagerX11::GetInstance()->GetScrollOffsets( xev, x_offset, y_offset, x_offset_ordinal, y_offset_ordinal, finger_count); @@ -782,6 +785,15 @@ xev, &x_scroll_offset, &y_scroll_offset); *x_offset = x_scroll_offset * kWheelScrollAmount; *y_offset = y_scroll_offset * kWheelScrollAmount; + + if (DeviceDataManagerX11::GetInstance()->IsTouchpadXInputEvent(xev)) { + *x_offset_ordinal = *x_offset; + *y_offset_ordinal = *y_offset; + // In libinput, we can check to validate whether the device supports + // 'two_finger', 'edge' scrolling or not. See + // https://www.mankier.com/4/libinput. + *finger_count = 2; + } return true; } return false;
diff --git a/ui/latency/mojo/DEPS b/ui/latency/mojo/DEPS index 248dbde..77a2762 100644 --- a/ui/latency/mojo/DEPS +++ b/ui/latency/mojo/DEPS
@@ -1,5 +1,4 @@ include_rules = [ - "+mojo/common", "+mojo/public", "+ui/gfx/geometry/mojo", "+ui/latency",
diff --git a/ui/message_center/public/mojo/DEPS b/ui/message_center/public/mojo/DEPS deleted file mode 100644 index 6cfa565..0000000 --- a/ui/message_center/public/mojo/DEPS +++ /dev/null
@@ -1,3 +0,0 @@ -include_rules = [ - "+mojo/common", -]
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc index 6aa3bb5..5c21e221 100644 --- a/ui/views/controls/menu/menu_item_view.cc +++ b/ui/views/controls/menu/menu_item_view.cc
@@ -1097,6 +1097,10 @@ } void MenuItemView::ApplyMinimumDimensions(MenuItemDimensions* dims) const { + // Don't apply minimums to menus without controllers or to comboboxes. + if (!GetMenuController() || GetMenuController()->is_combobox()) + return; + int used = dims->standard_width + dims->children_width + dims->minor_text_width; const MenuConfig& config = MenuConfig::instance();
diff --git a/ui/views/controls/menu/menu_item_view_unittest.cc b/ui/views/controls/menu/menu_item_view_unittest.cc index 6cb71926..9170ded6 100644 --- a/ui/views/controls/menu/menu_item_view_unittest.cc +++ b/ui/views/controls/menu/menu_item_view_unittest.cc
@@ -70,25 +70,16 @@ ASSERT_EQ(flexible_view, submenu->GetMenuItemAt(1)); gfx::Size flexible_size = flexible_view->GetPreferredSize(); - const MenuConfig& config = MenuConfig::instance(); + EXPECT_EQ(1, flexible_size.width()); - if (config.minimum_menu_width) - EXPECT_EQ(flexible_size.width(), config.minimum_menu_width); - else - EXPECT_EQ(flexible_size.width(), 1); + // ...but it should use whatever space is available to make a square. + int flex_height = flexible_view->GetHeightForWidth(label_size.width()); + EXPECT_EQ(label_size.width(), flex_height); - if (!config.minimum_container_item_height) { - // ...but it should use whatever space is available to make a square. - int flex_height = flexible_view->GetHeightForWidth(label_size.width()); - EXPECT_EQ(label_size.width(), flex_height); - - // The submenu should be tall enough to allow for both menu items at the - // given width. - EXPECT_EQ(label_size.height() + flex_height, - submenu->GetPreferredSize().height()); - } else { - EXPECT_EQ(flexible_size.height(), config.minimum_container_item_height); - } + // The submenu should be tall enough to allow for both menu items at the + // given width. + EXPECT_EQ(label_size.height() + flex_height, + submenu->GetPreferredSize().height()); } // Tests that the top-level menu item with hidden children should contain the
diff --git a/ui/views/controls/webview/web_dialog_view.cc b/ui/views/controls/webview/web_dialog_view.cc index ef8b793f..323d9f8 100644 --- a/ui/views/controls/webview/web_dialog_view.cc +++ b/ui/views/controls/webview/web_dialog_view.cc
@@ -307,19 +307,16 @@ return WebDialogWebContentsDelegate::OpenURLFromTab(source, params); } -void WebDialogView::AddNewContents(content::WebContents* source, - content::WebContents* new_contents, - WindowOpenDisposition disposition, - const gfx::Rect& initial_rect, - bool user_gesture, - bool* was_blocked) { - if (delegate_ && delegate_->HandleAddNewContents( - source, new_contents, disposition, initial_rect, user_gesture)) { - return; - } - WebDialogWebContentsDelegate::AddNewContents( - source, new_contents, disposition, initial_rect, user_gesture, - was_blocked); +void WebDialogView::AddNewContents( + content::WebContents* source, + std::unique_ptr<content::WebContents> new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_rect, + bool user_gesture, + bool* was_blocked) { + WebDialogWebContentsDelegate::AddNewContents(source, std::move(new_contents), + disposition, initial_rect, + user_gesture, was_blocked); } void WebDialogView::LoadingStateChanged(content::WebContents* source,
diff --git a/ui/views/controls/webview/web_dialog_view.h b/ui/views/controls/webview/web_dialog_view.h index 3a91e99..bfba061 100644 --- a/ui/views/controls/webview/web_dialog_view.h +++ b/ui/views/controls/webview/web_dialog_view.h
@@ -104,7 +104,7 @@ content::WebContents* source, const content::OpenURLParams& params) override; void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/ui/views/mus/BUILD.gn b/ui/views/mus/BUILD.gn index dfe239c1..3454547 100644 --- a/ui/views/mus/BUILD.gn +++ b/ui/views/mus/BUILD.gn
@@ -49,7 +49,6 @@ "//base:i18n", "//base/third_party/dynamic_annotations", "//cc", - "//mojo/common", "//mojo/public/cpp/bindings", "//net", "//services/catalog/public/cpp",
diff --git a/ui/views/mus/DEPS b/ui/views/mus/DEPS index 21ea014..5f4b90e 100644 --- a/ui/views/mus/DEPS +++ b/ui/views/mus/DEPS
@@ -4,7 +4,6 @@ "+components/services/font/public", "+components/gpu", "+mojo/cc", - "+mojo/common", "+mojo/converters", "+mojo/edk/embedder", "+mojo/public",
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc index 3f50f47..89513b6 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -2140,7 +2140,12 @@ case ui::ET_SCROLL_FLING_CANCEL: case ui::ET_SCROLL: { ui::ScrollEvent scrollev(xev); - SendEventToSink(&scrollev); + // We need to filter zero scroll offset here. Because + // MouseWheelEventQueue assumes we'll never get a zero scroll offset + // event and we need delta to determine which element to scroll on + // phaseBegan. + if (scrollev.x_offset() != 0.0 || scrollev.y_offset() != 0.0) + SendEventToSink(&scrollev); break; } case ui::ET_KEY_PRESSED:
diff --git a/ui/web_dialogs/web_dialog_delegate.cc b/ui/web_dialogs/web_dialog_delegate.cc index 7ef4cbe..f5ae082 100644 --- a/ui/web_dialogs/web_dialog_delegate.cc +++ b/ui/web_dialogs/web_dialog_delegate.cc
@@ -41,15 +41,6 @@ return false; } -bool WebDialogDelegate::HandleAddNewContents( - content::WebContents* source, - content::WebContents* new_contents, - WindowOpenDisposition disposition, - const gfx::Rect& initial_rect, - bool user_gesture) { - return false; -} - bool WebDialogDelegate::HandleShouldCreateWebContents() { return true; }
diff --git a/ui/web_dialogs/web_dialog_delegate.h b/ui/web_dialogs/web_dialog_delegate.h index eb2db20..b966e1f 100644 --- a/ui/web_dialogs/web_dialog_delegate.h +++ b/ui/web_dialogs/web_dialog_delegate.h
@@ -26,7 +26,6 @@ } namespace gfx { -class Rect; class Size; } @@ -123,17 +122,6 @@ const content::OpenURLParams& params, content::WebContents** out_new_contents); - // A callback to create a new tab with |new_contents|. |source| is the - // WebContent where the operation originated. |disposition| controls how the - // new tab should be opened. |initial_rect| is the position and size of the - // window if a new window is created. |user_gesture| is true if the operation - // was started by a user gesture. Return false to use the default handler. - virtual bool HandleAddNewContents(content::WebContents* source, - content::WebContents* new_contents, - WindowOpenDisposition disposition, - const gfx::Rect& initial_rect, - bool user_gesture); - // A callback to control whether a WebContents will be created. Returns // false to disallow the creation. Return true to use the default handler. virtual bool HandleShouldCreateWebContents();
diff --git a/ui/web_dialogs/web_dialog_web_contents_delegate.cc b/ui/web_dialogs/web_dialog_web_contents_delegate.cc index 08bf98a..306bf2b 100644 --- a/ui/web_dialogs/web_dialog_web_contents_delegate.cc +++ b/ui/web_dialogs/web_dialog_web_contents_delegate.cc
@@ -41,15 +41,16 @@ } void WebDialogWebContentsDelegate::AddNewContents( - WebContents* source, WebContents* new_contents, - WindowOpenDisposition disposition, const gfx::Rect& initial_rect, + WebContents* source, + std::unique_ptr<WebContents> new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_rect, bool user_gesture, bool* was_blocked) { // TODO(erikchen): Refactor AddNewContents to take strong ownership semantics. // https://crbug.com/832879. - handler_->AddNewContents(browser_context_, source, - base::WrapUnique(new_contents), disposition, - initial_rect, user_gesture); + handler_->AddNewContents(browser_context_, source, std::move(new_contents), + disposition, initial_rect, user_gesture); } bool WebDialogWebContentsDelegate::IsPopupOrPanel(
diff --git a/ui/web_dialogs/web_dialog_web_contents_delegate.h b/ui/web_dialogs/web_dialog_web_contents_delegate.h index a660e33..d1cb93d 100644 --- a/ui/web_dialogs/web_dialog_web_contents_delegate.h +++ b/ui/web_dialogs/web_dialog_web_contents_delegate.h
@@ -63,7 +63,7 @@ content::WebContents* source, const content::OpenURLParams& params) override; void AddNewContents(content::WebContents* source, - content::WebContents* new_contents, + std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture,
diff --git a/ui/webui/BUILD.gn b/ui/webui/BUILD.gn index 7757ffd..16f9b7c 100644 --- a/ui/webui/BUILD.gn +++ b/ui/webui/BUILD.gn
@@ -11,7 +11,6 @@ deps = [ "//base", "//content/public/browser", - "//mojo/common", "//services/service_manager/public/cpp", ] }