diff --git a/BUILD.gn b/BUILD.gn index 023d3da..6def4d2 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -1268,7 +1268,6 @@ "//third_party/blink/web_tests/editing/", "//third_party/blink/web_tests/external/", "//third_party/blink/web_tests/fast/", - "//third_party/blink/web_tests/fenced_frame/", "//third_party/blink/web_tests/fonts/", "//third_party/blink/web_tests/fragmentation/", "//third_party/blink/web_tests/fullscreen/",
diff --git a/DEPS b/DEPS index 54627d63..8dd3ea5 100644 --- a/DEPS +++ b/DEPS
@@ -245,7 +245,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '98c09e51f33e978a0d2860b70dd82b8c97aa4ca5', + 'skia_revision': 'd0c5af65231841e09eee189e14417530e9a81974', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -320,7 +320,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '34598f6ba9afbd140800b3ce465c53449c07c93b', + 'devtools_frontend_revision': '846327d74bdbe14aa93396e415d0928f05c5b9bf', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -404,7 +404,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. - 'libcxxabi_revision': '94855f7b7cdadf1aa5c58ac3ccf522e204e27087', + 'libcxxabi_revision': '7d7912617f159a10bcaaf0867f140469b2a77536', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -617,7 +617,7 @@ Var('chromium_git') + '/external/github.com/toji/webvr.info.git' + '@' + 'c58ae99b9ff9e2aa4c524633519570bf33536248', 'src/docs/website': { - 'url': Var('chromium_git') + '/website.git' + '@' + 'ea4df8bc39091983ec4f0beb57c5fdf4e8b5f970', + 'url': Var('chromium_git') + '/website.git' + '@' + 'ed52cd24ed88168a014780720690306e15cf8dd5', }, 'src/ios/third_party/earl_grey2/src': { @@ -1044,7 +1044,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'cb340f5b7bbdcaba0fad346b08db91538619a531', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'b674278ce71b2ee683b8b0c98c9a64152988ecdb', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1427,7 +1427,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'c581dd4f599dc73735f6d006ea1d25ea80ce3165', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '645a5c0de636e50b64ea256da8a722954d3c37ca', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1648,7 +1648,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'fc207904abbb29864991c71c7156336455a3d892', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '1ca57b9015517627f7d08ea8cfb82db30d2f8193', + Var('webrtc_git') + '/src.git' + '@' + '63c458586590330644fa1f0b66a4e5e3a72acf7f', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1718,7 +1718,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@83b507fd68910f94bd218ac0e4a6f0f048c8e8dc', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@c265f4235a719acb3e3e8f57bf55dcb0d7b3c770', 'condition': 'checkout_src_internal', },
diff --git a/WATCHLISTS b/WATCHLISTS index f382fc46..8875c2a 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -1126,6 +1126,7 @@ 'holding_space': { 'filepath': 'ash/public/cpp/holding_space|'\ 'ash/system/holding_space|'\ + 'ash/system/progress_indicator|'\ 'chrome/browser/lacros/.*holding_space|'\ 'chrome/browser/ui/ash/holding_space|'\ 'chrome/browser/ui/ash/thumbnail_loader|'\ @@ -2859,7 +2860,7 @@ 'ramyagopalan+watch@google.com', 'jorgelo+watch@chromium.org'], 'translate': ['translate-reviews@chromium.org'], - 'turtledove': ['taymon@google.com'], + 'turtledove': [], 'ui_compositor': ['cc-bugs@chromium.org'], 'ui_display_win': ['robliao+watch@chromium.org'], 'ui_resources': ['oshima+watch@chromium.org'],
diff --git a/android_webview/browser/aw_browser_process.cc b/android_webview/browser/aw_browser_process.cc index ccd307d..9cba1cc 100644 --- a/android_webview/browser/aw_browser_process.cc +++ b/android_webview/browser/aw_browser_process.cc
@@ -191,6 +191,7 @@ network::mojom::HttpAuthDynamicParamsPtr auth_dynamic_params = network::mojom::HttpAuthDynamicParams::New(); + auth_dynamic_params->allowed_schemes = AwBrowserContext::GetAuthSchemes(); auth_dynamic_params->server_allowlist = local_state()->GetString(prefs::kAuthServerAllowlist); auth_dynamic_params->android_negotiate_account_type =
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc index 3dd4ae1..d826310 100644 --- a/android_webview/browser/aw_content_browser_client.cc +++ b/android_webview/browser/aw_content_browser_client.cc
@@ -258,10 +258,8 @@ void AwContentBrowserClient::OnNetworkServiceCreated( network::mojom::NetworkService* network_service) { - network::mojom::HttpAuthStaticParamsPtr auth_static_params = - network::mojom::HttpAuthStaticParams::New(); - auth_static_params->supported_schemes = AwBrowserContext::GetAuthSchemes(); - content::GetNetworkService()->SetUpHttpAuth(std::move(auth_static_params)); + content::GetNetworkService()->SetUpHttpAuth( + network::mojom::HttpAuthStaticParams::New()); } void AwContentBrowserClient::ConfigureNetworkContextParams(
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 4b17289..cf038d9 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -1050,6 +1050,8 @@ "system/dark_mode/dark_mode_feature_pod_controller.cc", "system/dark_mode/dark_mode_feature_pod_controller.h", "system/enterprise/enterprise_domain_observer.h", + "system/firmware_update/firmware_update_notification_controller.cc", + "system/firmware_update/firmware_update_notification_controller.h", "system/geolocation/geolocation_controller.cc", "system/geolocation/geolocation_controller.h", "system/gesture_education/gesture_education_notification_controller.cc", @@ -1417,6 +1419,7 @@ "system/privacy_screen/privacy_screen_toast_controller.h", "system/privacy_screen/privacy_screen_toast_view.cc", "system/privacy_screen/privacy_screen_toast_view.h", + "system/progress_indicator/progress_indicator_animation_registry.h", "system/rotation/rotation_lock_feature_pod_controller.cc", "system/rotation/rotation_lock_feature_pod_controller.h", "system/scheduled_feature/scheduled_feature.cc", @@ -2514,6 +2517,7 @@ "system/bluetooth/tray_bluetooth_helper_legacy_unittest.cc", "system/bluetooth/unified_bluetooth_detailed_view_controller_unittest.cc", "system/caps_lock_notification_controller_unittest.cc", + "system/firmware_update/firmware_update_notification_controller_unittest.cc", "system/geolocation/geolocation_controller_unittest.cc", "system/gesture_education/gesture_education_notification_controller_unittest.cc", "system/holding_space/holding_space_animation_registry_unittest.cc",
diff --git a/ash/app_list/app_list_bubble_presenter.cc b/ash/app_list/app_list_bubble_presenter.cc index fa06492..d927625 100644 --- a/ash/app_list/app_list_bubble_presenter.cc +++ b/ash/app_list/app_list_bubble_presenter.cc
@@ -333,7 +333,7 @@ const absl::optional<AppListSortOrder>& new_order) { if (!bubble_view_) return; - bubble_view_->apps_page()->OnTemporarySortOrderChanged(new_order); + bubble_view_->OnTemporarySortOrderChanged(new_order); } void AppListBubblePresenter::ShowEmbeddedAssistantUI() {
diff --git a/ash/app_list/app_list_bubble_presenter_unittest.cc b/ash/app_list/app_list_bubble_presenter_unittest.cc index 35f3e53..1412acd 100644 --- a/ash/app_list/app_list_bubble_presenter_unittest.cc +++ b/ash/app_list/app_list_bubble_presenter_unittest.cc
@@ -360,6 +360,37 @@ EXPECT_TRUE(presenter->IsShowingEmbeddedAssistantUI()); } +TEST_F(AppListBubblePresenterTest, AppsPageVisibleAfterShowingAssistant) { + // Simulate production behavior for animations, assistant, and zero-state + // search results. + base::test::ScopedFeatureList features( + features::kProductivityLauncherAnimation); + ui::ScopedAnimationDurationScaleMode duration( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); + assistant_test_api_->EnableAssistantAndWait(); + GetTestAppListClient()->set_run_zero_state_callback_immediately(false); + + // Show the assistant. + PressAndReleaseKey(ui::VKEY_ASSISTANT); + AppListTestApi().WaitForBubbleWindow(/*wait_for_opening_animation=*/true); + + // Hide the assistant. + PressAndReleaseKey(ui::VKEY_ASSISTANT); + base::RunLoop().RunUntilIdle(); + + AppListBubblePresenter* presenter = GetBubblePresenter(); + ASSERT_FALSE(presenter->IsShowing()); + + // Show the launcher. + PressAndReleaseKey(ui::VKEY_BROWSER_SEARCH); + AppListTestApi().WaitForBubbleWindow(/*wait_for_opening_animation=*/true); + + // Apps page is visible, even though it was hidden when showing assistant. + EXPECT_TRUE( + presenter->bubble_view_for_test()->apps_page_for_test()->GetVisible()); + EXPECT_FALSE(presenter->IsShowingEmbeddedAssistantUI()); +} + TEST_F(AppListBubblePresenterTest, SearchKeyOpensToAppsPage) { // Simulate production behavior for animations, assistant, and zero-state // search results.
diff --git a/ash/app_list/app_list_test_api.cc b/ash/app_list/app_list_test_api.cc index 1c6c82d2..944250e 100644 --- a/ash/app_list/app_list_test_api.cc +++ b/ash/app_list/app_list_test_api.cc
@@ -80,7 +80,9 @@ AppListReorderUndoContainerView* GetReorderUndoContainerViewFromBubble() { DCHECK(features::IsLauncherAppSortEnabled()); - return GetAppListBubbleView()->apps_page()->reorder_undo_container_for_test(); + return GetAppListBubbleView() + ->apps_page_for_test() + ->reorder_undo_container_for_test(); } AppListReorderUndoContainerView* @@ -150,11 +152,19 @@ DCHECK_EQ(app_list_window, waiter.added_window()); } - if (wait_for_opening_animation) - WaitUntilAppListAnimationIdle(); + if (wait_for_opening_animation) { + // Clamshell productivity launcher animates the AppListBubbleView. + LayerAnimationStoppedWaiter().Wait( + app_list_controller->bubble_presenter_for_test() + ->bubble_view_for_test() + ->layer()); + } } void AppListTestApi::WaitUntilAppListAnimationIdle() { + // This function waits for the fullscreen launcher animation. + DCHECK(!features::IsProductivityLauncherEnabled() || + Shell::Get()->IsInTabletMode()); aura::Window* app_list_window = Shell::Get()->app_list_controller()->GetWindow(); DCHECK(app_list_window); @@ -267,7 +277,9 @@ AppsGridView* AppListTestApi::GetTopLevelAppsGridView() { if (features::IsProductivityLauncherEnabled() && !Shell::Get()->tablet_mode_controller()->InTabletMode()) { - return GetAppListBubbleView()->apps_page()->scrollable_apps_grid_view(); + return GetAppListBubbleView() + ->apps_page_for_test() + ->scrollable_apps_grid_view(); } return GetPagedAppsGridView();
diff --git a/ash/app_list/views/app_list_bubble_apps_page.cc b/ash/app_list/views/app_list_bubble_apps_page.cc index 13e8038..33d3df4 100644 --- a/ash/app_list/views/app_list_bubble_apps_page.cc +++ b/ash/app_list/views/app_list_bubble_apps_page.cc
@@ -35,6 +35,8 @@ #include "ui/compositor/layer.h" #include "ui/compositor/layer_animator.h" #include "ui/compositor/layer_type.h" +#include "ui/compositor/scoped_animation_duration_scale_mode.h" +#include "ui/gfx/geometry/transform.h" #include "ui/gfx/text_constants.h" #include "ui/views/animation/animation_builder.h" #include "ui/views/border.h" @@ -190,7 +192,9 @@ recent_apps_->RemoveObserver(this); } -void AppListBubbleAppsPage::StartShowAnimation() { +void AppListBubbleAppsPage::AnimateShowLauncher() { + DCHECK(GetVisible()); + // The animation relies on the correct positions of views, so force layout. if (needs_layout()) Layout(); @@ -237,11 +241,95 @@ weak_factory_.GetWeakPtr())); } -void AppListBubbleAppsPage::StartHideAnimation() { +void AppListBubbleAppsPage::AnimateHideLauncher() { // Remove the gradient mask from the scroll view to improve performance. gradient_helper_.reset(); } +void AppListBubbleAppsPage::AnimateShowPage() { + SetVisible(true); + + // If skipping animations, just update visibility. + if (!features::IsProductivityLauncherAnimationEnabled() || + ui::ScopedAnimationDurationScaleMode::is_zero()) { + return; + } + + // TODO(https://crbug.com/1286590): Add ui::AnimationThroughputReporter and + // tests. + + // Scroll contents has a layer, so animate that. + views::View* scroll_contents = scroll_view_->contents(); + DCHECK(scroll_contents->layer()); + DCHECK_EQ(scroll_contents->layer()->type(), ui::LAYER_TEXTURED); + + gfx::Transform translate_down; + constexpr int kVerticalOffset = 40; + translate_down.Translate(0, kVerticalOffset); + + // Position: Down 40 -> 0, duration 250ms, ease (0.00, 0.00, 0.20, 1.00) + // Opacity: 0% -> 100%, delay 50ms, duration 100ms + views::AnimationBuilder() + .SetPreemptionStrategy( + ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET) + .Once() + .SetOpacity(scroll_contents, 0.f) + .SetTransform(scroll_contents, translate_down) + .Then() + .SetDuration(base::Milliseconds(250)) + .SetTransform(scroll_contents, gfx::Transform(), + gfx::Tween::LINEAR_OUT_SLOW_IN) + .At(base::Milliseconds(50)) + .SetDuration(base::Milliseconds(100)) + .SetOpacity(scroll_contents, 1.f); +} + +void AppListBubbleAppsPage::AnimateHidePage() { + // If skipping animations, just update visibility. + if (!features::IsProductivityLauncherAnimationEnabled() || + ui::ScopedAnimationDurationScaleMode::is_zero()) { + SetVisible(false); + return; + } + + // TODO(https://crbug.com/1286590): Add ui::AnimationThroughputReporter and + // tests. + + // Update view visibility when the animation is done. + auto set_visible_false = base::BindRepeating( + [](base::WeakPtr<AppListBubbleAppsPage> self) { + if (!self) + return; + self->SetVisible(false); + ui::Layer* layer = self->scroll_view()->contents()->layer(); + layer->SetOpacity(1.f); + layer->SetTransform(gfx::Transform()); + }, + weak_factory_.GetWeakPtr()); + + // Scroll contents has a layer, so animate that. + views::View* scroll_contents = scroll_view_->contents(); + DCHECK(scroll_contents->layer()); + DCHECK_EQ(scroll_contents->layer()->type(), ui::LAYER_TEXTURED); + + // The animation spec says 40 dips down over 250ms, but the opacity animation + // renders the view invisible after 50ms, so animate the visible fraction. + gfx::Transform translate_down; + constexpr int kVerticalOffset = 40 * 250 / 50; + translate_down.Translate(0, kVerticalOffset); + + // Opacity: 100% -> 0%, duration 50ms + views::AnimationBuilder() + .SetPreemptionStrategy( + ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET) + .OnEnded(set_visible_false) + .OnAborted(set_visible_false) + .Once() + .SetDuration(base::Milliseconds(50)) + .SetOpacity(scroll_contents, 0.f) + .SetTransform(scroll_contents, translate_down); +} + void AppListBubbleAppsPage::AbortAllAnimations() { auto abort_animations = [](views::View* view) { if (view->layer()) @@ -333,6 +421,10 @@ return true; } +ui::Layer* AppListBubbleAppsPage::GetPageAnimationLayerForTest() { + return scroll_view_->contents()->layer(); +} + void AppListBubbleAppsPage::UpdateSeparatorVisibility() { separator_->SetVisible(recent_apps_->GetItemViewCount() > 0 || continue_section_->GetTasksSuggestionsCount() > 0);
diff --git a/ash/app_list/views/app_list_bubble_apps_page.h b/ash/app_list/views/app_list_bubble_apps_page.h index 178b307..f5ea41e 100644 --- a/ash/app_list/views/app_list_bubble_apps_page.h +++ b/ash/app_list/views/app_list_bubble_apps_page.h
@@ -17,6 +17,10 @@ #include "ui/views/view.h" #include "ui/views/view_observer.h" +namespace ui { +class Layer; +} // namespace ui + namespace views { class Separator; } // namespace views @@ -57,11 +61,17 @@ ~AppListBubbleAppsPage() override; // Starts the launcher show animation. - void StartShowAnimation(); + void AnimateShowLauncher(); // Starts the launcher hide animation. None of the child views animate, but // this disables the scroll view gradient mask to improve performance. - void StartHideAnimation(); + void AnimateHideLauncher(); + + // Starts the animation for showing the apps page, coming from another page. + void AnimateShowPage(); + + // Starts the animation for hiding the apps page, going to another page. + void AnimateHidePage(); // Aborts all layer animations, which invokes their cleanup callbacks. void AbortAllAnimations(); @@ -99,6 +109,9 @@ return scrollable_apps_grid_view_; } + // Which layer animates is an implementation detail. + ui::Layer* GetPageAnimationLayerForTest(); + RecentAppsView* recent_apps_for_test() { return recent_apps_; } views::Separator* separator_for_test() { return separator_; } AppListReorderUndoContainerView* reorder_undo_container_for_test() {
diff --git a/ash/app_list/views/app_list_bubble_apps_page_unittest.cc b/ash/app_list/views/app_list_bubble_apps_page_unittest.cc index dd41cb75..3b3838a 100644 --- a/ash/app_list/views/app_list_bubble_apps_page_unittest.cc +++ b/ash/app_list/views/app_list_bubble_apps_page_unittest.cc
@@ -7,11 +7,13 @@ #include "ash/app_list/test/app_list_test_helper.h" #include "ash/constants/ash_features.h" #include "ash/test/ash_test_base.h" +#include "ash/test/layer_animation_stopped_waiter.h" #include "base/test/scoped_feature_list.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animator.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/compositor/test/test_utils.h" +#include "ui/events/keycodes/keyboard_codes_posix.h" #include "ui/views/controls/scroll_view.h" namespace ash { @@ -56,6 +58,55 @@ EXPECT_FALSE(recent_apps->layer()); } +TEST_F(AppListBubbleAppsPageTest, ViewNotVisibleAfterAnimateHidePage) { + // Open the app list without animation. + ASSERT_EQ(ui::ScopedAnimationDurationScaleMode::duration_multiplier(), + ui::ScopedAnimationDurationScaleMode::ZERO_DURATION); + auto* helper = GetAppListTestHelper(); + helper->AddAppItems(5); + helper->ShowAppList(); + + auto* apps_page = helper->GetBubbleAppsPage(); + ASSERT_TRUE(apps_page->GetVisible()); + + // Enable animations. + ui::ScopedAnimationDurationScaleMode duration( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); + + // Type a key to trigger the animation to transition to the search page. + PressAndReleaseKey(ui::VKEY_A); + LayerAnimationStoppedWaiter().Wait(apps_page->GetPageAnimationLayerForTest()); + + // Apps page is not visible. + EXPECT_FALSE(apps_page->GetVisible()); +} + +TEST_F(AppListBubbleAppsPageTest, ViewVisibleAfterAnimateShowPage) { + // Open the app list without animation. + ASSERT_EQ(ui::ScopedAnimationDurationScaleMode::duration_multiplier(), + ui::ScopedAnimationDurationScaleMode::ZERO_DURATION); + auto* helper = GetAppListTestHelper(); + helper->AddAppItems(5); + helper->ShowAppList(); + + // Type a key switch to the search page. + PressAndReleaseKey(ui::VKEY_A); + + auto* apps_page = helper->GetBubbleAppsPage(); + ASSERT_FALSE(apps_page->GetVisible()); + + // Enable animations. + ui::ScopedAnimationDurationScaleMode duration( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); + + // Press escape to trigger animation back to the apps page. + PressAndReleaseKey(ui::VKEY_ESCAPE); + LayerAnimationStoppedWaiter().Wait(apps_page->GetPageAnimationLayerForTest()); + + // Apps page is visible. + EXPECT_TRUE(apps_page->GetVisible()); +} + TEST_F(AppListBubbleAppsPageTest, GradientMaskCreatedWhenAnimationsDisabled) { // Force disable animation. base::test::ScopedFeatureList feature;
diff --git a/ash/app_list/views/app_list_bubble_view.cc b/ash/app_list/views/app_list_bubble_view.cc index 289f7bc50..f1305614 100644 --- a/ash/app_list/views/app_list_bubble_view.cc +++ b/ash/app_list/views/app_list_bubble_view.cc
@@ -262,8 +262,8 @@ // AppListBubbleAppsPage handles moving the individual views. It also handles // smoothness reporting, because the view movement animation has a longer // duration. - if (apps_page_->GetVisible()) - apps_page_->StartShowAnimation(); + if (current_page_ == AppListBubblePage::kApps) + apps_page_->AnimateShowLauncher(); // Note: The assistant page handles its own show animation internally. } @@ -301,8 +301,8 @@ const gfx::Rect target_bounds = layer()->GetTargetBounds(); const gfx::Rect final_bounds = GetShowHideAnimationBounds(target_bounds); - if (apps_page_->GetVisible()) - apps_page_->StartHideAnimation(); + if (current_page_ == AppListBubblePage::kApps) + apps_page_->AnimateHideLauncher(); views::AnimationBuilder() .OnEnded(base::BindOnce(&AppListBubbleView::OnHideAnimationEnded, @@ -335,23 +335,47 @@ void AppListBubbleView::ShowPage(AppListBubblePage page) { DVLOG(1) << __PRETTY_FUNCTION__ << " page " << page; + if (page == current_page_) + return; + + const AppListBubblePage previous_page = current_page_; + current_page_ = page; + // The assistant has its own text input field. search_box_view_->SetVisible(page != AppListBubblePage::kAssistant); separator_->SetVisible(page != AppListBubblePage::kAssistant); - apps_page_->SetVisible(page == AppListBubblePage::kApps); search_page_->SetVisible(page == AppListBubblePage::kSearch); search_page_dialog_controller_->SetEnabled(page == AppListBubblePage::kSearch); assistant_page_->SetVisible(page == AppListBubblePage::kAssistant); - switch (page) { + switch (current_page_) { + case AppListBubblePage::kNone: + NOTREACHED(); + break; case AppListBubblePage::kApps: + if (previous_page == AppListBubblePage::kSearch) + apps_page_->AnimateShowPage(); + else + apps_page_->SetVisible(true); + search_box_view_->SetSearchBoxActive(true, /*event_type=*/ui::ET_UNKNOWN); + // Explicitly request focus in case the search box was active before. + search_box_view_->search_box()->RequestFocus(); + break; case AppListBubblePage::kSearch: + if (previous_page == AppListBubblePage::kApps) + apps_page_->AnimateHidePage(); + else + apps_page_->SetVisible(false); search_box_view_->SetSearchBoxActive(true, /*event_type=*/ui::ET_UNKNOWN); // Explicitly request focus in case the search box was active before. search_box_view_->search_box()->RequestFocus(); break; case AppListBubblePage::kAssistant: + if (previous_page == AppListBubblePage::kApps) + apps_page_->AnimateHidePage(); + else + apps_page_->SetVisible(false); // Explicitly set search box inactive so the next attempt to activate it // will succeed. search_box_view_->SetSearchBoxActive(false, @@ -362,7 +386,7 @@ } bool AppListBubbleView::IsShowingEmbeddedAssistantUI() const { - return assistant_page_->GetVisible(); + return current_page_ == AppListBubblePage::kAssistant; } void AppListBubbleView::ShowEmbeddedAssistantUI() { @@ -377,6 +401,11 @@ search_box_view_->GetPreferredSize().height(); } +void AppListBubbleView::OnTemporarySortOrderChanged( + const absl::optional<AppListSortOrder>& new_order) { + apps_page_->OnTemporarySortOrderChanged(new_order); +} + const char* AppListBubbleView::GetClassName() const { return "AppListBubbleView"; } @@ -429,12 +458,10 @@ void AppListBubbleView::QueryChanged(SearchBoxViewBase* sender) { DCHECK_EQ(sender, search_box_view_); - // TODO(https://crbug.com/1204551): Animated transitions. - const bool has_search = search_box_view_->HasSearch(); - apps_page_->SetVisible(!has_search); - search_page_->SetVisible(has_search); - search_page_dialog_controller_->SetEnabled(has_search); - assistant_page_->SetVisible(false); + if (search_box_view_->HasSearch()) + ShowPage(AppListBubblePage::kSearch); + else + ShowPage(AppListBubblePage::kApps); // Ask the controller to start the search. std::u16string query = @@ -461,7 +488,7 @@ } bool AppListBubbleView::CanSelectSearchResults() { - return search_page_->GetVisible() && + return current_page_ == AppListBubblePage::kSearch && search_page_->search_view()->CanSelectSearchResults(); } @@ -566,6 +593,12 @@ // Hide any open folder by showing the apps page. ShowApps(/*folder_item_view=*/nullptr, /*select_folder=*/false); + // Reset pages to default visibility. + current_page_ = AppListBubblePage::kNone; + apps_page_->SetVisible(true); + search_page_->SetVisible(false); + assistant_page_->SetVisible(false); + if (on_hide_animation_ended_) std::move(on_hide_animation_ended_).Run(); }
diff --git a/ash/app_list/views/app_list_bubble_view.h b/ash/app_list/views/app_list_bubble_view.h index 1cb3b8f..c3582a3 100644 --- a/ash/app_list/views/app_list_bubble_view.h +++ b/ash/app_list/views/app_list_bubble_view.h
@@ -75,6 +75,9 @@ // apps grid. Used for computing the bubble height on large screens. int GetHeightToFitAllApps() const; + void OnTemporarySortOrderChanged( + const absl::optional<AppListSortOrder>& new_order); + // views::View: const char* GetClassName() const override; bool AcceleratorPressed(const ui::Accelerator& accelerator) override; @@ -97,8 +100,6 @@ void ReparentFolderItemTransit(AppListFolderItem* folder_item) override; void ReparentDragEnded() override; - AppListBubbleAppsPage* apps_page() { return apps_page_; } - ViewShadow* view_shadow_for_test() { return view_shadow_.get(); } views::View* separator_for_test() { return separator_; } bool showing_folder_for_test() { return showing_folder_; } @@ -133,7 +134,14 @@ std::unique_ptr<SearchResultPageDialogController> search_page_dialog_controller_; + // Explicitly store the current page because multiple pages can be visible + // during animations. + AppListBubblePage current_page_ = AppListBubblePage::kNone; + std::unique_ptr<ViewShadow> view_shadow_; + + // The individual views are implementation details and are intentionally not + // exposed via getters (except for tests). SearchBoxView* search_box_view_ = nullptr; views::View* separator_ = nullptr; AppListBubbleAppsPage* apps_page_ = nullptr;
diff --git a/ash/app_list/views/apps_grid_view_unittest.cc b/ash/app_list/views/apps_grid_view_unittest.cc index b1c536152..d74658ea 100644 --- a/ash/app_list/views/apps_grid_view_unittest.cc +++ b/ash/app_list/views/apps_grid_view_unittest.cc
@@ -20,6 +20,7 @@ #include "ash/app_list/model/app_list_test_model.h" #include "ash/app_list/model/search/test_search_result.h" #include "ash/app_list/test/app_list_test_helper.h" +#include "ash/app_list/views/app_list_bubble_apps_page.h" #include "ash/app_list/views/app_list_bubble_search_page.h" #include "ash/app_list/views/app_list_bubble_view.h" #include "ash/app_list/views/app_list_folder_view.h" @@ -1606,12 +1607,15 @@ search_box_view_->GetBoundsInScreen().CenterPoint()); GetEventGenerator()->PressAndReleaseKey(ui::VKEY_A); + auto* helper = GetAppListTestHelper(); if (is_productivity_launcher_enabled_) { - ASSERT_TRUE(GetAppListTestHelper()->GetBubbleSearchPage()->GetVisible()); + // Wait for page switch animation. + LayerAnimationStoppedWaiter().Wait( + helper->GetBubbleAppsPage()->GetPageAnimationLayerForTest()); + ASSERT_FALSE(helper->GetBubbleAppsPage()->GetVisible()); + ASSERT_TRUE(helper->GetBubbleSearchPage()->GetVisible()); } else { - ASSERT_TRUE(GetAppListTestHelper() - ->GetFullscreenSearchResultPageView() - ->GetVisible()); + ASSERT_TRUE(helper->GetFullscreenSearchResultPageView()->GetVisible()); } // Verify the drag icon is hidden immediately. @@ -1672,16 +1676,19 @@ search_box_view_->GetBoundsInScreen().CenterPoint()); GetEventGenerator()->PressAndReleaseKey(ui::VKEY_A); + auto* helper = GetAppListTestHelper(); if (is_productivity_launcher_enabled_) { - ASSERT_TRUE(GetAppListTestHelper()->GetBubbleSearchPage()->GetVisible()); + // Wait for page switch animation. + LayerAnimationStoppedWaiter().Wait( + helper->GetBubbleAppsPage()->GetPageAnimationLayerForTest()); + ASSERT_FALSE(helper->GetBubbleAppsPage()->GetVisible()); + ASSERT_TRUE(helper->GetBubbleSearchPage()->GetVisible()); } else { - ASSERT_TRUE(GetAppListTestHelper() - ->GetFullscreenSearchResultPageView() - ->GetVisible()); + ASSERT_TRUE(helper->GetFullscreenSearchResultPageView()->GetVisible()); } EXPECT_FALSE(test_api_->GetDragIconLayer()); - EXPECT_FALSE(GetAppListTestHelper()->IsInFolderView()); + EXPECT_FALSE(helper->IsInFolderView()); } TEST_P(AppsGridViewClamshellTest, CheckFolderWithMultiplePagesContents) {
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index d251de48e..fd4c2695 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -4586,6 +4586,17 @@ <message name="IDS_ASH_STATUS_TRAY_SHELF_PARTY_OFF_SUBLABEL" desc="The sub label text shown under the tray menu button when Shelf Party mode is off."> Off </message> + + <!-- Firmware UI notifications --> + <message name="IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_AVAILABLE_TITLE" desc="Notification title to indicate to users that firmware updates are available."> + Firmware updates available + </message> + <message name="IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_AVAILABLE_BODY" desc="Notification body text to indicate to users that firmware updates are available."> + Firmware updates are available for your device. Click to review and update. + </message> + <message name="IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_BUTTON_TEXT" desc="Notification button text, if the user clicks on the button it will redirect them to the Firmware Update app."> + Update + </message> </messages> </release> </grit>
diff --git a/ash/ash_strings_grd/IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_AVAILABLE_BODY.png.sha1 b/ash/ash_strings_grd/IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_AVAILABLE_BODY.png.sha1 new file mode 100644 index 0000000..d3dca22 --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_AVAILABLE_BODY.png.sha1
@@ -0,0 +1 @@ +00e738a92aa788e63b46b3c77751ba013b30a88c \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_AVAILABLE_TITLE.png.sha1 b/ash/ash_strings_grd/IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_AVAILABLE_TITLE.png.sha1 new file mode 100644 index 0000000..58b69ab --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_AVAILABLE_TITLE.png.sha1
@@ -0,0 +1 @@ +b0a648f11737e3f4a6166b35f8816337c1d5bf1f \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_BUTTON_TEXT.png.sha1 b/ash/ash_strings_grd/IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_BUTTON_TEXT.png.sha1 new file mode 100644 index 0000000..d3dca22 --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_BUTTON_TEXT.png.sha1
@@ -0,0 +1 @@ +00e738a92aa788e63b46b3c77751ba013b30a88c \ No newline at end of file
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index 1fe3540d..03cdcb4 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -596,6 +596,11 @@ // Enables the Fast Pair feature. const base::Feature kFastPair{"FastPair", base::FEATURE_DISABLED_BY_DEFAULT}; +// Allows Fast Pair to use software scanning on devices which don't support +// hardware offloading of BLE scans. +const base::Feature kFastPairSoftwareScanning{ + "FastPairSoftwareScanning", base::FEATURE_DISABLED_BY_DEFAULT}; + // Enables mounting various archive formats (in two tiers) in Files App. This // flag controls the first tier, whose support is very good. // https://crbug.com/1216245 @@ -730,7 +735,7 @@ // Tote, the productivity feature that aims to reduce context switching by // enabling users to collect content and transfer or access it later. const base::Feature kHoldingSpaceInProgressAnimationV2{ - "HoldingSpaceInProgressAnimationV2", base::FEATURE_DISABLED_BY_DEFAULT}; + "HoldingSpaceInProgressAnimationV2", base::FEATURE_ENABLED_BY_DEFAULT}; // Enables in-progress downloads integration with the productivity feature that // aims to reduce context switching by enabling users to collect content and @@ -744,7 +749,7 @@ // content and transfer or access it later. const base::Feature kHoldingSpaceInProgressDownloadsNotificationSuppression{ "HoldingSpaceInProgressNotificationSuppression", - base::FEATURE_ENABLED_BY_DEFAULT}; + base::FEATURE_DISABLED_BY_DEFAULT}; // Enables incognito profile integration with the productivity feature that // aims to reduce context switching by enabling users to collect content and @@ -1539,6 +1544,10 @@ return base::FeatureList::IsEnabled(kFastPair); } +bool IsFastPairSoftwareScanningEnabled() { + return base::FeatureList::IsEnabled(kFastPairSoftwareScanning); +} + bool IsFileManagerFuseBoxEnabled() { return base::FeatureList::IsEnabled(kFuseBox); }
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index 899f556..f723260 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -233,6 +233,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kFamilyLinkOnSchoolDevice; COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kFastPair; +COMPONENT_EXPORT(ASH_CONSTANTS) +extern const base::Feature kFastPairSoftwareScanning; COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kFilesArchivemount; COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kFilesArchivemount2; COMPONENT_EXPORT(ASH_CONSTANTS) @@ -559,6 +561,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsExtendedOpenVpnSettingsEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFamilyLinkOnSchoolDeviceEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFastPairEnabled(); +COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFastPairSoftwareScanningEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFileManagerFuseBoxEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFileManagerSwaEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFirmwareUpdaterAppEnabled();
diff --git a/ash/public/cpp/BUILD.gn b/ash/public/cpp/BUILD.gn index 7e1107f..82a573a 100644 --- a/ash/public/cpp/BUILD.gn +++ b/ash/public/cpp/BUILD.gn
@@ -114,6 +114,7 @@ "clipboard_history_controller.h", "clipboard_image_model_factory.cc", "clipboard_image_model_factory.h", + "default_user_image.h", "desk_template.cc", "desk_template.h", "desks_templates_delegate.h",
diff --git a/ash/public/cpp/app_list/app_list_types.cc b/ash/public/cpp/app_list/app_list_types.cc index 05dda941..0a6fda33 100644 --- a/ash/public/cpp/app_list/app_list_types.cc +++ b/ash/public/cpp/app_list/app_list_types.cc
@@ -121,6 +121,8 @@ std::ostream& operator<<(std::ostream& os, AppListBubblePage page) { switch (page) { + case AppListBubblePage::kNone: + return os << "None"; case AppListBubblePage::kApps: return os << "Apps"; case AppListBubblePage::kSearch:
diff --git a/ash/public/cpp/app_list/app_list_types.h b/ash/public/cpp/app_list/app_list_types.h index 71521f7..1a3a0a0 100644 --- a/ash/public/cpp/app_list/app_list_types.h +++ b/ash/public/cpp/app_list/app_list_types.h
@@ -196,7 +196,18 @@ }; // Sub-pages of the app list bubble (with ProductivityLauncher). -enum class AppListBubblePage { kApps, kSearch, kAssistant }; +enum class AppListBubblePage { + // Used at startup and when the app list bubble is not visible. Allows + // detection of transitions like hidden -> apps or hidden -> assistant, + // avoiding unnecessary page hide animations. + kNone = 0, + // The apps grid, as well as continue tasks and recent apps. + kApps, + // The search page. + kSearch, + // The assistant page. + kAssistant +}; ASH_PUBLIC_EXPORT std::ostream& operator<<(std::ostream& os, AppListBubblePage page);
diff --git a/ash/public/cpp/default_user_image.h b/ash/public/cpp/default_user_image.h new file mode 100644 index 0000000..85a8cb9 --- /dev/null +++ b/ash/public/cpp/default_user_image.h
@@ -0,0 +1,25 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_PUBLIC_CPP_DEFAULT_USER_IMAGE_H_ +#define ASH_PUBLIC_CPP_DEFAULT_USER_IMAGE_H_ + +#include <string> + +#include "ash/public/cpp/ash_public_export.h" +#include "url/gurl.h" + +namespace ash { +namespace default_user_image { + +struct ASH_PUBLIC_EXPORT DefaultUserImage { + int index; + std::u16string title; + GURL url; +}; + +} // namespace default_user_image +} // namespace ash + +#endif // ASH_PUBLIC_CPP_DEFAULT_USER_IMAGE_H_
diff --git a/ash/public/cpp/personalization_app/user_display_info.cc b/ash/public/cpp/personalization_app/user_display_info.cc index 5463c8c..3977acc 100644 --- a/ash/public/cpp/personalization_app/user_display_info.cc +++ b/ash/public/cpp/personalization_app/user_display_info.cc
@@ -5,28 +5,15 @@ #include "ash/public/cpp/personalization_app/user_display_info.h" #include "base/strings/utf_string_conversions.h" #include "components/user_manager/user.h" -#include "ui/base/webui/web_ui_util.h" -#include "url/gurl.h" namespace ash { namespace personalization_app { -namespace { - -GURL GetDataUrl(const user_manager::User& user) { - if (user.GetImage().isNull()) - return GURL(); - return GURL(webui::GetBitmapDataUrl(*user.GetImage().bitmap())); -} - -} // namespace - UserDisplayInfo::UserDisplayInfo() = default; UserDisplayInfo::UserDisplayInfo(const user_manager::User& user) : email(user.GetDisplayEmail()), - name(base::UTF16ToUTF8(user.GetDisplayName())), - avatar(GetDataUrl(user)) {} + name(base::UTF16ToUTF8(user.GetDisplayName())) {} UserDisplayInfo::UserDisplayInfo(UserDisplayInfo&&) = default; UserDisplayInfo& UserDisplayInfo::operator=(UserDisplayInfo&&) = default;
diff --git a/ash/public/cpp/personalization_app/user_display_info.h b/ash/public/cpp/personalization_app/user_display_info.h index d524eb0..8dcc0e1 100644 --- a/ash/public/cpp/personalization_app/user_display_info.h +++ b/ash/public/cpp/personalization_app/user_display_info.h
@@ -22,10 +22,6 @@ // The display name of the user. std::string name; - // Data url of avatar image. This is a data url because this class is designed - // to be sent to WebUI. - GURL avatar; - UserDisplayInfo(); explicit UserDisplayInfo(const user_manager::User& user_info);
diff --git a/ash/public/cpp/system_tray_client.h b/ash/public/cpp/system_tray_client.h index c9c3f6b..7c9bf73a 100644 --- a/ash/public/cpp/system_tray_client.h +++ b/ash/public/cpp/system_tray_client.h
@@ -130,6 +130,9 @@ // Shows the MultiDevice setup flow dialog. virtual void ShowMultiDeviceSetup() = 0; + // Shows the Firmware update app. + virtual void ShowFirmwareUpdate() = 0; + // Attempts to restart the system for update. virtual void RequestRestartForUpdate() = 0;
diff --git a/ash/public/cpp/test/test_system_tray_client.cc b/ash/public/cpp/test/test_system_tray_client.cc index 5c6bf3f2..bb828b2 100644 --- a/ash/public/cpp/test/test_system_tray_client.cc +++ b/ash/public/cpp/test/test_system_tray_client.cc
@@ -96,6 +96,10 @@ show_multi_device_setup_count_++; } +void TestSystemTrayClient::ShowFirmwareUpdate() { + show_firmware_update_count_++; +} + void TestSystemTrayClient::RequestRestartForUpdate() {} void TestSystemTrayClient::SetLocaleAndExit(
diff --git a/ash/public/cpp/test/test_system_tray_client.h b/ash/public/cpp/test/test_system_tray_client.h index 97ab178..19b1815 100644 --- a/ash/public/cpp/test/test_system_tray_client.h +++ b/ash/public/cpp/test/test_system_tray_client.h
@@ -57,6 +57,7 @@ void ShowArcVpnCreate(const std::string& app_id) override; void ShowNetworkSettings(const std::string& network_id) override; void ShowMultiDeviceSetup() override; + void ShowFirmwareUpdate() override; void RequestRestartForUpdate() override; void SetLocaleAndExit(const std::string& locale_iso_code) override; void ShowAccessCodeCastingDialog() override; @@ -89,6 +90,8 @@ return show_sim_unlock_settings_count_; } + int show_firmware_update_count() const { return show_firmware_update_count_; } + const std::string& last_bluetooth_settings_device_id() const { return last_bluetooth_settings_device_id_; } @@ -101,6 +104,7 @@ int show_os_settings_privacy_and_security_count_ = 0; int show_wifi_sync_settings_count_ = 0; int show_sim_unlock_settings_count_ = 0; + int show_firmware_update_count_ = 0; std::string last_bluetooth_settings_device_id_; };
diff --git a/ash/quick_pair/feature_status_tracker/bluetooth_enabled_provider.cc b/ash/quick_pair/feature_status_tracker/bluetooth_enabled_provider.cc index 2186cbb..df5b851 100644 --- a/ash/quick_pair/feature_status_tracker/bluetooth_enabled_provider.cc +++ b/ash/quick_pair/feature_status_tracker/bluetooth_enabled_provider.cc
@@ -4,6 +4,7 @@ #include "ash/quick_pair/feature_status_tracker/bluetooth_enabled_provider.h" +#include "ash/constants/ash_features.h" #include "base/bind.h" #include "base/memory/scoped_refptr.h" #include "device/bluetooth/bluetooth_adapter.h" @@ -45,10 +46,15 @@ } bool BluetoothEnabledProvider::HasHardwareSupport() { - return adapter_.get() && adapter_->IsPresent() && - adapter_->GetLowEnergyScanSessionHardwareOffloadingStatus() == - device::BluetoothAdapter:: - LowEnergyScanSessionHardwareOffloadingStatus::kSupported; + if (!adapter_ || !adapter_->IsPresent()) + return false; + + if (features::IsFastPairSoftwareScanningEnabled()) + return true; + + return adapter_->GetLowEnergyScanSessionHardwareOffloadingStatus() == + device::BluetoothAdapter:: + LowEnergyScanSessionHardwareOffloadingStatus::kSupported; } } // namespace quick_pair
diff --git a/ash/quick_pair/keyed_service/quick_pair_metrics_logger.cc b/ash/quick_pair/keyed_service/quick_pair_metrics_logger.cc index 7cfe4047..462cc0a 100644 --- a/ash/quick_pair/keyed_service/quick_pair_metrics_logger.cc +++ b/ash/quick_pair/keyed_service/quick_pair_metrics_logger.cc
@@ -29,8 +29,6 @@ retroactive_pairing_detector); pairer_broker_observation_.Observe(pairer_broker); ui_broker_observation_.Observe(ui_broker); - - QP_LOG(ERROR) << feature_usage_metrics_logger_->IsAccessible().value(); } QuickPairMetricsLogger::~QuickPairMetricsLogger() = default;
diff --git a/ash/session/fullscreen_notification_bubble.cc b/ash/session/fullscreen_notification_bubble.cc index 8c9a3bb0..5778819 100644 --- a/ash/session/fullscreen_notification_bubble.cc +++ b/ash/session/fullscreen_notification_bubble.cc
@@ -11,9 +11,12 @@ #include "ash/wm/window_state.h" #include "base/bind.h" #include "base/location.h" +#include "base/scoped_observation.h" #include "base/time/time.h" #include "components/fullscreen_control/subtle_notification_view.h" #include "components/strings/grit/components_strings.h" +#include "ui/aura/window.h" +#include "ui/aura/window_observer.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/geometry/insets.h" #include "ui/strings/grit/ui_strings.h" @@ -60,14 +63,17 @@ WindowState* window_state) { // Early out if a WindowState is already tracked. The bubble should already be // visible in this case. - if (window_state_) { + if (window_state_observation_.IsObserving()) { // `window_state` arg should match the tracked `window_state_`. - DCHECK_EQ(window_state_, window_state); + DCHECK(window_state_observation_.IsObservingSource(window_state)); + DCHECK(window_observation_.IsObservingSource(window_state->window())); return; } + window_state_observation_.Observe(window_state); - window_state_ = window_state; - window_state_->AddObserver(this); + // Observe the window to properly handle window destruction. + DCHECK(!window_observation_.IsObserving()); + window_observation_.Observe(window_state->window()); Show(); } @@ -84,10 +90,8 @@ } void FullscreenNotificationBubble::Hide() { - if (window_state_) { - window_state_->RemoveObserver(this); - window_state_ = nullptr; - } + window_observation_.Reset(); + window_state_observation_.Reset(); if (!widget_->IsVisible()) return; @@ -95,6 +99,10 @@ widget_->Hide(); } +void FullscreenNotificationBubble::OnWindowDestroying(aura::Window* window) { + Hide(); +} + void FullscreenNotificationBubble::OnPreWindowStateTypeChange( WindowState* window_state, chromeos::WindowStateType old_type) {
diff --git a/ash/session/fullscreen_notification_bubble.h b/ash/session/fullscreen_notification_bubble.h index aa10815..943dd46 100644 --- a/ash/session/fullscreen_notification_bubble.h +++ b/ash/session/fullscreen_notification_bubble.h
@@ -11,6 +11,9 @@ #include "ash/wm/window_state.h" #include "ash/wm/window_state_observer.h" #include "base/memory/weak_ptr.h" +#include "base/scoped_observation.h" +#include "ui/aura/window.h" +#include "ui/aura/window_observer.h" class SubtleNotificationView; @@ -31,7 +34,8 @@ // A notification bubble shown when the device returns from sleep, low // brightness or the lock screen to remind the user that full screen mode is // active. -class ASH_EXPORT FullscreenNotificationBubble : public WindowStateObserver { +class ASH_EXPORT FullscreenNotificationBubble : public aura::WindowObserver, + public WindowStateObserver { public: FullscreenNotificationBubble(); @@ -47,6 +51,9 @@ views::Widget* widget_for_test() { return widget_; } private: + // aura::WindowObserver: + void OnWindowDestroying(aura::Window* window) override; + // WindowStateObserver: void OnPreWindowStateTypeChange(WindowState* window_state, chromeos::WindowStateType old_type) override; @@ -62,14 +69,14 @@ // The widget containing the bubble. views::Widget* widget_ = nullptr; - // The window state currently observed in order to hide the bubble if the user - // exits full screen mode before the timer is elapsed. It is set when the - // bubble is shown and reset when it is hidden. - WindowState* window_state_ = nullptr; - // A timer to auto-dismiss the bubble after a short period of time. std::unique_ptr<base::OneShotTimer> timer_; + base::ScopedObservation<aura::Window, aura::WindowObserver> + window_observation_{this}; + base::ScopedObservation<ash::WindowState, ash::WindowStateObserver> + window_state_observation_{this}; + base::WeakPtrFactory<FullscreenNotificationBubble> weak_ptr_factory_{this}; };
diff --git a/ash/session/fullscreen_notification_bubble_unittest.cc b/ash/session/fullscreen_notification_bubble_unittest.cc index cff1fd3..5eda584 100644 --- a/ash/session/fullscreen_notification_bubble_unittest.cc +++ b/ash/session/fullscreen_notification_bubble_unittest.cc
@@ -86,5 +86,21 @@ EXPECT_FALSE(widget->IsVisible()); } +TEST_F(FullscreenNotificationBubbleTest, HandleWindowDestruction) { + views::Widget* widget = bubble_->widget_for_test(); + EXPECT_FALSE(widget->IsVisible()); + + bubble_->ShowForWindowState(window_state_); + EXPECT_TRUE(widget->IsVisible()); + + // Destroy the window before the timer is elapsed. + window_.reset(); + EXPECT_FALSE(widget->IsVisible()); + + task_environment()->FastForwardBy( + base::Seconds(kExpectedAutoHideDelayInSeconds)); + EXPECT_FALSE(widget->IsVisible()); +} + } // namespace } // namespace ash
diff --git a/ash/shell.cc b/ash/shell.cc index 1cd5e5d0..86b5dbc 100644 --- a/ash/shell.cc +++ b/ash/shell.cc
@@ -111,6 +111,7 @@ #include "ash/system/brightness/brightness_controller_chromeos.h" #include "ash/system/brightness_control_delegate.h" #include "ash/system/caps_lock_notification_controller.h" +#include "ash/system/firmware_update/firmware_update_notification_controller.h" #include "ash/system/keyboard_brightness/keyboard_brightness_controller.h" #include "ash/system/keyboard_brightness_control_delegate.h" #include "ash/system/locale/locale_update_controller_impl.h" @@ -895,6 +896,8 @@ // before it. detachable_base_handler_.reset(); + firmware_update_notification_controller_.reset(); + pcie_peripheral_notification_controller_.reset(); usb_peripheral_notification_controller_.reset(); @@ -983,6 +986,10 @@ tablet_mode_controller_ = std::make_unique<TabletModeController>(); + firmware_update_notification_controller_ = + std::make_unique<FirmwareUpdateNotificationController>( + message_center::MessageCenter::Get()); + pcie_peripheral_notification_controller_ = std::make_unique<PciePeripheralNotificationController>( message_center::MessageCenter::Get());
diff --git a/ash/shell.h b/ash/shell.h index c8f7061..785162b 100644 --- a/ash/shell.h +++ b/ash/shell.h
@@ -124,6 +124,7 @@ class EventRewriterControllerImpl; class EventTransformationHandler; class WindowRestoreController; +class FirmwareUpdateNotificationController; class FloatController; class FocusCycler; class FrameThrottlingController; @@ -412,6 +413,12 @@ EventTransformationHandler* event_transformation_handler() { return event_transformation_handler_.get(); } + + FirmwareUpdateNotificationController* + firmware_update_notification_controller() { + return firmware_update_notification_controller_.get(); + } + FloatController* float_controller() { return float_controller_.get(); } ::wm::FocusController* focus_controller() { return focus_controller_.get(); } AshFocusRules* focus_rules() { return focus_rules_; } @@ -748,6 +755,8 @@ std::unique_ptr<DisplayHighlightController> display_highlight_controller_; std::unique_ptr<DisplaySpeakerController> display_speaker_controller_; std::unique_ptr<DragDropController> drag_drop_controller_; + std::unique_ptr<FirmwareUpdateNotificationController> + firmware_update_notification_controller_; std::unique_ptr<FocusCycler> focus_cycler_; std::unique_ptr<FloatController> float_controller_; std::unique_ptr<HoldingSpaceController> holding_space_controller_;
diff --git a/ash/system/accessibility/dictation_button_tray.cc b/ash/system/accessibility/dictation_button_tray.cc index f616a44..493b5621 100644 --- a/ash/system/accessibility/dictation_button_tray.cc +++ b/ash/system/accessibility/dictation_button_tray.cc
@@ -51,7 +51,9 @@ DictationProgressIndicator::DictationProgressIndicator( const DictationButtonTray* tray) - : HoldingSpaceProgressIndicator(/*animation_key=*/tray), tray_(tray) {} + : HoldingSpaceProgressIndicator(/*animation_registry=*/nullptr, + /*animation_key=*/tray), + tray_(tray) {} bool DictationProgressIndicator::IsVisible() { absl::optional<float> progress = CalculateProgress();
diff --git a/ash/system/firmware_update/firmware_update_notification_controller.cc b/ash/system/firmware_update/firmware_update_notification_controller.cc new file mode 100644 index 0000000..92ef515 --- /dev/null +++ b/ash/system/firmware_update/firmware_update_notification_controller.cc
@@ -0,0 +1,97 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/system/firmware_update/firmware_update_notification_controller.h" + +#include "ash/public/cpp/new_window_delegate.h" +#include "ash/public/cpp/notification_utils.h" +#include "ash/public/cpp/system_tray_client.h" +#include "ash/resources/vector_icons/vector_icons.h" +#include "ash/shell.h" +#include "ash/strings/grit/ash_strings.h" +#include "ash/system/model/system_tray_model.h" +#include "base/strings/utf_string_conversions.h" +#include "third_party/abseil-cpp/absl/types/optional.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/message_center/message_center.h" +#include "ui/message_center/public/cpp/notification.h" +#include "ui/message_center/public/cpp/notification_types.h" +#include "url/gurl.h" + +namespace ash { + +namespace { +const char kNotifierFirmwareUpdate[] = "ash.firmware_update"; +const char kFirmwareUpdateNotificationId[] = + "cros_firmware_update_notification_id"; + +// Represents the buttons in the notification. +enum ButtonIndex { kUpdate }; + +void ShowFirmwareUpdate() { + Shell::Get()->system_tray_model()->client()->ShowFirmwareUpdate(); +} + +void RemoveNotification(const std::string& notification_id) { + message_center::MessageCenter::Get()->RemoveNotification(notification_id, + /*from_user=*/true); +} + +void OnFirmwareUpdateAvailableNotificationClicked( + absl::optional<int> button_index) { + // Clicked on body. + if (!button_index) { + ShowFirmwareUpdate(); + RemoveNotification(kFirmwareUpdateNotificationId); + return; + } + + // TODO(michaelcheco): Add "Remind me later" button. + switch (*button_index) { + case ButtonIndex::kUpdate: + ShowFirmwareUpdate(); + break; + } + RemoveNotification(kFirmwareUpdateNotificationId); +} + +} // namespace + +FirmwareUpdateNotificationController::FirmwareUpdateNotificationController( + message_center::MessageCenter* message_center) + : message_center_(message_center) { + DCHECK(message_center_); +} + +FirmwareUpdateNotificationController::~FirmwareUpdateNotificationController() = + default; + +void FirmwareUpdateNotificationController::NotifyFirmwareUpdateAvailable() { + message_center::RichNotificationData optional; + optional.buttons.push_back( + message_center::ButtonInfo(l10n_util::GetStringUTF16( + IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_BUTTON_TEXT))); + std::unique_ptr<message_center::Notification> notification = + CreateSystemNotification( + message_center::NOTIFICATION_TYPE_SIMPLE, + kFirmwareUpdateNotificationId, + l10n_util::GetStringUTF16( + IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_AVAILABLE_TITLE), + l10n_util::GetStringUTF16( + IDS_ASH_FIRMWARE_UPDATE_NOTIFICATION_UPDATE_AVAILABLE_BODY), + /*display_source=*/std::u16string(), GURL(), + message_center::NotifierId( + message_center::NotifierType::SYSTEM_COMPONENT, + kNotifierFirmwareUpdate), + optional, + base::MakeRefCounted<message_center::HandleNotificationClickDelegate>( + base::BindRepeating( + &OnFirmwareUpdateAvailableNotificationClicked)), + kSettingsIcon, + message_center::SystemNotificationWarningLevel::NORMAL); + + message_center_->AddNotification(std::move(notification)); +} + +} // namespace ash \ No newline at end of file
diff --git a/ash/system/firmware_update/firmware_update_notification_controller.h b/ash/system/firmware_update/firmware_update_notification_controller.h new file mode 100644 index 0000000..e7324cb --- /dev/null +++ b/ash/system/firmware_update/firmware_update_notification_controller.h
@@ -0,0 +1,42 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_SYSTEM_FIRMWARE_UPDATE_FIRMWARE_UPDATE_NOTIFICATION_CONTROLLER_H_ +#define ASH_SYSTEM_FIRMWARE_UPDATE_FIRMWARE_UPDATE_NOTIFICATION_CONTROLLER_H_ + +#include "ash/ash_export.h" + +namespace message_center { +class MessageCenter; +} // namespace message_center + +namespace ash { + +// Manages showing notifications for fwupd daemon events. +// We display a WARNING notification on startup if a critical firmware update +// is available. +class ASH_EXPORT FirmwareUpdateNotificationController { + public: + explicit FirmwareUpdateNotificationController( + message_center::MessageCenter* message_center); + FirmwareUpdateNotificationController( + const FirmwareUpdateNotificationController&) = delete; + FirmwareUpdateNotificationController& operator=( + const FirmwareUpdateNotificationController&) = delete; + ~FirmwareUpdateNotificationController(); + + // Call to show a notification to indicate that a firmware update is + // available. + void NotifyFirmwareUpdateAvailable(); + + private: + friend class FirmwareUpdateNotificationControllerTest; + + // MessageCenter for adding notifications. + message_center::MessageCenter* const message_center_; +}; + +} // namespace ash + +#endif // ASH_SYSTEM_FIRMWARE_UPDATE_FIRMWARE_UPDATE_NOTIFICATION_CONTROLLER_H_ \ No newline at end of file
diff --git a/ash/system/firmware_update/firmware_update_notification_controller_unittest.cc b/ash/system/firmware_update/firmware_update_notification_controller_unittest.cc new file mode 100644 index 0000000..721329b --- /dev/null +++ b/ash/system/firmware_update/firmware_update_notification_controller_unittest.cc
@@ -0,0 +1,108 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/system/firmware_update/firmware_update_notification_controller.h" + +#include <memory> +#include <vector> + +#include "ash/public/cpp/test/test_new_window_delegate.h" +#include "ash/public/cpp/test/test_system_tray_client.h" +#include "ash/shell.h" +#include "ash/test/ash_test_base.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "third_party/abseil-cpp/absl/types/optional.h" +#include "ui/message_center/fake_message_center.h" +#include "ui/message_center/public/cpp/notification.h" +#include "ui/message_center/public/cpp/notification_types.h" + +using message_center::MessageCenter; + +namespace ash { + +namespace { +const char kFirmwareUpdateNotificationId[] = + "cros_firmware_update_notification_id"; + +// A mock implementation of |NewWindowDelegate| for use in tests. +class MockNewWindowDelegate : public testing::NiceMock<TestNewWindowDelegate> { + public: + // TestNewWindowDelegate: + MOCK_METHOD(void, + OpenUrl, + (const GURL& url, bool from_user_interaction), + (override)); +}; + +} // namespace + +class FirmwareUpdateNotificationControllerTest : public AshTestBase { + public: + FirmwareUpdateNotificationControllerTest() = default; + FirmwareUpdateNotificationControllerTest( + const FirmwareUpdateNotificationControllerTest&) = delete; + FirmwareUpdateNotificationControllerTest& operator=( + const FirmwareUpdateNotificationControllerTest&) = delete; + ~FirmwareUpdateNotificationControllerTest() override = default; + + FirmwareUpdateNotificationController* controller() { + return Shell::Get()->firmware_update_notification_controller(); + } + + message_center::Notification* GetFirmwareUpdateNotification() { + return MessageCenter::Get()->FindVisibleNotificationById( + kFirmwareUpdateNotificationId); + } + + int GetNumFirmwareUpdateUIOpened() { + return GetSystemTrayClient()->show_firmware_update_count(); + } + + void ClickNotification(absl::optional<int> button_index) { + // No button index means the notification body was clicked. + if (!button_index.has_value()) { + message_center::Notification* notification = + MessageCenter::Get()->FindVisibleNotificationById( + kFirmwareUpdateNotificationId); + notification->delegate()->Click(absl::nullopt, absl::nullopt); + return; + } + + message_center::Notification* notification = + MessageCenter::Get()->FindVisibleNotificationById( + kFirmwareUpdateNotificationId); + notification->delegate()->Click(button_index, absl::nullopt); + } +}; + +TEST_F(FirmwareUpdateNotificationControllerTest, FirmwareUpdateNotification) { + EXPECT_EQ(0u, MessageCenter::Get()->NotificationCount()); + + controller()->NotifyFirmwareUpdateAvailable(); + EXPECT_EQ(1u, MessageCenter::Get()->NotificationCount()); + + message_center::Notification* notification = GetFirmwareUpdateNotification(); + + EXPECT_TRUE(notification); + + // Ensure this notification has one button. + EXPECT_EQ(1u, notification->buttons().size()); + + EXPECT_EQ(0, GetNumFirmwareUpdateUIOpened()); + // Click on the update button and expect it to open the Firmware Update + // SWA. + ClickNotification(/*button_index=*/0); + EXPECT_EQ(1, GetNumFirmwareUpdateUIOpened()); + // Clicking on the notification will close it. + EXPECT_EQ(0u, MessageCenter::Get()->NotificationCount()); + + // Open new notification and click on its body. + controller()->NotifyFirmwareUpdateAvailable(); + EXPECT_EQ(1u, MessageCenter::Get()->NotificationCount()); + ClickNotification(absl::nullopt); + EXPECT_EQ(2, GetNumFirmwareUpdateUIOpened()); + EXPECT_EQ(0u, MessageCenter::Get()->NotificationCount()); +} + +} // namespace ash
diff --git a/ash/system/holding_space/holding_space_animation_registry.cc b/ash/system/holding_space/holding_space_animation_registry.cc index d905f48..fce5d5e 100644 --- a/ash/system/holding_space/holding_space_animation_registry.cc +++ b/ash/system/holding_space/holding_space_animation_registry.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ash/system/holding_space/holding_space_animation_registry.h" + #include <map> #include <memory> #include <set> @@ -11,7 +13,6 @@ #include "ash/public/cpp/holding_space/holding_space_controller_observer.h" #include "ash/public/cpp/holding_space/holding_space_model.h" #include "ash/public/cpp/holding_space/holding_space_model_observer.h" -#include "ash/system/holding_space/holding_space_animation_registry.h" #include "ash/system/holding_space/holding_space_progress_icon_animation.h" #include "ash/system/holding_space/holding_space_progress_ring_animation.h" #include "base/containers/contains.h" @@ -122,39 +123,6 @@ : nullptr; } - // Sets and returns the registered icon animation for the specified `key`. - // NOTE: This method accepts `nullptr` to support un-registration. - HoldingSpaceProgressIconAnimation* SetIconAnimationForKey( - const void* key, - std::unique_ptr<HoldingSpaceProgressIconAnimation> animation) { - HoldingSpaceProgressIconAnimation* animation_ptr = animation.get(); - if (animation) { - icon_animations_by_key_[key] = std::move(animation); - NotifyIconAnimationChangedForKey(key); - } else { - EraseIconAnimationForKey(key); - } - return animation_ptr; - } - - // Sets and returns the registered ring animation for the specified `key`. - // NOTE: This method accepts `nullptr` to support un-registration. - HoldingSpaceProgressRingAnimation* SetRingAnimationForKey( - const void* key, - std::unique_ptr<HoldingSpaceProgressRingAnimation> animation) { - HoldingSpaceProgressRingAnimation* animation_ptr = animation.get(); - if (animation) { - ring_animations_by_key_[key] = SubscribedProgressRingAnimation{ - .animation = std::move(animation), - .subscription = base::CallbackListSubscription(), - }; - NotifyRingAnimationChangedForKey(key); - } else { - EraseRingAnimationForKey(key); - } - return animation_ptr; - } - private: // HoldingSpaceControllerObserver: void OnHoldingSpaceModelAttached(HoldingSpaceModel* model) override { @@ -598,22 +566,6 @@ return progress_indicator_animation_delegate_->GetRingAnimationForKey(key); } -HoldingSpaceProgressIconAnimation* -HoldingSpaceAnimationRegistry::SetProgressIconAnimationForKey( - const void* key, - std::unique_ptr<HoldingSpaceProgressIconAnimation> animation) { - return progress_indicator_animation_delegate_->SetIconAnimationForKey( - key, std::move(animation)); -} - -HoldingSpaceProgressRingAnimation* -HoldingSpaceAnimationRegistry::SetProgressRingAnimationForKey( - const void* key, - std::unique_ptr<HoldingSpaceProgressRingAnimation> animation) { - return progress_indicator_animation_delegate_->SetRingAnimationForKey( - key, std::move(animation)); -} - void HoldingSpaceAnimationRegistry::OnShellDestroying() { auto& instance_owner = GetInstanceOwner(); DCHECK_EQ(instance_owner.get(), this);
diff --git a/ash/system/holding_space/holding_space_animation_registry.h b/ash/system/holding_space/holding_space_animation_registry.h index 8088b84..8e12c554 100644 --- a/ash/system/holding_space/holding_space_animation_registry.h +++ b/ash/system/holding_space/holding_space_animation_registry.h
@@ -5,11 +5,10 @@ #ifndef ASH_SYSTEM_HOLDING_SPACE_HOLDING_SPACE_ANIMATION_REGISTRY_H_ #define ASH_SYSTEM_HOLDING_SPACE_HOLDING_SPACE_ANIMATION_REGISTRY_H_ -#include <memory> - #include "ash/ash_export.h" #include "ash/shell.h" #include "ash/shell_observer.h" +#include "ash/system/progress_indicator/progress_indicator_animation_registry.h" #include "base/callback.h" #include "base/callback_list.h" #include "base/scoped_observation.h" @@ -28,15 +27,11 @@ // destroyed. // // Supported animation types: -// * Progress icon animation - independently drive the animation of properties -// for a progress indicator's inner icon, as opposed to progress ring -// animations which independently drive the animation of properties for a -// progress indicator's outer ring. -// * Progress ring animation - independently drive the animation of properties -// for a progress indicator's outer ring, as opposed to progress icon -// animations which independently drive the animation of properties for a -// progress indicator's inner icon. -class ASH_EXPORT HoldingSpaceAnimationRegistry : public ShellObserver { +// * Progress icon animation - see `ProgressIndicatorAnimationRegistry`. +// * Progress ring animation - see `ProgressIndicatorAnimationRegistry`. +class ASH_EXPORT HoldingSpaceAnimationRegistry + : public ProgressIndicatorAnimationRegistry, + public ShellObserver { public: HoldingSpaceAnimationRegistry(const HoldingSpaceAnimationRegistry&) = delete; HoldingSpaceAnimationRegistry& operator=( @@ -48,55 +43,17 @@ // when `Shell` is being destroyed. static HoldingSpaceAnimationRegistry* GetInstance(); - using ProgressIconAnimationChangedCallbackList = - base::RepeatingCallbackList<void(HoldingSpaceProgressIconAnimation*)>; - - // Adds the specified `callback` to be notified of changes to the progress - // icon animation associated with the specified `key`. The `callback` will - // continue to receive events so long as both `this` and the returned - // subscription exist. + // ProgressIndicatorAnimationRegistry: base::CallbackListSubscription AddProgressIconAnimationChangedCallbackForKey( const void* key, - ProgressIconAnimationChangedCallbackList::CallbackType callback); - - using ProgressRingAnimationChangedCallbackList = - base::RepeatingCallbackList<void(HoldingSpaceProgressRingAnimation*)>; - - // Adds the specified `callback` to be notified of changes to the progress - // ring animation associated with the specified `key`. The `callback` will - // continue to receive events so long as both `this` and the returned - // subscription exist. + ProgressIconAnimationChangedCallbackList::CallbackType callback) override; base::CallbackListSubscription AddProgressRingAnimationChangedCallbackForKey( const void* key, - ProgressRingAnimationChangedCallbackList::CallbackType callback); - - // Returns the progress icon animation registered for the specified `key`. For - // cumulative progress, the animation is keyed on a pointer to the holding - // space controller. For individual item progress, the animation is keyed on a - // pointer to the holding space item itself. NOTE: This may return `nullptr` - // if no such animation is registered. + ProgressRingAnimationChangedCallbackList::CallbackType callback) override; HoldingSpaceProgressIconAnimation* GetProgressIconAnimationForKey( - const void* key); - - // Returns the progress ring animation registered for the specified `key`. For - // cumulative progress, the animation is keyed on a pointer to the holding - // space controller. For individual item progress, the animation is keyed on a - // pointer to the holding space item itself. NOTE: This may return `nullptr` - // if no such animation is registered. + const void* key) override; HoldingSpaceProgressRingAnimation* GetProgressRingAnimationForKey( - const void* key); - - // Sets and returns the progress icon animation registered for the specified - // `key`. NOTE: This method accepts `nullptr` to support un-registration. - HoldingSpaceProgressIconAnimation* SetProgressIconAnimationForKey( - const void* key, - std::unique_ptr<HoldingSpaceProgressIconAnimation> animation); - - // Sets and returns the progress ring animation registered for the specified - // `key`. NOTE: This method accepts `nullptr` to support un-registration. - HoldingSpaceProgressRingAnimation* SetProgressRingAnimationForKey( - const void* key, - std::unique_ptr<HoldingSpaceProgressRingAnimation> animation); + const void* key) override; private: HoldingSpaceAnimationRegistry();
diff --git a/ash/system/holding_space/holding_space_animation_registry_unittest.cc b/ash/system/holding_space/holding_space_animation_registry_unittest.cc index 61645c5..74377bd 100644 --- a/ash/system/holding_space/holding_space_animation_registry_unittest.cc +++ b/ash/system/holding_space/holding_space_animation_registry_unittest.cc
@@ -233,77 +233,4 @@ } } -TEST_P(HoldingSpaceAnimationRegistryTest, SetProgressIconAnimationForKey) { - StartSession(); - - // Create `key` and verify no progress icon animation is registered. - size_t key = 0u; - EXPECT_FALSE(registry()->GetProgressIconAnimationForKey(&key)); - - // Count progress icon animation changed events. - size_t callback_call_count = 0u; - auto subscription = registry()->AddProgressIconAnimationChangedCallbackForKey( - &key, base::BindLambdaForTesting([&](HoldingSpaceProgressIconAnimation*) { - ++callback_call_count; - })); - - // Unregister progress icon animation for `key`. - EXPECT_FALSE(registry()->SetProgressIconAnimationForKey(&key, nullptr)); - EXPECT_FALSE(registry()->GetProgressIconAnimationForKey(&key)); - EXPECT_EQ(callback_call_count, 0u); - - // Create a progress icon `animation`. - auto animation = std::make_unique<HoldingSpaceProgressIconAnimation>(); - auto* animation_ptr = animation.get(); - - // Register progress icon `animation` for `key`. - EXPECT_EQ( - registry()->SetProgressIconAnimationForKey(&key, std::move(animation)), - animation_ptr); - EXPECT_EQ(registry()->GetProgressIconAnimationForKey(&key), animation_ptr); - EXPECT_EQ(callback_call_count, 1u); - - // Unregister progress icon animation for `key`. - EXPECT_FALSE(registry()->SetProgressIconAnimationForKey(&key, nullptr)); - EXPECT_FALSE(registry()->GetProgressIconAnimationForKey(&key)); - EXPECT_EQ(callback_call_count, 2u); -} - -TEST_P(HoldingSpaceAnimationRegistryTest, SetProgressRingAnimationForKey) { - StartSession(); - - // Create `key` and verify no progress ring animation is registered. - size_t key = 0u; - EXPECT_FALSE(registry()->GetProgressRingAnimationForKey(&key)); - - // Count progress ring animation changed events. - size_t callback_call_count = 0u; - auto subscription = registry()->AddProgressRingAnimationChangedCallbackForKey( - &key, base::BindLambdaForTesting([&](HoldingSpaceProgressRingAnimation*) { - ++callback_call_count; - })); - - // Unregister progress ring animation for `key`. - EXPECT_FALSE(registry()->SetProgressRingAnimationForKey(&key, nullptr)); - EXPECT_FALSE(registry()->GetProgressRingAnimationForKey(&key)); - EXPECT_EQ(callback_call_count, 0u); - - // Create a progress ring `animation`. - auto animation = HoldingSpaceProgressRingAnimation::CreateOfType( - HoldingSpaceProgressRingAnimation::Type::kPulse); - auto* animation_ptr = animation.get(); - - // Register progress ring `animation` for `key`. - EXPECT_EQ( - registry()->SetProgressRingAnimationForKey(&key, std::move(animation)), - animation_ptr); - EXPECT_EQ(registry()->GetProgressRingAnimationForKey(&key), animation_ptr); - EXPECT_EQ(callback_call_count, 1u); - - // Unregister progress ring animation for `key`. - EXPECT_FALSE(registry()->SetProgressRingAnimationForKey(&key, nullptr)); - EXPECT_FALSE(registry()->GetProgressRingAnimationForKey(&key)); - EXPECT_EQ(callback_call_count, 2u); -} - } // namespace ash
diff --git a/ash/system/holding_space/holding_space_progress_icon_animation.h b/ash/system/holding_space/holding_space_progress_icon_animation.h index 20dd4a9..689cb67 100644 --- a/ash/system/holding_space/holding_space_progress_icon_animation.h +++ b/ash/system/holding_space/holding_space_progress_icon_animation.h
@@ -5,13 +5,12 @@ #ifndef ASH_SYSTEM_HOLDING_SPACE_HOLDING_SPACE_PROGRESS_ICON_ANIMATION_H_ #define ASH_SYSTEM_HOLDING_SPACE_HOLDING_SPACE_PROGRESS_ICON_ANIMATION_H_ -#include "ash/ash_export.h" #include "ash/system/holding_space/holding_space_progress_indicator_animation.h" namespace ash { // An animation for a `HoldingSpaceProgressIndicator`'s icon. -class ASH_EXPORT HoldingSpaceProgressIconAnimation +class HoldingSpaceProgressIconAnimation : public HoldingSpaceProgressIndicatorAnimation { public: HoldingSpaceProgressIconAnimation();
diff --git a/ash/system/holding_space/holding_space_progress_indicator.cc b/ash/system/holding_space/holding_space_progress_indicator.cc index f13e56f..d4a6d7e 100644 --- a/ash/system/holding_space/holding_space_progress_indicator.cc +++ b/ash/system/holding_space/holding_space_progress_indicator.cc
@@ -13,8 +13,10 @@ #include "ash/public/cpp/holding_space/holding_space_progress.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/style/ash_color_provider.h" +#include "ash/system/holding_space/holding_space_animation_registry.h" #include "ash/system/holding_space/holding_space_progress_icon_animation.h" #include "ash/system/holding_space/holding_space_progress_ring_animation.h" +#include "ash/system/progress_indicator/progress_indicator_animation_registry.h" #include "base/scoped_observation.h" #include "third_party/skia/include/core/SkPath.h" #include "third_party/skia/include/core/SkPathBuilder.h" @@ -156,7 +158,9 @@ public: explicit HoldingSpaceControllerProgressIndicator( HoldingSpaceController* controller) - : HoldingSpaceProgressIndicator(/*animation_key=*/controller), + : HoldingSpaceProgressIndicator( + /*animation_registry=*/HoldingSpaceAnimationRegistry::GetInstance(), + /*animation_key=*/controller), controller_(controller) { controller_observation_.Observe(controller_); if (controller_->model()) @@ -252,7 +256,10 @@ public HoldingSpaceModelObserver { public: explicit HoldingSpaceItemProgressIndicator(const HoldingSpaceItem* item) - : HoldingSpaceProgressIndicator(/*animation_key=*/item), item_(item) { + : HoldingSpaceProgressIndicator( + /*animation_registry=*/HoldingSpaceAnimationRegistry::GetInstance(), + /*animation_key=*/item), + item_(item) { model_observation_.Observe(HoldingSpaceController::Get()->model()); } @@ -300,16 +307,17 @@ constexpr float HoldingSpaceProgressIndicator::kProgressComplete; HoldingSpaceProgressIndicator::HoldingSpaceProgressIndicator( + ProgressIndicatorAnimationRegistry* animation_registry, const void* animation_key) - : animation_key_(animation_key) { - HoldingSpaceAnimationRegistry* animation_registry = - HoldingSpaceAnimationRegistry::GetInstance(); + : animation_registry_(animation_registry), animation_key_(animation_key) { + if (!animation_registry_) + return; // Register to be notified of changes to the icon animation associated with // this progress indicator's `animation_key_`. Note that it is safe to use a // raw pointer here since `this` owns the subscription. icon_animation_changed_subscription_ = - animation_registry->AddProgressIconAnimationChangedCallbackForKey( + animation_registry_->AddProgressIconAnimationChangedCallbackForKey( animation_key_, base::BindRepeating( &HoldingSpaceProgressIndicator::OnProgressIconAnimationChanged, @@ -318,7 +326,7 @@ // If an `icon_animation` is already registered, perform additional // initialization. HoldingSpaceProgressIconAnimation* icon_animation = - animation_registry->GetProgressIconAnimationForKey(animation_key_); + animation_registry_->GetProgressIconAnimationForKey(animation_key_); if (icon_animation) OnProgressIconAnimationChanged(icon_animation); @@ -326,7 +334,7 @@ // this progress indicator's `animation_key_`. Note that it is safe to use a // raw pointer here since `this` owns the subscription. ring_animation_changed_subscription_ = - animation_registry->AddProgressRingAnimationChangedCallbackForKey( + animation_registry_->AddProgressRingAnimationChangedCallbackForKey( animation_key_, base::BindRepeating( &HoldingSpaceProgressIndicator::OnProgressRingAnimationChanged, @@ -335,7 +343,7 @@ // If `ring_animation` is already registered, perform additional // initialization. HoldingSpaceProgressRingAnimation* ring_animation = - animation_registry->GetProgressRingAnimationForKey(animation_key_); + animation_registry_->GetProgressRingAnimationForKey(animation_key_); if (ring_animation) OnProgressRingAnimationChanged(ring_animation); } @@ -405,8 +413,9 @@ const ui::PaintContext& context) { // Look up the associated `ring_animation` (if one exists). HoldingSpaceProgressRingAnimation* ring_animation = - HoldingSpaceAnimationRegistry::GetInstance() - ->GetProgressRingAnimationForKey(animation_key_); + animation_registry_ + ? animation_registry_->GetProgressRingAnimationForKey(animation_key_) + : nullptr; // Unless `this` is animating, nothing will paint if `progress_` is complete. if (progress_ == kProgressComplete && !ring_animation) @@ -484,8 +493,9 @@ // Look up the associated `icon_animation` (if one exists). HoldingSpaceProgressIconAnimation* icon_animation = - HoldingSpaceAnimationRegistry::GetInstance() - ->GetProgressIconAnimationForKey(animation_key_); + animation_registry_ + ? animation_registry_->GetProgressIconAnimationForKey(animation_key_) + : nullptr; float inner_ring_stroke_width = GetInnerRingStrokeWidth(layer());
diff --git a/ash/system/holding_space/holding_space_progress_indicator.h b/ash/system/holding_space/holding_space_progress_indicator.h index bb151a8..78a130c 100644 --- a/ash/system/holding_space/holding_space_progress_indicator.h +++ b/ash/system/holding_space/holding_space_progress_indicator.h
@@ -9,7 +9,6 @@ #include <vector> #include "ash/ash_export.h" -#include "ash/system/holding_space/holding_space_animation_registry.h" #include "base/callback_list.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/compositor/layer_delegate.h" @@ -21,6 +20,7 @@ class HoldingSpaceItem; class HoldingSpaceProgressIconAnimation; class HoldingSpaceProgressRingAnimation; +class ProgressIndicatorAnimationRegistry; // A class owning a `ui::Layer` which paints indication of progress. // NOTE: The owned `layer()` is not painted if progress == `1.f`. @@ -75,10 +75,13 @@ protected: // Each progress indicator is associated with an `animation_key_` which is - // used to look up animations in the `HoldingSpaceAnimationRegistry`. When an + // used to look up animations in the provided `animation_registry`. When an // animation exists, it will be painted in lieu of the determinate progress // indication that would otherwise be painted for the cached `progress_`. - explicit HoldingSpaceProgressIndicator(const void* animation_key); + // NOTE: `animation_registry` may be `nullptr` if animations are not needed. + HoldingSpaceProgressIndicator( + ProgressIndicatorAnimationRegistry* animation_registry, + const void* animation_key); // Returns the calculated progress to paint to the owned `layer()`. This is // invoked during `UpdateVisualState()` just prior to painting. @@ -94,30 +97,36 @@ void UpdateVisualState() override; // Invoked when the icon `animation` associated with this progress indicator's - // `animation_key_` has changed in the `HoldingSpaceAnimationRegistry`. + // `animation_key_` has changed in the `animation_registry_`. // NOTE: The specified `animation` may be `nullptr`. void OnProgressIconAnimationChanged( HoldingSpaceProgressIconAnimation* animation); // Invoked when the ring `animation` associated with this progress indicator's - // `animation_key_` has changed in the `HoldingSpaceAnimationRegistry`. + // `animation_key_` has changed in the `animation_registry_`. // NOTE: The specified `animation` may be `nullptr`. void OnProgressRingAnimationChanged( HoldingSpaceProgressRingAnimation* animation); - // The key for which to look up animations in the - // `HoldingSpaceAnimationRegistry`. When an animation exists, it will be - // painted in lieu of the determinate progress indication that would otherwise - // be painted for the cached `progress_`. + // The animation registry in which to look up animations for the associated + // `animation_key_`. When an animation exists, it will be painted in lieu of + // the determinate progress indication that would otherwise be painted for the + // cached `progress_`. + ProgressIndicatorAnimationRegistry* const animation_registry_; + + // The key for which to look up animations in the `animation_registry_`. + // When an animation exists, it will be painted in lieu of the determinate + // progress indication that would otherwise be painted for the cached + // `progress_`. const void* const animation_key_; // A subscription to receive events when the icon animation associated with // this progress indicator's `animation_key_` has changed in the - // `HoldingSpaceAnimationRegistry`. + // `animation_registry_`. base::CallbackListSubscription icon_animation_changed_subscription_; // A subscription to receive events on updates to the icon animation owned by - // the `HoldingSpaceAnimationRegistry` which is associated with this progress + // the `animation_registry_` which is associated with this progress // indicator's `animation_key_`. On icon animation update, the progress // indicator will `InvalidateLayer()` to trigger paint of the next animation // frame. @@ -125,11 +134,11 @@ // A subscription to receive events when the ring animation associated with // this progress indicator's `animation_key_` has changed in the - // `HoldingSpaceAnimationRegistry`. + // `animation_registry_`. base::CallbackListSubscription ring_animation_changed_subscription_; // A subscription to receive events on updates to the ring animation owned by - // the `HoldingSpaceAnimationRegistry` which is associated with this progress + // the `animation_registry_` which is associated with this progress // indicator's `animation_key_`. On ring animation update, the progress // indicator will `InvalidateLayer()` to trigger paint of the next animation // frame.
diff --git a/ash/system/holding_space/holding_space_progress_indicator_unittest.cc b/ash/system/holding_space/holding_space_progress_indicator_unittest.cc index c73d8b2..57951e64 100644 --- a/ash/system/holding_space/holding_space_progress_indicator_unittest.cc +++ b/ash/system/holding_space/holding_space_progress_indicator_unittest.cc
@@ -15,7 +15,8 @@ class TestHoldingSpaceProgressIndicator : public HoldingSpaceProgressIndicator { public: TestHoldingSpaceProgressIndicator() - : HoldingSpaceProgressIndicator(/*animation_key=*/this) {} + : HoldingSpaceProgressIndicator(/*animation_registry=*/nullptr, + /*animation_key=*/this) {} void SetProgress(const absl::optional<float>& progress) { progress_ = progress;
diff --git a/ash/system/holding_space/holding_space_progress_ring_animation.h b/ash/system/holding_space/holding_space_progress_ring_animation.h index 3e38e90..5a331bb 100644 --- a/ash/system/holding_space/holding_space_progress_ring_animation.h +++ b/ash/system/holding_space/holding_space_progress_ring_animation.h
@@ -7,14 +7,13 @@ #include <memory> -#include "ash/ash_export.h" #include "ash/system/holding_space/holding_space_progress_indicator_animation.h" namespace ash { // An animation for a `HoldingSpaceProgressIndicator` to be painted in lieu of // the determinate progress ring that would otherwise be painted. -class ASH_EXPORT HoldingSpaceProgressRingAnimation +class HoldingSpaceProgressRingAnimation : public HoldingSpaceProgressIndicatorAnimation { public: enum class Type {
diff --git a/ash/system/holding_space/holding_space_tray_icon_preview.cc b/ash/system/holding_space/holding_space_tray_icon_preview.cc index 40cdff4..11e24bd 100644 --- a/ash/system/holding_space/holding_space_tray_icon_preview.cc +++ b/ash/system/holding_space/holding_space_tray_icon_preview.cc
@@ -15,6 +15,7 @@ #include "ash/public/cpp/shelf_config.h" #include "ash/shelf/shelf.h" #include "ash/style/ash_color_provider.h" +#include "ash/system/holding_space/holding_space_animation_registry.h" #include "ash/system/holding_space/holding_space_progress_indicator.h" #include "ash/system/holding_space/holding_space_tray_icon.h" #include "ash/system/tray/tray_constants.h"
diff --git a/ash/system/progress_indicator/OWNERS b/ash/system/progress_indicator/OWNERS new file mode 100644 index 0000000..599e0c1e --- /dev/null +++ b/ash/system/progress_indicator/OWNERS
@@ -0,0 +1 @@ +file://ash/public/cpp/holding_space/OWNERS
diff --git a/ash/system/progress_indicator/progress_indicator_animation_registry.h b/ash/system/progress_indicator/progress_indicator_animation_registry.h new file mode 100644 index 0000000..4303608 --- /dev/null +++ b/ash/system/progress_indicator/progress_indicator_animation_registry.h
@@ -0,0 +1,69 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_SYSTEM_PROGRESS_INDICATOR_PROGRESS_INDICATOR_ANIMATION_REGISTRY_H_ +#define ASH_SYSTEM_PROGRESS_INDICATOR_PROGRESS_INDICATOR_ANIMATION_REGISTRY_H_ + +#include "base/callback_forward.h" + +namespace ash { + +class HoldingSpaceProgressIconAnimation; +class HoldingSpaceProgressRingAnimation; + +// A registry for progress indicator animations. +// +// Since animations are owned by the registry, they can be shared across +// different UI components as well have a lifetime which is decoupled from UI +// component lifetime. +// +// Supported animation types: +// * Progress icon animation - independently drive the animation of properties +// for a progress indicator's inner icon, as opposed to progress ring +// animations which independently drive the animation of properties for a +// progress indicator's outer ring. +// * Progress ring animation - independently drive the animation of properties +// for a progress indicator's outer ring, as opposed to progress icon +// animations which independently drive the animation of properties for a +// progress indicator's inner icon. +class ProgressIndicatorAnimationRegistry { + public: + using ProgressIconAnimationChangedCallbackList = + base::RepeatingCallbackList<void(HoldingSpaceProgressIconAnimation*)>; + + // Adds the specified `callback` to be notified of changes to the progress + // icon animation associated with the specified `key`. The `callback` will + // continue to receive events so long as both `this` and the returned + // subscription exist. + virtual base::CallbackListSubscription + AddProgressIconAnimationChangedCallbackForKey( + const void* key, + ProgressIconAnimationChangedCallbackList::CallbackType callback) = 0; + + using ProgressRingAnimationChangedCallbackList = + base::RepeatingCallbackList<void(HoldingSpaceProgressRingAnimation*)>; + + // Adds the specified `callback` to be notified of changes to the progress + // ring animation associated with the specified `key`. The `callback` will + // continue to receive events so long as both `this` and the returned + // subscription exist. + virtual base::CallbackListSubscription + AddProgressRingAnimationChangedCallbackForKey( + const void* key, + ProgressRingAnimationChangedCallbackList::CallbackType callback) = 0; + + // Returns the progress icon animation registered for the specified `key`. + // NOTE: This may return `nullptr` if no such animation is registered. + virtual HoldingSpaceProgressIconAnimation* GetProgressIconAnimationForKey( + const void* key) = 0; + + // Returns the progress ring animation registered for the specified `key`. + // NOTE: This may return `nullptr` if no such animation is registered. + virtual HoldingSpaceProgressRingAnimation* GetProgressRingAnimationForKey( + const void* key) = 0; +}; + +} // namespace ash + +#endif // ASH_SYSTEM_PROGRESS_INDICATOR_PROGRESS_INDICATOR_ANIMATION_REGISTRY_H_
diff --git a/ash/system/time/calendar_month_view.cc b/ash/system/time/calendar_month_view.cc index 2c5a3bc..cf74a67 100644 --- a/ash/system/time/calendar_month_view.cc +++ b/ash/system/time/calendar_month_view.cc
@@ -251,6 +251,7 @@ indicator_paint_flags.setColor(AshColorProvider::Get()->GetControlsLayerColor( AshColorProvider::ControlsLayerType::kFocusRingColor)); indicator_paint_flags.setStyle(cc::PaintFlags::kFill_Style); + indicator_paint_flags.setAntiAlias(true); canvas->DrawCircle(GetEventsPresentIndicatorCenterPosition(), kEventsPresentRoundedRadius, indicator_paint_flags); }
diff --git a/ash/webui/personalization_app/mojom/BUILD.gn b/ash/webui/personalization_app/mojom/BUILD.gn index 2a86d5d6..eeef529 100644 --- a/ash/webui/personalization_app/mojom/BUILD.gn +++ b/ash/webui/personalization_app/mojom/BUILD.gn
@@ -45,6 +45,10 @@ cpp = "ash::personalization_app::UserDisplayInfo" move_only = true }, + { + mojom = "ash.personalization_app.mojom.DefaultUserImage" + cpp = "ash::default_user_image::DefaultUserImage" + }, ] traits_headers = [ "personalization_app_mojom_traits.h" ] traits_sources = [ "personalization_app_mojom_traits.cc" ]
diff --git a/ash/webui/personalization_app/mojom/personalization_app.mojom b/ash/webui/personalization_app/mojom/personalization_app.mojom index e3567c1..403501d 100644 --- a/ash/webui/personalization_app/mojom/personalization_app.mojom +++ b/ash/webui/personalization_app/mojom/personalization_app.mojom
@@ -5,6 +5,7 @@ module ash.personalization_app.mojom; import "mojo/public/mojom/base/file_path.mojom"; +import "mojo/public/mojom/base/string16.mojom"; import "url/mojom/url.mojom"; // This should be kept in sync with |ash::WallpaperLayout| @@ -136,7 +137,8 @@ // Provides APIs to retrieve Wallpaper information. This API is exposed only to // the Personalization App (chrome://personalization). It is a mojom wrapper for -// APIs found in |backdrop_wallpaper.proto|. +// APIs found in |backdrop_wallpaper.proto| and |WallpaperController| APIs to +// change the user's wallpaper in Ash. interface WallpaperProvider { // Called to force the browser window to make the native views transparent // so that the user can see wallpaper in fullscreen on their desktop. Safe @@ -235,13 +237,37 @@ // The display name of the user. string name; - - // The device avatar image of the user as a data url. - url.mojom.Url avatar; }; -// Provides APIs to view information about the current user. +// Receives updated user image when it is changed for the current user. +interface UserImageObserver { + // Triggered by |UserManager::Observer::OnUserImageChanged|. + OnUserImageChanged(url.mojom.Url image); +}; + +// A default user image stored on the device that can be set as the user's +// device avatar image. +struct DefaultUserImage { + // A user image is identified by an index. + int32 index; + + // The title of the image to display to the user. + mojo_base.mojom.String16 title; + + // A url to display the image. Typically |chrome://theme/IDR_LOGIN_DEFAULT_X|. + url.mojom.Url url; +}; + +// Provides APIs to view information about the current user. This API is exposed +// only to the Personalization App (chrome://personalization), and is +// implemented by |PersonalizationAppUserProviderImpl| in chrome. interface UserProvider { + // Binds an observer for the current user's device image. + SetUserImageObserver(pending_remote<UserImageObserver> observer); + // Return information about the current user. GetUserInfo() => (UserInfo user_info); + + // Returns an array of default user images to choose from. + GetDefaultUserImages() => (array<DefaultUserImage> default_user_images); };
diff --git a/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.cc b/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.cc index f2c3087f..1997f4aa 100644 --- a/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.cc +++ b/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.cc
@@ -7,9 +7,10 @@ #include <string> #include <vector> +#include "ash/public/cpp/default_user_image.h" #include "ash/public/cpp/personalization_app/user_display_info.h" #include "ash/public/cpp/wallpaper/wallpaper_types.h" -#include "ash/webui/personalization_app/mojom/personalization_app.mojom-shared.h" +#include "ash/webui/personalization_app/mojom/personalization_app.mojom.h" #include "ash/webui/personalization_app/proto/backdrop_wallpaper.pb.h" #include "base/notreached.h" #include "base/unguessable_token.h" @@ -254,18 +255,40 @@ return user_display_info.name; } -const GURL& StructTraits<ash::personalization_app::mojom::UserInfoDataView, - ash::personalization_app::UserDisplayInfo>:: - avatar(const ash::personalization_app::UserDisplayInfo& user) { - return user.avatar; -} - bool StructTraits<ash::personalization_app::mojom::UserInfoDataView, ash::personalization_app::UserDisplayInfo>:: Read(ash::personalization_app::mojom::UserInfoDataView data, ash::personalization_app::UserDisplayInfo* out) { - return data.ReadEmail(&out->email) && data.ReadName(&out->name) && - data.ReadAvatar(&out->avatar); + return data.ReadEmail(&out->email) && data.ReadName(&out->name); +} + +int StructTraits<ash::personalization_app::mojom::DefaultUserImageDataView, + ash::default_user_image::DefaultUserImage>:: + index(const ash::default_user_image::DefaultUserImage& default_user_image) { + return default_user_image.index; +} + +const std::u16string& +StructTraits<ash::personalization_app::mojom::DefaultUserImageDataView, + ash::default_user_image::DefaultUserImage>:: + title(const ash::default_user_image::DefaultUserImage& default_user_image) { + return default_user_image.title; +} + +const GURL& +StructTraits<ash::personalization_app::mojom::DefaultUserImageDataView, + ash::default_user_image::DefaultUserImage>:: + url(const ash::default_user_image::DefaultUserImage& default_user_image) { + return default_user_image.url; +} + +bool StructTraits<ash::personalization_app::mojom::DefaultUserImageDataView, + ash::default_user_image::DefaultUserImage>:: + Read(ash::personalization_app::mojom::DefaultUserImageDataView data, + ash::default_user_image::DefaultUserImage* out) { + out->index = data.index(); + + return data.ReadTitle(&out->title) && data.ReadUrl(&out->url); } } // namespace mojo
diff --git a/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.h b/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.h index 2703fde..673468a87 100644 --- a/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.h +++ b/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.h
@@ -8,9 +8,10 @@ #include <string> #include <vector> +#include "ash/public/cpp/default_user_image.h" #include "ash/public/cpp/personalization_app/user_display_info.h" #include "ash/public/cpp/wallpaper/wallpaper_types.h" -#include "ash/webui/personalization_app/mojom/personalization_app.mojom-shared.h" +#include "ash/webui/personalization_app/mojom/personalization_app.mojom-forward.h" #include "ash/webui/personalization_app/proto/backdrop_wallpaper.pb.h" #include "base/unguessable_token.h" #include "mojo/public/cpp/bindings/enum_traits.h" @@ -83,12 +84,24 @@ const ash::personalization_app::UserDisplayInfo& user_display_info); static const std::string& name( const ash::personalization_app::UserDisplayInfo& user_display_info); - static const GURL& avatar( - const ash::personalization_app::UserDisplayInfo& user_display_info); static bool Read(ash::personalization_app::mojom::UserInfoDataView data, ash::personalization_app::UserDisplayInfo* out); }; +template <> +struct StructTraits<ash::personalization_app::mojom::DefaultUserImageDataView, + ash::default_user_image::DefaultUserImage> { + static int index( + const ash::default_user_image::DefaultUserImage& default_user_image); + static const std::u16string& title( + const ash::default_user_image::DefaultUserImage& default_user_image); + static const GURL& url( + const ash::default_user_image::DefaultUserImage& default_user_image); + static bool Read( + ash::personalization_app::mojom::DefaultUserImageDataView data, + ash::default_user_image::DefaultUserImage* out); +}; + } // namespace mojo #endif // ASH_WEBUI_PERSONALIZATION_APP_MOJOM_PERSONALIZATION_APP_MOJOM_TRAITS_H_
diff --git a/ash/webui/personalization_app/resources/BUILD.gn b/ash/webui/personalization_app/resources/BUILD.gn index 8c76aa0..f61ce62 100644 --- a/ash/webui/personalization_app/resources/BUILD.gn +++ b/ash/webui/personalization_app/resources/BUILD.gn
@@ -35,6 +35,7 @@ "trusted/theme/theme_state.ts", "trusted/user/user_actions.ts", "trusted/user/user_controller.ts", + "trusted/user/user_image_observer.ts", "trusted/user/user_interface_provider.ts", "trusted/user/user_reducers.ts", "trusted/user/user_state.ts", @@ -64,6 +65,7 @@ "trusted/personalization_toast_element.ts", "trusted/personalization_breadcrumb_element.ts", "trusted/user_preview_element.ts", + "trusted/user/avatar_list_element.ts", "trusted/user/user_subpage_element.ts", "trusted/wallpaper/google_photos_albums_element.ts", "trusted/wallpaper/google_photos_collection_element.ts",
diff --git a/ash/webui/personalization_app/resources/trusted/personalization_app.ts b/ash/webui/personalization_app/resources/trusted/personalization_app.ts index 58ab3ec..9ea46de 100644 --- a/ash/webui/personalization_app/resources/trusted/personalization_app.ts +++ b/ash/webui/personalization_app/resources/trusted/personalization_app.ts
@@ -18,6 +18,7 @@ import './personalization_main_element.js'; import './personalization_theme_element.js'; import './user_preview_element.js'; +import './user/avatar_list_element.js'; import './user/user_subpage_element.js'; import './wallpaper/wallpaper_subpage.js';
diff --git a/ash/webui/personalization_app/resources/trusted/user/avatar_list_element.html b/ash/webui/personalization_app/resources/trusted/user/avatar_list_element.html new file mode 100644 index 0000000..3cd159a --- /dev/null +++ b/ash/webui/personalization_app/resources/trusted/user/avatar_list_element.html
@@ -0,0 +1,7 @@ +<style></style> +<div id="container"> + <p>Avatar list</p> + <template is="dom-repeat" items="[[defaultUserImages_]]"> + <img src="[[item.url.url]]"> + </template> +</div> \ No newline at end of file
diff --git a/ash/webui/personalization_app/resources/trusted/user/avatar_list_element.ts b/ash/webui/personalization_app/resources/trusted/user/avatar_list_element.ts new file mode 100644 index 0000000..6d53faa2 --- /dev/null +++ b/ash/webui/personalization_app/resources/trusted/user/avatar_list_element.ts
@@ -0,0 +1,44 @@ +// Copyright 2022 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 The avatar-list component displays the list of avatar images + * that the user can select from. + */ + +import {html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {DefaultUserImage} from '../personalization_app.mojom-webui.js'; +import {WithPersonalizationStore} from '../personalization_store.js'; + +import {fetchDefaultUserImages} from './user_controller.js'; +import {getUserProvider} from './user_interface_provider.js'; + +export class AvatarList extends WithPersonalizationStore { + static get is() { + return 'avatar-list'; + } + + static get template() { + return html`{__html_template__}`; + } + + static get properties() { + return { + defaultUserImages_: Array, + }; + } + + defaultUserImages_: Array<DefaultUserImage>|null; + + connectedCallback() { + super.connectedCallback(); + this.watch<AvatarList['defaultUserImages_']>( + 'defaultUserImages_', state => state.user.defaultUserImages); + this.updateFromStore(); + fetchDefaultUserImages(getUserProvider(), this.getStore()); + } +} + +customElements.define(AvatarList.is, AvatarList);
diff --git a/ash/webui/personalization_app/resources/trusted/user/user_actions.ts b/ash/webui/personalization_app/resources/trusted/user/user_actions.ts index c2fc89b..21feeda6 100644 --- a/ash/webui/personalization_app/resources/trusted/user/user_actions.ts +++ b/ash/webui/personalization_app/resources/trusted/user/user_actions.ts
@@ -3,18 +3,44 @@ // found in the LICENSE file. import {Action} from 'chrome://resources/js/cr/ui/store.js'; +import {Url} from 'chrome://resources/mojo/url/mojom/url.mojom-webui.js'; -import {UserInfo} from '../personalization_app.mojom-webui.js'; +import {DefaultUserImage, UserInfo} from '../personalization_app.mojom-webui.js'; /** * @fileoverview Defines the actions to change user state. */ export enum UserActionName { + SET_DEFAULT_USER_IMAGES = 'set_default_user_images', + SET_USER_IMAGE = 'set_user_image', SET_USER_INFO = 'set_user_info', } -export type UserActions = SetUserInfoAction; +export type UserActions = + SetUserImageAction|SetDefaultUserImagesAction|SetUserInfoAction; + +export type SetUserImageAction = Action&{ + name: UserActionName.SET_USER_IMAGE, + image: Url, +}; + +export function setUserImageAction(image: Url): SetUserImageAction { + return {name: UserActionName.SET_USER_IMAGE, image}; +} + +export type SetDefaultUserImagesAction = Action&{ + name: UserActionName.SET_DEFAULT_USER_IMAGES, + defaultUserImages: Array<DefaultUserImage>, +}; + +export function setDefaultUserImagesAction( + defaultUserImages: Array<DefaultUserImage>): SetDefaultUserImagesAction { + return { + name: UserActionName.SET_DEFAULT_USER_IMAGES, + defaultUserImages, + }; +} export type SetUserInfoAction = Action&{ name: UserActionName.SET_USER_INFO; @@ -30,4 +56,4 @@ name: UserActionName.SET_USER_INFO, user_info, }; -} \ No newline at end of file +}
diff --git a/ash/webui/personalization_app/resources/trusted/user/user_controller.ts b/ash/webui/personalization_app/resources/trusted/user/user_controller.ts index 05e985a..c39b0cf 100644 --- a/ash/webui/personalization_app/resources/trusted/user/user_controller.ts +++ b/ash/webui/personalization_app/resources/trusted/user/user_controller.ts
@@ -4,7 +4,8 @@ import {UserProviderInterface} from '../personalization_app.mojom-webui'; import {PersonalizationStore} from '../personalization_store.js'; -import {setUserInfoAction} from './user_actions.js'; + +import {setDefaultUserImagesAction, setUserInfoAction} from './user_actions.js'; /** * @fileoverview provides functions to fetch and set user info. @@ -15,3 +16,9 @@ const {userInfo} = await provider.getUserInfo(); store.dispatch(setUserInfoAction(userInfo)); } + +export async function fetchDefaultUserImages( + provider: UserProviderInterface, store: PersonalizationStore) { + const {defaultUserImages} = await provider.getDefaultUserImages(); + store.dispatch(setDefaultUserImagesAction(defaultUserImages)); +} \ No newline at end of file
diff --git a/ash/webui/personalization_app/resources/trusted/user/user_image_observer.ts b/ash/webui/personalization_app/resources/trusted/user/user_image_observer.ts new file mode 100644 index 0000000..11090897 --- /dev/null +++ b/ash/webui/personalization_app/resources/trusted/user/user_image_observer.ts
@@ -0,0 +1,47 @@ +// Copyright 2022 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 {Url} from 'chrome://resources/mojo/url/mojom/url.mojom-webui.js'; + +import {UserImageObserverInterface, UserImageObserverReceiver, UserProviderInterface} from '../personalization_app.mojom-webui.js'; +import {PersonalizationStore} from '../personalization_store.js'; +import {setUserImageAction} from './user_actions.js'; + +import {getUserProvider} from './user_interface_provider.js'; + +/** @fileoverview listens for updates on user's avatar image. */ + +let instance: UserImageObserver|null = null; + +/** + * Listens for changes to user image and saves updates to PersonalizationStore. + */ +export class UserImageObserver implements UserImageObserverInterface { + static initUserImageObserverIfNeeded(): void { + if (!instance) { + instance = new UserImageObserver(); + } + } + + static shutdown() { + if (instance) { + instance.receiver_.$.close(); + instance = null; + } + } + + receiver_: UserImageObserverReceiver = this.initReceiver_(getUserProvider()); + + private initReceiver_(userProvider: UserProviderInterface): + UserImageObserverReceiver { + const receiver = new UserImageObserverReceiver(this); + userProvider.setUserImageObserver(receiver.$.bindNewPipeAndPassRemote()); + return receiver; + } + + onUserImageChanged(image: Url) { + const store = PersonalizationStore.getInstance(); + store.dispatch(setUserImageAction(image)); + } +}
diff --git a/ash/webui/personalization_app/resources/trusted/user/user_reducers.ts b/ash/webui/personalization_app/resources/trusted/user/user_reducers.ts index 0b197a0b..26da2c6 100644 --- a/ash/webui/personalization_app/resources/trusted/user/user_reducers.ts +++ b/ash/webui/personalization_app/resources/trusted/user/user_reducers.ts
@@ -9,6 +9,28 @@ import {UserActionName} from './user_actions.js'; import {UserState} from './user_state.js'; +export function imageReducer( + state: UserState['image'], action: Actions, + _: PersonalizationState): UserState['image'] { + switch (action.name) { + case UserActionName.SET_USER_IMAGE: + return action.image; + default: + return state; + } +} + +export function defaultUserImagesReducer( + state: UserState['defaultUserImages'], action: Actions, + _: PersonalizationState): UserState['defaultUserImages'] { + switch (action.name) { + case UserActionName.SET_DEFAULT_USER_IMAGES: + return action.defaultUserImages; + default: + return state; + } +} + export function infoReducer( state: UserState['info'], action: Actions, _: PersonalizationState): UserState['info'] { @@ -22,5 +44,7 @@ export const userReducers: {[K in keyof UserState]: ReducerFunction<UserState[K]>} = { + defaultUserImages: defaultUserImagesReducer, + image: imageReducer, info: infoReducer, };
diff --git a/ash/webui/personalization_app/resources/trusted/user/user_state.ts b/ash/webui/personalization_app/resources/trusted/user/user_state.ts index 22107d1..baa12248 100644 --- a/ash/webui/personalization_app/resources/trusted/user/user_state.ts +++ b/ash/webui/personalization_app/resources/trusted/user/user_state.ts
@@ -2,14 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {UserInfo} from '../personalization_app.mojom-webui.js'; +import {Url} from 'chrome://resources/mojo/url/mojom/url.mojom-webui.js'; + +import {DefaultUserImage, UserInfo} from '../personalization_app.mojom-webui.js'; export interface UserState { + defaultUserImages: Array<DefaultUserImage>|null; + image: Url|null; info: UserInfo|null; } export function emptyState(): UserState { return { + defaultUserImages: null, + image: null, info: null, }; }
diff --git a/ash/webui/personalization_app/resources/trusted/user/user_subpage_element.html b/ash/webui/personalization_app/resources/trusted/user/user_subpage_element.html index 735b1b1..229d6611 100644 --- a/ash/webui/personalization_app/resources/trusted/user/user_subpage_element.html +++ b/ash/webui/personalization_app/resources/trusted/user/user_subpage_element.html
@@ -2,4 +2,5 @@ <div id="container"> <h2>User</h2> <user-preview></user-preview> + <avatar-list></avatar-list> </div>
diff --git a/ash/webui/personalization_app/resources/trusted/user_preview_element.html b/ash/webui/personalization_app/resources/trusted/user_preview_element.html index d1516b4..59b3e01 100644 --- a/ash/webui/personalization_app/resources/trusted/user_preview_element.html +++ b/ash/webui/personalization_app/resources/trusted/user_preview_element.html
@@ -13,9 +13,11 @@ <template is="dom-if" if="[[info_]]"> <p id="name">[[info_.name]]</p> <p id="email">[[info_.email]]</p> - <div id="imageContainer"> - <img id="avatar" src="[[info_.avatar.url]]"> - <slot></slot> - </div> </template> + <div id="imageContainer"> + <template is="dom-if" if="[[image_]]"> + <img id="avatar" src="[[image_.url]]"> + </template> + <slot></slot> + </div> </div>
diff --git a/ash/webui/personalization_app/resources/trusted/user_preview_element.ts b/ash/webui/personalization_app/resources/trusted/user_preview_element.ts index 0c1b30b..eb9b6029 100644 --- a/ash/webui/personalization_app/resources/trusted/user_preview_element.ts +++ b/ash/webui/personalization_app/resources/trusted/user_preview_element.ts
@@ -7,11 +7,13 @@ * current user. */ +import {Url} from 'chrome://resources/mojo/url/mojom/url.mojom-webui.js'; import {html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {UserInfo} from './personalization_app.mojom-webui.js'; import {WithPersonalizationStore} from './personalization_store.js'; import {initializeUserData} from './user/user_controller.js'; +import {UserImageObserver} from './user/user_image_observer.js'; import {getUserProvider} from './user/user_interface_provider.js'; export class UserPreview extends WithPersonalizationStore { @@ -25,14 +27,18 @@ static get properties() { return { + image_: Object, info_: Object, }; } + private image_: Url|null; private info_: UserInfo|null; connectedCallback() { super.connectedCallback(); + UserImageObserver.initUserImageObserverIfNeeded(); + this.watch<UserPreview['image_']>('image_', state => state.user.image); this.watch<UserPreview['info_']>('info_', state => state.user.info); this.updateFromStore(); initializeUserData(getUserProvider(), this.getStore());
diff --git a/ash/webui/personalization_app/test/fake_personalization_app_user_provider.cc b/ash/webui/personalization_app/test/fake_personalization_app_user_provider.cc index 67ea992..ae96c92 100644 --- a/ash/webui/personalization_app/test/fake_personalization_app_user_provider.cc +++ b/ash/webui/personalization_app/test/fake_personalization_app_user_provider.cc
@@ -22,6 +22,10 @@ user_receiver_.Bind(std::move(receiver)); } +void FakePersonalizationAppUserProvider::SetUserImageObserver( + mojo::PendingRemote<ash::personalization_app::mojom::UserImageObserver> + observer) {} + void FakePersonalizationAppUserProvider::GetUserInfo( GetUserInfoCallback callback) { // auto user_info_ptr = ash::personalization_app::mojom::UserInfo::New(); @@ -33,4 +37,7 @@ std::move(callback).Run(std::move(display_info)); } +void FakePersonalizationAppUserProvider::GetDefaultUserImages( + GetDefaultUserImagesCallback callback) {} + } // namespace ash
diff --git a/ash/webui/personalization_app/test/fake_personalization_app_user_provider.h b/ash/webui/personalization_app/test/fake_personalization_app_user_provider.h index 810b748d..d3d9977 100644 --- a/ash/webui/personalization_app/test/fake_personalization_app_user_provider.h +++ b/ash/webui/personalization_app/test/fake_personalization_app_user_provider.h
@@ -39,7 +39,11 @@ override; // personalization_app::mojom::UserProvider + void SetUserImageObserver( + mojo::PendingRemote<ash::personalization_app::mojom::UserImageObserver> + observer) override; void GetUserInfo(GetUserInfoCallback callback) override; + void GetDefaultUserImages(GetDefaultUserImagesCallback callback) override; private: mojo::Receiver<ash::personalization_app::mojom::UserProvider> user_receiver_{
diff --git a/ash/wm/desks/templates/desks_templates_test_util.cc b/ash/wm/desks/templates/desks_templates_test_util.cc index bb46796..7eae5e9 100644 --- a/ash/wm/desks/templates/desks_templates_test_util.cc +++ b/ash/wm/desks/templates/desks_templates_test_util.cc
@@ -5,13 +5,17 @@ #include "ash/wm/desks/templates/desks_templates_test_util.h" #include "ash/shell.h" +#include "ash/style/close_button.h" #include "ash/wm/desks/desks_bar_view.h" #include "ash/wm/desks/expanded_desks_bar_button.h" +#include "ash/wm/desks/templates/desks_templates_dialog_controller.h" #include "ash/wm/desks/templates/desks_templates_item_view.h" #include "ash/wm/desks/templates/desks_templates_presenter.h" #include "ash/wm/desks/zero_state_button.h" #include "ash/wm/overview/overview_grid.h" #include "ash/wm/overview/overview_test_util.h" +#include "ui/views/widget/widget_delegate.h" +#include "ui/views/window/dialog_delegate.h" namespace ash { @@ -141,6 +145,21 @@ return item ? static_cast<views::Button*>(item) : nullptr; } +views::Button* GetTemplateItemDeleteButton(int index) { + auto* item = GetItemViewFromTemplatesGrid(index); + return item ? static_cast<views::Button*>(const_cast<CloseButton*>( + DesksTemplatesItemViewTestApi(item).delete_button())) + : nullptr; +} + +views::Button* GetDesksTemplatesDialogAcceptButton() { + const views::Widget* dialog_widget = + DesksTemplatesDialogController::Get()->dialog_widget(); + if (!dialog_widget) + return nullptr; + return dialog_widget->widget_delegate()->AsDialogDelegate()->GetOkButton(); +} + void WaitForDesksTemplatesUI() { auto* overview_session = GetOverviewSession(); DCHECK(overview_session);
diff --git a/ash/wm/desks/templates/desks_templates_test_util.h b/ash/wm/desks/templates/desks_templates_test_util.h index 8e95b8c..bbb4fc3 100644 --- a/ash/wm/desks/templates/desks_templates_test_util.h +++ b/ash/wm/desks/templates/desks_templates_test_util.h
@@ -152,6 +152,8 @@ views::Button* GetExpandedStateDesksTemplatesButton(); views::Button* GetSaveDeskAsTemplateButton(); views::Button* GetTemplateItemButton(int index); +views::Button* GetTemplateItemDeleteButton(int index); +views::Button* GetDesksTemplatesDialogAcceptButton(); // A lot of the UI relies on calling into the local desk data manager to // update, which sends callbacks via posting tasks. Call
diff --git a/ash/wm/overview/overview_grid.cc b/ash/wm/overview/overview_grid.cc index d47b463c..18e2180 100644 --- a/ash/wm/overview/overview_grid.cc +++ b/ash/wm/overview/overview_grid.cc
@@ -1699,8 +1699,8 @@ if (!desks_templates_grid_widget_) { desks_templates_grid_widget_ = DesksTemplatesGridView::CreateDesksTemplatesGridWidget(root_window_); - desks_templates_grid_view_ = desks_templates_grid_widget_->SetContentsView( - std::make_unique<DesksTemplatesGridView>()); + desks_templates_grid_view_ = static_cast<DesksTemplatesGridView*>( + desks_templates_grid_widget_->GetContentsView()); } for (auto& overview_mode_item : window_list_)
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc index 2719f2b..b62d742 100644 --- a/ash/wm/workspace/workspace_window_resizer.cc +++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -708,14 +708,19 @@ if (!did_move_or_resize_) { if (!details().restore_bounds_in_parent.IsEmpty()) { window_state()->ClearRestoreBounds(); - if (window_state()->IsMaximized() && - details().window_component == HTCAPTION) { - // Update the maximized window so that it looks like it has been - // restored (i.e. update the caption buttons and height of the browser - // frame). - window_state()->window()->SetProperty(kFrameRestoreLookKey, true); - CrossFadeAnimation(window_state()->window(), bounds, - /*maximize=*/false); + if (details().window_component == HTCAPTION) { + if (window_state()->IsMaximized()) { + // Update the maximized window so that it looks like it has been + // restored (i.e. update the caption buttons and height of the + // browser frame). + window_state()->window()->SetProperty(kFrameRestoreLookKey, true); + CrossFadeAnimation(window_state()->window(), bounds, + /*maximize=*/false); + base::RecordAction( + base::UserMetricsAction("WindowDrag_Unmaximize")); + } else if (window_state()->IsSnapped()) { + base::RecordAction(base::UserMetricsAction("WindowDrag_Unsnap")); + } } } RestackWindows();
diff --git a/base/callback_list.h b/base/callback_list.h index 50a435f0..42d0095 100644 --- a/base/callback_list.h +++ b/base/callback_list.h
@@ -87,7 +87,7 @@ // returned by CallbackListBase::Add() does not outlive the bound object in the // callback. A typical way to do this is to bind a callback to a member function // on `this` and store the returned subscription as a member variable. -class BASE_EXPORT CallbackListSubscription { +class [[nodiscard]] BASE_EXPORT CallbackListSubscription { public: CallbackListSubscription(); CallbackListSubscription(CallbackListSubscription&& subscription);
diff --git a/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/carousel/AssistantActionsDecoration.java b/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/carousel/AssistantActionsDecoration.java index 2177ee38..a9d943e8 100644 --- a/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/carousel/AssistantActionsDecoration.java +++ b/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/carousel/AssistantActionsDecoration.java
@@ -20,7 +20,6 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.chrome.autofill_assistant.R; -import org.chromium.components.browser_ui.styles.SemanticColorUtils; /** * Decoration added to the actions carousel that add offsets to each action to have the right inner @@ -89,7 +88,8 @@ mShadowPaint.setStyle(Paint.Style.STROKE); mShadowPaint.setStrokeWidth(mShadowLayerWidth); - mOverlayPaint.setColor(SemanticColorUtils.getSheetBgColor(context)); + mOverlayPaint.setColor( + ApiCompatibilityUtils.getColor(context.getResources(), R.color.sheet_bg_color)); } @Override
diff --git a/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantActionsCarouselUiTest.java b/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantActionsCarouselUiTest.java index e653758..e58e4da 100644 --- a/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantActionsCarouselUiTest.java +++ b/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantActionsCarouselUiTest.java
@@ -17,9 +17,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.allOf; -import android.content.Context; import android.support.test.InstrumentationRegistry; -import android.view.ContextThemeWrapper; import android.widget.LinearLayout; import androidx.test.filters.MediumTest; @@ -30,7 +28,6 @@ import org.junit.runner.RunWith; import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.chrome.R; import org.chromium.chrome.browser.autofill_assistant.carousel.AssistantActionsCarouselCoordinator; import org.chromium.chrome.browser.autofill_assistant.carousel.AssistantCarouselModel; import org.chromium.chrome.browser.autofill_assistant.carousel.AssistantChip; @@ -53,20 +50,19 @@ @Rule public CustomTabActivityTestRule mTestRule = new CustomTabActivityTestRule(); - Context mTargetContext = new ContextThemeWrapper( - InstrumentationRegistry.getTargetContext(), R.style.Theme_Chromium_Activity); - /** Creates a coordinator for use in UI tests, and adds it to the global view hierarchy. */ private AssistantActionsCarouselCoordinator createCoordinator(AssistantCarouselModel model) throws Exception { AssistantActionsCarouselCoordinator coordinator = TestThreadUtils.runOnUiThreadBlocking( - () -> new AssistantActionsCarouselCoordinator(mTargetContext, model)); + () + -> new AssistantActionsCarouselCoordinator( + InstrumentationRegistry.getTargetContext(), model)); TestThreadUtils.runOnUiThreadBlocking(() -> { // Note: apparently, we need an intermediate container for this coordinator's view, // otherwise the view will be invisible. // @TODO(crbug.com/806868) figure out why this is the case. - LinearLayout container = new LinearLayout(mTargetContext); + LinearLayout container = new LinearLayout(InstrumentationRegistry.getTargetContext()); container.addView(coordinator.getView()); AutofillAssistantUiTestUtil.attachToCoordinator(mTestRule.getActivity(), container); }); @@ -76,8 +72,8 @@ @Before public void setUp() { - mTestRule.startCustomTabActivityWithIntent( - CustomTabsTestUtils.createMinimalCustomTabIntent(mTargetContext, "about:blank")); + mTestRule.startCustomTabActivityWithIntent(CustomTabsTestUtils.createMinimalCustomTabIntent( + InstrumentationRegistry.getTargetContext(), "about:blank")); } /** Tests assumptions about the initial state of the carousel. */
diff --git a/chrome/android/features/tab_ui/java/res/values/colors.xml b/chrome/android/features/tab_ui/java/res/values/colors.xml index 1a1adb41..3a7115b 100644 --- a/chrome/android/features/tab_ui/java/res/values/colors.xml +++ b/chrome/android/features/tab_ui/java/res/values/colors.xml
@@ -6,7 +6,7 @@ <resources xmlns:tools="http://schemas.android.com/tools"> <!-- Tab Switcher colors. --> <color name="tab_grid_card_view_tint_color">@color/legacy_bg_color_elev_4</color> - <color name="tab_grid_card_view_tint_color_incognito">@color/default_bg_color_dark_elev_4_baseline</color> + <color name="tab_grid_card_view_tint_color_incognito">@color/default_bg_color_dark_elev_4</color> <color name="tab_grid_card_title_text_color">@color/default_text_color_list</color> <color name="tab_grid_card_title_text_color_incognito">@color/default_text_color_light_list</color> @@ -20,7 +20,7 @@ <color name="tab_grid_card_divider_tint_color_incognito">@color/divider_line_bg_color_light</color> <color name="tab_grid_card_thumbnail_placeholder_color">@color/default_bg_color_secondary</color> - <color name="tab_grid_card_thumbnail_placeholder_color_incognito">@color/default_bg_color_dark_elev_3_baseline</color> + <color name="tab_grid_card_thumbnail_placeholder_color_incognito">@color/default_bg_color_dark_elev_3</color> <color name="tab_grid_card_selected_color">@color/default_control_color_active_baseline</color> <color name="tab_grid_card_selected_color_incognito">@color/default_control_color_active_dark</color> @@ -30,7 +30,7 @@ <color name="tab_list_mini_card_default_background_color_incognito">@color/default_bg_color_secondary_dark</color> <color name="tab_grid_dialog_background_color">@color/legacy_bg_color_elev_1</color> - <color name="tab_grid_dialog_background_color_incognito">@color/default_bg_color_dark_elev_1_baseline</color> + <color name="tab_grid_dialog_background_color_incognito">@color/default_bg_color_dark_elev_1</color> <color name="tab_grid_dialog_ungroup_button_text_color">@color/default_icon_color_accent1_baseline</color> <color name="tab_grid_dialog_ungroup_button_text_color_incognito">@color/default_icon_color_blue_light</color>
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiToolbarView.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiToolbarView.java index 864956f..2e96544 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiToolbarView.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiToolbarView.java
@@ -25,7 +25,6 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.chrome.tab_ui.R; -import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.ui.KeyboardVisibilityDelegate; import org.chromium.ui.widget.ChromeImageView; @@ -151,10 +150,10 @@ } void setIsIncognito(boolean isIncognito) { + @ColorRes + int primaryColorRes = isIncognito ? R.color.dialog_bg_color_dark : R.color.dialog_bg_color; @ColorInt - int primaryColor = - isIncognito ? getResources().getColor(R.color.dialog_bg_color_dark_baseline) - : SemanticColorUtils.getDialogBgColor(getContext()); + int primaryColor = getResources().getColor(primaryColorRes); setPrimaryColor(primaryColor); @ColorRes
diff --git a/chrome/android/java/res/layout/bookmark_save_flow.xml b/chrome/android/java/res/layout/bookmark_save_flow.xml index 24292756d..79d783ef 100644 --- a/chrome/android/java/res/layout/bookmark_save_flow.xml +++ b/chrome/android/java/res/layout/bookmark_save_flow.xml
@@ -13,7 +13,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingVertical="16dp"> + android:paddingTop="16dp" + android:paddingBottom="10dp"> <LinearLayout android:layout_width="match_parent" @@ -73,7 +74,8 @@ android:id="@+id/notification_switch_divider" style="@style/HorizontalDivider" android:visibility="gone" - android:layout_marginTop="16dp"/> + android:layout_marginTop="8dp" + android:layout_marginBottom="6dp"/> <LinearLayout android:id="@+id/notification_switch_container"
diff --git a/chrome/android/java/res/layout/sharing_device_picker.xml b/chrome/android/java/res/layout/sharing_device_picker.xml index 56b3aa3..b228435 100644 --- a/chrome/android/java/res/layout/sharing_device_picker.xml +++ b/chrome/android/java/res/layout/sharing_device_picker.xml
@@ -21,7 +21,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:background="@drawable/sheet_background"> + android:background="@color/sheet_bg_color"> <TextView android:id="@+id/device_picker_toolbar"
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ChromeActivityUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ChromeActivityUnitTest.java index e80635e..47da343 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/ChromeActivityUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ChromeActivityUnitTest.java
@@ -16,7 +16,6 @@ import org.robolectric.Robolectric; import org.chromium.base.test.BaseRobolectricTestRunner; -import org.chromium.chrome.R; import org.chromium.chrome.browser.app.ChromeActivity; import org.chromium.chrome.browser.ui.BottomContainer; import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar; @@ -32,7 +31,6 @@ @Before public void setup() { mActivity = Robolectric.buildActivity(Activity.class).setup().get(); - mActivity.setTheme(R.style.Theme_BrowserUI_DayNight); } @Test
diff --git a/chrome/android/profiles/newest.txt b/chrome/android/profiles/newest.txt index aed84aa..494695d 100644 --- a/chrome/android/profiles/newest.txt +++ b/chrome/android/profiles/newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-99.0.4837.0_rc-r1-merged.afdo.bz2 +chromeos-chrome-amd64-99.0.4838.0_rc-r1-merged.afdo.bz2
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 602f70d..da01337 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -5682,6 +5682,11 @@ flag_descriptions::kFastPairDescription, kOsCrOS, FEATURE_VALUE_TYPE(ash::features::kFastPair)}, + {"fast-pair-software-scanning", + flag_descriptions::kFastPairSoftwareScanningName, + flag_descriptions::kFastPairSoftwareScanningDescription, kOsCrOS, + FEATURE_VALUE_TYPE(ash::features::kFastPairSoftwareScanning)}, + {"pcie-billboard-notification", flag_descriptions::kPcieBillboardNotificationName, flag_descriptions::kPcieBillboardNotificationDescription, kOsCrOS,
diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc index a5065a5..a10d5352 100644 --- a/chrome/browser/apps/guest_view/web_view_browsertest.cc +++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -122,7 +122,7 @@ #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" -#include "pdf/pdf_features.h" +#include "pdf/buildflags.h" #include "ppapi/buildflags/buildflags.h" #include "services/device/public/cpp/test/scoped_geolocation_overrider.h" #include "services/network/public/cpp/features.h" @@ -149,6 +149,11 @@ #include "content/public/test/ppapi_test_utils.h" #endif +#if BUILDFLAG(ENABLE_PDF) +#include "chrome/browser/pdf/pdf_extension_test_util.h" +#include "pdf/pdf_features.h" +#endif // BUILDFLAG(ENABLE_PDF) + using extensions::ContextMenuMatcher; using extensions::ExtensionsAPIClient; using extensions::MenuItem; @@ -3928,16 +3933,15 @@ TestHelper("testFocusWhileFocused", "web_view/shim", NO_TEST_SERVER); } -class WebViewTestWithUnseasonedOverride - : public base::test::WithFeatureOverride, - public WebViewTest { +#if BUILDFLAG(ENABLE_PDF) +class WebViewPdfTest : public base::test::WithFeatureOverride, + public WebViewTest { public: - WebViewTestWithUnseasonedOverride() + WebViewPdfTest() : base::test::WithFeatureOverride(chrome_pdf::features::kPdfUnseasoned) {} }; -IN_PROC_BROWSER_TEST_P(WebViewTestWithUnseasonedOverride, - NestedGuestContainerBounds) { +IN_PROC_BROWSER_TEST_P(WebViewPdfTest, NestedGuestContainerBounds) { TestHelper("testPDFInWebview", "web_view/shim", NO_TEST_SERVER); std::vector<content::WebContents*> guest_web_contents_list; @@ -3960,8 +3964,7 @@ // Test that context menu Back/Forward items in a MimeHandlerViewGuest affect // the embedder WebContents. See crbug.com/587355. -IN_PROC_BROWSER_TEST_P(WebViewTestWithUnseasonedOverride, - ContextMenuNavigationInMimeHandlerView) { +IN_PROC_BROWSER_TEST_P(WebViewPdfTest, ContextMenuNavigationInMimeHandlerView) { TestHelper("testNavigateToPDFInWebview", "web_view/shim", NO_TEST_SERVER); std::vector<content::WebContents*> guest_web_contents_list; @@ -3993,12 +3996,12 @@ web_view_contents->GetLastCommittedURL()); } -IN_PROC_BROWSER_TEST_P(WebViewTestWithUnseasonedOverride, - Shim_TestDialogInPdf) { +IN_PROC_BROWSER_TEST_P(WebViewPdfTest, Shim_TestDialogInPdf) { TestHelper("testDialogInPdf", "web_view/shim", NO_TEST_SERVER); } -INSTANTIATE_FEATURE_OVERRIDE_TEST_SUITE(WebViewTestWithUnseasonedOverride); +INSTANTIATE_FEATURE_OVERRIDE_TEST_SUITE(WebViewPdfTest); +#endif // BUILDFLAG(ENABLE_PDF) IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestMailtoLink) { TestHelper("testMailtoLink", "web_view/shim", NEEDS_TEST_SERVER);
diff --git a/chrome/browser/ash/accessibility/spoken_feedback_app_list_browsertest.cc b/chrome/browser/ash/accessibility/spoken_feedback_app_list_browsertest.cc index 6218b6c..f694296 100644 --- a/chrome/browser/ash/accessibility/spoken_feedback_app_list_browsertest.cc +++ b/chrome/browser/ash/accessibility/spoken_feedback_app_list_browsertest.cc
@@ -49,7 +49,7 @@ TestSearchResult(const std::string& id, double relevance) { set_id(id); SetTitle(base::UTF8ToUTF16(id)); - set_relevance(relevance); + SetDisplayScore(relevance); } TestSearchResult(const TestSearchResult&) = delete; @@ -337,6 +337,9 @@ std::make_unique<app_list::SearchControllerImplNew>( app_list_client->GetModelUpdaterForTest(), app_list_client, nullptr, browser()->profile()); + // Disable ranking, which may override the explicitly set relevance scores + // and best match status of results. + search_controller->disable_ranking_for_test(); InitializeTestSearchProviders(search_controller.get(), &apps_provider_, &web_provider_); ASSERT_TRUE(apps_provider_);
diff --git a/chrome/browser/ash/lock_screen_apps/first_app_run_toast_manager.cc b/chrome/browser/ash/lock_screen_apps/first_app_run_toast_manager.cc index 0cf6ef2..c2bdd937 100644 --- a/chrome/browser/ash/lock_screen_apps/first_app_run_toast_manager.cc +++ b/chrome/browser/ash/lock_screen_apps/first_app_run_toast_manager.cc
@@ -144,9 +144,9 @@ void FirstAppRunToastManager::ToastDialogDismissed() { { const extensions::Extension* app = app_window_->GetExtension(); - DictionaryPrefUpdateDeprecated dict_update( + DictionaryPrefUpdate dict_update( profile_->GetPrefs(), prefs::kNoteTakingAppsLockScreenToastShown); - dict_update->SetBoolean(app->id(), true); + dict_update->SetBoolKey(app->id(), true); } Reset(); }
diff --git a/chrome/browser/ash/lock_screen_apps/state_controller_unittest.cc b/chrome/browser/ash/lock_screen_apps/state_controller_unittest.cc index 19cf665..346ca53 100644 --- a/chrome/browser/ash/lock_screen_apps/state_controller_unittest.cc +++ b/chrome/browser/ash/lock_screen_apps/state_controller_unittest.cc
@@ -540,9 +540,9 @@ if (is_first_app_run_test_) return; - DictionaryPrefUpdateDeprecated dict_update( + DictionaryPrefUpdate dict_update( profile()->GetPrefs(), prefs::kNoteTakingAppsLockScreenToastShown); - dict_update->SetBoolean(app_id, true); + dict_update->SetBoolKey(app_id, true); } // Helper method to move state controller to the specified state.
diff --git a/chrome/browser/ash/login/users/default_user_image/default_user_images.cc b/chrome/browser/ash/login/users/default_user_image/default_user_images.cc index 67eaeb3..2077003 100644 --- a/chrome/browser/ash/login/users/default_user_image/default_user_images.cc +++ b/chrome/browser/ash/login/users/default_user_image/default_user_images.cc
@@ -5,7 +5,11 @@ #include "chrome/browser/ash/login/users/default_user_image/default_user_images.h" #include <algorithm> +#include <memory> +#include <string> +#include <vector> +#include "ash/public/cpp/default_user_image.h" #include "base/command_line.h" #include "base/cxx17_backports.h" #include "base/logging.h" @@ -21,6 +25,7 @@ #include "ui/chromeos/resources/grit/ui_chromeos_resources.h" #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" #include "ui/gfx/image/image_skia.h" +#include "url/gurl.h" namespace ash { namespace default_user_image { @@ -317,10 +322,10 @@ const int kHistogramImagesCount = kDefaultImagesCount + kHistogramSpecialImagesMaxCount; -std::string GetDefaultImageUrl(int index) { +GURL GetDefaultImageUrl(int index) { if (index <= 0 || index >= kDefaultImagesCount) - return kZeroDefaultUrl; - return base::StringPrintf("%s%d", kDefaultUrlPrefix, index); + return GURL(kZeroDefaultUrl); + return GURL(base::StringPrintf("%s%d", kDefaultUrlPrefix, index)); } bool IsDefaultImageUrl(const std::string& url, int* image_id) { @@ -354,19 +359,26 @@ kDefaultImageInfo[index].eligibility == Eligibility::kEligible; } -std::unique_ptr<base::ListValue> GetCurrentImageSet() { - auto image_urls = std::make_unique<base::ListValue>(); - for (int i = 0; i < base::size(kCurrentImageIndexes); ++i) { - auto image_data = std::make_unique<base::DictionaryValue>(); - int index = kCurrentImageIndexes[i]; +std::vector<DefaultUserImage> GetCurrentImageSet() { + std::vector<DefaultUserImage> result; + for (int index : kCurrentImageIndexes) { int string_id = kDefaultImageInfo[index].description_message_id; + std::u16string title = + string_id ? l10n_util::GetStringUTF16(string_id) : std::u16string(); - image_data->SetStringKey("url", - default_user_image::GetDefaultImageUrl(index)); - image_data->SetIntKey("index", index); - image_data->SetStringKey("title", string_id - ? l10n_util::GetStringUTF16(string_id) - : std::u16string()); + result.push_back({index, std::move(title), + default_user_image::GetDefaultImageUrl(index)}); + } + return result; +} + +std::unique_ptr<base::ListValue> GetCurrentImageSetAsListValue() { + auto image_urls = std::make_unique<base::ListValue>(); + for (auto& user_image : GetCurrentImageSet()) { + auto image_data = std::make_unique<base::DictionaryValue>(); + image_data->SetIntKey("index", user_image.index); + image_data->SetStringKey("title", std::move(user_image.title)); + image_data->SetStringKey("url", user_image.url.spec()); image_urls->Append(std::move(image_data)); } return image_urls;
diff --git a/chrome/browser/ash/login/users/default_user_image/default_user_images.h b/chrome/browser/ash/login/users/default_user_image/default_user_images.h index b8b782d..fe6124ab 100644 --- a/chrome/browser/ash/login/users/default_user_image/default_user_images.h +++ b/chrome/browser/ash/login/users/default_user_image/default_user_images.h
@@ -9,8 +9,11 @@ #include <memory> #include <string> +#include <vector> +#include "ash/public/cpp/default_user_image.h" #include "third_party/abseil-cpp/absl/types/optional.h" +#include "url/gurl.h" namespace base { class ListValue; @@ -61,7 +64,7 @@ // Returns the URL to a default user image with the specified index. If the // index is invalid, returns the default user image for index 0 (anonymous // avatar image). -std::string GetDefaultImageUrl(int index); +GURL GetDefaultImageUrl(int index); // Checks if the given URL points to one of the default images. If it is, // returns true and its index through `image_id`. If not, returns false. @@ -82,9 +85,10 @@ // Returns true if `index` is a in the current set of default images. bool IsInCurrentImageSet(int index); -// Returns a list of dictionary values with url and title properties set for -// each default user image in the current set. -std::unique_ptr<base::ListValue> GetCurrentImageSet(); +// Returns a vector of current |DefaultUserImage|. +std::vector<DefaultUserImage> GetCurrentImageSet(); + +std::unique_ptr<base::ListValue> GetCurrentImageSetAsListValue(); // Returns the source info of the default user image with specified index. // Returns nullopt if there is no source info.
diff --git a/chrome/browser/ash/login/users/default_user_image/default_user_images_unittest.cc b/chrome/browser/ash/login/users/default_user_image/default_user_images_unittest.cc index 978aef1de..1fa804df 100644 --- a/chrome/browser/ash/login/users/default_user_image/default_user_images_unittest.cc +++ b/chrome/browser/ash/login/users/default_user_image/default_user_images_unittest.cc
@@ -12,7 +12,7 @@ TEST(DefaultUserImagesTest, CurrentImageSetShouldBeEligible) { std::unique_ptr<base::ListValue> current_default_images = - default_user_image::GetCurrentImageSet(); + default_user_image::GetCurrentImageSetAsListValue(); for (auto& image_data : current_default_images.get()->GetList()) { const auto index = image_data.FindIntPath("index"); @@ -22,7 +22,7 @@ const auto* url = image_data.FindStringPath("url"); EXPECT_TRUE(url); - EXPECT_EQ(GetDefaultImageUrl(index.value()), url->c_str()); + EXPECT_EQ(GetDefaultImageUrl(index.value()).spec(), url->c_str()); const auto* title = image_data.FindStringPath("title"); EXPECT_TRUE(title);
diff --git a/chrome/browser/ash/web_applications/personalization_app/personalization_app_user_provider_impl.cc b/chrome/browser/ash/web_applications/personalization_app/personalization_app_user_provider_impl.cc index 0d31a31..9c958f8 100644 --- a/chrome/browser/ash/web_applications/personalization_app/personalization_app_user_provider_impl.cc +++ b/chrome/browser/ash/web_applications/personalization_app/personalization_app_user_provider_impl.cc
@@ -8,10 +8,24 @@ #include "ash/webui/personalization_app/mojom/personalization_app.mojom.h" #include "ash/webui/personalization_app/mojom/personalization_app_mojom_traits.h" #include "base/strings/utf_string_conversions.h" +#include "chrome/browser/ash/login/users/default_user_image/default_user_images.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" #include "components/user_manager/user_info.h" +#include "components/user_manager/user_manager.h" #include "content/public/browser/web_ui.h" +#include "ui/base/webui/web_ui_util.h" +#include "url/gurl.h" + +namespace { + +GURL GetUserImageDataUrl(const user_manager::User& user) { + if (user.GetImage().isNull()) + return GURL(); + return GURL(webui::GetBitmapDataUrl(*user.GetImage().bitmap())); +} + +} // namespace PersonalizationAppUserProviderImpl::PersonalizationAppUserProviderImpl( content::WebUI* web_ui) @@ -27,6 +41,21 @@ user_receiver_.Bind(std::move(receiver)); } +void PersonalizationAppUserProviderImpl::SetUserImageObserver( + mojo::PendingRemote<ash::personalization_app::mojom::UserImageObserver> + observer) { + // May already be bound if user refreshes page. + user_image_observer_remote_.reset(); + user_image_observer_remote_.Bind(std::move(observer)); + DCHECK(user_manager::UserManager::IsInitialized()); + auto* user_manager = user_manager::UserManager::Get(); + if (!user_manager_observer_.IsObserving()) + user_manager_observer_.Observe(user_manager); + + // Call it manually the first time. + OnUserImageChanged(*ash::ProfileHelper::Get()->GetUserByProfile(profile_)); +} + void PersonalizationAppUserProviderImpl::GetUserInfo( GetUserInfoCallback callback) { const user_manager::User* user = @@ -34,3 +63,30 @@ DCHECK(user); std::move(callback).Run(ash::personalization_app::UserDisplayInfo(*user)); } + +void PersonalizationAppUserProviderImpl::GetDefaultUserImages( + GetDefaultUserImagesCallback callback) { + std::vector<ash::default_user_image::DefaultUserImage> images = + ash::default_user_image::GetCurrentImageSet(); + std::move(callback).Run(std::move(images)); +} + +void PersonalizationAppUserProviderImpl::OnUserImageChanged( + const user_manager::User& user) { + const user_manager::User* desired_user = + ash::ProfileHelper::Get()->GetUserByProfile(profile_); + DCHECK(desired_user); + + if (user.GetAccountId() != desired_user->GetAccountId()) + return; + + int image_index = user.image_index(); + // Image is a valid default image and has an internal chrome://theme url. + if (ash::default_user_image::IsInCurrentImageSet(image_index)) { + user_image_observer_remote_->OnUserImageChanged( + ash::default_user_image::GetDefaultImageUrl(image_index)); + return; + } + // All other cases. + user_image_observer_remote_->OnUserImageChanged(GetUserImageDataUrl(user)); +}
diff --git a/chrome/browser/ash/web_applications/personalization_app/personalization_app_user_provider_impl.h b/chrome/browser/ash/web_applications/personalization_app/personalization_app_user_provider_impl.h index 102e1656..6877d8e 100644 --- a/chrome/browser/ash/web_applications/personalization_app/personalization_app_user_provider_impl.h +++ b/chrome/browser/ash/web_applications/personalization_app/personalization_app_user_provider_impl.h
@@ -7,8 +7,11 @@ #include "ash/webui/personalization_app/mojom/personalization_app.mojom.h" #include "ash/webui/personalization_app/personalization_app_user_provider.h" +#include "base/scoped_observation.h" +#include "components/user_manager/user_manager.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver.h" +#include "mojo/public/cpp/bindings/remote.h" class Profile; @@ -17,7 +20,8 @@ } // namespace content class PersonalizationAppUserProviderImpl - : public ash::PersonalizationAppUserProvider { + : public ash::PersonalizationAppUserProvider, + public user_manager::UserManager::Observer { public: explicit PersonalizationAppUserProviderImpl(content::WebUI* web_ui); @@ -34,12 +38,28 @@ receiver) override; // personalization_app::mojom::UserProvider: + void SetUserImageObserver( + mojo::PendingRemote<ash::personalization_app::mojom::UserImageObserver> + observer) override; + void GetUserInfo(GetUserInfoCallback callback) override; + void GetDefaultUserImages(GetDefaultUserImagesCallback callback) override; + + // user_manager::UserManager::Observer: + void OnUserImageChanged(const user_manager::User& user) override; + private: // Pointer to profile of user that opened personalization SWA. Not owned. Profile* const profile_ = nullptr; + base::ScopedObservation<user_manager::UserManager, + user_manager::UserManager::Observer> + user_manager_observer_{this}; + + mojo::Remote<ash::personalization_app::mojom::UserImageObserver> + user_image_observer_remote_; + mojo::Receiver<ash::personalization_app::mojom::UserProvider> user_receiver_{ this}; };
diff --git a/chrome/browser/ash/web_applications/personalization_app/personalization_app_user_provider_impl_unittest.cc b/chrome/browser/ash/web_applications/personalization_app/personalization_app_user_provider_impl_unittest.cc index a092be2..15946ff 100644 --- a/chrome/browser/ash/web_applications/personalization_app/personalization_app_user_provider_impl_unittest.cc +++ b/chrome/browser/ash/web_applications/personalization_app/personalization_app_user_provider_impl_unittest.cc
@@ -9,8 +9,11 @@ #include "ash/constants/ash_features.h" #include "ash/webui/personalization_app/mojom/personalization_app.mojom.h" #include "base/callback_helpers.h" +#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/test/bind.h" +#include "chrome/browser/ash/login/users/avatar/user_image_manager.h" +#include "chrome/browser/ash/login/users/default_user_image/default_user_images.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/login/users/scoped_test_user_manager.h" #include "chrome/test/base/testing_browser_process.h" @@ -47,6 +50,33 @@ user_manager->LoginUser(account_id); user_manager->SwitchActiveUser(account_id); } + +class TestUserImageObserver + : public ash::personalization_app::mojom::UserImageObserver { + public: + void OnUserImageChanged(const GURL& image) override { + current_user_image_ = image; + } + + mojo::PendingRemote<ash::personalization_app::mojom::UserImageObserver> + pending_remote() { + DCHECK(!user_image_observer_receiver_.is_bound()); + return user_image_observer_receiver_.BindNewPipeAndPassRemote(); + } + + const GURL& current_user_image() { + if (user_image_observer_receiver_.is_bound()) + user_image_observer_receiver_.FlushForTesting(); + return current_user_image_; + } + + private: + mojo::Receiver<ash::personalization_app::mojom::UserImageObserver> + user_image_observer_receiver_{this}; + + GURL current_user_image_; +}; + } // namespace class PersonalizationAppUserProviderImplTest : public testing::Test { @@ -97,6 +127,22 @@ return user_manager::UserManager::Get()->GetActiveUser()->GetImage(); } + ash::FakeChromeUserManager* GetFakeUserManager() { + return static_cast<ash::FakeChromeUserManager*>( + user_manager::UserManager::Get()); + } + + void SetUserImageObserver() { + user_provider_remote_->SetUserImageObserver( + test_user_image_observer_.pending_remote()); + } + + const GURL& current_user_image() { + if (user_provider_remote_.is_bound()) + user_provider_remote_.FlushForTesting(); + return test_user_image_observer_.current_user_image(); + } + private: content::BrowserTaskEnvironment task_environment_; user_manager::ScopedUserManager scoped_user_manager_; @@ -104,6 +150,7 @@ content::TestWebUI web_ui_; std::unique_ptr<content::WebContents> web_contents_; TestingProfile* profile_; + TestUserImageObserver test_user_image_observer_; mojo::Remote<ash::personalization_app::mojom::UserProvider> user_provider_remote_; std::unique_ptr<PersonalizationAppUserProviderImpl> user_provider_; @@ -112,11 +159,33 @@ TEST_F(PersonalizationAppUserProviderImplTest, GetsUserInfo) { user_provider_remote()->get()->GetUserInfo(base::BindLambdaForTesting( - [this](ash::personalization_app::UserDisplayInfo user_display_info) { + [](ash::personalization_app::UserDisplayInfo user_display_info) { EXPECT_EQ(kFakeTestEmail, user_display_info.email); EXPECT_EQ(kFakeTestName, user_display_info.name); - EXPECT_EQ(webui::GetBitmapDataUrl(*user_image().bitmap()), - user_display_info.avatar); })); user_provider_remote()->FlushForTesting(); } + +TEST_F(PersonalizationAppUserProviderImplTest, ObservesUserAvatarImage) { + // Observer has not received any images yet because it is not bound. + EXPECT_EQ(GURL(), current_user_image()); + + SetUserImageObserver(); + + // Observer received current user's avatar image as data url. + EXPECT_EQ(webui::GetBitmapDataUrl(*user_image().bitmap()), + current_user_image()); + + auto* user_image_manager = GetFakeUserManager()->GetUserImageManager( + GetFakeUserManager()->GetActiveUser()->GetAccountId()); + + // Select a default image. + int image_index = ash::default_user_image::GetRandomDefaultImageIndex(); + user_image_manager->SaveUserDefaultImageIndex(image_index); + + // Observer received the updated image url. Because it is a default image, + // receives the chrome://theme url. + EXPECT_EQ(base::StringPrintf("chrome://theme/IDR_LOGIN_DEFAULT_USER_%d", + image_index), + current_user_image()); +}
diff --git a/chrome/browser/attribution_reporting/chrome_attribution_browsertest.cc b/chrome/browser/attribution_reporting/chrome_attribution_browsertest.cc index 29b3854..bbe7500a 100644 --- a/chrome/browser/attribution_reporting/chrome_attribution_browsertest.cc +++ b/chrome/browser/attribution_reporting/chrome_attribution_browsertest.cc
@@ -100,7 +100,7 @@ // it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( browser()->tab_strip_model()->GetActiveWebContents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); base::HistogramTester histogram_tester; EXPECT_TRUE(ui_test_utils::NavigateToURL(
diff --git a/chrome/browser/battery/battery_metrics_browsertest.cc b/chrome/browser/battery/battery_metrics_browsertest.cc index cf83052..59a191a 100644 --- a/chrome/browser/battery/battery_metrics_browsertest.cc +++ b/chrome/browser/battery/battery_metrics_browsertest.cc
@@ -129,14 +129,7 @@ std::unique_ptr<MockBatteryMonitor> mock_battery_monitor_; }; -#if defined(OS_WIN) -#define DISABLED_ON_WIN(name) DISABLED##name -#else -#define DISABLED_ON_WIN(name) name -#endif - -IN_PROC_BROWSER_TEST_F(BatteryMetricsBrowserTest, - DISABLED_ON_WIN(BatteryDropUMA)) { +IN_PROC_BROWSER_TEST_F(BatteryMetricsBrowserTest, BatteryDropUMA) { // Verify that drops in battery level are recorded, and drops by less than 1% // are aggregated together until there is a full percentage drop. device::mojom::BatteryStatus status;
diff --git a/chrome/browser/browsing_data/browsing_data_history_observer_service.cc b/chrome/browser/browsing_data/browsing_data_history_observer_service.cc index 8c439c30..95c3ddbb 100644 --- a/chrome/browser/browsing_data/browsing_data_history_observer_service.cc +++ b/chrome/browser/browsing_data/browsing_data_history_observer_service.cc
@@ -62,7 +62,9 @@ base::Time delete_begin, base::Time delete_end) { if (!keywords_model->loaded()) { - keywords_model->RegisterOnLoadedCallback( + // TODO(https://crbug.com/1288724): Ignoring the return value here is + // probably a bug. + (void)keywords_model->RegisterOnLoadedCallback( base::BindOnce(&DeleteTemplateUrlsForTimeRange, keywords_model, delete_begin, delete_end)); keywords_model->Load(); @@ -75,7 +77,9 @@ void DeleteTemplateUrlsForDeletedOrigins(TemplateURLService* keywords_model, base::flat_set<GURL> deleted_origins) { if (!keywords_model->loaded()) { - keywords_model->RegisterOnLoadedCallback( + // TODO(https://crbug.com/1288724): Ignoring the return value here is + // probably a bug. + (void)keywords_model->RegisterOnLoadedCallback( base::BindOnce(&DeleteTemplateUrlsForDeletedOrigins, keywords_model, std::move(deleted_origins))); keywords_model->Load();
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_constants.h b/chrome/browser/browsing_data/chrome_browsing_data_remover_constants.h index fb80428..294e11d 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_constants.h +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_constants.h
@@ -51,7 +51,8 @@ DATA_TYPE_SITE_USAGE_DATA | DATA_TYPE_DURABLE_PERMISSION | DATA_TYPE_EXTERNAL_PROTOCOL_DATA | DATA_TYPE_ISOLATED_ORIGINS | content::BrowsingDataRemover::DATA_TYPE_TRUST_TOKENS | - content::BrowsingDataRemover::DATA_TYPE_CONVERSIONS, + content::BrowsingDataRemover::DATA_TYPE_CONVERSIONS | + content::BrowsingDataRemover::DATA_TYPE_AGGREGATION_SERVICE, // Datatypes protected by Important Sites. IMPORTANT_SITES_DATA_TYPES =
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 570a941..7e882ea 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2763,15 +2763,32 @@ } bool ChromeContentBrowserClient::IsInterestGroupAPIAllowed( - content::BrowserContext* browser_context, + content::RenderFrameHost* render_frame_host, + InterestGroupApiOperation operation, const url::Origin& top_frame_origin, - const GURL& api_url) { - Profile* profile = Profile::FromBrowserContext(browser_context); + const url::Origin& api_origin) { + Profile* profile = + Profile::FromBrowserContext(render_frame_host->GetBrowserContext()); PrivacySandboxSettings* privacy_sandbox_settings = PrivacySandboxSettingsFactory::GetForProfile(profile); + DCHECK(privacy_sandbox_settings); - return privacy_sandbox_settings && - privacy_sandbox_settings->IsFledgeAllowed(top_frame_origin, api_url); + // Join operations are subject to an additional check. + bool join_blocked = + operation == InterestGroupApiOperation::kJoin + ? !privacy_sandbox_settings->IsFledgeJoiningAllowed(top_frame_origin) + : false; + + bool allowed = + privacy_sandbox_settings->IsFledgeAllowed(top_frame_origin, api_origin) && + !join_blocked; + + if (operation == InterestGroupApiOperation::kJoin) { + content_settings::PageSpecificContentSettings::InterestGroupJoined( + render_frame_host, api_origin, !allowed); + } + + return allowed; } bool ChromeContentBrowserClient::IsConversionMeasurementOperationAllowed(
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index e5a3109..71dfd39 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -288,9 +288,10 @@ const url::Origin& requesting_origin, const url::Origin& embedding_origin) override; std::string GetWebBluetoothBlocklist() override; - bool IsInterestGroupAPIAllowed(content::BrowserContext* browser_context, + bool IsInterestGroupAPIAllowed(content::RenderFrameHost* render_frame_host, + InterestGroupApiOperation operation, const url::Origin& top_frame_origin, - const GURL& api_url) override; + const url::Origin& api_origin) override; bool IsConversionMeasurementOperationAllowed( content::BrowserContext* browser_context, ConversionMeasurementOperation operation,
diff --git a/chrome/browser/chrome_multiprofile_startup_browsertest.cc b/chrome/browser/chrome_multiprofile_startup_browsertest.cc index 6d2c113..f918ce8 100644 --- a/chrome/browser/chrome_multiprofile_startup_browsertest.cc +++ b/chrome/browser/chrome_multiprofile_startup_browsertest.cc
@@ -183,19 +183,20 @@ // At least one entry for the initial call is needed. ASSERT_FALSE(GetParam().expected_post_profile_init_call_args.empty()); + // The basic callbacks should be called only once. + EXPECT_CALL(*mock_part_, PreProfileInit()).Times(1); + EXPECT_CALL(*mock_part_, PreBrowserStart()).Times(1); + EXPECT_CALL(*mock_part_, PostBrowserStart()).Times(1); + EXPECT_CALL(*mock_part_, PreMainMessageLoopRun()).Times(1); + { + const auto& call_args = GetParam().expected_post_profile_init_call_args; InSequence s; - EXPECT_CALL(*mock_part_, PreProfileInit()); - const auto& first_profile_init_call_expected_args = - GetParam().expected_post_profile_init_call_args[0]; - EXPECT_CALL( - *mock_part_, - PostProfileInit( - first_profile_init_call_expected_args.profile_matcher, - first_profile_init_call_expected_args.is_initial_profile)); - EXPECT_CALL(*mock_part_, PreBrowserStart()); - EXPECT_CALL(*mock_part_, PostBrowserStart()); - EXPECT_CALL(*mock_part_, PreMainMessageLoopRun()); + for (const auto& expected_args : call_args) { + EXPECT_CALL(*mock_part_, + PostProfileInit(expected_args.profile_matcher, + expected_args.is_initial_profile)); + } } } @@ -222,10 +223,6 @@ // called a second time. IN_PROC_BROWSER_TEST_P(ChromeMultiProfileStartupBrowserTestBase, PostProfileInitInvocation) { - // Verify expectations set up in `CreatedBrowserMainParts` and reset to allow - // setting up post-startup expectations. - Mock::VerifyAndClearExpectations(&mock_part_); - EXPECT_EQ(2u, g_browser_process->profile_manager()->GetNumberOfProfiles()); if (GetParam().should_show_profile_picker) { EXPECT_EQ(0u, chrome::GetTotalBrowserCount()); @@ -237,26 +234,11 @@ EXPECT_FALSE(ProfilePicker::IsOpen()); } - // Set up expectations for other browser window launch. - EXPECT_CALL(*mock_part_, PreProfileInit()).Times(0); - EXPECT_CALL(*mock_part_, PreBrowserStart()).Times(0); - EXPECT_CALL(*mock_part_, PostBrowserStart()).Times(0); - EXPECT_CALL(*mock_part_, PreMainMessageLoopRun()).Times(0); - - const auto& call_args = GetParam().expected_post_profile_init_call_args; - // Note: `call_args[0]` is checked in `CreatedBrowserMainParts()`. - if (call_args.size() <= 1) { - EXPECT_CALL(*mock_part_, PostProfileInit(_, _)).Times(0); - } else { - InSequence s; - for (size_t i = 1; i < call_args.size(); ++i) { - const auto& expected_args = call_args[i]; - EXPECT_CALL(*mock_part_, - PostProfileInit(expected_args.profile_matcher, - expected_args.is_initial_profile)); - } - } - + // TODO(https://crbug.com/1288766): In some cases, profile creation is + // triggered by restoring the previously opened profile, and the test + // expectations in terms of `PostProfileInit()` calls can + // be met without opening browsers. We still open them for consistency, at + // least until we can make the test behaviour stricter. if (GetParam().should_show_profile_picker) { // No browser was previously open, as verified at the beginning of the test. // So we start by opening the browser for the default profile.
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc index 3e1f2f43..0d1bfa7 100644 --- a/chrome/browser/download/download_browsertest.cc +++ b/chrome/browser/download/download_browsertest.cc
@@ -96,7 +96,6 @@ #include "components/infobars/core/confirm_infobar_delegate.h" #include "components/infobars/core/infobar.h" #include "components/metrics/content/subprocess_metrics_provider.h" -#include "components/pdf/browser/pdf_web_contents_helper.h" #include "components/permissions/permission_request_manager.h" #include "components/prefs/pref_service.h" #include "components/reputation/core/safety_tip_test_utils.h" @@ -147,6 +146,7 @@ #include "net/test/embedded_test_server/request_handler_util.h" #include "net/test/url_request/url_request_mock_http_job.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" +#include "pdf/buildflags.h" #include "services/device/public/mojom/wake_lock.mojom.h" #include "services/device/public/mojom/wake_lock_provider.mojom.h" #include "testing/gtest/include/gtest/gtest.h" @@ -162,6 +162,10 @@ #include "chrome/browser/safe_browsing/test_safe_browsing_service.h" #endif +#if BUILDFLAG(ENABLE_PDF) +#include "components/pdf/browser/pdf_web_contents_helper.h" +#endif + using content::BrowserContext; using content::BrowserThread; using content::DownloadManager; @@ -2855,6 +2859,7 @@ base::test::ScopedFeatureList feature_list_; }; +#if BUILDFLAG(ENABLE_PDF) IN_PROC_BROWSER_TEST_F(DownloadTestSplitCacheEnabled, SaveMainFramePdfFromContextMenu_IsolationInfo) { embedded_test_server()->ServeFilesFromDirectory(GetTestDataDirectory()); @@ -3020,6 +3025,7 @@ download_waiter->NumDownloadsSeenInState(DownloadItem::COMPLETE)); CheckDownloadStates(1, DownloadItem::COMPLETE); } +#endif // BUILDFLAG(ENABLE_PDF) IN_PROC_BROWSER_TEST_F(DownloadTestSplitCacheEnabled, SaveSubframeImageFromContextMenu_IsolationInfo) { @@ -4335,7 +4341,7 @@ base::FilePath file_path(origin_directory.Append( #if BUILDFLAG(IS_WIN) crazy_w -#elif BUILDFLAG(IS_POSIX) +#elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) crazy8 #endif )); @@ -5199,7 +5205,8 @@ #if BUILDFLAG(IS_WIN) const char kDangerousMockFilePath[] = "/downloads/dangerous/dangerous.exe"; -#elif BUILDFLAG(IS_POSIX) +#elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) +// TODO(crbug.com/1264058): Find an actually "dangerous" extension for Fuchsia. const char kDangerousMockFilePath[] = "/downloads/dangerous/dangerous.sh"; #endif
diff --git a/chrome/browser/extensions/api/quick_unlock_private/OWNERS b/chrome/browser/extensions/api/quick_unlock_private/OWNERS index 965fbf7..25fff6ea8 100644 --- a/chrome/browser/extensions/api/quick_unlock_private/OWNERS +++ b/chrome/browser/extensions/api/quick_unlock_private/OWNERS
@@ -1,3 +1,4 @@ alemate@chromium.org +rsorokin@chromium.org file://chrome/browser/resources/settings/chromeos/OWNERS
diff --git a/chrome/browser/extensions/api/tabs/tabs_test.cc b/chrome/browser/extensions/api/tabs/tabs_test.cc index e7473da..52bf53c 100644 --- a/chrome/browser/extensions/api/tabs/tabs_test.cc +++ b/chrome/browser/extensions/api/tabs/tabs_test.cc
@@ -30,7 +30,6 @@ #include "chrome/browser/extensions/extension_function_test_utils.h" #include "chrome/browser/extensions/extension_tab_util.h" #include "chrome/browser/extensions/window_controller.h" -#include "chrome/browser/pdf/pdf_extension_test_util.h" #include "chrome/browser/prefs/incognito_mode_prefs.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h" @@ -63,6 +62,7 @@ #include "extensions/test/extension_test_message_listener.h" #include "extensions/test/result_catcher.h" #include "net/test/embedded_test_server/embedded_test_server.h" +#include "pdf/buildflags.h" #include "third_party/blink/public/common/page/page_zoom.h" #include "ui/base/window_open_disposition.h" #include "ui/gfx/geometry/rect.h" @@ -71,6 +71,10 @@ #include "ui/base/test/scoped_fake_nswindow_fullscreen.h" #endif +#if BUILDFLAG(ENABLE_PDF) +#include "chrome/browser/pdf/pdf_extension_test_util.h" +#endif + namespace extensions { namespace keys = tabs_constants; @@ -1883,6 +1887,7 @@ base::MatchPattern(error, manifest_errors::kCannotAccessChromeUrl)); } +#if BUILDFLAG(ENABLE_PDF) // Regression test for crbug.com/660498. IN_PROC_BROWSER_TEST_F(ExtensionApiTest, TemporaryAddressSpoof) { ASSERT_TRUE(StartEmbeddedTestServer()); @@ -1936,6 +1941,7 @@ // avoid a race during browser teardown (see crbug.com/882213). navigation_manager.WaitForNavigationFinished(); } +#endif // BUILDFLAG(ENABLE_PDF) // Tests how chrome.windows.create behaves when setSelfAsOpener parameter is // used. setSelfAsOpener was introduced as a fix for https://crbug.com/713888
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedStream.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedStream.java index 13048836..874e6b4 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedStream.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedStream.java
@@ -54,6 +54,8 @@ import org.chromium.chrome.browser.xsurface.SurfaceScope; import org.chromium.components.browser_ui.bottomsheet.BottomSheetContent; import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; +import org.chromium.components.browser_ui.bottomsheet.BottomSheetController.StateChangeReason; +import org.chromium.components.browser_ui.bottomsheet.EmptyBottomSheetObserver; import org.chromium.components.browser_ui.share.ShareParams; import org.chromium.components.browser_ui.widget.animation.Interpolators; import org.chromium.components.feed.proto.FeedUiProto; @@ -152,9 +154,22 @@ FeedStreamJni.get().reportOtherUserAction( mNativeFeedStream, FeedStream.this, FeedUserActionType.OPENED_CONTEXT_MENU); + // Remember the currently focused view so that we can get back to it once the bottom + // sheet is closed. This is to fix the problem that the last focused view is not + // restored after opening and closing the bottom sheet. + mLastFocusedView = mActivity.getCurrentFocus(); + // Make a sheetContent with the view. mBottomSheetContent = new CardMenuBottomSheetContent(view); mBottomSheetOriginatingSliceId = getSliceIdFromView(actionSourceView); + mBottomSheetController.addObserver(new EmptyBottomSheetObserver() { + @Override + public void onSheetClosed(@StateChangeReason int reason) { + if (mLastFocusedView == null) return; + mLastFocusedView.requestFocus(); + mLastFocusedView = null; + } + }); mBottomSheetController.requestShowContent(mBottomSheetContent, true); } @@ -418,6 +433,7 @@ private final BottomSheetController mBottomSheetController; private BottomSheetContent mBottomSheetContent; private String mBottomSheetOriginatingSliceId; + private View mLastFocusedView; // Sort options drawer. private View mSortView;
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index ece25f4..5addd36 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -3109,7 +3109,12 @@ { "name": "fast-pair", "owners": [ "//ash/quick_pair/OWNERS", "jonmann@chromium.org" ], - "expiry_milestone": 101 + "expiry_milestone": 102 + }, + { + "name": "fast-pair-software-scanning", + "owners": [ "//ash/quick_pair/OWNERS", "jonmann@chromium.org" ], + "expiry_milestone": 102 }, { "name": "feature-notification-guide",
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 2032d2f..9e8844c 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -4293,6 +4293,12 @@ "Use along with #bluetooth-advertisement-monitoring to allow background " "scanning."; +const char kFastPairSoftwareScanningName[] = + "Enable Fast Pair Software Scanning"; +const char kFastPairSoftwareScanningDescription[] = + "Allow using Fast Pair on devices which don't support hardware offloading " + "of BLE scans. For development use."; + const char kUseHDRTransferFunctionName[] = "Monitor/Display HDR transfer function"; const char kUseHDRTransferFunctionDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index abec084f..5e32282 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -2460,6 +2460,9 @@ extern const char kFastPairName[]; extern const char kFastPairDescription[]; +extern const char kFastPairSoftwareScanningName[]; +extern const char kFastPairSoftwareScanningDescription[]; + extern const char kUseHDRTransferFunctionName[]; extern const char kUseHDRTransferFunctionDescription[];
diff --git a/chrome/browser/infobars/infobars_browsertest.cc b/chrome/browser/infobars/infobars_browsertest.cc index bc679c1..42e57d1a 100644 --- a/chrome/browser/infobars/infobars_browsertest.cc +++ b/chrome/browser/infobars/infobars_browsertest.cc
@@ -223,8 +223,8 @@ break; case IBD::EXTENSION_DEV_TOOLS_INFOBAR_DELEGATE: - extensions::ExtensionDevToolsInfoBarDelegate::Create("id", "Extension", - base::DoNothing()); + (void)extensions::ExtensionDevToolsInfoBarDelegate::Create( + "id", "Extension", base::DoNothing()); break; case IBD::INCOGNITO_CONNECTABILITY_INFOBAR_DELEGATE: {
diff --git a/chrome/browser/media/history/media_history_browsertest.cc b/chrome/browser/media/history/media_history_browsertest.cc index 408c6692..4817ea6 100644 --- a/chrome/browser/media/history/media_history_browsertest.cc +++ b/chrome/browser/media/history/media_history_browsertest.cc
@@ -834,7 +834,7 @@ // doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( browser->tab_strip_model()->GetActiveWebContents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); // Start a page and wait for significant playback so we record watchtime. EXPECT_TRUE(SetupPageAndStartPlaying(browser, GetTestURL())); EXPECT_TRUE(WaitForSignificantPlayback(browser)); @@ -910,7 +910,7 @@ // doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( browser->tab_strip_model()->GetActiveWebContents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); // Start a page and wait for significant playback so we record watchtime. EXPECT_TRUE(SetupPageAndStartPlayingAudioOnly(browser, GetTestURL())); @@ -980,7 +980,7 @@ // doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( browser->tab_strip_model()->GetActiveWebContents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); // Start a page and wait for significant playback so we record watchtime. EXPECT_TRUE(SetupPageAndStartPlayingVideoOnly(browser, GetTestURL()));
diff --git a/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.cc b/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.cc index e67b9ac..2ad2b06e 100644 --- a/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.cc +++ b/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.cc
@@ -97,7 +97,7 @@ StartTimer(); - dial_registry_ = std::make_unique<DialRegistry>(*this); + dial_registry_ = std::make_unique<DialRegistry>(*this, task_runner_); dial_registry_->Start(); }
diff --git a/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h b/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h index 38a2b09..68417d3 100644 --- a/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h +++ b/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h
@@ -11,6 +11,7 @@ #include "base/containers/flat_map.h" #include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h" +#include "base/memory/scoped_refptr.h" #include "base/sequence_checker.h" #include "base/task/sequenced_task_runner.h" #include "chrome/browser/media/router/discovery/dial/device_description_service.h"
diff --git a/chrome/browser/media/router/discovery/dial/dial_registry.cc b/chrome/browser/media/router/discovery/dial/dial_registry.cc index 87623d1..e150ef38a 100644 --- a/chrome/browser/media/router/discovery/dial/dial_registry.cc +++ b/chrome/browser/media/router/discovery/dial/dial_registry.cc
@@ -36,16 +36,18 @@ namespace media_router { -DialRegistry::DialRegistry(DialRegistry::Client& client) - : registry_generation_(0), +DialRegistry::DialRegistry( + DialRegistry::Client& client, + const scoped_refptr<base::SequencedTaskRunner>& task_runner) + : client_(client), + task_runner_(task_runner), + registry_generation_(0), last_event_registry_generation_(0), label_count_(0), refresh_interval_delta_(base::Seconds(kDialRefreshIntervalSecs)), expiration_delta_(base::Seconds(kDialExpirationSecs)), max_devices_(kDialMaxDevices), - client_(client), clock_(base::DefaultClock::GetInstance()) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_GT(max_devices_, 0U); } @@ -59,12 +61,13 @@ } void DialRegistry::SetNetLog(net::NetLog* net_log) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!net_log_) net_log_ = net_log; } void DialRegistry::Start() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); content::GetUIThreadTaskRunner({})->PostTaskAndReplyWithResult( FROM_HERE, base::BindOnce(&content::GetNetworkConnectionTracker), base::BindOnce(&DialRegistry::SetNetworkConnectionTracker, @@ -72,7 +75,7 @@ } std::unique_ptr<DialService> DialRegistry::CreateDialService() { - return std::make_unique<DialServiceImpl>(*this, net_log_); + return std::make_unique<DialServiceImpl>(*this, task_runner_, net_log_); } void DialRegistry::ClearDialService() { @@ -123,7 +126,7 @@ } bool DialRegistry::DiscoverNow() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!ReadyToDiscover()) return false; @@ -142,7 +145,7 @@ } void DialRegistry::StartPeriodicDiscovery() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!ReadyToDiscover() || dial_) return; @@ -157,13 +160,13 @@ } void DialRegistry::DoDiscovery() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(dial_); dial_->Discover(); } void DialRegistry::StopPeriodicDiscovery() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!dial_) return; @@ -173,7 +176,7 @@ } bool DialRegistry::PruneExpiredDevices() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); bool pruned_device = false; auto it = device_by_label_map_.begin(); while (it != device_by_label_map_.end()) { @@ -212,7 +215,7 @@ } void DialRegistry::Clear() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); device_by_id_map_.clear(); device_by_label_map_.clear(); registry_generation_++; @@ -237,17 +240,17 @@ } std::string DialRegistry::NextLabel() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return base::NumberToString(++label_count_); } void DialRegistry::OnDiscoveryRequest() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); MaybeSendDeviceList(); } void DialRegistry::OnDeviceDiscovered(const DialDeviceData& device) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Adds |device| to our list of devices or updates an existing device, unless // |device| is a duplicate. Returns true if the list was modified and @@ -272,7 +275,7 @@ } bool DialRegistry::MaybeAddDevice(std::unique_ptr<DialDeviceData> device_data) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (device_by_id_map_.size() == max_devices_) { return false; } @@ -284,14 +287,14 @@ } void DialRegistry::OnDiscoveryFinished() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (PruneExpiredDevices()) registry_generation_++; MaybeSendDeviceList(); } void DialRegistry::OnError(DialService::DialServiceErrorCode code) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); switch (code) { case DialService::DIAL_SERVICE_SOCKET_ERROR: client_.OnDialError(DIAL_SOCKET_ERROR);
diff --git a/chrome/browser/media/router/discovery/dial/dial_registry.h b/chrome/browser/media/router/discovery/dial/dial_registry.h index 1130279..1890f29 100644 --- a/chrome/browser/media/router/discovery/dial/dial_registry.h +++ b/chrome/browser/media/router/discovery/dial/dial_registry.h
@@ -14,6 +14,9 @@ #include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h" +#include "base/memory/scoped_refptr.h" +#include "base/sequence_checker.h" +#include "base/task/sequenced_task_runner.h" #include "base/timer/timer.h" #include "chrome/browser/media/router/discovery/dial/dial_service.h" #include "services/network/public/cpp/network_connection_tracker.h" @@ -30,8 +33,8 @@ namespace media_router { // Keeps track of devices that have responded to discovery requests and notifies -// the client with the current device list. -// DialRegistry lives on the IO thread. +// the client with the current device list. All APIs should be called on the +// sequence bound to |task_runner_|. class DialRegistry : public DialService::Client, public network::NetworkConnectionTracker::NetworkConnectionObserver { @@ -47,7 +50,6 @@ DIAL_UNKNOWN }; - // Invoked on the IO thread. class Client { public: // Called when the list of DIAL devices has changed. Will be called @@ -60,7 +62,8 @@ virtual ~Client() = default; }; - explicit DialRegistry(DialRegistry::Client& client); + DialRegistry(DialRegistry::Client& client, + const scoped_refptr<base::SequencedTaskRunner>& task_runner); DialRegistry(const DialRegistry&) = delete; DialRegistry(DialRegistry&&) = delete; DialRegistry& operator=(const DialRegistry&) = delete; @@ -152,6 +155,12 @@ // Returns the next label to use for a newly-seen device. std::string NextLabel(); + // Unowned reference to the DialRegistry::Client. + Client& client_; + + // Task runner for the DialRegistry. + scoped_refptr<base::SequencedTaskRunner> task_runner_; + // Incremented each time we modify the registry of active devices. int registry_generation_; @@ -174,14 +183,10 @@ // construct the device list sent to API clients. DeviceByLabelMap device_by_label_map_; - // Timer used to manage periodic discovery requests. Timer is created and - // destroyed on IO thread. + // Timer used to manage periodic discovery requests. std::unique_ptr<base::RepeatingTimer> repeating_timer_; - // Unowned reference to the DialRegistry::Client. - Client& client_; - - // Set just after construction, only used on the IO thread. + // Set just after construction. raw_ptr<net::NetLog> net_log_ = nullptr; raw_ptr<network::NetworkConnectionTracker> network_connection_tracker_ = @@ -189,6 +194,8 @@ raw_ptr<base::Clock> clock_; + SEQUENCE_CHECKER(sequence_checker_); + friend class DialMediaSinkServiceImplTest; friend class DialRegistryTest; FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestAddRemoveListeners);
diff --git a/chrome/browser/media/router/discovery/dial/dial_registry_unittest.cc b/chrome/browser/media/router/discovery/dial/dial_registry_unittest.cc index e1acbc6..3953d3e 100644 --- a/chrome/browser/media/router/discovery/dial/dial_registry_unittest.cc +++ b/chrome/browser/media/router/discovery/dial/dial_registry_unittest.cc
@@ -11,6 +11,8 @@ #include "chrome/browser/media/router/discovery/dial/dial_registry.h" #include "chrome/browser/media/router/discovery/dial/dial_service.h" #include "chrome/test/base/testing_profile.h" +#include "content/public/browser/browser_task_traits.h" +#include "content/public/browser/browser_thread.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -55,7 +57,7 @@ class MockDialRegistry : public DialRegistry { public: explicit MockDialRegistry(DialRegistry::Client& client) - : DialRegistry(client) { + : DialRegistry(client, content::GetIOThreadTaskRunner({})) { SetClockForTest(&clock_); }
diff --git a/chrome/browser/media/router/discovery/dial/dial_service_impl.cc b/chrome/browser/media/router/discovery/dial/dial_service_impl.cc index 7ebee76..e5646c7 100644 --- a/chrome/browser/media/router/discovery/dial/dial_service_impl.cc +++ b/chrome/browser/media/router/discovery/dial/dial_service_impl.cc
@@ -62,11 +62,12 @@ #if !BUILDFLAG(IS_CHROMEOS_ASH) void PostSendNetworkList( base::WeakPtr<DialServiceImpl> impl, + scoped_refptr<base::SequencedTaskRunner> task_runner, const absl::optional<net::NetworkInterfaceList>& networks) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&DialServiceImpl::SendNetworkList, - std::move(impl), networks)); + task_runner->PostTask(FROM_HERE, + base::BindOnce(&DialServiceImpl::SendNetworkList, + std::move(impl), networks)); } #endif // !BUILDFLAG(IS_CHROMEOS_ASH) @@ -166,20 +167,23 @@ #else // This function and PostSendNetworkList together handle DialServiceImpl's use // of the network service, while keeping all of DialServiceImpl running on the -// IO thread. DialServiceImpl has a legacy threading model, where it was -// designed to be called from the UI thread and run on the IO thread. Although -// a WeakPtr is desired for safety when posting tasks, they are not -// thread/sequence-safe. DialServiceImpl's simple use of the network service, -// however, doesn't actually require that any of its state be accessed on the UI -// thread. Therefore, the UI thread functions can be free functions which just -// pass-through an IO thread WeakPtr which will be used when passing the network -// service result back to the IO thread. This model will change when the +// sequence associated with task_runner_ (currently the IO thread). +// DialServiceImpl has a legacy threading model, where it was designed to be +// called from the UI thread and run on a different thread. Although a WeakPtr +// is desired for safety when posting tasks, they are not thread/sequence-safe. +// DialServiceImpl's simple use of the network service, however, doesn't +// actually require that any of its state be accessed on the UI thread. +// Therefore, the UI thread functions can be free functions which just +// pass-through an thread WeakPtr which will be used when passing the network +// service result back to the calling thread. This model will change when the // network service is fully launched and this code is updated. -void GetNetworkListOnUIThread(base::WeakPtr<DialServiceImpl> impl) { +void GetNetworkListOnUIThread( + base::WeakPtr<DialServiceImpl> impl, + scoped_refptr<base::SequencedTaskRunner> task_runner) { DCHECK_CURRENTLY_ON(BrowserThread::UI); content::GetNetworkService()->GetNetworkList( net::INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES, - base::BindOnce(&PostSendNetworkList, std::move(impl))); + base::BindOnce(&PostSendNetworkList, std::move(impl), task_runner)); } #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -187,18 +191,17 @@ DialServiceImpl::DialSocket::DialSocket(DialServiceImpl* dial_service) : is_writing_(false), is_reading_(false), dial_service_(dial_service) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(dial_service_); } DialServiceImpl::DialSocket::~DialSocket() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } bool DialServiceImpl::DialSocket::CreateAndBindSocket( const IPAddress& bind_ip_address, net::NetLog* net_log) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!socket_); DCHECK(bind_ip_address.IsIPv4()); @@ -243,13 +246,13 @@ } bool DialServiceImpl::DialSocket::IsClosed() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return !socket_; } bool DialServiceImpl::DialSocket::CheckResult(const char* operation, int result) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (result < net::OK && result != net::ERR_IO_PENDING) { Close(); std::string error_str(net::ErrorToString(result)); @@ -260,7 +263,7 @@ } void DialServiceImpl::DialSocket::Close() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); is_reading_ = false; is_writing_ = false; socket_.reset(); @@ -268,7 +271,7 @@ void DialServiceImpl::DialSocket::OnSocketWrite(int send_buffer_size, int result) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); is_writing_ = false; if (!CheckResult("OnSocketWrite", result)) return; @@ -276,7 +279,7 @@ } bool DialServiceImpl::DialSocket::ReadSocket() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!socket_) return false; @@ -303,7 +306,7 @@ } void DialServiceImpl::DialSocket::OnSocketRead(int result) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); is_reading_ = false; if (!CheckResult("OnSocketRead", result)) return; @@ -315,7 +318,7 @@ } void DialServiceImpl::DialSocket::HandleResponse(int bytes_read) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_GT(bytes_read, 0); if (bytes_read > kDialRecvBufferSize) { return; @@ -392,9 +395,12 @@ return true; } -DialServiceImpl::DialServiceImpl(DialService::Client& client, - net::NetLog* net_log) +DialServiceImpl::DialServiceImpl( + DialService::Client& client, + const scoped_refptr<base::SequencedTaskRunner>& task_runner, + net::NetLog* net_log) : client_(client), + task_runner_(task_runner), net_log_(net_log), discovery_active_(false), num_requests_sent_(0), @@ -403,7 +409,6 @@ kDialRequestIntervalMillis) + base::Seconds(kDialResponseTimeoutSecs)), request_interval_(base::Milliseconds(kDialRequestIntervalMillis)) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); IPAddress address; bool success = address.AssignFromIPLiteral(kDialRequestAddress); DCHECK(success); @@ -412,11 +417,11 @@ } DialServiceImpl::~DialServiceImpl() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } bool DialServiceImpl::Discover() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (discovery_active_) { return false; } @@ -427,7 +432,7 @@ } void DialServiceImpl::StartDiscovery() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(discovery_active_); if (HasOpenSockets()) { return; @@ -441,15 +446,15 @@ base::BindOnce(&DialServiceImpl::DiscoverOnAddresses, weak_ptr_factory_.GetWeakPtr())); #else - ui_task_runner->PostTask(FROM_HERE, - base::BindOnce(&GetNetworkListOnUIThread, - weak_ptr_factory_.GetWeakPtr())); + ui_task_runner->PostTask( + FROM_HERE, base::BindOnce(&GetNetworkListOnUIThread, + weak_ptr_factory_.GetWeakPtr(), task_runner_)); #endif } void DialServiceImpl::SendNetworkList( const absl::optional<NetworkInterfaceList>& networks) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); using InterfaceIndexAddressFamily = std::pair<uint32_t, net::AddressFamily>; std::set<InterfaceIndexAddressFamily> interface_index_addr_family_seen; @@ -513,7 +518,7 @@ } void DialServiceImpl::SendOneRequest() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (num_requests_sent_ == max_requests_) { request_timer_.Stop(); return; @@ -526,7 +531,7 @@ } void DialServiceImpl::NotifyOnDiscoveryRequest() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // If discovery is inactive, no reason to notify client. if (!discovery_active_) { return; @@ -544,7 +549,7 @@ void DialServiceImpl::NotifyOnDeviceDiscovered( const DialDeviceData& device_data) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!discovery_active_) { return; } @@ -552,13 +557,13 @@ } void DialServiceImpl::NotifyOnError() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); client_.OnError(HasOpenSockets() ? DIAL_SERVICE_SOCKET_ERROR : DIAL_SERVICE_NO_INTERFACES); } void DialServiceImpl::FinishDiscovery() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(discovery_active_); // Close all open sockets. dial_sockets_.clear();
diff --git a/chrome/browser/media/router/discovery/dial/dial_service_impl.h b/chrome/browser/media/router/discovery/dial/dial_service_impl.h index 4c27ad5..6de9720 100644 --- a/chrome/browser/media/router/discovery/dial/dial_service_impl.h +++ b/chrome/browser/media/router/discovery/dial/dial_service_impl.h
@@ -11,6 +11,9 @@ #include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h" +#include "base/memory/scoped_refptr.h" +#include "base/sequence_checker.h" +#include "base/task/sequenced_task_runner.h" #include "base/timer/timer.h" #include "chrome/browser/media/router/discovery/dial/dial_service.h" #include "net/base/ip_address.h" @@ -27,7 +30,9 @@ // Implements DialService using net::UdpSocket. class DialServiceImpl : public DialService { public: - DialServiceImpl(DialService::Client& client, net::NetLog* net_log); + DialServiceImpl(DialService::Client& client, + const scoped_refptr<base::SequencedTaskRunner>& task_runner, + net::NetLog* net_log); DialServiceImpl(const DialServiceImpl&) = delete; DialServiceImpl(DialServiceImpl&&) = delete; @@ -42,10 +47,10 @@ private: friend void PostSendNetworkList( base::WeakPtr<DialServiceImpl> impl, + scoped_refptr<base::SequencedTaskRunner> task_runner, const absl::optional<net::NetworkInterfaceList>& networks); // Represents a socket binding to a single network interface. - // DialSocket lives on the IO thread. class DialSocket { public: explicit DialSocket(DialServiceImpl* dial_service); @@ -120,6 +125,8 @@ // Pointer to the DialServiceImpl that owns this socket. const raw_ptr<DialServiceImpl> dial_service_; + + SEQUENCE_CHECKER(sequence_checker_); }; // Starts the control flow for one discovery cycle. @@ -164,6 +171,10 @@ // Unowned reference to the DialService::Client. DialService::Client& client_; + // Task runner for the DialServiceImpl. Currently must be bound to the IO + // thread because of socket use, but this may change in the future. + scoped_refptr<base::SequencedTaskRunner> task_runner_; + // DialSockets for each network interface whose ip address was // successfully bound. std::vector<std::unique_ptr<DialSocket>> dial_sockets_; @@ -200,7 +211,8 @@ // requests. base::TimeDelta request_interval_; - // WeakPtrFactory for WeakPtrs that are invalidated on IO thread. + SEQUENCE_CHECKER(sequence_checker_); + base::WeakPtrFactory<DialServiceImpl> weak_ptr_factory_{this}; friend class DialServiceImplTest;
diff --git a/chrome/browser/media/router/discovery/dial/dial_service_impl_unittest.cc b/chrome/browser/media/router/discovery/dial/dial_service_impl_unittest.cc index dbbb5b1..a72e9f08 100644 --- a/chrome/browser/media/router/discovery/dial/dial_service_impl_unittest.cc +++ b/chrome/browser/media/router/discovery/dial/dial_service_impl_unittest.cc
@@ -12,6 +12,8 @@ #include "base/memory/ref_counted.h" #include "base/run_loop.h" #include "chrome/browser/media/router/discovery/dial/dial_device_data.h" +#include "content/public/browser/browser_task_traits.h" +#include "content/public/browser/browser_thread.h" #include "content/public/test/browser_task_environment.h" #include "net/base/ip_address.h" #include "net/base/ip_endpoint.h" @@ -53,7 +55,9 @@ DialServiceImplTest() : task_environment_(content::BrowserTaskEnvironment::IO_MAINLOOP), mock_ip_(net::IPAddress::IPv4AllZeros()), - dial_service_(mock_client_, net::NetLog::Get()) { + dial_service_(mock_client_, + content::GetIOThreadTaskRunner({}), + net::NetLog::Get()) { dial_socket_ = dial_service_.CreateDialSocket(); }
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc index be364ac..58f70c4 100644 --- a/chrome/browser/net/system_network_context_manager.cc +++ b/chrome/browser/net/system_network_context_manager.cc
@@ -109,11 +109,6 @@ network::mojom::HttpAuthStaticParamsPtr auth_static_params = network::mojom::HttpAuthStaticParams::New(); - // TODO(https://crbug/549273): Allow this to change after startup. - auth_static_params->supported_schemes = - base::SplitString(local_state->GetString(prefs::kAuthSchemes), ",", - base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) auth_static_params->gssapi_library_name = local_state->GetString(prefs::kGSSAPILibraryName); @@ -128,6 +123,9 @@ network::mojom::HttpAuthDynamicParamsPtr auth_dynamic_params = network::mojom::HttpAuthDynamicParams::New(); + auth_dynamic_params->allowed_schemes = + base::SplitString(local_state->GetString(prefs::kAuthSchemes), ",", + base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); auth_dynamic_params->server_allowlist = local_state->GetString(prefs::kAuthServerAllowlist); auth_dynamic_params->delegate_allowlist = @@ -360,6 +358,7 @@ PrefChangeRegistrar::NamedChangeCallback auth_pref_callback = base::BindRepeating(&OnAuthPrefsChanged, base::Unretained(local_state_)); + pref_change_registrar_.Add(prefs::kAuthSchemes, auth_pref_callback); pref_change_registrar_.Add(prefs::kAuthServerAllowlist, auth_pref_callback); pref_change_registrar_.Add(prefs::kAuthNegotiateDelegateAllowlist, auth_pref_callback);
diff --git a/chrome/browser/net/system_network_context_manager_browsertest.cc b/chrome/browser/net/system_network_context_manager_browsertest.cc index caf9b74..e41e2b4 100644 --- a/chrome/browser/net/system_network_context_manager_browsertest.cc +++ b/chrome/browser/net/system_network_context_manager_browsertest.cc
@@ -87,20 +87,11 @@ // Test defaults. network::mojom::HttpAuthStaticParamsPtr static_params = SystemNetworkContextManager::GetHttpAuthStaticParamsForTesting(); - EXPECT_THAT(static_params->supported_schemes, - testing::ElementsAre("basic", "digest", "ntlm", "negotiate")); EXPECT_EQ("", static_params->gssapi_library_name); - +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) // Test that prefs are reflected in params. PrefService* local_state = g_browser_process->local_state(); - - local_state->SetString(prefs::kAuthSchemes, "basic"); - static_params = - SystemNetworkContextManager::GetHttpAuthStaticParamsForTesting(); - EXPECT_THAT(static_params->supported_schemes, testing::ElementsAre("basic")); - -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) const char dev_null[] = "/dev/null"; local_state->SetString(prefs::kGSSAPILibraryName, dev_null); static_params = @@ -113,6 +104,8 @@ // Test defaults. network::mojom::HttpAuthDynamicParamsPtr dynamic_params = SystemNetworkContextManager::GetHttpAuthDynamicParamsForTesting(); + EXPECT_THAT(*dynamic_params->allowed_schemes, + testing::ElementsAre("basic", "digest", "ntlm", "negotiate")); EXPECT_FALSE(dynamic_params->negotiate_disable_cname_lookup); EXPECT_FALSE(dynamic_params->enable_negotiate_port); EXPECT_TRUE(dynamic_params->basic_over_http_enabled); @@ -125,6 +118,8 @@ local_state->SetBoolean(prefs::kDisableAuthNegotiateCnameLookup, true); dynamic_params = SystemNetworkContextManager::GetHttpAuthDynamicParamsForTesting(); + EXPECT_THAT(*dynamic_params->allowed_schemes, + testing::ElementsAre("basic", "digest", "ntlm", "negotiate")); EXPECT_TRUE(dynamic_params->negotiate_disable_cname_lookup); EXPECT_FALSE(dynamic_params->enable_negotiate_port); EXPECT_TRUE(dynamic_params->basic_over_http_enabled); @@ -135,6 +130,8 @@ local_state->SetBoolean(prefs::kEnableAuthNegotiatePort, true); dynamic_params = SystemNetworkContextManager::GetHttpAuthDynamicParamsForTesting(); + EXPECT_THAT(*dynamic_params->allowed_schemes, + testing::ElementsAre("basic", "digest", "ntlm", "negotiate")); EXPECT_TRUE(dynamic_params->negotiate_disable_cname_lookup); EXPECT_TRUE(dynamic_params->enable_negotiate_port); EXPECT_TRUE(dynamic_params->basic_over_http_enabled); @@ -145,6 +142,8 @@ local_state->SetBoolean(prefs::kBasicAuthOverHttpEnabled, false); dynamic_params = SystemNetworkContextManager::GetHttpAuthDynamicParamsForTesting(); + EXPECT_THAT(*dynamic_params->allowed_schemes, + testing::ElementsAre("basic", "digest", "ntlm", "negotiate")); EXPECT_TRUE(dynamic_params->negotiate_disable_cname_lookup); EXPECT_TRUE(dynamic_params->enable_negotiate_port); EXPECT_FALSE(dynamic_params->basic_over_http_enabled); @@ -156,6 +155,8 @@ local_state->SetString(prefs::kAuthServerAllowlist, kServerAllowList); dynamic_params = SystemNetworkContextManager::GetHttpAuthDynamicParamsForTesting(); + EXPECT_THAT(*dynamic_params->allowed_schemes, + testing::ElementsAre("basic", "digest", "ntlm", "negotiate")); EXPECT_TRUE(dynamic_params->negotiate_disable_cname_lookup); EXPECT_TRUE(dynamic_params->enable_negotiate_port); EXPECT_FALSE(dynamic_params->basic_over_http_enabled); @@ -167,6 +168,8 @@ kDelegateAllowList); dynamic_params = SystemNetworkContextManager::GetHttpAuthDynamicParamsForTesting(); + EXPECT_THAT(*dynamic_params->allowed_schemes, + testing::ElementsAre("basic", "digest", "ntlm", "negotiate")); EXPECT_TRUE(dynamic_params->negotiate_disable_cname_lookup); EXPECT_TRUE(dynamic_params->enable_negotiate_port); EXPECT_EQ(kServerAllowList, dynamic_params->server_allowlist); @@ -174,10 +177,23 @@ EXPECT_EQ(kDelegateAllowList, dynamic_params->delegate_allowlist); EXPECT_FALSE(dynamic_params->delegate_by_kdc_policy); + local_state->SetString(prefs::kAuthSchemes, "basic"); + dynamic_params = + SystemNetworkContextManager::GetHttpAuthDynamicParamsForTesting(); + EXPECT_THAT(*dynamic_params->allowed_schemes, testing::ElementsAre("basic")); + EXPECT_TRUE(dynamic_params->negotiate_disable_cname_lookup); + EXPECT_TRUE(dynamic_params->enable_negotiate_port); + EXPECT_FALSE(dynamic_params->basic_over_http_enabled); + EXPECT_EQ(kServerAllowList, dynamic_params->server_allowlist); + EXPECT_EQ(kDelegateAllowList, dynamic_params->delegate_allowlist); + EXPECT_FALSE(dynamic_params->delegate_by_kdc_policy); + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) + local_state->SetString(prefs::kAuthSchemes, "basic"); local_state->SetBoolean(prefs::kAuthNegotiateDelegateByKdcPolicy, true); dynamic_params = SystemNetworkContextManager::GetHttpAuthDynamicParamsForTesting(); + EXPECT_THAT(*dynamic_params->allowed_schemes, testing::ElementsAre("basic")); EXPECT_TRUE(dynamic_params->negotiate_disable_cname_lookup); EXPECT_TRUE(dynamic_params->enable_negotiate_port); EXPECT_FALSE(dynamic_params->basic_over_http_enabled);
diff --git a/chrome/browser/net/trust_token_usecounter_browsertest.cc b/chrome/browser/net/trust_token_usecounter_browsertest.cc index b079613..f92f524 100644 --- a/chrome/browser/net/trust_token_usecounter_browsertest.cc +++ b/chrome/browser/net/trust_token_usecounter_browsertest.cc
@@ -94,7 +94,7 @@ ->GetActiveWebContents() ->GetController() .GetBackForwardCache() - .DisableForTesting(content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + .DisableForTesting(content::BackForwardCache::TEST_REQUIRES_NO_CACHING); base::HistogramTester histograms; @@ -141,7 +141,7 @@ // that the histogram will be recorded when the previous page is unloaded. // TODO(https://crbug.com/1229122): Investigate if this needs further fix. web_contents->GetController().GetBackForwardCache().DisableForTesting( - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); // It's important to set the trust token arguments before updating src, as // the latter triggers a load. It's also important to JsReplace the trustToken @@ -176,7 +176,7 @@ // that the histogram will be recorded when the previous page is unloaded. // TODO(https://crbug.com/1229122): Investigate if this needs further fix. web_contents->GetController().GetBackForwardCache().DisableForTesting( - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); // It's important to set the trust token arguments before updating src, as // the latter triggers a load. It's also important to JsReplace the trustToken
diff --git a/chrome/browser/page_load_metrics/integration_tests/first_input_delay_browsertest.cc b/chrome/browser/page_load_metrics/integration_tests/first_input_delay_browsertest.cc index 8b3ef98..e50d10f 100644 --- a/chrome/browser/page_load_metrics/integration_tests/first_input_delay_browsertest.cc +++ b/chrome/browser/page_load_metrics/integration_tests/first_input_delay_browsertest.cc
@@ -39,7 +39,7 @@ // that the histogram will be recorded when the previous page is unloaded. // TODO(https://crbug.com/1229122): Investigate if this needs further fix. web_contents()->GetController().GetBackForwardCache().DisableForTesting( - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); StartTracing({"loading"});
diff --git a/chrome/browser/page_load_metrics/integration_tests/user_timing_browsertest.cc b/chrome/browser/page_load_metrics/integration_tests/user_timing_browsertest.cc index 27054273..8af0bb64 100644 --- a/chrome/browser/page_load_metrics/integration_tests/user_timing_browsertest.cc +++ b/chrome/browser/page_load_metrics/integration_tests/user_timing_browsertest.cc
@@ -28,7 +28,7 @@ // Ensure that the previous page won't be stored in the back/forward cache, so // that the histogram will be recorded when the previous page is unloaded. web_contents()->GetController().GetBackForwardCache().DisableForTesting( - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); // Check web perf API. const base::Value eval_result =
diff --git a/chrome/browser/page_load_metrics/observers/ad_metrics/ads_page_load_metrics_observer_browsertest.cc b/chrome/browser/page_load_metrics/observers/ad_metrics/ads_page_load_metrics_observer_browsertest.cc index 8dc0cd4..915396d 100644 --- a/chrome/browser/page_load_metrics/observers/ad_metrics/ads_page_load_metrics_observer_browsertest.cc +++ b/chrome/browser/page_load_metrics/observers/ad_metrics/ads_page_load_metrics_observer_browsertest.cc
@@ -881,7 +881,7 @@ ->GetActiveWebContents() ->GetController() .GetBackForwardCache() - .DisableForTesting(content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + .DisableForTesting(content::BackForwardCache::TEST_REQUIRES_NO_CACHING); content::DOMMessageQueue msg_queue;
diff --git a/chrome/browser/page_load_metrics/observers/core/amp_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/core/amp_page_load_metrics_observer_unittest.cc index 84c75f5..1fa2996 100644 --- a/chrome/browser/page_load_metrics/observers/core/amp_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/core/amp_page_load_metrics_observer_unittest.cc
@@ -406,7 +406,7 @@ tester()->SimulateMetadataUpdate(metadata, subframe); page_load_metrics::mojom::FrameRenderDataUpdate render_data(1.0, 0.5, 0, 0, 0, - 0, 0, 0, {}); + 0, {}); tester()->SimulateRenderDataUpdate(render_data, subframe); // Navigate the main frame to trigger metrics recording. @@ -454,7 +454,7 @@ base::TimeTicks current_time = base::TimeTicks::Now(); page_load_metrics::mojom::FrameRenderDataUpdate render_data(0.65, 0.65, 0, 0, - 0, 0, 0, 0, {}); + 0, 0, {}); render_data.new_layout_shifts.emplace_back( page_load_metrics::mojom::LayoutShift::New(
diff --git a/chrome/browser/page_load_metrics/observers/core/ukm_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/core/ukm_page_load_metrics_observer_unittest.cc index 762036f..5dc6083 100644 --- a/chrome/browser/page_load_metrics/observers/core/ukm_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/core/ukm_page_load_metrics_observer_unittest.cc
@@ -1713,7 +1713,7 @@ NavigateAndCommit(GURL(kTestUrl1)); base::TimeTicks current_time = base::TimeTicks::Now(); page_load_metrics::mojom::FrameRenderDataUpdate render_data(1.0, 1.0, 0, 0, 0, - 0, 0, 0, {}); + 0, {}); render_data.new_layout_shifts.emplace_back( page_load_metrics::mojom::LayoutShift::New( current_time - base::Milliseconds(4000), 0.5)); @@ -1727,7 +1727,7 @@ web_contents()->WasHidden(); page_load_metrics::mojom::FrameRenderDataUpdate render_data_2(1.5, 0.0, 0, 0, - 0, 0, 0, 0, {}); + 0, 0, {}); render_data_2.new_layout_shifts.emplace_back( page_load_metrics::mojom::LayoutShift::New( current_time - base::Milliseconds(2500), 1.5)); @@ -1774,7 +1774,7 @@ NavigateAndCommit(GURL(kTestUrl1)); base::TimeTicks current_time = base::TimeTicks::Now(); page_load_metrics::mojom::FrameRenderDataUpdate render_data(1.0, 1.0, 0, 0, 0, - 0, 0, 0, {}); + 0, {}); render_data.new_layout_shifts.emplace_back( page_load_metrics::mojom::LayoutShift::New( current_time - base::Milliseconds(4000), 0.5)); @@ -1809,7 +1809,7 @@ } page_load_metrics::mojom::FrameRenderDataUpdate render_data_2(1.5, 0.0, 0, 0, - 0, 0, 0, 0, {}); + 0, 0, {}); render_data_2.new_layout_shifts.emplace_back( page_load_metrics::mojom::LayoutShift::New( current_time - base::Milliseconds(2500), 1.5)); @@ -1871,7 +1871,7 @@ // Bring the tab to the foreground and simulate a layout shift. web_contents()->WasShown(); page_load_metrics::mojom::FrameRenderDataUpdate render_data(1.0, 1.0, 0, 0, 0, - 0, 0, 0, {}); + 0, {}); render_data.new_layout_shifts.emplace_back( page_load_metrics::mojom::LayoutShift::New( current_time - base::Milliseconds(4000), 0.5)); @@ -1945,7 +1945,7 @@ // Simulate layout instability in the main frame. page_load_metrics::mojom::FrameRenderDataUpdate render_data(1.0, 1.0, 0, 0, 0, - 0, 0, 0, {}); + 0, {}); tester()->SimulateRenderDataUpdate(render_data); RenderFrameHost* subframe = @@ -2482,7 +2482,7 @@ NavigateAndCommit(GURL(kTestUrl1)); page_load_metrics::mojom::FrameRenderDataUpdate render_data(1.0, 1.0, 0, 0, 0, - 0, 0, 0, {}); + 0, {}); tester()->SimulateRenderDataUpdate(render_data); // Simulate closing the tab. @@ -2516,8 +2516,8 @@ void CLSUkmPageLoadMetricsObserverTest::SimulateShiftDelta( float delta, content::RenderFrameHost* frame) { - page_load_metrics::mojom::FrameRenderDataUpdate render_data( - delta, delta, 0, 0, 0, 0, 0, 0, {}); + page_load_metrics::mojom::FrameRenderDataUpdate render_data(delta, delta, 0, + 0, 0, 0, {}); tester()->SimulateRenderDataUpdate(render_data, frame); }
diff --git a/chrome/browser/page_load_metrics/observers/data_saver_site_breakdown_metrics_observer_browsertest.cc b/chrome/browser/page_load_metrics/observers/data_saver_site_breakdown_metrics_observer_browsertest.cc index ab465bd..4dd6976 100644 --- a/chrome/browser/page_load_metrics/observers/data_saver_site_breakdown_metrics_observer_browsertest.cc +++ b/chrome/browser/page_load_metrics/observers/data_saver_site_breakdown_metrics_observer_browsertest.cc
@@ -393,7 +393,7 @@ // TODO(https://crbug.com/1229122): Investigate if this needs further fix. content::DisableBackForwardCacheForTesting( browser()->tab_strip_model()->GetActiveWebContents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); const struct { std::string url; size_t expected_min_page_size;
diff --git a/chrome/browser/page_load_metrics/observers/data_use_metrics_observer_browsertest.cc b/chrome/browser/page_load_metrics/observers/data_use_metrics_observer_browsertest.cc index 4a91300..464fef6c 100644 --- a/chrome/browser/page_load_metrics/observers/data_use_metrics_observer_browsertest.cc +++ b/chrome/browser/page_load_metrics/observers/data_use_metrics_observer_browsertest.cc
@@ -48,7 +48,7 @@ // TODO(https://crbug.com/1229122): Investigate if this needs further fix. content::DisableBackForwardCacheForTesting( browser()->tab_strip_model()->GetActiveWebContents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); const struct { std::string url; size_t expected_min_page_size; @@ -119,7 +119,7 @@ // it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( browser()->tab_strip_model()->GetActiveWebContents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); std::unique_ptr<net::EmbeddedTestServer> plaintext_server = std::make_unique<net::EmbeddedTestServer>(
diff --git a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc index 25b86a09..343b8f5 100644 --- a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc
@@ -186,7 +186,7 @@ tester()->SimulateTimingUpdate(timing); page_load_metrics::mojom::FrameRenderDataUpdate render_data(1.0, 1.0, 0, 0, 0, - 0, 0, 0, {}); + 0, {}); tester()->SimulateRenderDataUpdate(render_data); render_data.layout_shift_delta = 1.5; render_data.layout_shift_delta_before_input_or_scroll = 0.0; @@ -634,7 +634,7 @@ NavigateAndCommit(GURL("https://www.google.com/search#q=test")); NavigateAndCommit(GURL(kExampleUrl)); page_load_metrics::mojom::FrameRenderDataUpdate render_data(1.0, 1.0, 0, 0, 0, - 0, 0, 0, {}); + 0, {}); tester()->SimulateRenderDataUpdate(render_data); web_contents()->WasHidden();
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc b/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc index 1baa055..b4eac97d 100644 --- a/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc +++ b/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
@@ -1632,7 +1632,7 @@ ->GetActiveWebContents() ->GetController() .GetBackForwardCache() - .DisableForTesting(content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + .DisableForTesting(content::BackForwardCache::TEST_REQUIRES_NO_CACHING); auto waiter = CreatePageLoadMetricsTestWaiter(); waiter->AddPageExpectation(TimingField::kLoadEvent); @@ -1682,7 +1682,7 @@ ->GetActiveWebContents() ->GetController() .GetBackForwardCache() - .DisableForTesting(content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + .DisableForTesting(content::BackForwardCache::TEST_REQUIRES_NO_CACHING); auto waiter = CreatePageLoadMetricsTestWaiter(); waiter->AddPageExpectation(TimingField::kLoadEvent);
diff --git a/chrome/browser/permissions/prediction_based_permission_ui_selector.cc b/chrome/browser/permissions/prediction_based_permission_ui_selector.cc index 2997a14..287b34b 100644 --- a/chrome/browser/permissions/prediction_based_permission_ui_selector.cc +++ b/chrome/browser/permissions/prediction_based_permission_ui_selector.cc
@@ -37,6 +37,7 @@ using QuietUiReason = PredictionBasedPermissionUiSelector::QuietUiReason; using Decision = PredictionBasedPermissionUiSelector::Decision; +using PredictionSource = PredictionBasedPermissionUiSelector::PredictionSource; constexpr auto VeryUnlikely = permissions:: PermissionPrediction_Likelihood_DiscretizedLikelihood_VERY_UNLIKELY; @@ -93,7 +94,7 @@ #if BUILDFLAG(BUILD_WITH_TFLITE_LIB) if (base::FeatureList::IsEnabled( - permissions::features::kPermissionOnDevicePredictions)) { + permissions::features::kPermissionOnDeviceNotificationPredictions)) { PredictionModelHandlerFactory::GetForBrowserContext(profile); } #endif // BUILDFLAG(BUILD_WITH_TFLITE_LIB) @@ -108,8 +109,9 @@ VLOG(1) << "[CPSS] Selector activated"; callback_ = std::move(callback); last_request_grant_likelihood_ = absl::nullopt; - - if (!IsAllowedToUseAssistedPrompts(request->request_type())) { + const PredictionSource prediction_source = + GetPredictionTypeToUse(request->request_type()); + if (prediction_source == PredictionSource::USE_NONE) { VLOG(1) << "[CPSS] Configuration either does not allows CPSS requests or " "the request was held back"; std::move(callback_).Run(Decision::UseNormalUiAndShowNoWarning()); @@ -144,12 +146,14 @@ DCHECK(!request_); #if BUILDFLAG(BUILD_WITH_TFLITE_LIB) - if (base::FeatureList::IsEnabled( - permissions::features::kPermissionOnDevicePredictions)) { + if (prediction_source == PredictionSource::USE_ANY || + prediction_source == PredictionSource::USE_ONDEVICE) { permissions::PredictionModelHandler* prediction_model_handler = PredictionModelHandlerFactory::GetForBrowserContext(profile_); if (prediction_model_handler->ModelAvailable()) { VLOG(1) << "[CPSS] Using locally available model"; + permissions::PermissionUmaUtil::RecordPermissionPredictionSource( + permissions::PermissionPredictionSource::ON_DEVICE); auto proto_request = GetPredictionRequestProto(features); prediction_model_handler->ExecuteModelWithInput( base::BindOnce( @@ -158,19 +162,31 @@ /*lookup_succesful=*/true, /*response_from_cache=*/false), *proto_request); return; + } else if (prediction_source == PredictionSource::USE_ONDEVICE) { + VLOG(1) << "[CPSS] Model is not available and cannot fall back to server " + "side execution"; + std::move(callback_).Run(Decision::UseNormalUiAndShowNoWarning()); + return; } } #endif // BUILDFLAG(BUILD_WITH_TFLITE_LIB) - permissions::PredictionService* service = - PredictionServiceFactory::GetForProfile(profile_); + if (prediction_source == PredictionSource::USE_ANY || + prediction_source == PredictionSource::USE_SERVER_SIDE) { + permissions::PredictionService* service = + PredictionServiceFactory::GetForProfile(profile_); - VLOG(1) << "[CPSS] Starting prediction service request"; - request_ = std::make_unique<PredictionServiceRequest>( - service, features, - base::BindOnce( - &PredictionBasedPermissionUiSelector::LookupResponseReceived, - base::Unretained(this), /*is_on_device=*/false)); + VLOG(1) << "[CPSS] Starting prediction service request"; + permissions::PermissionUmaUtil::RecordPermissionPredictionSource( + permissions::PermissionPredictionSource::SERVER_SIDE); + request_ = std::make_unique<PredictionServiceRequest>( + service, features, + base::BindOnce( + &PredictionBasedPermissionUiSelector::LookupResponseReceived, + base::Unretained(this), /*is_on_device=*/false)); + return; + } + NOTREACHED(); } void PredictionBasedPermissionUiSelector::Cancel() { @@ -244,54 +260,58 @@ std::move(callback_).Run(Decision::UseNormalUiAndShowNoWarning()); } -bool PredictionBasedPermissionUiSelector::IsAllowedToUseAssistedPrompts( +PredictionSource PredictionBasedPermissionUiSelector::GetPredictionTypeToUse( permissions::RequestType request_type) { // We need to also check `kQuietNotificationPrompts` here since there is no // generic safeguard anywhere else in the stack. if (!base::FeatureList::IsEnabled(features::kQuietNotificationPrompts) || !safe_browsing::IsSafeBrowsingEnabled(*(profile_->GetPrefs()))) { - return false; + return PredictionSource::USE_NONE; } - double hold_back_chance = 0.0; - bool is_permissions_predictions_enabled = false; - switch (request_type) { - case permissions::RequestType::kNotifications: - is_permissions_predictions_enabled = - base::FeatureList::IsEnabled(features::kPermissionPredictions); - hold_back_chance = features::kPermissionPredictionsHoldbackChance.Get(); - break; - case permissions::RequestType::kGeolocation: - // Only quiet chip ui is supported for Geolocation - is_permissions_predictions_enabled = - base::FeatureList::IsEnabled( - features::kPermissionGeolocationPredictions) && - base::FeatureList::IsEnabled( - permissions::features::kPermissionQuietChip); - hold_back_chance = - features::kPermissionGeolocationPredictionsHoldbackChance.Get(); - break; - default: - NOTREACHED(); - } - if (!is_permissions_predictions_enabled) - return false; - const bool should_hold_back = - hold_back_chance && base::RandDouble() < hold_back_chance; - // Only recording the hold back UMA histogram if the request was actually - // eligible for an assisted prompt - switch (request_type) { - case permissions::RequestType::kNotifications: + bool is_server_side_prediction_enabled = false; + bool is_ondevice_prediction_enabled = false; + + bool is_tflite_available = false; +#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) + is_tflite_available = true; +#endif // BUILDFLAG(BUILD_WITH_TFLITE_LIB) + + if (request_type == permissions::RequestType::kNotifications) { + if (base::FeatureList::IsEnabled(features::kPermissionPredictions)) { + bool should_hold_back = + base::RandDouble() < + features::kPermissionPredictionsHoldbackChance.Get(); + is_server_side_prediction_enabled = !should_hold_back; base::UmaHistogramBoolean("Permissions.PredictionService.Request", !should_hold_back); - break; - case permissions::RequestType::kGeolocation: + } + is_ondevice_prediction_enabled = + is_tflite_available && + base::FeatureList::IsEnabled( + permissions::features::kPermissionOnDeviceNotificationPredictions); + } + + if (request_type == permissions::RequestType::kGeolocation) { + if (base::FeatureList::IsEnabled( + features::kPermissionGeolocationPredictions)) { + bool should_hold_back = + base::RandDouble() < + features::kPermissionGeolocationPredictionsHoldbackChance.Get(); + is_server_side_prediction_enabled = !should_hold_back; base::UmaHistogramBoolean( "Permissions.PredictionService.GeolocationRequest", !should_hold_back); - break; - default: - NOTREACHED(); + } } - return !should_hold_back; + + if (is_server_side_prediction_enabled && is_ondevice_prediction_enabled) { + return PredictionSource::USE_ANY; + } else if (is_server_side_prediction_enabled) { + return PredictionSource::USE_SERVER_SIDE; + } else if (is_ondevice_prediction_enabled) { + return PredictionSource::USE_ONDEVICE; + } else { + return PredictionSource::USE_NONE; + } }
diff --git a/chrome/browser/permissions/prediction_based_permission_ui_selector.h b/chrome/browser/permissions/prediction_based_permission_ui_selector.h index ff9ba49c..09e4aed 100644 --- a/chrome/browser/permissions/prediction_based_permission_ui_selector.h +++ b/chrome/browser/permissions/prediction_based_permission_ui_selector.h
@@ -26,6 +26,12 @@ class PredictionBasedPermissionUiSelector : public permissions::PermissionUiSelector { public: + enum class PredictionSource { + USE_SERVER_SIDE, + USE_ONDEVICE, + USE_ANY, + USE_NONE, + }; using PredictionGrantLikelihood = permissions::PermissionUmaUtil::PredictionGrantLikelihood; // Constructs an instance in the context of the given |profile|. @@ -57,7 +63,8 @@ bool lookup_succesful, bool response_from_cache, const absl::optional<permissions::GeneratePredictionsResponse>& response); - bool IsAllowedToUseAssistedPrompts(permissions::RequestType request_type); + PredictionSource GetPredictionTypeToUse( + permissions::RequestType request_type); void set_likelihood_override(PredictionGrantLikelihood mock_likelihood) { likelihood_override_for_testing_ = mock_likelihood;
diff --git a/chrome/browser/portal/portal_browsertest.cc b/chrome/browser/portal/portal_browsertest.cc index 77d7a30..0cbdb2a 100644 --- a/chrome/browser/portal/portal_browsertest.cc +++ b/chrome/browser/portal/portal_browsertest.cc
@@ -18,7 +18,6 @@ #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/history/history_test_utils.h" #include "chrome/browser/interstitials/security_interstitial_page_test_utils.h" -#include "chrome/browser/pdf/pdf_extension_test_util.h" #include "chrome/browser/safe_browsing/test_safe_browsing_service.h" #include "chrome/browser/task_manager/providers/task.h" #include "chrome/browser/task_manager/task_manager_browsertest_util.h" @@ -43,6 +42,7 @@ #include "content/public/test/test_navigation_observer.h" #include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" +#include "pdf/buildflags.h" #include "services/network/public/mojom/fetch_api.mojom.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -50,6 +50,10 @@ #include "ui/base/l10n/l10n_util.h" #include "url/gurl.h" +#if BUILDFLAG(ENABLE_PDF) +#include "chrome/browser/pdf/pdf_extension_test_util.h" +#endif // BUILDFLAG(ENABLE_PDF) + using content::WebContents; class PortalBrowserTest : public InProcessBrowserTest { @@ -283,6 +287,7 @@ EXPECT_THAT(tester->GetWebContentsTaskTitles(), expected_titles); } +#if BUILDFLAG(ENABLE_PDF) IN_PROC_BROWSER_TEST_F(PortalBrowserTest, PdfViewerLoadsInPortal) { ASSERT_TRUE(embedded_test_server()->Start()); GURL url(embedded_test_server()->GetURL("/title1.html")); @@ -305,6 +310,7 @@ ASSERT_TRUE(pdf_extension_test_util::EnsurePDFHasLoaded(portal_contents)); } +#endif // BUILDFLAG(ENABLE_PDF) // Test that we do not show main frame interstitials in portal contents. We // should treat portals like subframes in terms of how to display the error to
diff --git a/chrome/browser/prefetch/no_state_prefetch/prerender_nostate_prefetch_browsertest.cc b/chrome/browser/prefetch/no_state_prefetch/prerender_nostate_prefetch_browsertest.cc index 0fe429a..3d94375 100644 --- a/chrome/browser/prefetch/no_state_prefetch/prerender_nostate_prefetch_browsertest.cc +++ b/chrome/browser/prefetch/no_state_prefetch/prerender_nostate_prefetch_browsertest.cc
@@ -1050,7 +1050,7 @@ // back/forward cache to ensure that it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( GetActiveWebContents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); GURL first_url = src_server()->GetURL("/hung"); // Start the first prefetch directly instead of via PrefetchFromFile for the @@ -1747,7 +1747,7 @@ // back/forward cache to ensure that it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( browser()->tab_strip_model()->GetActiveWebContents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); UseHttpsSrcServer(); GetNoStatePrefetchManager()->mutable_config().abandon_time_to_live = base::Milliseconds(500);
diff --git a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc index 3ecd33c..94611957 100644 --- a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc +++ b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc
@@ -1318,7 +1318,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( - GetWebContents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + GetWebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); SetDataSaverEnabled(true); ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), GetOriginServerURL("/simple.html"))); @@ -1988,7 +1988,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( - GetWebContents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + GetWebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); GURL starting_page = GetOriginServerURL("/simple.html"); SetDataSaverEnabled(true); ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), starting_page)); @@ -2897,7 +2897,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( - GetWebContents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + GetWebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); base::HistogramTester histogram_tester; SetDataSaverEnabled(true); @@ -3775,7 +3775,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( - GetWebContents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + GetWebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); SetDataSaverEnabled(true); GURL starting_page = GetOriginServerURL("/simple.html"); ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), starting_page)); @@ -4049,7 +4049,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( - GetWebContents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + GetWebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); base::HistogramTester histogram_tester; SetDataSaverEnabled(true); @@ -4479,7 +4479,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( - GetWebContents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + GetWebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); GURL starting_page = GetOriginServerURL("/simple.html"); SetDataSaverEnabled(true); ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), starting_page)); @@ -4582,7 +4582,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( - GetWebContents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + GetWebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); SetDataSaverEnabled(true); GURL starting_page = GetReferringPageServerURL("/search/q=blah"); @@ -4638,7 +4638,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( - GetWebContents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + GetWebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); SetDataSaverEnabled(true); GURL starting_page = GetReferringPageServerURL("/search/q=blah"); @@ -4698,7 +4698,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( - GetWebContents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + GetWebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); SetDataSaverEnabled(true); GURL starting_page = GetOriginServerURL("/search/q=blah");
diff --git a/chrome/browser/prefetch/search_prefetch/search_prefetch_service_browsertest.cc b/chrome/browser/prefetch/search_prefetch/search_prefetch_service_browsertest.cc index 3cb5977..67633e0 100644 --- a/chrome/browser/prefetch/search_prefetch/search_prefetch_service_browsertest.cc +++ b/chrome/browser/prefetch/search_prefetch/search_prefetch_service_browsertest.cc
@@ -1176,7 +1176,7 @@ // Disable back/forward cache to ensure that it doesn't get preserved in the // back/forward cache. content::DisableBackForwardCacheForTesting( - GetWebContents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + GetWebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); std::string search_terms = "prefetch_content"; GURL prefetch_url = GetSearchServerQueryURL(search_terms + "&pf=cs"); @@ -1244,7 +1244,7 @@ // Disable back/forward cache to ensure that it doesn't get preserved in the // back/forward cache. content::DisableBackForwardCacheForTesting( - GetWebContents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + GetWebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); std::string search_terms = "prefetch_content"; GURL prefetch_url = GetSearchServerQueryURL(search_terms + "&pf=cs"); @@ -1367,7 +1367,7 @@ // Disable back/forward cache to ensure that it doesn't get preserved in the // back/forward cache. content::DisableBackForwardCacheForTesting( - GetWebContents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + GetWebContents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); std::string search_terms = "prefetch_content"; GURL prefetch_url = GetSearchServerQueryURL(search_terms + "&pf=cs");
diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc index c90b3e9..f643516 100644 --- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc +++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
@@ -435,7 +435,7 @@ #endif #if BUILDFLAG(BUILD_WITH_TFLITE_LIB) if (base::FeatureList::IsEnabled( - permissions::features::kPermissionOnDevicePredictions)) { + permissions::features::kPermissionOnDeviceNotificationPredictions)) { PredictionModelHandlerFactory::GetInstance(); } #endif // BUILDFLAG(BUILD_WITH_TFLITE_LIB)
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc index 65905b8..0e18a26 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -155,6 +155,7 @@ #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/ssl_status.h" #include "content/public/browser/web_contents.h" +#include "content/public/common/referrer.h" #include "content/public/common/url_constants.h" #include "content/public/common/url_utils.h" #include "extensions/buildflags/buildflags.h" @@ -573,9 +574,7 @@ } #endif // !BUILDFLAG(IS_CHROMEOS_ASH) -void OnProfileCreated(const GURL& link_url, - const content::Referrer& referrer, - Profile* profile) { +void OnProfileCreated(const GURL& link_url, Profile* profile) { Browser* browser = chrome::FindLastActiveWithProfile(profile); NavigateParams nav_params( browser, link_url, @@ -586,7 +585,9 @@ destination browser which is not correct. */ ui::PAGE_TRANSITION_TYPED); nav_params.disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; - nav_params.referrer = referrer; + // We are opening the link across profiles, so sending the referer + // header is a privacy risk. + nav_params.referrer = content::Referrer(); nav_params.window_action = NavigateParams::SHOW_WINDOW; Navigate(&nav_params); } @@ -3249,8 +3250,7 @@ base::FilePath profile_path = profile_link_paths_[profile_index]; profiles::SwitchToProfile( profile_path, false, - base::BindRepeating(OnProfileCreated, params_.link_url, - CreateReferrer(params_.link_url, params_))); + base::BindRepeating(OnProfileCreated, params_.link_url)); } void RenderViewContextMenu::ExecInspectElement() {
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc b/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc index 7437b6ff..60a8cb91 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc
@@ -89,6 +89,7 @@ #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" +#include "pdf/buildflags.h" #include "pdf/pdf_features.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "testing/gmock/include/gmock/gmock.h" @@ -433,14 +434,6 @@ raw_ptr<guest_view::TestGuestViewManager> test_guest_view_manager_; }; -class PdfPluginContextMenuBrowserTestWithUnseasonedOverride - : public base::test::WithFeatureOverride, - public PdfPluginContextMenuBrowserTest { - public: - PdfPluginContextMenuBrowserTestWithUnseasonedOverride() - : base::test::WithFeatureOverride(chrome_pdf::features::kPdfUnseasoned) {} -}; - IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, NonExtensionMenuItemsAlwaysVisible) { std::unique_ptr<TestRenderViewContextMenu> menu1 = @@ -1490,6 +1483,80 @@ EXPECT_EQ(profile, Profile::FromBrowserContext(tab->GetBrowserContext())); } } + +// Verify that "Open Link as <profile>" doesn't send referrer URL. +IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, OpenProfileNoneReferrer) { + signin_util::ScopedForceSigninSetterForTesting force_signin_setter(true); + + // Create the profile. + ProfileAttributesStorage& storage = + g_browser_process->profile_manager()->GetProfileAttributesStorage(); + Profile* profile = CreateSecondaryProfile(1); + ProfileAttributesEntry* entry = + storage.GetProfileAttributesWithPath(profile->GetPath()); + ASSERT_NE(entry, nullptr); + entry->LockForceSigninProfile(false); + profiles::FindOrCreateNewWindowForProfile( + profile, chrome::startup::IsProcessStartup::kNo, + chrome::startup::IsFirstRun::kNo, false); + + ASSERT_TRUE(embedded_test_server()->Start()); + + GURL echoheader(embedded_test_server()->GetURL("/echoheader?Referer")); + // Go to a |page| with a link to echoheader URL. + GURL page("data:text/html,<a href='" + echoheader.spec() + "'>link</a>"); + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), page)); + + // Set up referrer URL. + const GURL kReferrer("http://foo.com/test"); + content::ContextMenuParams context_menu_params; + context_menu_params.page_url = kReferrer; + context_menu_params.link_url = echoheader; + context_menu_params.unfiltered_link_url = echoheader; + context_menu_params.link_url = echoheader; + context_menu_params.src_url = echoheader; + + TestRenderViewContextMenu menu( + *browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame(), + context_menu_params); + menu.Init(); + + // Verify that the Open in Profile option is shown. + ui::MenuModel* model = nullptr; + int index; + ASSERT_TRUE(menu.GetMenuModelAndItemIndex(IDC_OPEN_LINK_IN_PROFILE_FIRST, + &model, &index)); + + ui_test_utils::AllBrowserTabAddedWaiter add_tab; + int command_id = menu.GetCommandIDByProfilePath(profile->GetPath()); + ASSERT_NE(-1, command_id); + menu.ExecuteCommand(command_id, 0); + + content::WebContents* tab = add_tab.Wait(); + content::WaitForLoadStop(tab); + + // Verify that it's the correct tab and profile. + EXPECT_EQ(profile, Profile::FromBrowserContext(tab->GetBrowserContext())); + ASSERT_EQ(echoheader, tab->GetLastCommittedURL()); + + // Verify that the header text echoed on the page doesn't reveal `kReferrer`. + const std::string kNoneReferrer("None"); + std::string actual_referrer; + ASSERT_TRUE(content::ExecuteScriptAndExtractString( + tab, + "window.domAutomationController.send(window.document.body.textContent);", + &actual_referrer)); + ASSERT_EQ(kNoneReferrer, actual_referrer); + + // Verify that the javascript referrer is empty. + std::string page_referrer; + const std::string kEmptyReferrer(""); + ASSERT_TRUE(content::ExecuteScriptAndExtractString( + tab, "window.domAutomationController.send(window.document.referrer);", + &page_referrer)); + ASSERT_EQ(kEmptyReferrer, page_referrer); +} + #endif // !BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(GOOGLE_CHROME_BRANDING) @@ -1790,6 +1857,15 @@ EXPECT_THAT(new_tab_content, testing::MatchesRegex(".*ep=ccm&s=&st=\\d+")); } +#if BUILDFLAG(ENABLE_PDF) +class PdfPluginContextMenuBrowserTestWithUnseasonedOverride + : public base::test::WithFeatureOverride, + public PdfPluginContextMenuBrowserTest { + public: + PdfPluginContextMenuBrowserTestWithUnseasonedOverride() + : base::test::WithFeatureOverride(chrome_pdf::features::kPdfUnseasoned) {} +}; + IN_PROC_BROWSER_TEST_P(PdfPluginContextMenuBrowserTestWithUnseasonedOverride, FullPagePdfHasPageItems) { std::unique_ptr<TestRenderViewContextMenu> menu = SetupAndCreateMenu(); @@ -1872,6 +1948,7 @@ run_loop.Run(); } } +#endif // BUILDFLAG(ENABLE_PDF) class LoadImageRequestObserver : public content::WebContentsObserver { public:
diff --git a/chrome/browser/resources/segmentation_internals/segmentation_internals.html b/chrome/browser/resources/segmentation_internals/segmentation_internals.html index a52ebb8..b626884 100644 --- a/chrome/browser/resources/segmentation_internals/segmentation_internals.html +++ b/chrome/browser/resources/segmentation_internals/segmentation_internals.html
@@ -2,9 +2,22 @@ <html lang="en" dir="ltr"> <head> <style> - .segment { + .client { border: 1px outset black; - margin: 2px 2px 2px 2px; + margin: 1px 1px 1px 1px; + } + .segment { + border: 1px outset blue; + margin: 1px 1px 1px 1px; + } + .hidden-meta { + display : none; + } + .shown-meta { + display : block; + } + .overwrite { + width : 50px; } </style> <meta charset="utf-8"> @@ -18,8 +31,8 @@ <div> Initialized: <span id="initialized">false</span>, Service status: <span id="service-status">0</span> </div> - <h4>Segment information</h4> - <div id="segment-container"> + <h4>Client information</h4> + <div id="client-container"> </div> <script type="module" src="segmentation_internals.js"></script> </body>
diff --git a/chrome/browser/resources/segmentation_internals/segmentation_internals.ts b/chrome/browser/resources/segmentation_internals/segmentation_internals.ts index 1fd81a71..a7ad7b2 100644 --- a/chrome/browser/resources/segmentation_internals/segmentation_internals.ts +++ b/chrome/browser/resources/segmentation_internals/segmentation_internals.ts
@@ -4,24 +4,82 @@ import {$} from 'chrome://resources/js/util.m.js'; -import {SegmentInfo} from './segmentation_internals.mojom-webui.js'; +import {ClientInfo, SegmentInfo} from './segmentation_internals.mojom-webui.js'; import {SegmentationInternalsBrowserProxy} from './segmentation_internals_browser_proxy.js'; function getProxy(): SegmentationInternalsBrowserProxy { return SegmentationInternalsBrowserProxy.getInstance(); } -function addChildDivToParent(parent: HTMLElement, info: SegmentInfo) { +function addClientInfo(parent: HTMLElement, info: ClientInfo) { + const div = document.createElement('div'); + div.className = 'client'; + const configTitle = document.createElement('h5'); + configTitle.textContent = + 'Segmentation Key: ' + String(info.segmentationKey) + + ', Selected Segment: ' + String(info.selectedSegment); + div.appendChild(configTitle); + for (let i = 0; i < info.segmentInfo.length; ++i) { + addSegmentInfoToParent(div, info.segmentationKey, info.segmentInfo[i]!); + } + parent.appendChild(div); +} + +function addSegmentInfoToParent( + parent: HTMLElement, segmentationKey: string, info: SegmentInfo) { const div = document.createElement('div'); div.className = 'segment'; - div.textContent = String(info.optimizationTarget); + const targetDiv = document.createElement('div'); + targetDiv.textContent = 'Segment Id: ' + String(info.segmentName); + div.appendChild(targetDiv); + const resultDiv = document.createElement('div'); + resultDiv.textContent = 'Result: ' + String(info.predictionResult); + div.appendChild(resultDiv); + const buttonDiv = document.createElement('div'); + if (info.canExecuteSegment) { + const btn = document.createElement('button'); + btn.innerHTML = 'Execute model'; + btn.addEventListener('click', () => { + getProxy().executeModel(info.segmentId); + }); + buttonDiv.appendChild(btn); + } + const overwriteText = document.createElement('label'); + overwriteText.innerHTML = 'Overwrite result: '; + buttonDiv.appendChild(overwriteText); + const overwriteValue = document.createElement('input'); + overwriteValue.type = 'number'; + overwriteValue.value = '0'; + overwriteValue.className = 'overwrite'; + buttonDiv.appendChild(overwriteValue); + const overwriteBtn = document.createElement('button'); + overwriteBtn.innerHTML = 'Overwrite'; + overwriteBtn.addEventListener('click', () => { + getProxy().overwriteResult( + info.segmentId, parseFloat(overwriteValue.value)); + }); + buttonDiv.appendChild(overwriteBtn); + const setSelectionBtn = document.createElement('button'); + setSelectionBtn.innerHTML = 'Set Selected'; + setSelectionBtn.addEventListener('click', () => { + getProxy().setSelected(segmentationKey, info.segmentId); + }); + buttonDiv.appendChild(setSelectionBtn); + div.appendChild(buttonDiv); + const dataDiv = document.createElement('div'); + dataDiv.textContent = String(info.segmentData); + div.appendChild(dataDiv); + dataDiv.className = 'hidden-meta'; div.setAttribute('simple', ''); - div.addEventListener('click', () => { + div.addEventListener('click', (e) => { + if (e.target != targetDiv && e.target != resultDiv && e.target != dataDiv) { + return; + } if (div.hasAttribute('simple')) { - div.textContent = String(info.segmentData); + dataDiv.className = 'shown-meta'; div.removeAttribute('simple'); } else { - div.textContent = String(info.optimizationTarget); + dataDiv.className = 'hidden-meta'; div.setAttribute('simple', ''); } }); @@ -35,16 +93,16 @@ $('service-status').textContent = String(status); }); - getProxy().getCallbackRouter().onSegmentInfoAvailable.addListener( - (segmentInfos: Array<SegmentInfo>) => { - const parent = $('segment-container'); + getProxy().getCallbackRouter().onClientInfoAvailable.addListener( + (clientInfos: Array<ClientInfo>) => { + const parent = $('client-container'); // Remove all current children. while (parent.firstChild) { parent.removeChild(parent.firstChild); } // Append new children. - for (let i = 0; i < segmentInfos.length; ++i) { - addChildDivToParent(parent, segmentInfos[i]!); + for (let i = 0; i < clientInfos.length; ++i) { + addClientInfo(parent, clientInfos[i]!); } });
diff --git a/chrome/browser/resources/segmentation_internals/segmentation_internals_browser_proxy.ts b/chrome/browser/resources/segmentation_internals/segmentation_internals_browser_proxy.ts index 88e5f30..223e3a41 100644 --- a/chrome/browser/resources/segmentation_internals/segmentation_internals_browser_proxy.ts +++ b/chrome/browser/resources/segmentation_internals/segmentation_internals_browser_proxy.ts
@@ -21,6 +21,18 @@ return this.handler.getServiceStatus(); } + executeModel(target: number) { + return this.handler.executeModel(target); + } + + overwriteResult(target: number, result: number) { + return this.handler.overwriteResult(target, result); + } + + setSelected(segmentationKey: string, target: number) { + return this.handler.setSelected(segmentationKey, target); + } + static getInstance(): SegmentationInternalsBrowserProxy { return instance || (instance = new SegmentationInternalsBrowserProxy()); }
diff --git a/chrome/browser/signin/dice_tab_helper_unittest.cc b/chrome/browser/signin/dice_tab_helper_unittest.cc index 96eab075f..85cf9a7 100644 --- a/chrome/browser/signin/dice_tab_helper_unittest.cc +++ b/chrome/browser/signin/dice_tab_helper_unittest.cc
@@ -77,7 +77,7 @@ // be recreated after navigation (which resets the signin page state). Disable // back/forward cache to ensure that it doesn't get preserved in the cache. content::DisableBackForwardCacheForTesting( - web_contents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + web_contents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); DiceTabHelper::CreateForWebContents(web_contents()); DiceTabHelper* dice_tab_helper = DiceTabHelper::FromWebContents(web_contents());
diff --git a/chrome/browser/subresource_filter/ad_tagging_browsertest.cc b/chrome/browser/subresource_filter/ad_tagging_browsertest.cc index a5edb4d1..7eb0833 100644 --- a/chrome/browser/subresource_filter/ad_tagging_browsertest.cc +++ b/chrome/browser/subresource_filter/ad_tagging_browsertest.cc
@@ -405,7 +405,7 @@ // TODO(https://crbug.com/1229122): Investigate if this needs further fix. content::DisableBackForwardCacheForTesting( browser()->tab_strip_model()->GetActiveWebContents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); base::HistogramTester histogram_tester;
diff --git a/chrome/browser/tab_contents/view_source_browsertest.cc b/chrome/browser/tab_contents/view_source_browsertest.cc index b2277cf..5d525c8 100644 --- a/chrome/browser/tab_contents/view_source_browsertest.cc +++ b/chrome/browser/tab_contents/view_source_browsertest.cc
@@ -656,7 +656,7 @@ // |view_source_contents| to make sure it will not be put into the back // forward cache. view_source_contents->GetController().GetBackForwardCache().DisableForTesting( - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); // 4. Navigate the view-source page to a c.com/title1.html ASSERT_TRUE(ui_test_utils::NavigateToURL(
diff --git a/chrome/browser/ui/android/appmenu/internal/java/res/drawable/menu_action_bar_bg.xml b/chrome/browser/ui/android/appmenu/internal/java/res/drawable/menu_action_bar_bg.xml index 5977d6c..3b34567 100644 --- a/chrome/browser/ui/android/appmenu/internal/java/res/drawable/menu_action_bar_bg.xml +++ b/chrome/browser/ui/android/appmenu/internal/java/res/drawable/menu_action_bar_bg.xml
@@ -13,5 +13,5 @@ android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" /> <solid - android:color="@color/menu_action_bar_bg_color_baseline"/> + android:color="@color/menu_action_bar_bg_color"/> </shape>
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc index 4b625c3..695aa07 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
@@ -882,9 +882,9 @@ const base::Time time = base::Time::Now(); arc::ArcAppScopedPrefUpdate update(prefs_, app_id, arc::prefs::kArcApps); - base::DictionaryValue* app_dict = update.Get(); + base::Value* app_dict = update.Get(); const std::string string_value = base::NumberToString(time.ToInternalValue()); - app_dict->SetString(kLastLaunchTime, string_value); + app_dict->SetStringKey(kLastLaunchTime, string_value); for (auto& observer : observer_list_) observer.OnAppLastLaunchTimeUpdated(app_id); @@ -1064,8 +1064,8 @@ instance->SetResizeLockState(app_info->package_name, state); arc::ArcAppScopedPrefUpdate update(prefs_, app_id, arc::prefs::kArcApps); - base::DictionaryValue* app_dict = update.Get(); - app_dict->SetInteger(kResizeLockState, static_cast<int32_t>(state)); + base::Value* app_dict = update.Get(); + app_dict->SetIntKey(kResizeLockState, static_cast<int32_t>(state)); NotifyAppStatesChanged(app_id); } @@ -1090,7 +1090,7 @@ } arc::ArcAppScopedPrefUpdate update(prefs_, app_id, arc::prefs::kArcApps); - base::DictionaryValue* app_dict = update.Get(); + base::Value* app_dict = update.Get(); app_dict->SetBoolKey(kResizeLockNeedsConfirmation, is_needed); } @@ -1282,28 +1282,28 @@ GetResizeLockNeedsConfirmation(app_id); arc::ArcAppScopedPrefUpdate update(prefs_, app_id, arc::prefs::kArcApps); - base::DictionaryValue* app_dict = update.Get(); - app_dict->SetString(kName, updated_name); - app_dict->SetString(kPackageName, package_name); - app_dict->SetString(kActivity, activity); - app_dict->SetString(kIntentUri, intent_uri); - app_dict->SetString(kIconResourceId, icon_resource_id); - app_dict->SetBoolean(kSuspended, suspended); - app_dict->SetBoolean(kSticky, sticky); - app_dict->SetBoolean(kNotificationsEnabled, notifications_enabled); - app_dict->SetInteger(kResizeLockState, - static_cast<int32_t>(resize_lock_state)); - app_dict->SetBoolean(kResizeLockNeedsConfirmation, + base::Value* app_dict = update.Get(); + app_dict->SetStringKey(kName, updated_name); + app_dict->SetStringKey(kPackageName, package_name); + app_dict->SetStringKey(kActivity, activity); + app_dict->SetStringKey(kIntentUri, intent_uri); + app_dict->SetStringKey(kIconResourceId, icon_resource_id); + app_dict->SetBoolKey(kSuspended, suspended); + app_dict->SetBoolKey(kSticky, sticky); + app_dict->SetBoolKey(kNotificationsEnabled, notifications_enabled); + app_dict->SetIntKey(kResizeLockState, + static_cast<int32_t>(resize_lock_state)); + app_dict->SetBoolKey(kResizeLockNeedsConfirmation, resize_lock_needs_confirmation); - app_dict->SetBoolean(kShortcut, shortcut); - app_dict->SetBoolean(kLaunchable, launchable); + app_dict->SetBoolKey(kShortcut, shortcut); + app_dict->SetBoolKey(kLaunchable, launchable); // Note the install time is the first time the Chrome OS sees the app, not the // actual install time in Android side. if (GetInstallTime(app_id).is_null()) { std::string install_time_str = base::NumberToString(base::Time::Now().ToInternalValue()); - app_dict->SetString(kInstallTime, install_time_str); + app_dict->SetStringKey(kInstallTime, install_time_str); } const bool was_disabled = ready_apps_.count(app_id) == 0; @@ -1434,20 +1434,20 @@ arc::ArcAppScopedPrefUpdate update(prefs_, package_name, arc::prefs::kArcPackages); - base::DictionaryValue* package_dict = update.Get(); + base::Value* package_dict = update.Get(); const std::string id_str = base::NumberToString(package.last_backup_android_id); const std::string time_str = base::NumberToString(package.last_backup_time); int old_package_version = package_dict->FindIntKey(kPackageVersion).value_or(-1); - package_dict->SetBoolean(kShouldSync, package.sync); - package_dict->SetInteger(kPackageVersion, package.package_version); - package_dict->SetString(kLastBackupAndroidId, id_str); - package_dict->SetString(kLastBackupTime, time_str); - package_dict->SetBoolean(kSystem, package.system); - package_dict->SetBoolean(kUninstalled, false); - package_dict->SetBoolean(kVPNProvider, package.vpn_provider); + package_dict->SetBoolKey(kShouldSync, package.sync); + package_dict->SetIntKey(kPackageVersion, package.package_version); + package_dict->SetStringKey(kLastBackupAndroidId, id_str); + package_dict->SetStringKey(kLastBackupTime, time_str); + package_dict->SetBoolKey(kSystem, package.system); + package_dict->SetBoolKey(kUninstalled, false); + package_dict->SetBoolKey(kVPNProvider, package.vpn_provider); base::DictionaryValue permissions_dict; if (package.permission_states.has_value()) { @@ -1663,13 +1663,13 @@ arc::ArcAppScopedPrefUpdate update(prefs_, package_name, arc::prefs::kArcPackages); - base::DictionaryValue* package_dict = update.Get(); + base::Value* package_dict = update.Get(); if (!apps_to_remove.empty()) { auto* shelf_controller = ChromeShelfController::instance(); if (shelf_controller) { int pin_index = shelf_controller->PinnedItemIndexByAppID(*apps_to_remove.begin()); - package_dict->SetInteger(kPinIndex, pin_index); + package_dict->SetIntKey(kPinIndex, pin_index); } }
diff --git a/chrome/browser/ui/app_list/arc/arc_app_scoped_pref_update.cc b/chrome/browser/ui/app_list/arc/arc_app_scoped_pref_update.cc index f55eb930..bb4fc38 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_scoped_pref_update.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_scoped_pref_update.cc
@@ -11,17 +11,17 @@ ArcAppScopedPrefUpdate::ArcAppScopedPrefUpdate(PrefService* service, const std::string& id, const std::string& path) - : DictionaryPrefUpdateDeprecated(service, path), id_(id) {} + : DictionaryPrefUpdate(service, path), id_(id) {} ArcAppScopedPrefUpdate::~ArcAppScopedPrefUpdate() = default; -base::DictionaryValue* ArcAppScopedPrefUpdate::Get() { - base::DictionaryValue* dict = DictionaryPrefUpdateDeprecated::Get(); +base::Value* ArcAppScopedPrefUpdate::Get() { + base::Value* dict = DictionaryPrefUpdate::Get(); base::Value* dict_item = dict->FindKeyOfType(id_, base::Value::Type::DICTIONARY); if (!dict_item) dict_item = dict->SetKey(id_, base::Value(base::Value::Type::DICTIONARY)); - return static_cast<base::DictionaryValue*>(dict_item); + return dict_item; } } // namespace arc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_scoped_pref_update.h b/chrome/browser/ui/app_list/arc/arc_app_scoped_pref_update.h index 180f5ae..55f59f6 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_scoped_pref_update.h +++ b/chrome/browser/ui/app_list/arc/arc_app_scoped_pref_update.h
@@ -14,7 +14,7 @@ namespace arc { // Pref updater for ARC apps. Used in deferent pref sections. -class ArcAppScopedPrefUpdate : public DictionaryPrefUpdateDeprecated { +class ArcAppScopedPrefUpdate : public DictionaryPrefUpdate { public: // This is used in following cases: // |path| is "arc.apps" - To update ARC apps preferences. In this case |id| @@ -32,8 +32,8 @@ ~ArcAppScopedPrefUpdate() override; - // DictionaryPrefUpdateDeprecated: - base::DictionaryValue* Get() override; + // DictionaryPrefUpdate: + base::Value* Get() override; private: const std::string id_;
diff --git a/chrome/browser/ui/app_list/arc/arc_default_app_list.cc b/chrome/browser/ui/app_list/arc/arc_default_app_list.cc index c5184d0..8b73457 100644 --- a/chrome/browser/ui/app_list/arc/arc_default_app_list.cc +++ b/chrome/browser/ui/app_list/arc/arc_default_app_list.cc
@@ -329,7 +329,7 @@ // Store hidden flag. arc::ArcAppScopedPrefUpdate(profile_->GetPrefs(), app_id, kDefaultApps) .Get() - ->SetBoolean(kHidden, hidden); + ->SetBoolKey(kHidden, hidden); } void ArcDefaultAppList::SetAppsHiddenForPackage(
diff --git a/chrome/browser/ui/app_list/search/ranking/constants.h b/chrome/browser/ui/app_list/search/ranking/constants.h index 639ea60..5dc0e06 100644 --- a/chrome/browser/ui/app_list/search/ranking/constants.h +++ b/chrome/browser/ui/app_list/search/ranking/constants.h
@@ -15,7 +15,7 @@ constexpr size_t kNumTopMatches = 3u; // The score threshold before we consider a result a top match. -constexpr double kTopMatchThreshold = 0.9; +constexpr double kTopMatchThreshold = 0.8; // String to add to the details text of top match results. Keep the char[] and // char16_t versions in sync.
diff --git a/chrome/browser/ui/app_list/search/ranking/ranker_delegate.cc b/chrome/browser/ui/app_list/search/ranking/ranker_delegate.cc index 31e6863..1fbab59 100644 --- a/chrome/browser/ui/app_list/search/ranking/ranker_delegate.cc +++ b/chrome/browser/ui/app_list/search/ranking/ranker_delegate.cc
@@ -13,6 +13,7 @@ #include "chrome/browser/ui/app_list/search/ranking/score_normalizing_ranker.h" #include "chrome/browser/ui/app_list/search/ranking/top_match_ranker.h" #include "chrome/browser/ui/app_list/search/ranking/util.h" +#include "chrome/browser/ui/app_list/search/util/score_normalizer.h" #include "chrome/browser/ui/app_list/search/util/score_normalizer.pb.h" namespace app_list { @@ -29,6 +30,14 @@ } // namespace RankerDelegate::RankerDelegate(Profile* profile, SearchController* controller) { + // Score normalization parameters: + ScoreNormalizer::Params score_normalizer_params; + // Change this version number when changing the number of bins below. + score_normalizer_params.version = 1; + // The maximum number of buckets the score normalizer discretizes result + // scores into. + score_normalizer_params.max_bins = 5; + // Result ranking parameters. // TODO(crbug.com/1199206): These need tweaking. FtrlOptimizer::Params ftrl_result_params; @@ -66,6 +75,7 @@ // 2. Score normalization, a precursor to other ranking. AddRanker(std::make_unique<ScoreNormalizingRanker>( + score_normalizer_params, PersistentProto<ScoreNormalizerProto>( state_dir.AppendASCII("score_norm.pb"), kStandardWriteDelay)));
diff --git a/chrome/browser/ui/app_list/search/ranking/score_normalizing_ranker.cc b/chrome/browser/ui/app_list/search/ranking/score_normalizing_ranker.cc index 21eee02..9de2e0e 100644 --- a/chrome/browser/ui/app_list/search/ranking/score_normalizing_ranker.cc +++ b/chrome/browser/ui/app_list/search/ranking/score_normalizing_ranker.cc
@@ -16,8 +16,8 @@ // Returns true if results from this provider should not have their result // scores normalized. This is to prevent creating an unnecessary number of // normalizers. -bool ShouldIgnoreProvider(ProviderType type) { - switch (type) { +bool ShouldIgnoreProvider(ProviderType provider) { + switch (provider) { // Deprecated types: case ProviderType::kLauncher: case ProviderType::kAnswerCard: @@ -37,14 +37,32 @@ } } +std::string ProviderToString(ProviderType provider) { + return base::NumberToString(static_cast<int>(provider)); +} + } // namespace ScoreNormalizingRanker::ScoreNormalizingRanker( - PersistentProto<ScoreNormalizerProto> proto) {} + ScoreNormalizer::Params params, + PersistentProto<ScoreNormalizerProto> proto) + : normalizer_(std::move(proto), params) {} ScoreNormalizingRanker::~ScoreNormalizingRanker() {} void ScoreNormalizingRanker::UpdateResultRanks(ResultsMap& results, - ProviderType provider) {} + ProviderType provider) { + if (ShouldIgnoreProvider(provider)) + return; + + auto it = results.find(provider); + DCHECK(it != results.end()); + + std::string provider_string = ProviderToString(provider); + for (auto& result : it->second) { + result->scoring().normalized_relevance = + normalizer_.UpdateAndNormalize(provider_string, result->relevance()); + } +} } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/ranking/score_normalizing_ranker.h b/chrome/browser/ui/app_list/search/ranking/score_normalizing_ranker.h index fbdab7ba..615beaf 100644 --- a/chrome/browser/ui/app_list/search/ranking/score_normalizing_ranker.h +++ b/chrome/browser/ui/app_list/search/ranking/score_normalizing_ranker.h
@@ -8,6 +8,7 @@ #include "base/containers/flat_map.h" #include "chrome/browser/ui/app_list/search/ranking/ranker.h" #include "chrome/browser/ui/app_list/search/util/persistent_proto.h" +#include "chrome/browser/ui/app_list/search/util/score_normalizer.h" namespace app_list { @@ -23,12 +24,10 @@ // // Some providers don't have any transformation applied, see // ShouldIgnoreProvider in the implementation for details. -// -// TODO(crbug.com/1199206): This was made a no-op after stability concerns, but -// will be re-added soon. class ScoreNormalizingRanker : public Ranker { public: - explicit ScoreNormalizingRanker(PersistentProto<ScoreNormalizerProto> proto); + ScoreNormalizingRanker(ScoreNormalizer::Params params, + PersistentProto<ScoreNormalizerProto> proto); ~ScoreNormalizingRanker() override; ScoreNormalizingRanker(const ScoreNormalizingRanker&) = delete; @@ -36,6 +35,9 @@ // Ranker: void UpdateResultRanks(ResultsMap& results, ProviderType provider) override; + + private: + ScoreNormalizer normalizer_; }; } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/ranking/score_normalizing_ranker_unittest.cc b/chrome/browser/ui/app_list/search/ranking/score_normalizing_ranker_unittest.cc new file mode 100644 index 0000000..4e2a543 --- /dev/null +++ b/chrome/browser/ui/app_list/search/ranking/score_normalizing_ranker_unittest.cc
@@ -0,0 +1,92 @@ +// Copyright 2022 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/ui/app_list/search/ranking/score_normalizing_ranker.h" + +#include "base/files/file_util.h" +#include "base/files/scoped_temp_dir.h" +#include "base/test/task_environment.h" +#include "chrome/browser/ui/app_list/search/chrome_search_result.h" +#include "chrome/browser/ui/app_list/search/ranking/types.h" +#include "chrome/browser/ui/app_list/search/search_controller.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace app_list { +namespace { + +class TestResult : public ChromeSearchResult { + public: + explicit TestResult(const std::string& id, + double score, + ResultType result_type) { + set_id(id); + SetDisplayScore(score); + SetResultType(result_type); + } + ~TestResult() override {} + + // ChromeSearchResult overrides: + void Open(int event_flags) override {} +}; + +Results MakeResults(const std::vector<std::string>& ids, + const std::vector<double> scores, + ResultType result_type) { + Results res; + CHECK_EQ(ids.size(), scores.size()); + for (size_t i = 0; i < ids.size(); ++i) { + res.push_back(std::make_unique<TestResult>(ids[i], scores[i], result_type)); + } + return res; +} + +} // namespace + +class ScoreNormalizingRankerTest : public testing::Test { + public: + void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); } + + void Wait() { task_environment_.RunUntilIdle(); } + + base::FilePath GetPath() { return temp_dir_.GetPath().Append("proto"); } + + PersistentProto<ScoreNormalizerProto> GetProto() { + return PersistentProto<ScoreNormalizerProto>(GetPath(), base::Seconds(0)); + } + + base::test::TaskEnvironment task_environment_{ + base::test::TaskEnvironment::MainThreadType::UI, + base::test::TaskEnvironment::ThreadPoolExecutionMode::QUEUED, + base::test::TaskEnvironment::TimeSource::MOCK_TIME}; + base::ScopedTempDir temp_dir_; +}; + +TEST_F(ScoreNormalizingRankerTest, UpdateResultRanks) { + ScoreNormalizingRanker ranker(ScoreNormalizer::Params(), GetProto()); + Wait(); + + ResultsMap results; + results[ResultType::kInstalledApp] = MakeResults( + {"a", "b", "c", "d"}, {0.1, 0.2, 0.3, 0.4}, ResultType::kInstalledApp); + results[ResultType::kFileSearch] = + MakeResults({"e", "f"}, {1.0, 2.0}, ResultType::kFileSearch); + + ranker.UpdateResultRanks(results, ResultType::kInstalledApp); + + // App results should have been scored, but their precise scoring is up to the + // implementation of the score normalizer itself. Let its tests cover this, + // and just check that the results have been scored at all. + const auto& app_results = results[ResultType::kInstalledApp]; + for (size_t i = 0; i < 4; ++i) { + EXPECT_GT(app_results[i]->scoring().normalized_relevance, 0.0); + } + + // File results should not have been scored. + const auto& file_results = results[ResultType::kFileSearch]; + EXPECT_FLOAT_EQ(file_results[0]->scoring().normalized_relevance, 0.0); + EXPECT_FLOAT_EQ(file_results[1]->scoring().normalized_relevance, 0.0); +} + +} // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/search_controller.h b/chrome/browser/ui/app_list/search/search_controller.h index e3967fed..a0651dff 100644 --- a/chrome/browser/ui/app_list/search/search_controller.h +++ b/chrome/browser/ui/app_list/search/search_controller.h
@@ -124,6 +124,8 @@ virtual void set_results_changed_callback_for_test( ResultsChangedCallback callback) = 0; + + virtual void disable_ranking_for_test() = 0; }; } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/search_controller_impl.cc b/chrome/browser/ui/app_list/search/search_controller_impl.cc index 84f769f..5eabf431 100644 --- a/chrome/browser/ui/app_list/search/search_controller_impl.cc +++ b/chrome/browser/ui/app_list/search/search_controller_impl.cc
@@ -291,4 +291,9 @@ results_changed_callback_ = std::move(callback); } +void SearchControllerImpl::disable_ranking_for_test() { + // Only called for the productivity launcher. + NOTREACHED(); +} + } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/search_controller_impl.h b/chrome/browser/ui/app_list/search/search_controller_impl.h index 65a7c96..0cf121760 100644 --- a/chrome/browser/ui/app_list/search/search_controller_impl.h +++ b/chrome/browser/ui/app_list/search/search_controller_impl.h
@@ -80,6 +80,7 @@ base::Time session_start() override; void set_results_changed_callback_for_test( ResultsChangedCallback callback) override; + void disable_ranking_for_test() override; void NotifyResultsAdded(const std::vector<ChromeSearchResult*>& results);
diff --git a/chrome/browser/ui/app_list/search/search_controller_impl_new.cc b/chrome/browser/ui/app_list/search/search_controller_impl_new.cc index acdde65..3cf4c17 100644 --- a/chrome/browser/ui/app_list/search/search_controller_impl_new.cc +++ b/chrome/browser/ui/app_list/search/search_controller_impl_new.cc
@@ -318,6 +318,9 @@ return; } + if (disable_ranking_for_test_) + return; + // Update ranking of all results and categories for this provider. This // ordering is important, as result scores may affect category scores. ranker_->UpdateResultRanks(results_, provider_type); @@ -544,4 +547,8 @@ // Unused. } +void SearchControllerImplNew::disable_ranking_for_test() { + disable_ranking_for_test_ = true; +} + } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/search_controller_impl_new.h b/chrome/browser/ui/app_list/search/search_controller_impl_new.h index e29e296..5549608 100644 --- a/chrome/browser/ui/app_list/search/search_controller_impl_new.h +++ b/chrome/browser/ui/app_list/search/search_controller_impl_new.h
@@ -83,6 +83,7 @@ ResultsChangedCallback callback) override; std::u16string get_query() override; base::Time session_start() override; + void disable_ranking_for_test() override; void set_ranker_delegate_for_test( std::unique_ptr<RankerDelegate> ranker_delegate) { @@ -135,6 +136,8 @@ // Top-level result ranker. std::unique_ptr<RankerDelegate> ranker_; + bool disable_ranking_for_test_ = false; + // Storage for all search results for the current query. ResultsMap results_;
diff --git a/chrome/browser/ui/ash/desks_templates/desks_templates_client.cc b/chrome/browser/ui/ash/desks_templates/desks_templates_client.cc index ab8afaa..301b151 100644 --- a/chrome/browser/ui/ash/desks_templates/desks_templates_client.cc +++ b/chrome/browser/ui/ash/desks_templates/desks_templates_client.cc
@@ -248,7 +248,17 @@ void DesksTemplatesClient::RemovePolicyPreconfiguredTemplate( const AccountId& account_id) { + Profile* profile = + ash::ProfileHelper::Get()->GetProfileByAccountId(account_id); + if (!IsSupportedProfile(profile)) + return; + + DCHECK(profile); + preconfigured_desk_templates_json_.erase(account_id); + + if (profile == active_profile_) + GetDeskModel()->RemovePolicyDeskTemplates(); } void DesksTemplatesClient::MaybeCreateAppLaunchHandler() {
diff --git a/chrome/browser/ui/ash/desks_templates/desks_templates_client_browsertest.cc b/chrome/browser/ui/ash/desks_templates/desks_templates_client_browsertest.cc index 098303ca..5cf9358 100644 --- a/chrome/browser/ui/ash/desks_templates/desks_templates_client_browsertest.cc +++ b/chrome/browser/ui/ash/desks_templates/desks_templates_client_browsertest.cc
@@ -8,6 +8,7 @@ #include <cstdlib> #include <memory> #include <string> +#include <vector> #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" @@ -15,9 +16,11 @@ #include "ash/public/cpp/shell_window_ids.h" #include "ash/session/session_controller_impl.h" #include "ash/shell.h" +#include "ash/wm/desks/desk.h" #include "ash/wm/desks/desks_test_util.h" #include "ash/wm/desks/templates/desks_templates_test_util.h" #include "ash/wm/overview/overview_test_util.h" +#include "base/guid.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "base/test/bind.h" @@ -49,7 +52,9 @@ #include "chrome/browser/web_applications/test/web_app_install_test_utils.h" #include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/ui_test_utils.h" #include "chromeos/ui/base/window_state_type.h" +#include "components/account_id/account_id.h" #include "components/app_restore/app_launch_info.h" #include "components/app_restore/features.h" #include "components/app_restore/full_restore_save_handler.h" @@ -71,6 +76,7 @@ #include "ui/display/screen.h" #include "ui/events/test/event_generator.h" #include "ui/views/controls/button/button.h" +#include "ui/views/controls/button/label_button.h" #include "url/gurl.h" using ::testing::_; @@ -84,6 +90,12 @@ constexpr char kExampleUrl2[] = "https://examples2.com"; constexpr char kExampleUrl3[] = "https://examples3.com"; constexpr char kYoutubeUrl[] = "https://www.youtube.com/"; +constexpr char kTestAdminTemplateUuid[] = + "1f4ec992-0fa9-415d-a136-4b7c292c39dc"; +constexpr char kTestAdminTemplateFormat[] = + "[{\"version\":1,\"uuid\":\"%s\",\"name\": \"test admin template\"," + "\"created_time_usec\": \"1633535632\",\"updated_time_usec\": " + "\"1633535632\",\"desk\":{}}]"; Browser* FindBrowser(int32_t window_id) { for (auto* browser : *BrowserList::GetInstance()) { @@ -107,6 +119,8 @@ return urls; } +// TODO(crbug.com/1286515): Remove this. Tests should navigate to overview and +// click the button using an event generator. std::unique_ptr<ash::DeskTemplate> CaptureActiveDeskAndSaveTemplate() { base::RunLoop run_loop; std::unique_ptr<ash::DeskTemplate> desk_template; @@ -122,6 +136,37 @@ return desk_template; } +std::vector<ash::DeskTemplate*> GetDeskTemplates() { + base::RunLoop run_loop; + std::vector<ash::DeskTemplate*> templates; + + DesksTemplatesClient::Get()->GetDeskTemplates(base::BindLambdaForTesting( + [&](const std::vector<ash::DeskTemplate*>& desk_templates, + std::string error_string) { + templates = desk_templates; + run_loop.Quit(); + })); + run_loop.Run(); + + return templates; +} + +// Search `desk_templates` for a template with `uuid` and returns true if found, +// false if not. +bool ContainUuidInTemplates( + const std::string& uuid, + const std::vector<ash::DeskTemplate*>& desk_templates) { + base::GUID guid = base::GUID::ParseCaseInsensitive(uuid); + DCHECK(guid.is_valid()); + + for (auto* desk_template : desk_templates) { + if (desk_template->uuid() == guid) + return true; + } + + return false; +} + std::string GetTemplateJson(const std::string& uuid, Profile* profile) { base::RunLoop run_loop; std::string template_json_result; @@ -173,11 +218,34 @@ event_generator.ClickLeftButton(); } -void ClickSaveDeskAsTemplateButton() { +// If `wait_for_ui` is true, wait for the callback from the model to update the +// UI. +void ClickSaveDeskAsTemplateButton(bool wait_for_ui) { views::Button* save_desk_as_template_button = ash::GetSaveDeskAsTemplateButton(); DCHECK(save_desk_as_template_button); ClickButton(save_desk_as_template_button); + if (wait_for_ui) + ash::WaitForDesksTemplatesUI(); +} + +void ClickSaveDeskAsTemplateButton() { + ClickSaveDeskAsTemplateButton(/*wait_for_ui=*/true); +} + +void ClickZeroStateTemplatesButton() { + views::Button* zero_state_templates_button = + ash::GetZeroStateDesksTemplatesButton(); + ASSERT_TRUE(zero_state_templates_button); + ClickButton(zero_state_templates_button); + ash::WaitForDesksTemplatesUI(); +} + +void ClickExpandedStateTemplatesButton() { + views::Button* expanded_state_templates_button = + ash::GetExpandedStateDesksTemplatesButton(); + ASSERT_TRUE(expanded_state_templates_button); + ClickButton(expanded_state_templates_button); ash::WaitForDesksTemplatesUI(); } @@ -190,6 +258,22 @@ ash::WaitForDesksTemplatesUI(); } +const std::vector<ash::DeskTemplate*> GetAllEntries() { + std::vector<ash::DeskTemplate*> templates; + base::RunLoop loop; + DesksTemplatesClient::Get()->GetDeskModel()->GetAllEntries( + base::BindLambdaForTesting( + [&](desks_storage::DeskModel::GetAllEntriesStatus status, + const std::vector<ash::DeskTemplate*>& entries) { + DCHECK_EQ(desks_storage::DeskModel::GetAllEntriesStatus::kOk, + status); + templates = entries; + loop.Quit(); + })); + loop.Run(); + return templates; +} + class MockDesksTemplatesAppLaunchHandler : public DesksTemplatesAppLaunchHandler { public: @@ -475,7 +559,6 @@ const std::u16string kDeskName(u"Test Desk Name"); auto* desks_controller = ash::DesksController::Get(); - ASSERT_EQ(0, desks_controller->GetActiveDeskIndex()); // TODO(crbug.com/1273532): Note that `SetTemplate` allows setting an empty @@ -1029,7 +1112,9 @@ } // Tests that basic operations using the native UI work as expected. -// TODO(crbug.com/1286515): Remove the NativeUI prefix from these tests. +// TODO(crbug.com/1286515): Remove the NativeUI prefix from these tests. Remove +// the tests that do not have the NativeUI prefix other than GetDeskTemplateJson +// once the extension is deprecated. IN_PROC_BROWSER_TEST_F(DesksTemplatesClientTest, NativeUIBasic) { auto* desk_model = DesksTemplatesClient::Get()->GetDeskModel(); ASSERT_EQ(0, desk_model->GetEntryCount()); @@ -1119,6 +1204,90 @@ browser_window->parent()); } +// Tests that a browser's urls can be captured correctly in the desk template. +IN_PROC_BROWSER_TEST_F(DesksTemplatesClientTest, + NativeUICaptureBrowserUrlsTest) { + // Create a new browser and add a few tabs to it. + Browser* browser = CreateBrowser({GURL(kExampleUrl1), GURL(kExampleUrl2)}); + aura::Window* window = browser->window()->GetNativeWindow(); + + const int32_t browser_window_id = + window->GetProperty(app_restore::kWindowIdKey); + // Get current tabs from browser. + std::vector<GURL> urls = GetURLsForBrowserWindow(browser); + + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + + ClickSaveDeskAsTemplateButton(); + + std::vector<ash::DeskTemplate*> templates = GetAllEntries(); + ASSERT_EQ(1u, templates.size()); + + ash::DeskTemplate* desk_template = templates.front(); + const app_restore::RestoreData* restore_data = + desk_template->desk_restore_data(); + const auto& app_id_to_launch_list = restore_data->app_id_to_launch_list(); + EXPECT_EQ(app_id_to_launch_list.size(), 1u); + + // Find `browser` window's app restore data. + auto iter = app_id_to_launch_list.find(extension_misc::kChromeAppId); + ASSERT_TRUE(iter != app_id_to_launch_list.end()); + auto app_restore_data_iter = iter->second.find(browser_window_id); + ASSERT_TRUE(app_restore_data_iter != iter->second.end()); + const auto& data = app_restore_data_iter->second; + // Check the urls are captured correctly in the `desk_template`. + EXPECT_EQ(data->urls.value(), urls); +} + +// Tests that incognito browser windows will NOT be captured in the desk +// template. +IN_PROC_BROWSER_TEST_F(DesksTemplatesClientTest, + NativeUICaptureIncognitoBrowserTest) { + Browser* incognito_browser = CreateIncognitoBrowser(); + chrome::AddTabAt(incognito_browser, GURL(kExampleUrl1), /*index=*/-1, + /*foreground=*/true); + chrome::AddTabAt(incognito_browser, GURL(kExampleUrl2), /*index=*/-1, + /*foreground=*/true); + incognito_browser->window()->Show(); + aura::Window* window = incognito_browser->window()->GetNativeWindow(); + + const int32_t incognito_browser_window_id = + window->GetProperty(app_restore::kWindowIdKey); + + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + + // Incognito browsers are unsupported so a dialog will popup asking users if + // they are sure. Use a key press to accept the dialog instead of a click as + // dialog buttons think a click generated by the event generator is an + // accidentally click and therefore ignores it. + ClickSaveDeskAsTemplateButton(/*wait_for_ui=*/false); + views::Button* dialog_accept_button = + ash::GetDesksTemplatesDialogAcceptButton(); + ASSERT_TRUE(dialog_accept_button); + aura::Window* root_window = + dialog_accept_button->GetWidget()->GetNativeWindow()->GetRootWindow(); + ui::test::EventGenerator event_generator(root_window); + event_generator.PressAndReleaseKey(ui::VKEY_RETURN); + + std::vector<ash::DeskTemplate*> templates = GetAllEntries(); + ASSERT_EQ(1u, templates.size()); + + ash::DeskTemplate* desk_template = templates.front(); + const app_restore::RestoreData* restore_data = + desk_template->desk_restore_data(); + const auto& app_id_to_launch_list = restore_data->app_id_to_launch_list(); + EXPECT_EQ(1u, app_id_to_launch_list.size()); + + // Find `browser` window's app restore data. + auto iter = app_id_to_launch_list.find(extension_misc::kChromeAppId); + ASSERT_FALSE(iter == app_id_to_launch_list.end()); + auto app_restore_data_iter = iter->second.find(incognito_browser_window_id); + // Created incognito window is NOT in restore list. + EXPECT_TRUE(iter->second.end() == app_restore_data_iter); +} + // Tests that launching a template that contains a system web app works as // expected. IN_PROC_BROWSER_TEST_F(DesksTemplatesClientTest, @@ -1151,12 +1320,7 @@ ash::ToggleOverview(); ash::WaitForOverviewEnterAnimation(); - views::Button* zero_state_templates_button = - ash::GetZeroStateDesksTemplatesButton(); - ASSERT_TRUE(zero_state_templates_button); - ClickButton(zero_state_templates_button); - ash::WaitForDesksTemplatesUI(); - + ClickZeroStateTemplatesButton(); ClickFirstTemplateItem(); for (auto* browser : *BrowserList::GetInstance()) { @@ -1211,12 +1375,8 @@ // template. ash::ToggleOverview(); ash::WaitForOverviewEnterAnimation(); - views::Button* zero_state_templates_button = - ash::GetZeroStateDesksTemplatesButton(); - ASSERT_TRUE(zero_state_templates_button); - ClickButton(zero_state_templates_button); - ash::WaitForDesksTemplatesUI(); + ClickZeroStateTemplatesButton(); ClickFirstTemplateItem(); // Wait for the tabs to load. @@ -1241,6 +1401,442 @@ EXPECT_EQ(gfx::Rect(), settings_window->layer()->clip_rect()); } +// Tests that browser windows created from a template have the correct bounds +// and window state. +IN_PROC_BROWSER_TEST_F(DesksTemplatesClientTest, + NativeUIBrowserWindowRestorationTest) { + // Create a new browser and set its bounds. + Browser* browser_1 = CreateBrowser({GURL(kExampleUrl1), GURL(kExampleUrl2)}); + const gfx::Rect browser_bounds_1 = gfx::Rect(100, 100, 600, 200); + aura::Window* window_1 = browser_1->window()->GetNativeWindow(); + window_1->SetBounds(browser_bounds_1); + + // Create a new minimized browser. + Browser* browser_2 = CreateBrowser({GURL(kExampleUrl1)}); + const gfx::Rect browser_bounds_2 = gfx::Rect(150, 150, 500, 300); + aura::Window* window_2 = browser_2->window()->GetNativeWindow(); + window_2->SetBounds(browser_bounds_2); + EXPECT_EQ(browser_bounds_2, window_2->bounds()); + browser_2->window()->Minimize(); + + // Create a new maximized browser. + Browser* browser_3 = CreateBrowser({GURL(kExampleUrl1)}); + browser_3->window()->Maximize(); + + EXPECT_EQ(browser_bounds_1, window_1->bounds()); + EXPECT_EQ(browser_bounds_2, window_2->bounds()); + ASSERT_TRUE(browser_2->window()->IsMinimized()); + ASSERT_TRUE(browser_3->window()->IsMaximized()); + + const int32_t browser_window_id_1 = + window_1->GetProperty(app_restore::kWindowIdKey); + const int32_t browser_window_id_2 = + window_2->GetProperty(app_restore::kWindowIdKey); + const int32_t browser_window_id_3 = + browser_3->window()->GetNativeWindow()->GetProperty( + app_restore::kWindowIdKey); + + // Capture the active desk, which contains the three browser windows. + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + ClickSaveDeskAsTemplateButton(); + + ClickFirstTemplateItem(); + + // Wait for the tabs to load. + content::RunAllTasksUntilIdle(); + + // Verify that the browser was launched with the correct bounds. + Browser* new_browser_1 = FindBrowser(browser_window_id_1); + ASSERT_TRUE(new_browser_1); + EXPECT_EQ(browser_bounds_1, + new_browser_1->window()->GetNativeWindow()->bounds()); + + // Verify that the browser was launched and minimized. + Browser* new_browser_2 = FindBrowser(browser_window_id_2); + ASSERT_TRUE(new_browser_2); + ASSERT_TRUE(new_browser_2->window()->IsMinimized()); + EXPECT_EQ(browser_bounds_2, + new_browser_2->window()->GetNativeWindow()->bounds()); + + // Verify that the browser was launched and maximized. + Browser* new_browser_3 = FindBrowser(browser_window_id_3); + ASSERT_TRUE(new_browser_3); + ASSERT_TRUE(new_browser_3->window()->IsMaximized()); +} + +// Tests that saving and launching a template that contains a PWA works as +// expected. +IN_PROC_BROWSER_TEST_F(DesksTemplatesClientTest, + NativeUILaunchTemplateWithPWA) { + Browser* pwa_browser = + InstallAndLaunchPWA(GURL(kExampleUrl1), /*launch_in_browser=*/false); + ASSERT_TRUE(pwa_browser->is_type_app()); + aura::Window* pwa_window = pwa_browser->window()->GetNativeWindow(); + const gfx::Rect pwa_bounds(50, 50, 500, 500); + pwa_window->SetBounds(pwa_bounds); + const int32_t pwa_window_id = + pwa_window->GetProperty(app_restore::kWindowIdKey); + const std::string* app_name = + pwa_window->GetProperty(app_restore::kBrowserAppNameKey); + ASSERT_TRUE(app_name); + + // Capture the active desk, which contains the PWA. + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + ClickSaveDeskAsTemplateButton(); + + std::vector<ash::DeskTemplate*> templates = GetAllEntries(); + ASSERT_EQ(1u, templates.size()); + + // Find `pwa_browser` window's app restore data. + ash::DeskTemplate* desk_template = templates.front(); + const app_restore::RestoreData* restore_data = + desk_template->desk_restore_data(); + const auto& app_id_to_launch_list = restore_data->app_id_to_launch_list(); + EXPECT_EQ(1u, app_id_to_launch_list.size()); + ASSERT_TRUE(restore_data->HasAppTypeBrowser()); + auto iter = app_id_to_launch_list.find(extension_misc::kChromeAppId); + ASSERT_TRUE(iter != app_id_to_launch_list.end()); + auto app_restore_data_iter = iter->second.find(pwa_window_id); + ASSERT_TRUE(app_restore_data_iter != iter->second.end()); + const auto& data = app_restore_data_iter->second; + // Verify window info are correctly captured. + EXPECT_EQ(pwa_bounds, data->current_bounds.value()); + ASSERT_TRUE(data->app_type_browser.has_value() && + data->app_type_browser.value()); + EXPECT_EQ(*app_name, *data->app_name); + + // Launch the template. + ClickFirstTemplateItem(); + + // Verify that the PWA was launched correctly. + Browser* new_pwa_browser = FindBrowser(pwa_window_id); + ASSERT_TRUE(new_pwa_browser); + ASSERT_TRUE(new_pwa_browser->is_type_app()); + aura::Window* new_browser_window = + new_pwa_browser->window()->GetNativeWindow(); + EXPECT_NE(new_browser_window, pwa_window); + EXPECT_EQ(pwa_bounds, new_browser_window->bounds()); + const std::string* new_app_name = + new_browser_window->GetProperty(app_restore::kBrowserAppNameKey); + ASSERT_TRUE(new_app_name); + EXPECT_EQ(*app_name, *new_app_name); +} + +// Tests that saving and launching a template that contains a PWA in a browser +// window works as expected. +IN_PROC_BROWSER_TEST_F(DesksTemplatesClientTest, + NativeUILaunchTemplateWithPWAInBrowser) { + Browser* pwa_browser = + InstallAndLaunchPWA(GURL(kYoutubeUrl), /*launch_in_browser=*/true); + aura::Window* pwa_window = pwa_browser->window()->GetNativeWindow(); + const int32_t pwa_window_id = + pwa_window->GetProperty(app_restore::kWindowIdKey); + + // Capture the active desk, which contains the PWA. + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + ClickSaveDeskAsTemplateButton(); + + std::vector<ash::DeskTemplate*> templates = GetAllEntries(); + ASSERT_EQ(1u, templates.size()); + + // Test that `pwa_browser` restore data can be found. + ash::DeskTemplate* desk_template = templates.front(); + const app_restore::RestoreData* restore_data = + desk_template->desk_restore_data(); + const auto& app_id_to_launch_list = restore_data->app_id_to_launch_list(); + EXPECT_EQ(1u, app_id_to_launch_list.size()); + + // Test that `pwa_browser`'s restore data is saved under the Chrome browser + // app id extension_misc::kChromeAppId, not Youtube app id + // extension_misc::kYoutubeAppId. + auto iter = app_id_to_launch_list.find(extension_misc::kChromeAppId); + ASSERT_TRUE(iter != app_id_to_launch_list.end()); + auto app_restore_data_iter = iter->second.find(pwa_window_id); + ASSERT_TRUE(app_restore_data_iter != iter->second.end()); + + iter = app_id_to_launch_list.find(extension_misc::kYoutubeAppId); + EXPECT_TRUE(iter == app_id_to_launch_list.end()); +} + +// Tests that browsers and SWAs can be captured correctly in the desk template. +IN_PROC_BROWSER_TEST_F(DesksTemplatesClientTest, + NativeUICaptureActiveDeskAsTemplateTest) { + // Change `browser`'s bounds. + const gfx::Rect browser_bounds(800, 200); + aura::Window* window = browser()->window()->GetNativeWindow(); + window->SetBounds(browser_bounds); + // Make the window visible on all desks. + window->SetProperty(aura::client::kWindowWorkspaceKey, + aura::client::kWindowWorkspaceVisibleOnAllWorkspaces); + const int32_t browser_window_id = + window->GetProperty(app_restore::kWindowIdKey); + + // Create the settings app, which is a system web app. + web_app::AppId settings_app_id = + CreateSettingsSystemWebApp(browser()->profile()); + + // Change the Settings app's bounds too. + const gfx::Rect settings_app_bounds(100, 100, 800, 300); + aura::Window* settings_window = FindBrowserWindow(kSettingsWindowId); + const int32_t settings_window_id = + settings_window->GetProperty(app_restore::kWindowIdKey); + ASSERT_TRUE(settings_window); + settings_window->SetBounds(settings_app_bounds); + + auto* desks_controller = ash::DesksController::Get(); + const std::u16string desk_name = + desks_controller->GetDeskName(desks_controller->GetActiveDeskIndex()); + + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + + ClickSaveDeskAsTemplateButton(); + + std::vector<ash::DeskTemplate*> templates = GetAllEntries(); + ASSERT_EQ(1u, templates.size()); + + ash::DeskTemplate* desk_template = templates.front(); + + // Test the default template's name is the desk's name it was created from. + EXPECT_EQ(desk_name, desk_template->template_name()); + + const app_restore::RestoreData* restore_data = + desk_template->desk_restore_data(); + const auto& app_id_to_launch_list = restore_data->app_id_to_launch_list(); + EXPECT_EQ(2u, app_id_to_launch_list.size()); + + // Find `browser` window's app restore data. + auto iter = app_id_to_launch_list.find(extension_misc::kChromeAppId); + ASSERT_NE(iter, app_id_to_launch_list.end()); + auto app_restore_data_iter = iter->second.find(browser_window_id); + ASSERT_NE(iter->second.end(), app_restore_data_iter); + const auto& data = app_restore_data_iter->second; + // Verify window info are correctly captured. + EXPECT_EQ(browser_bounds, data->current_bounds.value()); + // `visible_on_all_workspaces` should have been reset even though + // the captured window is visible on all workspaces. + EXPECT_FALSE(data->desk_id.has_value()); + auto* screen = display::Screen::GetScreen(); + EXPECT_EQ(screen->GetDisplayNearestWindow(window).id(), + data->display_id.value()); + EXPECT_EQ(window->GetProperty(aura::client::kShowStateKey), + chromeos::ToWindowShowState(data->window_state_type.value())); + // We don't capture the window's desk_id as a template will always + // create in a new desk. + EXPECT_FALSE(data->desk_id.has_value()); + + // Find Setting app's app restore data. + auto iter2 = app_id_to_launch_list.find(settings_app_id); + ASSERT_NE(app_id_to_launch_list.end(), iter2); + auto app_restore_data_iter2 = iter2->second.find(settings_window_id); + ASSERT_NE(iter->second.end(), app_restore_data_iter2); + const auto& data2 = app_restore_data_iter2->second; + EXPECT_EQ( + static_cast<int>(apps::mojom::LaunchContainer::kLaunchContainerWindow), + data2->container.value()); + EXPECT_EQ(static_cast<int>(WindowOpenDisposition::NEW_WINDOW), + data2->disposition.value()); + // Verify window info are correctly captured. + EXPECT_EQ(settings_app_bounds, data2->current_bounds.value()); + EXPECT_FALSE(data2->desk_id.has_value()); + EXPECT_EQ(screen->GetDisplayNearestWindow(window).id(), + data->display_id.value()); + EXPECT_EQ(window->GetProperty(aura::client::kShowStateKey), + chromeos::ToWindowShowState(data->window_state_type.value())); + EXPECT_EQ(window->GetProperty(aura::client::kShowStateKey), + chromeos::ToWindowShowState(data->window_state_type.value())); + EXPECT_FALSE(data2->desk_id.has_value()); +} + +// Tests that launching a template that contains a chrome app works as expected. +IN_PROC_BROWSER_TEST_F(DesksTemplatesClientTest, + NativeUILaunchTemplateWithChromeApp) { + // Create a chrome app. + const extensions::Extension* extension = + LoadAndLaunchPlatformApp("launch", "Launched"); + ASSERT_TRUE(extension); + + const std::string extension_id = extension->id(); + ::full_restore::SaveAppLaunchInfo( + profile()->GetPath(), + std::make_unique<app_restore::AppLaunchInfo>( + extension_id, apps::mojom::LaunchContainer::kLaunchContainerWindow, + WindowOpenDisposition::NEW_WINDOW, display::kDefaultDisplayId, + std::vector<base::FilePath>{}, nullptr)); + + extensions::AppWindow* app_window = CreateAppWindow(profile(), extension); + ASSERT_TRUE(app_window); + ASSERT_TRUE(GetFirstAppWindowForApp(extension_id)); + + // Enter overview and save the current desk as a template. + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + + ClickSaveDeskAsTemplateButton(); + + // Close the chrome app window. We'll need to verify if it reopens later. + views::Widget* app_widget = + views::Widget::GetWidgetForNativeWindow(app_window->GetNativeWindow()); + app_widget->CloseNow(); + ASSERT_FALSE(GetFirstAppWindowForApp(extension_id)); + + ash::DesksController* desks_controller = ash::DesksController::Get(); + ASSERT_EQ(0, desks_controller->GetActiveDeskIndex()); + + // `BrowserAppLauncher::LaunchAppWithParams()` does not launch the chrome app + // in tests, so here we set up a mock app launch handler and just verify a + // `LaunchSystemWebAppOrChromeApp()` call with the associated extension is + // seen. + auto mock_app_launch_handler = + std::make_unique<MockDesksTemplatesAppLaunchHandler>(profile()); + MockDesksTemplatesAppLaunchHandler* mock_app_launch_handler_ptr = + mock_app_launch_handler.get(); + ScopedDesksTemplatesAppLaunchHandlerSetter scoped_launch_handler( + std::move(mock_app_launch_handler)); + + EXPECT_CALL(*mock_app_launch_handler_ptr, + LaunchSystemWebAppOrChromeApp(_, extension_id, _)); + + // Launch the template we saved. + ClickFirstTemplateItem(); +} + +// Tests that the windows and tabs count histogram is recorded properly. +IN_PROC_BROWSER_TEST_F(DesksTemplatesClientTest, + NativeUIDeskTemplateWindowAndTabCountHistogram) { + base::HistogramTester histogram_tester; + + // Create the settings app, which is a system web app. + CreateSettingsSystemWebApp(browser()->profile()); + + CreateBrowser({GURL(kExampleUrl1), GURL(kExampleUrl2)}); + CreateBrowser({GURL(kExampleUrl1), GURL(kExampleUrl2), GURL(kExampleUrl3)}); + + // Save a template. + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + ClickSaveDeskAsTemplateButton(); + + constexpr char kWindowCountHistogramName[] = "Ash.DeskTemplate.WindowCount"; + constexpr char kTabCountHistogramName[] = "Ash.DeskTemplate.TabCount"; + constexpr char kWindowAndTabCountHistogramName[] = + "Ash.DeskTemplate.WindowAndTabCount"; + // NOTE: there is an existing browser with 1 tab created by BrowserMain(). + histogram_tester.ExpectBucketCount(kWindowCountHistogramName, 4, 1); + histogram_tester.ExpectBucketCount(kTabCountHistogramName, 6, 1); + histogram_tester.ExpectBucketCount(kWindowAndTabCountHistogramName, 7, 1); +} + +// Tests that the template count histogram is recorded properly. +IN_PROC_BROWSER_TEST_F(DesksTemplatesClientTest, + NativeUIDeskTemplateUserTemplateCountHistogram) { + base::HistogramTester histogram_tester; + + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + + // Save 3 templates. + const int saves = 3; + for (int i = 0; i < saves; i++) { + ClickSaveDeskAsTemplateButton(); + + // Exit and renenter overview to save the next template. Once we are viewing + // the grid we can't go back to regular overview unless we exit overview or + // delete all the templates. + if (i != saves - 1) { + ash::ToggleOverview(); + ash::WaitForOverviewExitAnimation(); + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + } + } + + views::Button* delete_button = ash::GetTemplateItemDeleteButton(/*index=*/0); + ClickButton(delete_button); + + // Confirm deleting a template. Use a key press to accept the dialog instead + // of a click as dialog buttons think a click generated by the event generator + // is an accidentally click and therefore ignores it. + views::Button* dialog_accept_button = + ash::GetDesksTemplatesDialogAcceptButton(); + ASSERT_TRUE(dialog_accept_button); + aura::Window* root_window = + dialog_accept_button->GetWidget()->GetNativeWindow()->GetRootWindow(); + ui::test::EventGenerator event_generator(root_window); + event_generator.PressAndReleaseKey(ui::VKEY_RETURN); + + // Wait for the model to update. + ash::WaitForDesksTemplatesUI(); + + // Save one more template. + ash::ToggleOverview(); + ash::WaitForOverviewExitAnimation(); + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + ClickSaveDeskAsTemplateButton(); + + // Verify that all template saves and deletes are captured by the histogram. + constexpr char kUserTemplateCountHistogramName[] = + "Ash.DeskTemplate.UserTemplateCount"; + histogram_tester.ExpectBucketCount(kUserTemplateCountHistogramName, 1, 1); + histogram_tester.ExpectBucketCount(kUserTemplateCountHistogramName, 2, 2); + histogram_tester.ExpectBucketCount(kUserTemplateCountHistogramName, 3, 2); +} + +// Tests that browser session restore isn't triggered when we launch a template +// that contains a browser window. +IN_PROC_BROWSER_TEST_F(DesksTemplatesClientTest, + NativeUIPreventBrowserSessionRestoreTest) { + // Do not exit from test or delete the Profile* when last browser is closed. + ScopedKeepAlive keep_alive(KeepAliveOrigin::BROWSER, + KeepAliveRestartOption::DISABLED); + ScopedProfileKeepAlive profile_keep_alive( + browser()->profile(), ProfileKeepAliveOrigin::kBrowserWindow); + + // Enable session service. + SessionStartupPref pref(SessionStartupPref::LAST); + Profile* profile = browser()->profile(); + SessionStartupPref::SetStartupPref(profile, pref); + + const int expected_tab_count = 2; + chrome::AddTabAt(browser(), GURL(kExampleUrl2), /*index=*/-1, + /*foreground=*/true); + EXPECT_EQ(expected_tab_count, browser()->tab_strip_model()->count()); + const int32_t browser_window_id = + browser()->window()->GetNativeWindow()->GetProperty( + app_restore::kWindowIdKey); + + // Enter overview and save the current desk as a template. + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + + ClickSaveDeskAsTemplateButton(); + + // Exit overview, close the browser and verify that all browser windows are + // closed. + ash::ToggleOverview(); + ash::WaitForOverviewExitAnimation(); + CloseBrowserSynchronously(browser()); + EXPECT_EQ(0u, chrome::GetTotalBrowserCount()); + + // Reenter overview and launch the template we saved. + ash::ToggleOverview(); + ash::WaitForOverviewEnterAnimation(); + ash::WaitForDesksTemplatesUI(); + ClickZeroStateTemplatesButton(); + ClickFirstTemplateItem(); + + // Verify that the browser was launched with the correct number of tabs, and + // that browser session restore did not restore any windows/tabs. + Browser* new_browser = FindBrowser(browser_window_id); + ASSERT_TRUE(new_browser); + EXPECT_EQ(expected_tab_count, GetURLsForBrowserWindow(new_browser).size()); + EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); +} + class DesksTemplatesClientArcTest : public InProcessBrowserTest { public: DesksTemplatesClientArcTest() { @@ -1321,12 +1917,8 @@ // template. ash::ToggleOverview(); ash::WaitForOverviewEnterAnimation(); - views::Button* zero_state_templates_button = - ash::GetZeroStateDesksTemplatesButton(); - ASSERT_TRUE(zero_state_templates_button); - ClickButton(zero_state_templates_button); - ash::WaitForDesksTemplatesUI(); + ClickZeroStateTemplatesButton(); ClickFirstTemplateItem(); ash::ToggleOverview(); @@ -1348,14 +1940,9 @@ arc_helper()->StopInstance(); } -// TODO(crbug.com/1273532): Add more tests: -// - Deleting templates. -// - Launching templates with uninstalled apps. -// - Launching ARC apps which already have an instance open. -// - Test for spoken feedback. -// - Port tests that use `DesksTemplatesClient` directly. These were meant to -// test launching while the prototype extension was being built, but now we -// can do end to end tests with the native UI. +// TODO(crbug.com/1273532): Port over LaunchMultipleDeskTemplates and +// DeskTemplateLaunchFromTemplateHistogram to use the native UI to do template +// operations. class DesksTemplatesClientMultiProfileTest : public ash::LoginManagerTest { public: @@ -1396,25 +1983,35 @@ const app_restore::RestoreData* restore_data = desk_template->desk_restore_data(); const auto& app_id_to_launch_list = restore_data->app_id_to_launch_list(); - EXPECT_EQ(app_id_to_launch_list.size(), 1u); + EXPECT_EQ(1u, app_id_to_launch_list.size()); - auto get_templates_size = []() { - base::RunLoop run_loop; - int templates_num = 0; - DesksTemplatesClient::Get()->GetDeskTemplates(base::BindLambdaForTesting( - [&](const std::vector<ash::DeskTemplate*>& desk_templates, - std::string error_string) { - templates_num = desk_templates.size(); - run_loop.Quit(); - })); - run_loop.Run(); - return templates_num; - }; - EXPECT_EQ(get_templates_size(), 1); + EXPECT_EQ(1u, GetDeskTemplates().size()); // Now switch to |account_id2_|. Test that the captured desk template can't // be accessed from |account_id2_|. ash::UserAddingScreen::Get()->Start(); AddUser(account_id2_); - EXPECT_EQ(get_templates_size(), 0); + EXPECT_EQ(0u, GetDeskTemplates().size()); +} + +// Tests that admin templates policy can be set. +IN_PROC_BROWSER_TEST_F(DesksTemplatesClientMultiProfileTest, + SetAndClearAdminTemplates) { + EXPECT_TRUE(DesksTemplatesClient::Get()); + + // Set an admin template policy. + DesksTemplatesClient::Get()->SetPolicyPreconfiguredTemplate( + account_id1_, std::make_unique<std::string>(base::StringPrintf( + kTestAdminTemplateFormat, kTestAdminTemplateUuid))); + + // Verify that the admin templates is present. + EXPECT_TRUE( + ContainUuidInTemplates(kTestAdminTemplateUuid, GetDeskTemplates())); + + // Clear admin templates. + DesksTemplatesClient::Get()->RemovePolicyPreconfiguredTemplate(account_id1_); + + // Verify that the admin templates is removed. + EXPECT_FALSE( + ContainUuidInTemplates(kTestAdminTemplateUuid, GetDeskTemplates())); }
diff --git a/chrome/browser/ui/ash/system_tray_client_impl.cc b/chrome/browser/ui/ash/system_tray_client_impl.cc index 5b5ea95..f39b4a0c 100644 --- a/chrome/browser/ui/ash/system_tray_client_impl.cc +++ b/chrome/browser/ui/ash/system_tray_client_impl.cc
@@ -575,6 +575,10 @@ chromeos::multidevice_setup::MultiDeviceSetupDialog::Show(); } +void SystemTrayClientImpl::ShowFirmwareUpdate() { + chrome::ShowFirmwareUpdatesApp(ProfileManager::GetActiveUserProfile()); +} + void SystemTrayClientImpl::RequestRestartForUpdate() { browser_shutdown::NotifyAndTerminate(/*fast_path=*/true); }
diff --git a/chrome/browser/ui/ash/system_tray_client_impl.h b/chrome/browser/ui/ash/system_tray_client_impl.h index fdc04fa..bc9c03a 100644 --- a/chrome/browser/ui/ash/system_tray_client_impl.h +++ b/chrome/browser/ui/ash/system_tray_client_impl.h
@@ -93,6 +93,7 @@ void ShowArcVpnCreate(const std::string& app_id) override; void ShowNetworkSettings(const std::string& network_id) override; void ShowMultiDeviceSetup() override; + void ShowFirmwareUpdate() override; void RequestRestartForUpdate() override; void SetLocaleAndExit(const std::string& locale_iso_code) override; void ShowAccessCodeCastingDialog() override;
diff --git a/chrome/browser/ui/browser_window_state.cc b/chrome/browser/ui/browser_window_state.cc index 09bdf9d..29c16d2 100644 --- a/chrome/browser/ui/browser_window_state.cc +++ b/chrome/browser/ui/browser_window_state.cc
@@ -48,11 +48,11 @@ return true; } -class WindowPlacementPrefUpdate : public DictionaryPrefUpdateDeprecated { +class WindowPlacementPrefUpdate : public DictionaryPrefUpdate { public: WindowPlacementPrefUpdate(PrefService* service, const std::string& window_name) - : DictionaryPrefUpdateDeprecated(service, prefs::kAppWindowPlacement), + : DictionaryPrefUpdate(service, prefs::kAppWindowPlacement), window_name_(window_name) {} WindowPlacementPrefUpdate(const WindowPlacementPrefUpdate&) = delete; @@ -61,16 +61,14 @@ ~WindowPlacementPrefUpdate() override {} - base::DictionaryValue* Get() override { - base::DictionaryValue* all_apps_dict = - DictionaryPrefUpdateDeprecated::Get(); - base::DictionaryValue* this_app_dict_weak = nullptr; - if (!all_apps_dict->GetDictionary(window_name_, &this_app_dict_weak)) { - auto this_app_dict = std::make_unique<base::DictionaryValue>(); - this_app_dict_weak = this_app_dict.get(); - all_apps_dict->Set(window_name_, std::move(this_app_dict)); + base::Value* Get() override { + base::Value* all_apps_dict = DictionaryPrefUpdate::Get(); + base::Value* this_app_dict = all_apps_dict->FindDictPath(window_name_); + if (!this_app_dict) { + this_app_dict = all_apps_dict->SetPath( + window_name_, base::Value(base::Value::Type::DICTIONARY)); } - return this_app_dict_weak; + return this_app_dict; } private: @@ -96,32 +94,29 @@ } } -std::unique_ptr<DictionaryPrefUpdateDeprecated> -GetWindowPlacementDictionaryReadWrite(const std::string& window_name, - PrefService* prefs) { +std::unique_ptr<DictionaryPrefUpdate> GetWindowPlacementDictionaryReadWrite( + const std::string& window_name, + PrefService* prefs) { DCHECK(!window_name.empty()); - // A normal DictionaryPrefUpdateDeprecated will suffice for non-app windows. + // A normal DictionaryPrefUpdate will suffice for non-app windows. if (prefs->FindPreference(window_name)) { - return std::make_unique<DictionaryPrefUpdateDeprecated>(prefs, window_name); + return std::make_unique<DictionaryPrefUpdate>(prefs, window_name); } - return std::unique_ptr<DictionaryPrefUpdateDeprecated>( - new WindowPlacementPrefUpdate(prefs, window_name)); + return std::make_unique<WindowPlacementPrefUpdate>(prefs, window_name); } -const base::DictionaryValue* GetWindowPlacementDictionaryReadOnly( +const base::Value* GetWindowPlacementDictionaryReadOnly( const std::string& window_name, PrefService* prefs) { DCHECK(!window_name.empty()); if (prefs->FindPreference(window_name)) - return &base::Value::AsDictionaryValue(*prefs->GetDictionary(window_name)); + return prefs->GetDictionary(window_name); - const base::DictionaryValue* app_windows = &base::Value::AsDictionaryValue( - *prefs->GetDictionary(prefs::kAppWindowPlacement)); + const base::Value* app_windows = + prefs->GetDictionary(prefs::kAppWindowPlacement); if (!app_windows) return nullptr; - const base::DictionaryValue* to_return = nullptr; - app_windows->GetDictionary(window_name, &to_return); - return to_return; + return app_windows->FindDictKey(window_name); } bool ShouldSaveWindowPlacement(const Browser* browser) {
diff --git a/chrome/browser/ui/browser_window_state.h b/chrome/browser/ui/browser_window_state.h index 8ec84a1..e6f9396 100644 --- a/chrome/browser/ui/browser_window_state.h +++ b/chrome/browser/ui/browser_window_state.h
@@ -15,7 +15,7 @@ namespace base { class CommandLine; -class DictionaryValue; +class Value; } // namespace base namespace gfx { @@ -31,12 +31,12 @@ // of the window that is stored in the given PrefService. If the window_name // isn't the name of a registered preference it is assumed to be the name of an // app and the AppWindowPlacement key is used to find the app's dictionary. -std::unique_ptr<DictionaryPrefUpdateDeprecated> -GetWindowPlacementDictionaryReadWrite(const std::string& window_name, - PrefService* prefs); +std::unique_ptr<DictionaryPrefUpdate> GetWindowPlacementDictionaryReadWrite( + const std::string& window_name, + PrefService* prefs); // Returns NULL if the window corresponds to an app that doesn't have placement // information stored in the preferences system. -const base::DictionaryValue* GetWindowPlacementDictionaryReadOnly( +const base::Value* GetWindowPlacementDictionaryReadOnly( const std::string& window_name, PrefService* prefs);
diff --git a/chrome/browser/ui/cocoa/applescript/scripting.sdef b/chrome/browser/ui/cocoa/applescript/scripting.sdef index 88ce33d..5a9e19e5 100644 --- a/chrome/browser/ui/cocoa/applescript/scripting.sdef +++ b/chrome/browser/ui/cocoa/applescript/scripting.sdef
@@ -270,7 +270,7 @@ <cocoa key="uniqueID"/> </property> <property name="title" code="pnam" description="The title of the folder." type="text"/> - <property name="parent index" code="Pidx" description="Returns the index with respect to its parent bookmark folder" type="number" access="r"> + <property name="index" code="pidx" description="Returns the index with respect to its parent bookmark folder." type="number" access="r"> <cocoa key="index"/> </property> </class> @@ -282,7 +282,7 @@ </property> <property name="title" code="pnam" description="The title of the bookmark item." type="text"/> <property name="URL" code="URL " description="The URL of the bookmark." type="text"/> - <property name="parent index" code="Pidx" description="Returns the index with respect to its parent bookmark folder" type="number" access="r"> + <property name="index" code="pidx" description="Returns the index with respect to its parent bookmark folder." type="number" access="r"> <cocoa key="index"/> </property> </class>
diff --git a/chrome/browser/ui/media_router/cast_dialog_controller.h b/chrome/browser/ui/media_router/cast_dialog_controller.h index 270d60a..adb1068 100644 --- a/chrome/browser/ui/media_router/cast_dialog_controller.h +++ b/chrome/browser/ui/media_router/cast_dialog_controller.h
@@ -11,6 +11,10 @@ #include "components/media_router/common/media_route.h" #include "components/media_router/common/media_sink.h" +namespace content { +class WebContents; +} + namespace media_router { class CastDialogModel; @@ -47,6 +51,9 @@ // Removes the specified issue. No-op if the ID is invalid. virtual void ClearIssue(const Issue::Id& issue_id) = 0; + + // Gets the tab contents (if any) that was used to initiate this dialog box. + virtual content::WebContents* GetInitiator() = 0; }; } // namespace media_router
diff --git a/chrome/browser/ui/media_router/media_router_ui.cc b/chrome/browser/ui/media_router/media_router_ui.cc index 8bb7fae..2849132 100644 --- a/chrome/browser/ui/media_router/media_router_ui.cc +++ b/chrome/browser/ui/media_router/media_router_ui.cc
@@ -177,6 +177,10 @@ RemoveIssue(issue_id); } +content::WebContents* MediaRouterUI::GetInitiator() { + return initiator(); +} + void MediaRouterUI::InitWithDefaultMediaSource() { DCHECK(!query_result_manager_); InitCommon();
diff --git a/chrome/browser/ui/media_router/media_router_ui.h b/chrome/browser/ui/media_router/media_router_ui.h index 1e78d49..b8dd5a30 100644 --- a/chrome/browser/ui/media_router/media_router_ui.h +++ b/chrome/browser/ui/media_router/media_router_ui.h
@@ -70,6 +70,7 @@ MediaCastMode cast_mode) override; void StopCasting(const std::string& route_id) override; void ClearIssue(const Issue::Id& issue_id) override; + content::WebContents* GetInitiator() override; // Initializes internal state (e.g. starts listening for MediaSinks) for // targeting the default MediaSource (if any) of |initiator_|. The contents of
diff --git a/chrome/browser/ui/messages/android/BUILD.gn b/chrome/browser/ui/messages/android/BUILD.gn index 7c85925..76e54b1 100644 --- a/chrome/browser/ui/messages/android/BUILD.gn +++ b/chrome/browser/ui/messages/android/BUILD.gn
@@ -5,10 +5,8 @@ android_resources("java_resources") { sources = [ - "java/res/drawable-v24/snackbar_background_tablet.xml", "java/res/drawable/snackbar_background_tablet.xml", "java/res/layout/snackbar.xml", - "java/res/values-night/dimens.xml", "java/res/values/dimens.xml", ] @@ -35,7 +33,6 @@ ":java_resources", "//base:base_java", "//chrome/browser/util:java", - "//components/browser_ui/styles/android:java", "//components/browser_ui/styles/android:java_resources", "//components/browser_ui/widget/android:java", "//components/infobars/android:infobar_android_enums_java",
diff --git a/chrome/browser/ui/messages/android/java/res/drawable-v24/snackbar_background_tablet.xml b/chrome/browser/ui/messages/android/java/res/drawable-v24/snackbar_background_tablet.xml deleted file mode 100644 index 4ec3b1d..0000000 --- a/chrome/browser/ui/messages/android/java/res/drawable-v24/snackbar_background_tablet.xml +++ /dev/null
@@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2022 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. --> - -<org.chromium.components.browser_ui.widget.SurfaceColorDrawable - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:shape="rectangle" - app:surfaceElevation="@dimen/snackbar_background_tablet_elev"> - <corners - android:topLeftRadius="2dp" - android:topRightRadius="2dp"/> -</org.chromium.components.browser_ui.widget.SurfaceColorDrawable>
diff --git a/chrome/browser/ui/messages/android/java/res/drawable/snackbar_background_tablet.xml b/chrome/browser/ui/messages/android/java/res/drawable/snackbar_background_tablet.xml index d91bd9e..9a9d937 100644 --- a/chrome/browser/ui/messages/android/java/res/drawable/snackbar_background_tablet.xml +++ b/chrome/browser/ui/messages/android/java/res/drawable/snackbar_background_tablet.xml
@@ -6,10 +6,10 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > - <solid android:color="@color/snackbar_background_color_baseline" /> + <solid android:color="@color/snackbar_background_color" /> <corners - android:topLeftRadius="2dp" - android:topRightRadius="2dp"/> + android:topLeftRadius="2dip" + android:topRightRadius="2dip"/> </shape>
diff --git a/chrome/browser/ui/messages/android/java/res/values-night/dimens.xml b/chrome/browser/ui/messages/android/java/res/values-night/dimens.xml deleted file mode 100644 index 3f24764..0000000 --- a/chrome/browser/ui/messages/android/java/res/values-night/dimens.xml +++ /dev/null
@@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2022 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. --> - -<resources xmlns:tools="http://schemas.android.com/tools"> - <!-- Snackbars --> - <dimen name="snackbar_background_tablet_elev">@dimen/default_elevation_4</dimen> -</resources>
diff --git a/chrome/browser/ui/messages/android/java/res/values/dimens.xml b/chrome/browser/ui/messages/android/java/res/values/dimens.xml index d74eba9..29ad6b0 100644 --- a/chrome/browser/ui/messages/android/java/res/values/dimens.xml +++ b/chrome/browser/ui/messages/android/java/res/values/dimens.xml
@@ -10,5 +10,4 @@ <dimen name="snackbar_margin_tablet">24dp</dimen> <dimen name="snackbar_shadow_height">8dp</dimen> <dimen name="snackbar_text_view_margin">24dp</dimen> - <dimen name="snackbar_background_tablet_elev">@dimen/default_elevation_0</dimen> </resources>
diff --git a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java index 31d1fe4..d01675c 100644 --- a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java +++ b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java
@@ -29,7 +29,6 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.chrome.ui.messages.R; -import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.components.browser_ui.widget.animation.Interpolators; import org.chromium.components.browser_ui.widget.text.TemplatePreservingTextView; import org.chromium.ui.base.DeviceFormFactor; @@ -263,7 +262,8 @@ return snackbar.getBackgroundColor(); } - return SemanticColorUtils.getSnackbarBackgroundColor(view.getContext()); + return ApiCompatibilityUtils.getColor( + view.getResources(), R.color.snackbar_background_color); } private static int getTextAppearance(Snackbar snackbar) {
diff --git a/chrome/browser/ui/tabs/pinned_tab_codec.cc b/chrome/browser/ui/tabs/pinned_tab_codec.cc index 1797912..074a15d 100644 --- a/chrome/browser/ui/tabs/pinned_tab_codec.cc +++ b/chrome/browser/ui/tabs/pinned_tab_codec.cc
@@ -87,7 +87,7 @@ if (!prefs) return; - ListPrefUpdateDeprecated update(prefs, prefs::kPinnedTabs); + ListPrefUpdate update(prefs, prefs::kPinnedTabs); base::Value* values = update.Get(); values->ClearList(); for (const auto& tab : tabs)
diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc index 28ef9445..68e6dcf 100644 --- a/chrome/browser/ui/views/chrome_views_delegate.cc +++ b/chrome/browser/ui/views/chrome_views_delegate.cc
@@ -88,7 +88,7 @@ if (!prefs) return; - std::unique_ptr<DictionaryPrefUpdateDeprecated> pref_update = + std::unique_ptr<DictionaryPrefUpdate> pref_update = chrome::GetWindowPlacementDictionaryReadWrite(window_name, prefs); base::Value* window_preferences = pref_update->Get(); window_preferences->SetIntKey("left", bounds.x());
diff --git a/chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view_unittest.cc b/chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view_unittest.cc index 13ef135..431e094 100644 --- a/chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view_unittest.cc +++ b/chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view_unittest.cc
@@ -141,6 +141,7 @@ media_router::MediaCastMode cast_mode)); MOCK_METHOD1(StopCasting, void(const std::string& route_id)); MOCK_METHOD1(ClearIssue, void(const media_router::Issue::Id& issue_id)); + MOCK_METHOD0(GetInitiator, content::WebContents*()); }; } // anonymous namespace
diff --git a/chrome/browser/ui/views/media_router/cast_dialog_view.cc b/chrome/browser/ui/views/media_router/cast_dialog_view.cc index f73d4e26..1ebd9b1 100644 --- a/chrome/browser/ui/views/media_router/cast_dialog_view.cc +++ b/chrome/browser/ui/views/media_router/cast_dialog_view.cc
@@ -260,18 +260,23 @@ } void CastDialogView::ShowAccessCodeCastDialog() { - MediaCastMode preferred_cast_mode; + if (!controller_) + return; - // Select the preferred cast mode based on the current selected source. + CastModeSet cast_mode_set; switch (selected_source_) { case SourceType::kTab: - preferred_cast_mode = MediaCastMode::PRESENTATION; + cast_mode_set = {MediaCastMode::PRESENTATION, MediaCastMode::TAB_MIRROR}; break; case SourceType::kDesktop: - preferred_cast_mode = MediaCastMode::DESKTOP_MIRROR; + cast_mode_set = {MediaCastMode::DESKTOP_MIRROR}; + break; + default: + NOTREACHED(); break; } - AccessCodeCastDialog::Show(preferred_cast_mode); + + AccessCodeCastDialog::Show(cast_mode_set, controller_->GetInitiator()); } void CastDialogView::MaybeShowAccessCodeCastButton() {
diff --git a/chrome/browser/ui/views/media_router/cast_dialog_view_browsertest.cc b/chrome/browser/ui/views/media_router/cast_dialog_view_browsertest.cc index 4e4062e9..be66d19 100644 --- a/chrome/browser/ui/views/media_router/cast_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/media_router/cast_dialog_view_browsertest.cc
@@ -63,6 +63,7 @@ media_router::MediaCastMode cast_mode) override {} void StopCasting(const media_router::MediaRoute::Id& route_id) override {} void ClearIssue(const media_router::Issue::Id& issue_id) override {} + content::WebContents* GetInitiator() override { return nullptr; } }; } // namespace
diff --git a/chrome/browser/ui/views/media_router/cast_dialog_view_unittest.cc b/chrome/browser/ui/views/media_router/cast_dialog_view_unittest.cc index 4befba9..5911b852 100644 --- a/chrome/browser/ui/views/media_router/cast_dialog_view_unittest.cc +++ b/chrome/browser/ui/views/media_router/cast_dialog_view_unittest.cc
@@ -87,6 +87,7 @@ void(const std::string& sink_id, MediaCastMode cast_mode)); MOCK_METHOD1(StopCasting, void(const std::string& route_id)); MOCK_METHOD1(ClearIssue, void(const Issue::Id& issue_id)); + MOCK_METHOD0(GetInitiator, content::WebContents*()); }; class CastDialogViewTest : public ChromeViewsTestBase {
diff --git a/chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc b/chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc index 471d2733..3defeb7 100644 --- a/chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc +++ b/chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc
@@ -272,8 +272,8 @@ void InlineLoginUIBrowserTest::AddEmailToOneClickRejectedList( const std::string& email) { PrefService* pref_service = browser()->profile()->GetPrefs(); - ListPrefUpdateDeprecated updater(pref_service, - prefs::kReverseAutologinRejectedEmailList); + ListPrefUpdate updater(pref_service, + prefs::kReverseAutologinRejectedEmailList); if (!base::Contains(updater->GetList(), base::Value(email))) updater->Append(email); }
diff --git a/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.cc b/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.cc index 5955b976..955036c 100644 --- a/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.cc +++ b/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.cc
@@ -24,10 +24,16 @@ AccessCodeCastHandler::AccessCodeCastHandler( mojo::PendingReceiver<access_code_cast::mojom::PageHandler> page_handler, mojo::PendingRemote<access_code_cast::mojom::Page> page, - Profile* profile) + Profile* profile, + MediaRouter* media_router, + const media_router::CastModeSet& cast_mode_set, + content::WebContents* web_contents) : AccessCodeCastHandler(std::move(page_handler), std::move(page), profile, + media_router, + cast_mode_set, + web_contents, media_router::DualMediaSinkService::GetInstance() ->GetCastMediaSinkServiceImpl()) { DCHECK(profile_); @@ -37,10 +43,16 @@ mojo::PendingReceiver<access_code_cast::mojom::PageHandler> page_handler, mojo::PendingRemote<access_code_cast::mojom::Page> page, Profile* profile, + MediaRouter* media_router, + const media_router::CastModeSet& cast_mode_set, + content::WebContents* web_contents, CastMediaSinkServiceImpl* cast_media_sink_service_impl) : page_(std::move(page)), receiver_(this, std::move(page_handler)), profile_(profile), + media_router_(media_router), + cast_mode_set_(cast_mode_set), + web_contents_(web_contents), cast_media_sink_service_impl_(cast_media_sink_service_impl) { DCHECK(profile_); }
diff --git a/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.h b/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.h index b2262a4..e0cda36 100644 --- a/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.h +++ b/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.h
@@ -11,6 +11,7 @@ #include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h" #include "chrome/browser/media/router/discovery/mdns/media_sink_util.h" #include "chrome/browser/ui/app_list/search/search_controller.h" +#include "chrome/browser/ui/media_router/media_cast_mode.h" #include "chrome/browser/ui/webui/access_code_cast/access_code_cast.mojom.h" #include "components/media_router/common/discovery/media_sink_internal.h" #include "mojo/public/cpp/bindings/pending_remote.h" @@ -21,6 +22,14 @@ using ::media_router::CreateCastMediaSinkResult; using ::media_router::MediaSinkInternal; +namespace content { +class WebContents; +} + +namespace media_router { +class MediaRouter; +} + // TODO(b/213324920): Remove WebUI from the media_router namespace after // expiration module has been completed. namespace media_router { @@ -32,13 +41,19 @@ AccessCodeCastHandler( mojo::PendingReceiver<access_code_cast::mojom::PageHandler> page_handler, mojo::PendingRemote<access_code_cast::mojom::Page> page, - Profile* profile); + Profile* profile, + media_router::MediaRouter* media_router, + const media_router::CastModeSet& cast_mode_set, + content::WebContents* web_contents); // Constructor that is used for testing. AccessCodeCastHandler( mojo::PendingReceiver<access_code_cast::mojom::PageHandler> page_handler, mojo::PendingRemote<access_code_cast::mojom::Page> page, Profile* profile, + media_router::MediaRouter* media_router, + const media_router::CastModeSet& cast_mode_set, + content::WebContents* web_contents, CastMediaSinkServiceImpl* cast_media_sink_service_impl); ~AccessCodeCastHandler() override; @@ -83,6 +98,10 @@ // Used to fetch OAuth2 access tokens. raw_ptr<Profile> const profile_; + const raw_ptr<media_router::MediaRouter> media_router_; + const media_router::CastModeSet cast_mode_set_; + const raw_ptr<content::WebContents> web_contents_; + AddSinkCallback add_sink_callback_; raw_ptr<CastMediaSinkServiceImpl> const cast_media_sink_service_impl_;
diff --git a/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_unittest.cc b/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_unittest.cc index 5de2e3f..9b56d03 100644 --- a/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_unittest.cc +++ b/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_unittest.cc
@@ -17,12 +17,15 @@ #include "chrome/browser/media/router/providers/cast/dual_media_sink_service.h" #include "chrome/browser/media/router/test/provider_test_helpers.h" #include "chrome/browser/search_engines/template_url_service_factory.h" +#include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" #include "components/cast_channel/cast_socket.h" #include "components/cast_channel/cast_socket_service.h" #include "components/cast_channel/cast_test_util.h" +#include "components/media_router/browser/media_router_factory.h" +#include "components/media_router/browser/test/mock_media_router.h" #include "components/media_router/common/test/test_helper.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" @@ -55,7 +58,7 @@ } // namespace -class AccessCodeCastHandlerTest : public testing::Test { +class AccessCodeCastHandlerTest : public ChromeRenderViewHostTestHarness { protected: AccessCodeCastHandlerTest() : mock_time_task_runner_(new base::TestMockTimeTaskRunner()), @@ -66,7 +69,6 @@ new CastSessionTracker(&dual_media_sink_service_, &message_handler_, mock_cast_socket_service_->task_runner())), - profile_manager_(TestingBrowserProcess::GetGlobal()), mock_cast_media_sink_service_impl_( new MockCastMediaSinkServiceImpl(mock_sink_discovered_cb_.Get(), mock_cast_socket_service_.get(), @@ -76,24 +78,39 @@ } void SetUp() override { - ASSERT_TRUE(profile_manager_.SetUp()); + ChromeRenderViewHostTestHarness::SetUp(); + profile_manager_ = std::make_unique<TestingProfileManager>( + TestingBrowserProcess::GetGlobal()); + ASSERT_TRUE(profile_manager_->SetUp()); + router_ = static_cast<MockMediaRouter*>( + MediaRouterFactory::GetInstance()->SetTestingFactoryAndUse( + web_contents()->GetBrowserContext(), + base::BindRepeating(&MockMediaRouter::Create))); + media_router::CastModeSet cast_mode_set = { + media_router::MediaCastMode::DESKTOP_MIRROR}; handler_ = std::make_unique<AccessCodeCastHandler>( mojo::PendingReceiver<access_code_cast::mojom::PageHandler>(), page_.BindAndGetRemote(), - profile_manager()->CreateTestingProfile("foo_email"), + profile_manager()->CreateTestingProfile("foo_email"), router_, + cast_mode_set, web_contents(), mock_cast_media_sink_service_impl_.get()); } - void TearDown() override { handler_.reset(); } + void TearDown() override { + handler_.reset(); + profile_manager_->DeleteAllTestingProfiles(); + profile_manager_.reset(); + task_environment()->RunUntilIdle(); + ChromeRenderViewHostTestHarness::TearDown(); + } AccessCodeCastHandler* handler() { return handler_.get(); } - TestingProfileManager* profile_manager() { return &profile_manager_; } + TestingProfileManager* profile_manager() { return profile_manager_.get(); } private: - // Everything must be called on Chrome_UIThread. - content::BrowserTaskEnvironment task_environment_; - scoped_refptr<base::TestMockTimeTaskRunner> mock_time_task_runner_; + raw_ptr<MockMediaRouter> router_; + static std::vector<DiscoveryNetworkInfo> GetFakeNetworkInfo() { return { DiscoveryNetworkInfo{std::string("enp0s2"), std::string("ethernet1")}}; @@ -114,7 +131,7 @@ testing::NiceMock<cast_channel::MockCastMessageHandler> message_handler_; std::unique_ptr<media_router::CastSessionTracker> session_tracker_; testing::StrictMock<MockPage> page_; - TestingProfileManager profile_manager_; + std::unique_ptr<TestingProfileManager> profile_manager_; std::unique_ptr<MockCastMediaSinkServiceImpl> mock_cast_media_sink_service_impl_;
diff --git a/chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.cc b/chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.cc index a6df295e..7ea7345 100644 --- a/chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.cc +++ b/chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.cc
@@ -7,6 +7,7 @@ #include "base/containers/span.h" #include "base/json/json_writer.h" #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/media_router/media_cast_mode.h" @@ -15,7 +16,11 @@ #include "chrome/grit/access_code_cast_resources.h" #include "chrome/grit/access_code_cast_resources_map.h" #include "chrome/grit/generated_resources.h" +#include "components/media_router/browser/media_router.h" +#include "components/media_router/browser/media_router_factory.h" #include "components/strings/grit/components_strings.h" +#include "components/user_manager/user_manager.h" +#include "content/public/browser/browser_context.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui_data_source.h" #include "content/public/common/bindings_policy.h" @@ -28,19 +33,47 @@ /////////////////////////////////////////////////////////////////////////////// AccessCodeCastDialog::AccessCodeCastDialog( - media_router::MediaCastMode cast_mode) - : cast_mode_(cast_mode) { + content::BrowserContext* context, + const media_router::CastModeSet& cast_mode_set, + content::WebContents* web_contents) + : context_(context), + cast_mode_set_(cast_mode_set), + web_contents_(web_contents) { + DCHECK(context_) << "Must have a context!"; + DCHECK(!cast_mode_set_.empty()) + << "Must have at least one available casting mode!"; + DCHECK(*cast_mode_set_.begin() == + media_router::MediaCastMode::DESKTOP_MIRROR || + web_contents_) + << "Web contents must be set for non desktop-mode casting!"; set_can_resize(false); } -void AccessCodeCastDialog::Show(media_router::MediaCastMode mode) { - Profile* profile = ProfileManager::GetActiveUserProfile(); - AccessCodeCastDialog* dialog = new AccessCodeCastDialog(mode); - chrome::ShowWebDialog(nullptr, profile, dialog); +void AccessCodeCastDialog::Show(const media_router::CastModeSet& cast_mode_set, + content::WebContents* web_contents) { + AccessCodeCastDialog::Show(web_contents ? web_contents->GetMainFrame() + ->GetOutermostMainFrame() + ->GetNativeView() + : nullptr, + web_contents + ? web_contents->GetBrowserContext() + : ProfileManager::GetActiveUserProfile(), + cast_mode_set, web_contents); +} + +void AccessCodeCastDialog::Show(gfx::NativeView parent, + content::BrowserContext* context, + const media_router::CastModeSet& cast_mode_set, + content::WebContents* web_contents) { + chrome::ShowWebDialog( + parent, context, + new AccessCodeCastDialog(context, cast_mode_set, web_contents)); } ui::ModalType AccessCodeCastDialog::GetDialogModalType() const { - return ui::MODAL_TYPE_NONE; + // If there are no web_contents_, that means that the dialog was launched + // from the system tray, so therefore it shuold be a system dialog. + return web_contents_ ? ui::MODAL_TYPE_WINDOW : ui::MODAL_TYPE_SYSTEM; } std::u16string AccessCodeCastDialog::GetDialogTitle() const { @@ -63,7 +96,6 @@ std::string AccessCodeCastDialog::GetDialogArgs() const { base::DictionaryValue args; - args.SetKey("castMode", base::Value(cast_mode_)); std::string json; base::JSONWriter::Write(args, &json); return json; @@ -71,6 +103,11 @@ void AccessCodeCastDialog::OnDialogShown(content::WebUI* webui) { webui_ = webui; + AccessCodeCastUI* controller = + webui_->GetController()->GetAs<AccessCodeCastUI>(); + controller->SetCastModeSet(cast_mode_set_); + controller->SetBrowserContext(context_); + controller->SetWebContents(web_contents_); } void AccessCodeCastDialog::OnDialogClosed(const std::string& json_retval) { @@ -116,7 +153,6 @@ /////////////////////////////////////////////////////////////////////////////// // AccessCodeCast UI controller: /////////////////////////////////////////////////////////////////////////////// - AccessCodeCastUI::AccessCodeCastUI(content::WebUI* web_ui) : MojoWebDialogUI(web_ui) { auto source = base::WrapUnique( @@ -149,6 +185,19 @@ AccessCodeCastUI::~AccessCodeCastUI() = default; +void AccessCodeCastUI::SetCastModeSet( + const media_router::CastModeSet& cast_mode_set) { + cast_mode_set_ = cast_mode_set; +} + +void AccessCodeCastUI::SetBrowserContext(content::BrowserContext* context) { + context_ = context; +} + +void AccessCodeCastUI::SetWebContents(content::WebContents* web_contents) { + web_contents_ = web_contents; +} + void AccessCodeCastUI::BindInterface( mojo::PendingReceiver<access_code_cast::mojom::PageHandlerFactory> receiver) { @@ -161,8 +210,18 @@ mojo::PendingReceiver<access_code_cast::mojom::PageHandler> receiver) { DCHECK(page); + // We only get a MediaRouter if the browser context is present. This is to + // prevent our js unit tests from failing. + media_router::MediaRouter* router = + context_ + ? media_router::MediaRouterFactory::GetApiForBrowserContext(context_) + : nullptr; + page_handler_ = std::make_unique<AccessCodeCastHandler>( - std::move(receiver), std::move(page), Profile::FromWebUI(web_ui())); + std::move(receiver), std::move(page), + context_ ? Profile::FromBrowserContext(context_) + : Profile::FromWebUI(web_ui()), + router, cast_mode_set_, web_contents_); } WEB_UI_CONTROLLER_TYPE_IMPL(AccessCodeCastUI)
diff --git a/chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h b/chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h index 7318d8f..e282669a 100644 --- a/chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h +++ b/chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h
@@ -12,18 +12,27 @@ #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" +#include "ui/gfx/native_widget_types.h" #include "ui/web_dialogs/web_dialog_delegate.h" #include "ui/web_dialogs/web_dialog_ui.h" #include "url/gurl.h" +namespace content { +class BrowserContext; +class WebContents; +} // namespace content + class AccessCodeCastDialog : public ui::WebDialogDelegate { public: - explicit AccessCodeCastDialog(media_router::MediaCastMode cast_mode); + AccessCodeCastDialog(content::BrowserContext* context, + const media_router::CastModeSet& cast_mode_set, + content::WebContents* web_contents); ~AccessCodeCastDialog() override; AccessCodeCastDialog(const AccessCodeCastDialog&) = delete; AccessCodeCastDialog& operator=(const AccessCodeCastDialog&) = delete; - static void Show(media_router::MediaCastMode mode = - media_router::MediaCastMode::DESKTOP_MIRROR); + static void Show(const media_router::CastModeSet& cast_mode_set = + {media_router::MediaCastMode::DESKTOP_MIRROR}, + content::WebContents* web_contents = nullptr); private: ui::ModalType GetDialogModalType() const override; @@ -47,8 +56,17 @@ bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host, const GURL& security_origin, blink::mojom::MediaStreamType type) override; + + static void Show(gfx::NativeView parent, + content::BrowserContext* context, + const media_router::CastModeSet& cast_mode_set, + content::WebContents* web_contents); + raw_ptr<content::WebUI> webui_ = nullptr; - media_router::MediaCastMode cast_mode_; + const raw_ptr<content::BrowserContext> context_; + // Cast modes that should be attempted. + const media_router::CastModeSet cast_mode_set_; + const raw_ptr<content::WebContents> web_contents_; }; // The WebUI controller for chrome://access-code-cast. @@ -65,6 +83,18 @@ mojo::PendingReceiver<access_code_cast::mojom::PageHandlerFactory> receiver); + // Set the set of modes that should be attempted when casting. + virtual void SetCastModeSet(const media_router::CastModeSet& cast_mode_set); + + // This is the browser context that was used to launch the media router + // dialog. This may be different than the context that was used to launch + // this dialog. + virtual void SetBrowserContext(content::BrowserContext* context); + + // The webcontents that were in focus when the media router dialog was + // launched. May be null in the case of desktop casting. + virtual void SetWebContents(content::WebContents* web_contents); + private: // access_code_cast::mojom::PageHandlerFactory: void CreatePageHandler( @@ -76,6 +106,10 @@ mojo::Receiver<access_code_cast::mojom::PageHandlerFactory> factory_receiver_{ this}; + raw_ptr<content::BrowserContext> context_ = nullptr; + media_router::CastModeSet cast_mode_set_; + raw_ptr<content::WebContents> web_contents_ = nullptr; + WEB_UI_CONTROLLER_TYPE_DECL(); };
diff --git a/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc b/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc index d89ef02..8f0ead6 100644 --- a/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc +++ b/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc
@@ -140,7 +140,13 @@ content::WebUIDataSource::Create(chrome::kChromeUIBluetoothPairingHost); AddBluetoothStrings(source); - source->AddLocalizedString("title", IDS_SETTINGS_BLUETOOTH_PAIR_DEVICE_TITLE); + if (chromeos::features::IsBluetoothRevampEnabled()) { + source->AddLocalizedString("title", IDS_BLUETOOTH_PAIRING_PAIR_NEW_DEVICES); + } else { + source->AddLocalizedString("title", + IDS_SETTINGS_BLUETOOTH_PAIR_DEVICE_TITLE); + } + webui::SetupWebUIDataSource( source, base::make_span(kBluetoothPairingDialogResources,
diff --git a/chrome/browser/ui/webui/segmentation_internals/segmentation_internals.mojom b/chrome/browser/ui/webui/segmentation_internals/segmentation_internals.mojom index ced4e99..3bdd0aef 100644 --- a/chrome/browser/ui/webui/segmentation_internals/segmentation_internals.mojom +++ b/chrome/browser/ui/webui/segmentation_internals/segmentation_internals.mojom
@@ -13,13 +13,34 @@ int32 intialization_status; }; -// Information about a segment +// Information about a segment. struct SegmentInfo { - // Target of the optimization. - string optimization_target; + // String representation of the segment ID. + string segment_name; + + // Int value of the segment ID. + int32 segment_id; // Detailed segmentation information. string segment_data; + + // Whether the segment can be executed. + bool can_execute_segment; + + // Latest result for executing the segment. + string prediction_result; +}; + +// Information about a segmentation client. +struct ClientInfo { + // Key uniquely identifies a segmentation client. + string segmentation_key; + + // Which segment is currently selected. + string selected_segment; + + // A list of segments needed by this client. + array<SegmentInfo> segment_info; }; // Used by the WebUI page to bootstrap bidirectional communication. @@ -33,6 +54,17 @@ interface PageHandler { // Gets the segmentation service status. GetServiceStatus(); + + // Executes a segment using available metrics data in the DB. + ExecuteModel(int32 segment_id); + + // Overwrites the result for the given segment identified by |segment_id|. + // This will trigger a new round of segment selection and update the existing + // result in Prefs. + OverwriteResult(int32 segment_id, float result); + + // Sets the selected segment for the client identified by |segmentation_key|. + SetSelected(string segmentation_key, int32 optimization_target); }; // Renderer-side handler for internal page to process the updates from @@ -45,8 +77,8 @@ OnServiceStatusChanged(bool is_initialized, int32 status_flag); - // Notifies the page when all segment info becomes available from the service. - // |segment_info| is an array of all segment information stored in the - // database, - OnSegmentInfoAvailable(array<SegmentInfo> segment_info); + // Notifies the page when all client info becomes available from the service. + // |client_info| is an array of all client information stored in the + // database. + OnClientInfoAvailable(array<ClientInfo> client_info); };
diff --git a/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_page_handler_impl.cc b/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_page_handler_impl.cc index cfcca43..0a9e403 100644 --- a/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_page_handler_impl.cc +++ b/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_page_handler_impl.cc
@@ -7,8 +7,12 @@ #include "base/bind.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/segmentation_platform/segmentation_platform_service_factory.h" +#include "components/optimization_guide/core/model_util.h" +#include "components/optimization_guide/core/optimization_guide_util.h" #include "components/segmentation_platform/public/segmentation_platform_service.h" +using optimization_guide::proto::OptimizationTarget; + SegmentationInternalsPageHandlerImpl::SegmentationInternalsPageHandlerImpl( mojo::PendingReceiver<segmentation_internals::mojom::PageHandler> receiver, mojo::PendingRemote<segmentation_internals::mojom::Page> page, @@ -28,9 +32,33 @@ } void SegmentationInternalsPageHandlerImpl::GetServiceStatus() { - if (service_proxy_) { - service_proxy_->GetServiceStatus(); - } + if (!service_proxy_) + return; + service_proxy_->GetServiceStatus(); +} + +void SegmentationInternalsPageHandlerImpl::ExecuteModel(int segment_id) { + if (!service_proxy_) + return; + service_proxy_->ExecuteModel(static_cast<OptimizationTarget>(segment_id)); +} + +void SegmentationInternalsPageHandlerImpl::OverwriteResult(int segment_id, + float result) { + if (!service_proxy_) + return; + service_proxy_->OverwriteResult(static_cast<OptimizationTarget>(segment_id), + result); +} + +void SegmentationInternalsPageHandlerImpl::SetSelected( + const std::string& segmentation_key, + int segment_id) { + if (!service_proxy_) + return; + + service_proxy_->SetSelectedSegment( + segmentation_key, static_cast<OptimizationTarget>(segment_id)); } void SegmentationInternalsPageHandlerImpl::OnServiceStatusChanged( @@ -39,14 +67,28 @@ page_->OnServiceStatusChanged(is_initialized, status_flag); } -void SegmentationInternalsPageHandlerImpl::OnSegmentInfoAvailable( - const std::vector<std::pair<std::string, std::string>>& segment_info) { - std::vector<segmentation_internals::mojom::SegmentInfoPtr> available_segments; - for (const auto& info : segment_info) { - auto segment_data = segmentation_internals::mojom::SegmentInfo::New(); - segment_data->optimization_target = info.first; - segment_data->segment_data = info.second; - available_segments.push_back(std::move(segment_data)); +void SegmentationInternalsPageHandlerImpl::OnClientInfoAvailable( + const std::vector<segmentation_platform::ServiceProxy::ClientInfo>& + client_info) { + std::vector<segmentation_internals::mojom::ClientInfoPtr> available_clients; + for (const auto& info : client_info) { + auto client = segmentation_internals::mojom::ClientInfo::New(); + client->segmentation_key = info.segmentation_key; + client->selected_segment = + optimization_guide::GetStringNameForOptimizationTarget( + info.selected_segment); + for (const auto& status : info.segment_status) { + auto segment_data = segmentation_internals::mojom::SegmentInfo::New(); + segment_data->segment_name = + optimization_guide::GetStringNameForOptimizationTarget( + status.segment_id); + segment_data->segment_id = status.segment_id; + segment_data->segment_data = status.segment_metadata; + segment_data->prediction_result = status.prediction_result; + segment_data->can_execute_segment = status.can_execute_segment; + client->segment_info.emplace_back(std::move(segment_data)); + } + available_clients.emplace_back(std::move(client)); } - page_->OnSegmentInfoAvailable(std::move(available_segments)); + page_->OnClientInfoAvailable(std::move(available_clients)); }
diff --git a/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_page_handler_impl.h b/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_page_handler_impl.h index 01c96c58..a9daefb0 100644 --- a/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_page_handler_impl.h +++ b/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_page_handler_impl.h
@@ -35,13 +35,17 @@ // segmentation_internals::mojom::PageHandler: void GetServiceStatus() override; + void ExecuteModel(int segment_id) override; + void OverwriteResult(int segment_id, float result) override; + void SetSelected(const std::string& segmentation_key, + int segment_id) override; private: // segmentation_platform::ServiceProxy::Observer overrides. void OnServiceStatusChanged(bool is_initialized, int status_flag) override; - void OnSegmentInfoAvailable( - const std::vector<std::pair<std::string, std::string>>& segment_info) - override; + void OnClientInfoAvailable( + const std::vector<segmentation_platform::ServiceProxy::ClientInfo>& + client_info) override; mojo::Receiver<segmentation_internals::mojom::PageHandler> receiver_; mojo::Remote<segmentation_internals::mojom::Page> page_;
diff --git a/chrome/browser/ui/webui/settings/chromeos/change_picture_handler.cc b/chrome/browser/ui/webui/settings/chromeos/change_picture_handler.cc index c397e25..8d3070c 100644 --- a/chrome/browser/ui/webui/settings/chromeos/change_picture_handler.cc +++ b/chrome/browser/ui/webui/settings/chromeos/change_picture_handler.cc
@@ -157,7 +157,7 @@ void ChangePictureHandler::SendDefaultImages() { base::DictionaryValue result; std::unique_ptr<base::ListValue> current_default_images = - default_user_image::GetCurrentImageSet(); + default_user_image::GetCurrentImageSetAsListValue(); result.SetKey( "current_default_images", base::Value::FromUniquePtrValue(std::move(current_default_images))); @@ -268,7 +268,8 @@ if (default_user_image::IsInCurrentImageSet(previous_image_index_)) { // User has image from the current set of default images. base::Value image_url( - default_user_image::GetDefaultImageUrl(previous_image_index_)); + default_user_image::GetDefaultImageUrl(previous_image_index_) + .spec()); FireWebUIListener("selected-image-changed", image_url); } else { // User has a deprecated default image, send it for preview. @@ -277,8 +278,9 @@ previous_image_format_ = user_manager::UserImage::FORMAT_UNKNOWN; base::DictionaryValue result; - result.SetStringPath("url", default_user_image::GetDefaultImageUrl( - previous_image_index_)); + result.SetStringPath( + "url", default_user_image::GetDefaultImageUrl(previous_image_index_) + .spec()); auto source_info = default_user_image::GetDefaultImageSourceInfo( previous_image_index_); if (source_info.has_value()) {
diff --git a/chrome/browser/ui/webui/settings/chromeos/change_picture_handler_unittest.cc b/chrome/browser/ui/webui/settings/chromeos/change_picture_handler_unittest.cc index 82a7324..39a97a2 100644 --- a/chrome/browser/ui/webui/settings/chromeos/change_picture_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/chromeos/change_picture_handler_unittest.cc
@@ -92,7 +92,8 @@ void SelectNewDefaultImage(int default_image_index) { base::ListValue args; - args.Append(default_user_image::GetDefaultImageUrl(default_image_index)); + args.Append( + default_user_image::GetDefaultImageUrl(default_image_index).spec()); args.Append("default"); web_ui_->HandleReceivedMessage("selectImage", &args);
diff --git a/chrome/browser/ui/webui/settings/site_settings_handler.cc b/chrome/browser/ui/webui/settings/site_settings_handler.cc index 9f1369f..c0bd9fa 100644 --- a/chrome/browser/ui/webui/settings/site_settings_handler.cc +++ b/chrome/browser/ui/webui/settings/site_settings_handler.cc
@@ -679,7 +679,28 @@ int64_t size = site->InclusiveSize(); if (size != 0) usage_string = base::UTF16ToUTF8(ui::FormatBytes(size)); - int num_cookies = site->NumberOfCookies(); + + // Usage info only includes unpartitioned cookies, so each cookie must be + // inspected. + // TODO (crbug.com/1271155): This is slow, the replacement for the + // CookiesTreeModel should improve this significantly. + int num_cookies = 0; + for (const auto& site_child : site->children()) { + if (site_child->GetDetailedInfo().node_type != + CookieTreeNode::DetailedInfo::TYPE_COOKIES) { + continue; + } + + num_cookies += base::ranges::count_if( + site_child->children(), + [](const std::unique_ptr<CookieTreeNode>& cookie) { + const auto& detailed_info = cookie->GetDetailedInfo(); + DCHECK(detailed_info.node_type == + CookieTreeNode::DetailedInfo::TYPE_COOKIE); + DCHECK(detailed_info.cookie); + return !detailed_info.cookie->IsPartitioned(); + }); + } if (num_cookies != 0) { cookie_string = base::UTF16ToUTF8(l10n_util::GetPluralStringFUTF16( IDS_SETTINGS_SITE_SETTINGS_NUM_COOKIES, num_cookies)); @@ -767,7 +788,8 @@ usage_host_ = args->GetList()[0].GetString(); update_site_details_ = true; - if (cookies_tree_model_ && !send_sites_list_) { + if (cookies_tree_model_ && !send_sites_list_ && + !tree_model_set_for_testing_) { cookies_tree_model_->RemoveCookiesTreeObserver(this); cookies_tree_model_.reset(); } @@ -1730,6 +1752,7 @@ void SiteSettingsHandler::SetCookiesTreeModelForTesting( std::unique_ptr<CookiesTreeModel> cookies_tree_model) { cookies_tree_model_ = std::move(cookies_tree_model); + tree_model_set_for_testing_ = true; } void SiteSettingsHandler::ClearAllSitesMapForTesting() {
diff --git a/chrome/browser/ui/webui/settings/site_settings_handler.h b/chrome/browser/ui/webui/settings/site_settings_handler.h index 8ecbd74..235a454 100644 --- a/chrome/browser/ui/webui/settings/site_settings_handler.h +++ b/chrome/browser/ui/webui/settings/site_settings_handler.h
@@ -140,6 +140,7 @@ FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, ExcludeWebUISchemesInLists); FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, IncludeWebUISchemesInGetOriginPermissions); + FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, HandleGetUsageInfo); // Creates the CookiesTreeModel if necessary. void EnsureCookiesTreeModelCreated(); @@ -309,6 +310,10 @@ std::unique_ptr<CookiesTreeModel> cookies_tree_model_; + // Whether the tree model was set for testing. Allows the handler to avoid + // resetting the tree model. + bool tree_model_set_for_testing_ = false; + // Whether to send all sites list on cookie tree model update. bool send_sites_list_ = false;
diff --git a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc index acc99ce..1c05a761 100644 --- a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc
@@ -426,6 +426,25 @@ ASSERT_EQ(expected_string, data.arg2()->GetString()); } + void ValidateUsageInfo(const std::string& expected_usage_host, + const std::string& expected_usage_string, + const std::string& expected_cookie_string) { + const content::TestWebUI::CallData& data = *web_ui()->call_data().back(); + EXPECT_EQ("cr.webUIListenerCallback", data.function_name()); + + ASSERT_TRUE(data.arg1()->is_string()); + EXPECT_EQ("usage-total-changed", data.arg1()->GetString()); + + ASSERT_TRUE(data.arg2()->is_string()); + EXPECT_EQ(expected_usage_host, data.arg2()->GetString()); + + ASSERT_TRUE(data.arg3()->is_string()); + EXPECT_EQ(expected_usage_string, data.arg3()->GetString()); + + ASSERT_TRUE(data.arg4()->is_string()); + EXPECT_EQ(expected_cookie_string, data.arg4()->GetString()); + } + void CreateIncognitoProfile() { incognito_profile_ = TestingProfile::Builder().BuildIncognito(profile()); } @@ -2790,4 +2809,24 @@ EXPECT_EQ(base::UTF16ToUTF8(ui::FormatBytes(int64_t(size))), data.arg3()->GetString()); } + +TEST_F(SiteSettingsHandlerTest, HandleGetUsageInfo) { + // Confirm that usage info only returns unpartitioned storage. + SetUpCookiesTreeModel(); + + EXPECT_EQ(28, handler()->cookies_tree_model_->GetRoot()->GetTotalNodeCount()); + + base::Value args(base::Value::Type::LIST); + args.Append("www.example.com"); + handler()->HandleFetchUsageTotal(&base::Value::AsListValue(args)); + handler()->OnGetUsageInfo(); + ValidateUsageInfo("www.example.com", "2 B", "1 cookie"); + + args.ClearList(); + args.Append("example.com"); + handler()->HandleFetchUsageTotal(&base::Value::AsListValue(args)); + handler()->OnGetUsageInfo(); + ValidateUsageInfo("example.com", "", "1 cookie"); +} + } // namespace settings
diff --git a/chrome/browser/usb/web_usb_service_impl_unittest.cc b/chrome/browser/usb/web_usb_service_impl_unittest.cc index 2b9587f..e4dc503 100644 --- a/chrome/browser/usb/web_usb_service_impl_unittest.cc +++ b/chrome/browser/usb/web_usb_service_impl_unittest.cc
@@ -422,7 +422,7 @@ // back/forward cache in RenderFrameHostImpl::CreateWebUsbService(), but that // path is not triggered in unit tests, so this test fails. Fix this. content::DisableBackForwardCacheForTesting( - web_contents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + web_contents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); const auto origin = url::Origin::Create(GURL(kDefaultTestUrl));
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 13368ba..e42651bb 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1642593155-94d16e3ff211c9d634f56fddefa0354e8313fc70.profdata +chrome-mac-main-1642614982-dfab581bea14f80f8c7b7e02932dd91ba2487a23.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index e06258e..8787d911 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1642604245-3a84b41787a0d28fce834ba8f50d7408f833771f.profdata +chrome-win32-main-1642614982-716801fd13a2d90c07c5161c10b98dac8b9ca9fb.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 6b355483..16a23f62 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1642604245-5b010e4723ff9db2c3baf71069785a97d79d7b0d.profdata +chrome-win64-main-1642614982-96db94ad5f3dc4f5fe8a925113fa887d1e1d307e.profdata
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index bf02522..12b2935 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -6639,6 +6639,7 @@ "../browser/ui/app_list/search/ranking/answer_ranker_unittest.cc", "../browser/ui/app_list/search/ranking/ftrl_ranker_unittest.cc", "../browser/ui/app_list/search/ranking/removed_results_ranker_unittest.cc", + "../browser/ui/app_list/search/ranking/score_normalizing_ranker_unittest.cc", "../browser/ui/app_list/search/search_controller_impl_new_unittest.cc", "../browser/ui/app_list/search/search_controller_impl_unittest.cc", "../browser/ui/app_list/search/search_result_ranker/app_launch_event_logger_unittest.cc",
diff --git a/chrome/test/data/webui/chromeos/personalization_app/BUILD.gn b/chrome/test/data/webui/chromeos/personalization_app/BUILD.gn index a793c4ac..222ce0e9 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/BUILD.gn +++ b/chrome/test/data/webui/chromeos/personalization_app/BUILD.gn
@@ -29,6 +29,7 @@ target_gen_dir), ] in_files = [ + "avatar_list_element_test.ts", "ambient_subpage_element_test.ts", "google_photos_albums_element_test.ts", "google_photos_collection_element_test.ts",
diff --git a/chrome/test/data/webui/chromeos/personalization_app/avatar_list_element_test.ts b/chrome/test/data/webui/chromeos/personalization_app/avatar_list_element_test.ts new file mode 100644 index 0000000..cf8e3ee --- /dev/null +++ b/chrome/test/data/webui/chromeos/personalization_app/avatar_list_element_test.ts
@@ -0,0 +1,46 @@ +// Copyright 2022 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 {AvatarList} from 'chrome://personalization/trusted/user/avatar_list_element.js'; +import {UserActionName} from 'chrome://personalization/trusted/user/user_actions.js'; +import {assertDeepEquals} from 'chrome://webui-test/chai_assert.js'; + +import {baseSetup, initElement, teardownElement} from './personalization_app_test_utils.js'; +import {TestPersonalizationStore} from './test_personalization_store.js'; +import {TestUserProvider} from './test_user_interface_provider.js'; + +export function AvatarListTest() { + let avatarListElement: AvatarList|null; + + let testUserProvider: TestUserProvider; + let testPersonalizationStore: TestPersonalizationStore; + + setup(function() { + const mocks = baseSetup(); + testUserProvider = mocks.userProvider; + testPersonalizationStore = mocks.personalizationStore; + }); + + teardown(async () => { + await teardownElement(avatarListElement); + avatarListElement = null; + }); + + test('fetches list of default avatar images and saves to store', async () => { + avatarListElement = initElement(AvatarList); + testPersonalizationStore.expectAction( + UserActionName.SET_DEFAULT_USER_IMAGES); + await testUserProvider.whenCalled('getDefaultUserImages'); + const action = await testPersonalizationStore.waitForAction( + UserActionName.SET_DEFAULT_USER_IMAGES); + + assertDeepEquals( + { + name: UserActionName.SET_DEFAULT_USER_IMAGES, + defaultUserImages: testUserProvider.defaultUserImages, + }, + action, + ); + }); +}
diff --git a/chrome/test/data/webui/chromeos/personalization_app/personalization_app_component_test.ts b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_component_test.ts index 105ff07..e3db157 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/personalization_app_component_test.ts +++ b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_component_test.ts
@@ -6,6 +6,7 @@ import 'chrome://webui-test/mojo_webui_test_support.js'; import {AmbientSubpageTest} from './ambient_subpage_element_test.js'; +import {AvatarListTest} from './avatar_list_element_test.js'; import {GooglePhotosAlbumsTest} from './google_photos_albums_element_test.js'; import {GooglePhotosCollectionTest} from './google_photos_collection_element_test.js'; import {GooglePhotosPhotosByAlbumIdTest} from './google_photos_photos_by_album_id_element_test.js'; @@ -31,6 +32,7 @@ const testCases = [ AmbientSubpageTest, + AvatarListTest, GooglePhotosAlbumsTest, GooglePhotosCollectionTest, GooglePhotosPhotosByAlbumIdTest,
diff --git a/chrome/test/data/webui/chromeos/personalization_app/test_user_interface_provider.ts b/chrome/test/data/webui/chromeos/personalization_app/test_user_interface_provider.ts index 186d8cb6..e8f0e282 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/test_user_interface_provider.ts +++ b/chrome/test/data/webui/chromeos/personalization_app/test_user_interface_provider.ts
@@ -2,23 +2,47 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {UserInfo, UserProviderInterface} from 'chrome://personalization/trusted/personalization_app.mojom-webui.js'; +import {DefaultUserImage, UserImageObserverRemote, UserInfo, UserProviderInterface} from 'chrome://personalization/trusted/personalization_app.mojom-webui.js'; +import {Url} from 'chrome://resources/mojo/url/mojom/url.mojom-webui.js'; import {TestBrowserProxy} from 'chrome://webui-test/test_browser_proxy.js'; export class TestUserProvider extends TestBrowserProxy implements UserProviderInterface { + public defaultUserImages: Array<DefaultUserImage> = [ + { + index: 8, + title: {data: 'Test title'.split('').map(ch => ch.charCodeAt(0))}, + url: {url: 'data://test_url'}, + }, + ]; + + public image: Url = {url: 'data://avatar-url'}; + public info: UserInfo = { - avatar: {url: 'data://avatar-url'}, name: 'test name', email: 'test@email', }; constructor() { - super(['getUserInfo']); + super([ + 'setUserImageObserver', + 'getDefaultUserImages', + 'getUserInfo', + ]); + } + + setUserImageObserver(observer: UserImageObserverRemote) { + this.methodCalled('setUserImageObserver', observer); } async getUserInfo(): Promise<{userInfo: UserInfo}> { this.methodCalled('getUserInfo'); return Promise.resolve({userInfo: this.info}); } + + async getDefaultUserImages(): + Promise<{defaultUserImages: Array<DefaultUserImage>}> { + this.methodCalled('getDefaultUserImages'); + return Promise.resolve({defaultUserImages: this.defaultUserImages}); + } }
diff --git a/chrome/test/data/webui/chromeos/personalization_app/user_preview_element_test.ts b/chrome/test/data/webui/chromeos/personalization_app/user_preview_element_test.ts index 6145a86..0883334 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/user_preview_element_test.ts +++ b/chrome/test/data/webui/chromeos/personalization_app/user_preview_element_test.ts
@@ -44,9 +44,15 @@ assertEquals( userProvider.info.name, userPreviewElement!.shadowRoot!.getElementById('name')!.innerText); + }); + + test('displays user image', async () => { + personalizationStore.data.user.image = userProvider.image; + userPreviewElement = initElement(UserPreview); + await waitAfterNextRender(userPreviewElement!); const avatarImage = userPreviewElement!.shadowRoot!.getElementById( 'avatar') as HTMLImageElement; - assertEquals(userProvider.info.avatar.url, avatarImage.src); + assertEquals(userProvider.image.url, avatarImage.src); }); }
diff --git a/chrome/test/data/webui/read_later/side_panel/side_panel_browsertest.js b/chrome/test/data/webui/read_later/side_panel/side_panel_browsertest.js index 066f03bf..8797075 100644 --- a/chrome/test/data/webui/read_later/side_panel/side_panel_browsertest.js +++ b/chrome/test/data/webui/read_later/side_panel/side_panel_browsertest.js
@@ -46,9 +46,16 @@ } }; -TEST_F('SidePanelBookmarksListTest', 'All', function() { +GEN('#if defined(OS_MAC)'); +GEN('// Flaky, https://crbug.com/1288747'); +GEN('#define MAYBE_All DISABLED_All'); +GEN('#else'); +GEN('#define MAYBE_All All'); +GEN('#endif'); +TEST_F('SidePanelBookmarksListTest', 'MAYBE_All', function() { mocha.run(); }); +GEN('#undef MAYBE_All'); var SidePanelBookmarkFolderTest = class extends SidePanelBrowserTest { @@ -58,14 +65,7 @@ } }; - -GEN('#if defined(OS_MAC)'); -GEN('// Flaky, https://crbug.com/1288747'); -GEN('#define MAYBE_All DISABLED_All'); -GEN('#else'); -GEN('#define MAYBE_All All'); -GEN('#endif'); -TEST_F('SidePanelBookmarkFolderTest', 'MAYBE_All', function() { +TEST_F('SidePanelBookmarkFolderTest', 'All', function() { mocha.run(); });
diff --git a/chrome/test/data/webui/settings/chromeos/esim_remove_profile_dialog_test.js b/chrome/test/data/webui/settings/chromeos/esim_remove_profile_dialog_test.js index 9857a218..d94888a 100644 --- a/chrome/test/data/webui/settings/chromeos/esim_remove_profile_dialog_test.js +++ b/chrome/test/data/webui/settings/chromeos/esim_remove_profile_dialog_test.js
@@ -40,8 +40,8 @@ esimRemoveProfileDialog.networkState = response.result; document.body.appendChild(esimRemoveProfileDialog); assertTrue(!!esimRemoveProfileDialog); + // TODO(b/214301268): Add interactive test for cancel button focus. await flushAsync(); - assertEquals(esimRemoveProfileDialog.$$('#cancel'), getDeepActiveElement()); } function flushAsync() {
diff --git a/chrome/updater/test/integration_tests.cc b/chrome/updater/test/integration_tests.cc index 9d04752..a259dcc9 100644 --- a/chrome/updater/test/integration_tests.cc +++ b/chrome/updater/test/integration_tests.cc
@@ -538,19 +538,13 @@ ExpectClean(); } -#if BUILDFLAG(IS_MAC) -// TODO(https://crbug.com/1287235): Failing consistently on Mac. -#define MAYBE_UninstallUpdaterWhenAllAppsUninstalled \ - DISABLED_UninstallUpdaterWhenAllAppsUninstalled -#else -#define MAYBE_UninstallUpdaterWhenAllAppsUninstalled \ - UninstallUpdaterWhenAllAppsUninstalled -#endif -TEST_F(IntegrationTest, MAYBE_UninstallUpdaterWhenAllAppsUninstalled) { +TEST_F(IntegrationTest, UninstallUpdaterWhenAllAppsUninstalled) { Install(); RegisterApp("test1"); ExpectInstalled(); WaitForUpdaterExit(); + // TODO(crbug.com/1287235): The test is flaky without the following line. + SetServerStarts(24); RunWake(0); WaitForUpdaterExit(); ExpectInstalled();
diff --git a/chromecast/base/chromecast_switches.cc b/chromecast/base/chromecast_switches.cc index 06845d1..d231080 100644 --- a/chromecast/base/chromecast_switches.cc +++ b/chromecast/base/chromecast_switches.cc
@@ -228,6 +228,10 @@ // running in a different process from `cast_service`. const char kUseCastBrowserPrefConfig[] = "use-cast-browser-pref-config"; +// Creates the service broker inside of this process. Only one process should +// host the service broker. +const char kInProcessBroker[] = "in-process-broker"; + } // namespace switches namespace chromecast {
diff --git a/chromecast/base/chromecast_switches.h b/chromecast/base/chromecast_switches.h index eb40888a..52c2cde 100644 --- a/chromecast/base/chromecast_switches.h +++ b/chromecast/base/chromecast_switches.h
@@ -108,6 +108,7 @@ // Switches for Cast browser decoupling. extern const char kDeferFeatureList[]; extern const char kUseCastBrowserPrefConfig[]; +extern const char kInProcessBroker[]; } // namespace switches
diff --git a/chromecast/browser/BUILD.gn b/chromecast/browser/BUILD.gn index bbfae70..feedc3f 100644 --- a/chromecast/browser/BUILD.gn +++ b/chromecast/browser/BUILD.gn
@@ -234,6 +234,8 @@ "//chromecast/common/media", "//chromecast/external_mojo/broker_service", "//chromecast/external_mojo/external_service_support:external_service", + "//chromecast/external_mojo/external_service_support:util", + "//chromecast/external_mojo/public/cpp:common", "//chromecast/graphics", "//chromecast/media", "//chromecast/media:libcast_media",
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc index 6907e66..ef9f66c 100644 --- a/chromecast/browser/cast_browser_main_parts.cc +++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -60,6 +60,7 @@ #include "chromecast/external_mojo/broker_service/broker_service.h" #include "chromecast/external_mojo/external_service_support/external_connector.h" #include "chromecast/external_mojo/external_service_support/external_service.h" +#include "chromecast/external_mojo/public/cpp/common.h" #include "chromecast/graphics/cast_window_manager.h" #include "chromecast/media/base/key_systems_common.h" #include "chromecast/media/base/video_plane_controller.h" @@ -559,12 +560,17 @@ } void CastBrowserMainParts::PostCreateThreads() { - auto* service_manager_connector = - ServiceManagerConnection::GetForProcess()->GetConnector(); - broker_service_ = - std::make_unique<external_mojo::BrokerService>(service_manager_connector); - connector_ = external_service_support::ExternalConnector::Create( - broker_service_->CreateConnector()); + if (GetSwitchValueBoolean(switches::kInProcessBroker, true)) { + auto* service_manager_connector = + ServiceManagerConnection::GetForProcess()->GetConnector(); + broker_service_ = std::make_unique<external_mojo::BrokerService>( + service_manager_connector); + connector_ = external_service_support::ExternalConnector::Create( + broker_service_->CreateConnector()); + } else { + connector_ = external_service_support::ExternalConnector::Create( + external_mojo::GetBrokerPath()); + } media_connector_ = connector_->Clone(); browser_service_ = std::make_unique<external_service_support::ExternalService>();
diff --git a/chromecast/browser/cast_web_service.h b/chromecast/browser/cast_web_service.h index 26b64ee..1a8775f 100644 --- a/chromecast/browser/cast_web_service.h +++ b/chromecast/browser/cast_web_service.h
@@ -20,6 +20,7 @@ #include "chromecast/browser/mojom/cast_web_service.mojom.h" #include "chromecast/common/identification_settings_manager.h" #include "chromecast/common/mojom/identification_settings.mojom.h" +#include "chromecast/external_mojo/external_service_support/reconnecting_remote.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "url/origin.h" @@ -69,6 +70,7 @@ LRURendererCache* overlay_renderer_cache() { return overlay_renderer_cache_.get(); } + ReconnectingRemote<mojom::CastWebService>* proxy() { return &proxy_; } bool IsCastWebUIOrigin(const url::Origin& origin); @@ -118,6 +120,12 @@ content::BrowserContext* const browser_context_; // This is used on Aura platforms. CastWindowManager* const window_manager_; + + // This is injected into clients which live in the browser or in a remote + // process. This is temporary until the clients exclusively live in an + // external process. + ReconnectingRemote<mojom::CastWebService> proxy_{this}; + CastWebViewFactory default_web_view_factory_; CastWebViewFactory* override_web_view_factory_ = nullptr;
diff --git a/chromecast/external_mojo/external_service_support/BUILD.gn b/chromecast/external_mojo/external_service_support/BUILD.gn index dcb6064..9ec612f 100644 --- a/chromecast/external_mojo/external_service_support/BUILD.gn +++ b/chromecast/external_mojo/external_service_support/BUILD.gn
@@ -123,7 +123,9 @@ ":process_setup", ":tracing_client", "//base", + "//chromecast/base:chromecast_switches", "//chromecast/external_mojo/public/cpp:common", + "//chromecast/external_mojo/public/cpp:external_mojo_broker", "//mojo/core/embedder", ] public_deps = [ ":service_process" ] @@ -144,6 +146,15 @@ ] } +source_set("util") { + public = [ "reconnecting_remote.h" ] + public_deps = [ + ":external_service", + "//base", + "//mojo/public/cpp/bindings", + ] +} + executable("standalone_mojo_broker") { sources = [ "standalone_mojo_broker.cc" ] deps = [
diff --git a/chromecast/external_mojo/external_service_support/external_connector.h b/chromecast/external_mojo/external_service_support/external_connector.h index a6c63a7b..05f41354 100644 --- a/chromecast/external_mojo/external_service_support/external_connector.h +++ b/chromecast/external_mojo/external_service_support/external_connector.h
@@ -103,6 +103,11 @@ // sequence. virtual std::unique_ptr<ExternalConnector> Clone() = 0; + // Requests a PendingRemote for an ExternalConnector which can be passed to a + // different process. + virtual mojo::PendingRemote<external_mojo::mojom::ExternalConnector> + RequestConnector() = 0; + // Sends a request for a Chromium ServiceManager connector. virtual void SendChromiumConnectorRequest( mojo::ScopedMessagePipeHandle request) = 0;
diff --git a/chromecast/external_mojo/external_service_support/external_connector_impl.cc b/chromecast/external_mojo/external_service_support/external_connector_impl.cc index 96249746..1ab5939 100644 --- a/chromecast/external_mojo/external_service_support/external_connector_impl.cc +++ b/chromecast/external_mojo/external_service_support/external_connector_impl.cc
@@ -267,9 +267,16 @@ } // Bind to the current sequence since this is a public method. BindConnectorIfNecessary(); + return std::make_unique<ExternalConnectorImpl>(RequestConnector()); +} + +mojo::PendingRemote<external_mojo::mojom::ExternalConnector> +ExternalConnectorImpl::RequestConnector() { + // Bind to the current sequence since this is a public method. + BindConnectorIfNecessary(); mojo::PendingRemote<external_mojo::mojom::ExternalConnector> remote; connector_->Clone(remote.InitWithNewPipeAndPassReceiver()); - return std::make_unique<ExternalConnectorImpl>(std::move(remote)); + return remote; } void ExternalConnectorImpl::SendChromiumConnectorRequest(
diff --git a/chromecast/external_mojo/external_service_support/external_connector_impl.h b/chromecast/external_mojo/external_service_support/external_connector_impl.h index 50c0d7ca..e8cf3fe 100644 --- a/chromecast/external_mojo/external_service_support/external_connector_impl.h +++ b/chromecast/external_mojo/external_service_support/external_connector_impl.h
@@ -56,6 +56,8 @@ mojo::ScopedMessagePipeHandle interface_pipe, bool async = true) override; std::unique_ptr<ExternalConnector> Clone() override; + mojo::PendingRemote<external_mojo::mojom::ExternalConnector> + RequestConnector() override; void SendChromiumConnectorRequest( mojo::ScopedMessagePipeHandle request) override; void QueryServiceList(
diff --git a/chromecast/external_mojo/external_service_support/fake_external_connector.cc b/chromecast/external_mojo/external_service_support/fake_external_connector.cc index e969f01..e9d61b9 100644 --- a/chromecast/external_mojo/external_service_support/fake_external_connector.cc +++ b/chromecast/external_mojo/external_service_support/fake_external_connector.cc
@@ -87,6 +87,11 @@ return std::make_unique<FakeExternalConnector>(std::move(remote)); } +mojo::PendingRemote<external_mojo::mojom::ExternalConnector> +FakeExternalConnector::RequestConnector() { + return mojo::PendingRemote<external_mojo::mojom::ExternalConnector>(); +} + void FakeExternalConnector::SendChromiumConnectorRequest( mojo::ScopedMessagePipeHandle request) {}
diff --git a/chromecast/external_mojo/external_service_support/fake_external_connector.h b/chromecast/external_mojo/external_service_support/fake_external_connector.h index 1bcd512..4a106f7 100644 --- a/chromecast/external_mojo/external_service_support/fake_external_connector.h +++ b/chromecast/external_mojo/external_service_support/fake_external_connector.h
@@ -54,6 +54,8 @@ std::vector<chromecast::external_mojo::mojom::ServiceInstanceInfoPtr> service_instances_info) override; std::unique_ptr<external_service_support::ExternalConnector> Clone() override; + mojo::PendingRemote<external_mojo::mojom::ExternalConnector> + RequestConnector() override; void SendChromiumConnectorRequest( mojo::ScopedMessagePipeHandle request) override; void QueryServiceList(
diff --git a/chromecast/external_mojo/external_service_support/reconnecting_remote.h b/chromecast/external_mojo/external_service_support/reconnecting_remote.h new file mode 100644 index 0000000..5bfecb0 --- /dev/null +++ b/chromecast/external_mojo/external_service_support/reconnecting_remote.h
@@ -0,0 +1,112 @@ +// Copyright 2022 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 CHROMECAST_EXTERNAL_MOJO_EXTERNAL_SERVICE_SUPPORT_RECONNECTING_REMOTE_H_ +#define CHROMECAST_EXTERNAL_MOJO_EXTERNAL_SERVICE_SUPPORT_RECONNECTING_REMOTE_H_ + +#include <memory> +#include <string> +#include <utility> +#include <vector> + +#include "base/bind.h" +#include "base/callback.h" +#include "base/check.h" +#include "base/memory/weak_ptr.h" +#include "base/sequence_checker.h" +#include "chromecast/external_mojo/external_service_support/external_connector.h" +#include "mojo/public/cpp/bindings/remote.h" + +namespace chromecast { + +// A class which wraps a mojo::Remote with automatic reconnection logic. +// +// Two reconnection methods are supported: (1) Provide a service name and an +// ExternalConnector to reconnect, or (2) provide a callback to rebind the +// remote. +// +// Clients can register observer callbacks to be notified of reconnect events so +// that they can re-initialize some state in the remote process. Observers are +// notified in the same order they were registered. Observers should use WeakPtr +// if they expect to outlive the ReconnectingRemote. +// +// This class can also be used to wrap a local implementation. This can be used +// for (1) Client code which can exist in both in and out-of-process, and (2) +// Injecting a mock implementation. Since the impl is called directly, this +// allows for synchronous method call validation, as opposed to asynchronously +// posting mojo calls which require a base::RunLoop to verify in unit tests. +// +template <typename Interface> +class ReconnectingRemote { + public: + // Reconnect option 1: Provide an ExternalConnector to request the interface + // from a named service. + ReconnectingRemote(const std::string& service_name, + external_service_support::ExternalConnector* connector) + : service_name_(service_name), connector_(connector) { + DCHECK(connector_); + Connect(); + } + + // Reconnect option 2: Provide a callback to re-bind |remote_|. |remote_| is + // always in an unbound state before |connect_callback_| is run. + explicit ReconnectingRemote( + base::RepeatingCallback<void(mojo::Remote<Interface>* remote)> + connect_callback) + : connect_callback_(std::move(connect_callback)) { + Connect(); + } + + // Option 3: Inject an implementation directly to wrap a local implementation. + // Reconnection is not necessary since a local instance will always exist. + explicit ReconnectingRemote(Interface* impl) : remote_proxy_(impl) {} + + ReconnectingRemote(const ReconnectingRemote&) = delete; + ReconnectingRemote& operator=(const ReconnectingRemote&) = delete; + ~ReconnectingRemote() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } + + Interface* get() const { return remote_proxy_; } + Interface* operator->() const { return get(); } + Interface& operator*() const { return *get(); } + + void OnReconnect(base::RepeatingClosure callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + observer_callbacks_.push_back(std::move(callback)); + } + + private: + void Connect() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + remote_.reset(); + if (connector_) { + connector_->BindInterface(service_name_, + remote_.BindNewPipeAndPassReceiver()); + } else { + connect_callback_.Run(&remote_); + } + DCHECK(remote_.is_bound()); + remote_proxy_ = remote_.get(); + remote_.set_disconnect_handler( + base::BindOnce(&ReconnectingRemote::Connect, base::Unretained(this))); + for (auto& callback : observer_callbacks_) { + callback.Run(); + } + } + + const std::string service_name_; + external_service_support::ExternalConnector* const connector_ = nullptr; + + base::RepeatingCallback<void(mojo::Remote<Interface>* remote)> + connect_callback_; + + mojo::Remote<Interface> remote_; + Interface* remote_proxy_ = nullptr; + std::vector<base::RepeatingClosure> observer_callbacks_; + + SEQUENCE_CHECKER(sequence_checker_); + base::WeakPtrFactory<ReconnectingRemote> weak_factory_{this}; +}; + +} // namespace chromecast +#endif // CHROMECAST_EXTERNAL_MOJO_EXTERNAL_SERVICE_SUPPORT_RECONNECTING_REMOTE_H_
diff --git a/chromecast/external_mojo/external_service_support/standalone_service_main.cc b/chromecast/external_mojo/external_service_support/standalone_service_main.cc index 69f99c8..3a3d61f9 100644 --- a/chromecast/external_mojo/external_service_support/standalone_service_main.cc +++ b/chromecast/external_mojo/external_service_support/standalone_service_main.cc
@@ -7,18 +7,24 @@ #include "base/at_exit.h" #include "base/bind.h" +#include "base/command_line.h" #include "base/message_loop/message_pump_for_io.h" #include "base/message_loop/message_pump_type.h" #include "base/run_loop.h" #include "base/task/single_thread_task_executor.h" #include "base/task/thread_pool/thread_pool_instance.h" +#include "base/threading/sequence_bound.h" +#include "base/threading/thread.h" +#include "chromecast/base/chromecast_switches.h" #include "chromecast/external_mojo/external_service_support/external_connector.h" #include "chromecast/external_mojo/external_service_support/process_setup.h" #include "chromecast/external_mojo/external_service_support/service_process.h" #include "chromecast/external_mojo/external_service_support/tracing_client.h" #include "chromecast/external_mojo/public/cpp/common.h" +#include "chromecast/external_mojo/public/cpp/external_mojo_broker.h" #include "mojo/core/embedder/embedder.h" #include "mojo/core/embedder/scoped_ipc_support.h" +#include "mojo/public/cpp/bindings/pending_remote.h" // Simple process entrypoint for standalone Mojo services. @@ -61,9 +67,32 @@ "StandaloneService"); GlobalState state; - chromecast::external_service_support::ExternalConnector::Connect( - chromecast::external_mojo::GetBrokerPath(), - base::BindOnce(&OnConnected, &state)); + // State for in-process Mojo broker. + auto broker_thread = std::make_unique<base::Thread>("external_mojo"); + base::SequenceBound<chromecast::external_mojo::ExternalMojoBroker> broker; + + if (chromecast::GetSwitchValueBoolean(switches::kInProcessBroker, false)) { + // Set up the external Mojo Broker. + broker_thread->StartWithOptions( + base::Thread::Options(base::MessagePumpType::IO, 0)); + broker = base::SequenceBound<chromecast::external_mojo::ExternalMojoBroker>( + broker_thread->task_runner(), + chromecast::external_mojo::GetBrokerPath()); + mojo::PendingRemote<chromecast::external_mojo::mojom::ExternalConnector> + connector_remote; + broker + .AsyncCall( + &chromecast::external_mojo::ExternalMojoBroker::BindConnector) + .WithArgs(connector_remote.InitWithNewPipeAndPassReceiver()); + OnConnected(&state, + chromecast::external_service_support::ExternalConnector::Create( + std::move(connector_remote))); + } else { + // Connect to existing Mojo broker. + chromecast::external_service_support::ExternalConnector::Connect( + chromecast::external_mojo::GetBrokerPath(), + base::BindOnce(&OnConnected, &state)); + } run_loop.Run(); base::ThreadPoolInstance::Get()->Shutdown();
diff --git a/components/browser_ui/styles/android/BUILD.gn b/components/browser_ui/styles/android/BUILD.gn index a93ffba..fc1e70fa 100644 --- a/components/browser_ui/styles/android/BUILD.gn +++ b/components/browser_ui/styles/android/BUILD.gn
@@ -204,7 +204,6 @@ "java/res/drawable/smartphone_black_24dp.xml", "java/res/drawable/toolbar_hairline.xml", "java/res/values-night/colors.xml", - "java/res/values-night/dimens.xml", "java/res/values-night/drawables.xml", "java/res/values-night/styles.xml", "java/res/values-night/themes.xml",
diff --git a/components/browser_ui/styles/android/java/res/values-night/dimens.xml b/components/browser_ui/styles/android/java/res/values-night/dimens.xml deleted file mode 100644 index c83ce0a..0000000 --- a/components/browser_ui/styles/android/java/res/values-night/dimens.xml +++ /dev/null
@@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2022 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. --> - -<resources> - <!-- Surface color elevations --> - <dimen name="dialog_bg_color_elev">@dimen/default_elevation_3</dimen> - <dimen name="sheet_bg_color_elev">@dimen/default_elevation_4</dimen> - <dimen name="snackbar_background_color_elev">@dimen/default_elevation_4</dimen> -</resources>
diff --git a/components/browser_ui/styles/android/java/res/values/dimens.xml b/components/browser_ui/styles/android/java/res/values/dimens.xml index c55ea4d..6806760 100644 --- a/components/browser_ui/styles/android/java/res/values/dimens.xml +++ b/components/browser_ui/styles/android/java/res/values/dimens.xml
@@ -20,9 +20,4 @@ <item name="text_highlight_alpha" format="float" type="dimen">0.2</item> <item name="progress_bar_bg_alpha" format="float" type="dimen">0.2</item> - - <!-- Surface color elevations --> - <dimen name="dialog_bg_color_elev">@dimen/default_elevation_0</dimen> - <dimen name="sheet_bg_color_elev">@dimen/default_elevation_0</dimen> - <dimen name="snackbar_background_color_elev">@dimen/default_elevation_0</dimen> </resources>
diff --git a/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/SemanticColorUtils.java b/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/SemanticColorUtils.java index 8efb1d2..3afd248c 100644 --- a/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/SemanticColorUtils.java +++ b/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/SemanticColorUtils.java
@@ -15,7 +15,7 @@ /** * Provides semantic color values, typically in place of <macro>s which currently cannot be used in - * Java code, or for surface colors that must be calculated to Java code. + * Java code. */ public class SemanticColorUtils { private static final String TAG = "SemanticColorUtils"; @@ -113,24 +113,6 @@ return getDefaultBgColorElev2(context); } - /** Returns the surface color value of the conceptual dialog_bg_color. */ - public static @ColorInt int getDialogBgColor(Context context) { - return resolveSurfaceColorElev( - R.dimen.dialog_bg_color_elev, R.color.dialog_bg_color, context); - } - - /** Returns the surface color value of the conceptual sheet_bg_color. */ - public static @ColorInt int getSheetBgColor(Context context) { - return resolveSurfaceColorElev( - R.dimen.sheet_bg_color_elev, R.color.sheet_bg_color, context); - } - - /** Returns the surface color value of the conceptual snackbar_background_color_baseline. */ - public static @ColorInt int getSnackbarBackgroundColor(Context context) { - return resolveSurfaceColorElev(R.dimen.snackbar_background_color_elev, - R.color.snackbar_background_color_baseline, context); - } - // Colors that will be experimented with. This is independent of |IS_FULL_DYNAMIC_COLORS|. /** Returns the semantic color value that corresponds to default_text_color_link. */ public static @ColorInt int getDefaultTextColorLink(Context context) {
diff --git a/components/browser_ui/widget/android/BUILD.gn b/components/browser_ui/widget/android/BUILD.gn index a6d1d055..6a647bd 100644 --- a/components/browser_ui/widget/android/BUILD.gn +++ b/components/browser_ui/widget/android/BUILD.gn
@@ -162,7 +162,6 @@ "java/res/drawable-v24/oval_surface_1.xml", "java/res/drawable-v24/rectangle_surface_1.xml", "java/res/drawable-v24/rounded_rectangle_surface_1.xml", - "java/res/drawable-v24/sheet_background.xml", "java/res/drawable-xhdpi/btn_delete_24dp.png", "java/res/drawable-xhdpi/btn_info.png", "java/res/drawable-xhdpi/ic_arrow_back_white_24dp.png", @@ -203,7 +202,6 @@ "java/res/drawable/rectangle_surface_1.xml", "java/res/drawable/rounded_rectangle_surface_1.xml", "java/res/drawable/search_toolbar_modern_bg.xml", - "java/res/drawable/sheet_background.xml", "java/res/drawable/tile_view_highlight.xml", "java/res/drawable/tile_view_highlight_mask.xml", "java/res/drawable/tile_view_highlight_plain.xml", @@ -237,7 +235,6 @@ "java/res/layout/tile_view_modern.xml", "java/res/layout/tile_view_modern_condensed.xml", "java/res/values-ldrtl/values.xml", - "java/res/values-night/dimens.xml", "java/res/values-night/drawables.xml", "java/res/values-sw600dp/dimens.xml", "java/res/values/attrs.xml",
diff --git a/components/browser_ui/widget/android/java/res/drawable-v24/sheet_background.xml b/components/browser_ui/widget/android/java/res/drawable-v24/sheet_background.xml deleted file mode 100644 index 52fe2e42..0000000 --- a/components/browser_ui/widget/android/java/res/drawable-v24/sheet_background.xml +++ /dev/null
@@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2022 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. --> - -<org.chromium.components.browser_ui.widget.SurfaceColorDrawable - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:shape="rectangle" - app:surfaceElevation="@dimen/sheet_background_elev"> -</org.chromium.components.browser_ui.widget.SurfaceColorDrawable> \ No newline at end of file
diff --git a/components/browser_ui/widget/android/java/res/drawable/sheet_background.xml b/components/browser_ui/widget/android/java/res/drawable/sheet_background.xml deleted file mode 100644 index 2eee173..0000000 --- a/components/browser_ui/widget/android/java/res/drawable/sheet_background.xml +++ /dev/null
@@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2022 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. --> - -<shape - xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <solid android:color="@color/sheet_bg_color" /> -</shape> \ No newline at end of file
diff --git a/components/browser_ui/widget/android/java/res/values-night/dimens.xml b/components/browser_ui/widget/android/java/res/values-night/dimens.xml deleted file mode 100644 index 73d5e205..0000000 --- a/components/browser_ui/widget/android/java/res/values-night/dimens.xml +++ /dev/null
@@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2022 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. --> - -<resources> - <dimen name="sheet_background_elev">@dimen/default_elevation_4</dimen> -</resources>
diff --git a/components/browser_ui/widget/android/java/res/values/dimens.xml b/components/browser_ui/widget/android/java/res/values/dimens.xml index bedf8c8b..edb5ee3 100644 --- a/components/browser_ui/widget/android/java/res/values/dimens.xml +++ b/components/browser_ui/widget/android/java/res/values/dimens.xml
@@ -10,7 +10,6 @@ <dimen name="clear_text_button_end_padding">10dp</dimen> <dimen name="default_rounded_corner_radius">8dp</dimen> <dimen name="card_rounded_corner_radius">16dp</dimen> - <dimen name="sheet_background_elev">@dimen/default_elevation_0</dimen> <!-- DualControlLayout --> <dimen name="dual_control_margin_between_items">8dp</dimen>
diff --git a/components/content_settings/browser/page_specific_content_settings.cc b/components/content_settings/browser/page_specific_content_settings.cc index 34622be04..86db2bc 100644 --- a/components/content_settings/browser/page_specific_content_settings.cc +++ b/components/content_settings/browser/page_specific_content_settings.cc
@@ -420,6 +420,14 @@ } // static +void PageSpecificContentSettings::InterestGroupJoined( + content::RenderFrameHost* rfh, + const url::Origin api_origin, + bool blocked_by_policy) { + // TODO(crbug.com/1286276): Not implemented yet. +} + +// static content::WebContentsObserver* PageSpecificContentSettings::GetWebContentsObserverForTest( content::WebContents* web_contents) {
diff --git a/components/content_settings/browser/page_specific_content_settings.h b/components/content_settings/browser/page_specific_content_settings.h index a0476d2..a79ab2b 100644 --- a/components/content_settings/browser/page_specific_content_settings.h +++ b/components/content_settings/browser/page_specific_content_settings.h
@@ -262,6 +262,12 @@ const blink::StorageKey& storage_key, bool blocked_by_policy); + // Called when |api_origin| attempts to join an interest group via the + // Interest Group API. + static void InterestGroupJoined(content::RenderFrameHost* rfh, + const url::Origin api_origin, + bool blocked_by_policy); + static content::WebContentsObserver* GetWebContentsObserverForTest( content::WebContents* web_contents);
diff --git a/components/desks_storage/BUILD.gn b/components/desks_storage/BUILD.gn index 5702d517..df019b5 100644 --- a/components/desks_storage/BUILD.gn +++ b/components/desks_storage/BUILD.gn
@@ -15,6 +15,8 @@ "core/desk_sync_service.h", "core/desk_template_conversion.cc", "core/desk_template_conversion.h", + "core/desk_template_util.cc", + "core/desk_template_util.h", "core/local_desk_data_manager.cc", "core/local_desk_data_manager.h", ] @@ -40,6 +42,7 @@ sources = [ "core/desk_sync_bridge_unittest.cc", "core/desk_template_conversion_unittests.cc", + "core/desk_template_util_unittests.cc", "core/local_desks_data_manager_unittests.cc", ] deps = [
diff --git a/components/desks_storage/core/desk_model.cc b/components/desks_storage/core/desk_model.cc index 23f34894..d9a457e5 100644 --- a/components/desks_storage/core/desk_model.cc +++ b/components/desks_storage/core/desk_model.cc
@@ -5,8 +5,10 @@ #include "components/desks_storage/core/desk_model.h" #include "ash/public/cpp/desk_template.h" +#include "base/guid.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" +#include "base/logging.h" #include "components/desks_storage/core/desk_model_observer.h" #include "components/desks_storage/core/desk_template_conversion.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -46,23 +48,6 @@ observers_.RemoveObserver(observer); } -void DeskModel::SetPolicyDeskTemplates(const std::string& policyJson) { - policy_entries_.clear(); - - base::StringPiece raw_json = base::StringPiece(policyJson); - base::JSONReader::ValueWithError parsed_list = - base::JSONReader::ReadAndReturnValueWithError(raw_json); - if (!parsed_list.value || !parsed_list.value->is_list()) - return; - - for (auto& desk_template : parsed_list.value->GetList()) { - std::unique_ptr<ash::DeskTemplate> dt = - desk_template_conversion::ParseDeskTemplateFromPolicy(desk_template); - if (dt) - policy_entries_.push_back(std::move(dt)); - } -} - void DeskModel::GetTemplateJson(const std::string& uuid, apps::AppRegistryCache* app_cache, GetTemplateJsonCallback callback) { @@ -72,6 +57,49 @@ base::Unretained(this), std::move(callback), app_cache)); } +void DeskModel::SetPolicyDeskTemplates(const std::string& policy_json) { + policy_entries_.clear(); + + base::StringPiece raw_json = base::StringPiece(policy_json); + base::JSONReader::ValueWithError parsed_list = + base::JSONReader::ReadAndReturnValueWithError(raw_json); + if (!parsed_list.value) + return; + + if (!parsed_list.value->is_list()) { + LOG(WARNING) << "Expected JSON list in admin templates policy."; + return; + } + + for (auto& desk_template : parsed_list.value->GetList()) { + std::unique_ptr<ash::DeskTemplate> dt = + desk_template_conversion::ParseDeskTemplateFromPolicy(desk_template); + if (dt) { + policy_entries_.push_back(std::move(dt)); + } else { + LOG(WARNING) << "Failed to parse admin template from JSON: " + << desk_template; + } + } +} + +void DeskModel::RemovePolicyDeskTemplates() { + policy_entries_.clear(); +} + +std::unique_ptr<ash::DeskTemplate> DeskModel::GetAdminDeskTemplateByUUID( + const std::string& uuid_str) const { + const base::GUID uuid = base::GUID::ParseCaseInsensitive(uuid_str); + + for (const std::unique_ptr<ash::DeskTemplate>& policy_entry : + policy_entries_) { + if (policy_entry->uuid() == uuid) + return policy_entry->Clone(); + } + + return nullptr; +} + void DeskModel::HandleTemplateConversionToPolicyJson( GetTemplateJsonCallback callback, apps::AppRegistryCache* app_cache, @@ -84,10 +112,12 @@ } std::string raw_json; - bool conversion_success = base::JSONWriter::Write( - desk_template_conversion::SerializeDeskTemplateAsPolicy(entry.get(), - app_cache), - &raw_json); + base::Value template_list(base::Value::Type::LIST); + template_list.Append(desk_template_conversion::SerializeDeskTemplateAsPolicy( + entry.get(), app_cache)); + + const bool conversion_success = + base::JSONWriter::Write(template_list, &raw_json); if (conversion_success) std::move(callback).Run(GetTemplateJsonStatus::kOk, raw_json);
diff --git a/components/desks_storage/core/desk_model.h b/components/desks_storage/core/desk_model.h index 30880fa..8221dc1 100644 --- a/components/desks_storage/core/desk_model.h +++ b/components/desks_storage/core/desk_model.h
@@ -88,15 +88,15 @@ using GetEntryByUuidCallback = base::OnceCallback<void(GetEntryByUuidStatus status, std::unique_ptr<ash::DeskTemplate> entry)>; - // Get a specific desk template by |uuid|. Actual storage backend does not + // Get a specific desk template by `uuid`. Actual storage backend does not // need to keep desk templates in memory. The storage backend could load the - // specified desk template into memory and then call the |callback| with a + // specified desk template into memory and then call the `callback` with a // unique_ptr to the loaded desk template. - // If the specified desk template does not exist, |callback| will be called - // with |kNotFound| and an empty unique_ptr. If the specified desk template - // exists, but could not be loaded/parsed, |callback| will be called with - // |kFailure| and an empty unique_ptr. An asynchronous |callback| is used here - // to accommodate storage backend that need to perform asynchronous I/O. + // If the specified desk template does not exist, `callback` will be called + // with `kNotFound` and a `nullptr`. If the specified desk template exists, + // but could not be loaded/parsed, `callback` will be called with `kFailure` + // and a nullptr. An asynchronous `callback` is used here to accommodate + // storage backend that need to perform asynchronous I/O. virtual void GetEntryByUUID(const std::string& uuid, GetEntryByUuidCallback callback) = 0; @@ -157,10 +157,18 @@ void AddObserver(DeskModelObserver* observer); void RemoveObserver(DeskModelObserver* observer); - // Operations to update the preconfigured desk templates from policy - void SetPolicyDeskTemplates(const std::string& policyJson); + // Updates the preconfigured desk templates from policy. + void SetPolicyDeskTemplates(const std::string& policy_json); + + // Removes the preconfigured desk templates from policy. + void RemovePolicyDeskTemplates(); protected: + // Finds the admin desk template with the given `uuid`. Returns `nullptr` if + // none is found. + std::unique_ptr<ash::DeskTemplate> GetAdminDeskTemplateByUUID( + const std::string& uuid) const; + // The observers. base::ObserverList<DeskModelObserver>::Unchecked observers_;
diff --git a/components/desks_storage/core/desk_sync_bridge.cc b/components/desks_storage/core/desk_sync_bridge.cc index 9dc2894..1379e23 100644 --- a/components/desks_storage/core/desk_sync_bridge.cc +++ b/components/desks_storage/core/desk_sync_bridge.cc
@@ -23,6 +23,7 @@ #include "components/app_restore/window_info.h" #include "components/desks_storage/core/desk_model_observer.h" #include "components/desks_storage/core/desk_template_conversion.h" +#include "components/desks_storage/core/desk_template_util.h" #include "components/services/app_service/public/cpp/app_registry_cache.h" #include "components/services/app_service/public/cpp/app_registry_cache_wrapper.h" #include "components/sync/model/entity_change.h" @@ -587,7 +588,7 @@ // Add/update the remote_entry to the model. entries_[uuid] = std::move(remote_entry); - added_or_updated.push_back(GetEntryByUUID(uuid)); + added_or_updated.push_back(GetUserEntryByUUID(uuid)); // Write to the store. batch->WriteData(uuid.AsLowercaseString(), serialized_remote_entry); @@ -611,7 +612,7 @@ for (const std::string& uuid : storage_keys) { const DeskTemplate* entry = - GetEntryByUUID(base::GUID::ParseCaseInsensitive(uuid)); + GetUserEntryByUUID(base::GUID::ParseCaseInsensitive(uuid)); if (!entry) { continue; } @@ -662,22 +663,27 @@ void DeskSyncBridge::GetEntryByUUID(const std::string& uuid_str, GetEntryByUuidCallback callback) { if (!IsReady()) { - std::move(callback).Run(GetEntryByUuidStatus::kFailure, - std::unique_ptr<DeskTemplate>()); + std::move(callback).Run(GetEntryByUuidStatus::kFailure, nullptr); return; } const base::GUID uuid = base::GUID::ParseCaseInsensitive(uuid_str); if (!uuid.is_valid()) { - std::move(callback).Run(GetEntryByUuidStatus::kInvalidUuid, - std::unique_ptr<DeskTemplate>()); + std::move(callback).Run(GetEntryByUuidStatus::kInvalidUuid, nullptr); return; } auto it = entries_.find(uuid); if (it == entries_.end()) { - std::move(callback).Run(GetEntryByUuidStatus::kNotFound, - std::unique_ptr<DeskTemplate>()); + std::unique_ptr<DeskTemplate> policy_entry = + GetAdminDeskTemplateByUUID(uuid_str); + + if (policy_entry) { + std::move(callback).Run(GetEntryByUuidStatus::kOk, + std::move(policy_entry)); + } else { + std::move(callback).Run(GetEntryByUuidStatus::kNotFound, nullptr); + } } else { std::move(callback).Run(GetEntryByUuidStatus::kOk, it->second.get()->Clone()); @@ -707,6 +713,15 @@ entry->set_template_name( base::CollapseWhitespace(new_entry->template_name(), true)); + // While we still find duplicate names iterate the duplicate number. i.e. + // if there are 4 duplicates of some template name then this iterates until + // the current template will be named 5. + while (HasUserTemplateWithName(entry->template_name())) { + entry->set_template_name( + desk_template_util::AppendDuplicateNumberToDuplicateName( + entry->template_name())); + } + std::unique_ptr<ModelTypeStore::WriteBatch> batch = store_->CreateWriteBatch(); @@ -723,7 +738,7 @@ batch->GetMetadataChangeList()); entries_[uuid] = std::move(entry); - const DeskTemplate* result = GetEntryByUUID(uuid); + const DeskTemplate* result = GetUserEntryByUUID(uuid); batch->WriteData(uuid.AsLowercaseString(), ToSyncProto(result).SerializeAsString()); @@ -744,7 +759,7 @@ const base::GUID uuid = base::GUID::ParseCaseInsensitive(uuid_str); - if (GetEntryByUUID(uuid) == nullptr) { + if (GetUserEntryByUUID(uuid) == nullptr) { // Consider the deletion successful if the entry does not exist. std::move(callback).Run(DeleteEntryStatus::kOk); return; @@ -789,11 +804,11 @@ } std::size_t DeskSyncBridge::GetEntryCount() const { - return entries_.size(); + return entries_.size() + policy_entries_.size(); } std::size_t DeskSyncBridge::GetMaxEntryCount() const { - return kMaxTemplateCount; + return kMaxTemplateCount + policy_entries_.size(); } std::vector<base::GUID> DeskSyncBridge::GetAllEntryUuids() const { @@ -845,7 +860,7 @@ return pb_entry; } -const DeskTemplate* DeskSyncBridge::GetEntryByUUID( +const DeskTemplate* DeskSyncBridge::GetUserEntryByUUID( const base::GUID& uuid) const { auto it = entries_.find(uuid); if (it == entries_.end()) @@ -966,4 +981,13 @@ } } +bool DeskSyncBridge::HasUserTemplateWithName(const std::u16string& name) { + return std::find_if( + entries_.begin(), entries_.end(), + [&name](std::pair<const base::GUID, + std::unique_ptr<ash::DeskTemplate>>& entry) { + return entry.second->template_name() == name; + }) != entries_.end(); +} + } // namespace desks_storage
diff --git a/components/desks_storage/core/desk_sync_bridge.h b/components/desks_storage/core/desk_sync_bridge.h index a736617..00ae0b39 100644 --- a/components/desks_storage/core/desk_sync_bridge.h +++ b/components/desks_storage/core/desk_sync_bridge.h
@@ -86,7 +86,7 @@ sync_pb::WorkspaceDeskSpecifics ToSyncProto( const ash::DeskTemplate* desk_template); - const ash::DeskTemplate* GetEntryByUUID(const base::GUID& uuid) const; + const ash::DeskTemplate* GetUserEntryByUUID(const base::GUID& uuid) const; private: using DeskEntries = std::map<base::GUID, std::unique_ptr<ash::DeskTemplate>>; @@ -119,6 +119,9 @@ void UploadLocalOnlyData(syncer::MetadataChangeList* metadata_change_list, const syncer::EntityChangeList& entity_data); + // Returns true if `templates_` contains a desk template with `name`. + bool HasUserTemplateWithName(const std::u16string& name); + // |entries_| is keyed by UUIDs. DeskEntries entries_;
diff --git a/components/desks_storage/core/desk_sync_bridge_unittest.cc b/components/desks_storage/core/desk_sync_bridge_unittest.cc index 365e148..567aa73f 100644 --- a/components/desks_storage/core/desk_sync_bridge_unittest.cc +++ b/components/desks_storage/core/desk_sync_bridge_unittest.cc
@@ -10,6 +10,8 @@ #include "ash/public/cpp/desk_template.h" #include "base/guid.h" +#include "base/json/json_reader.h" +#include "base/json/json_writer.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -19,6 +21,7 @@ #include "components/account_id/account_id.h" #include "components/app_restore/app_launch_info.h" #include "components/desks_storage/core/desk_model_observer.h" +#include "components/desks_storage/core/desk_template_conversion.h" #include "components/services/app_service/public/cpp/app_registry_cache.h" #include "components/services/app_service/public/cpp/app_registry_cache_wrapper.h" #include "components/sync/model/entity_change.h" @@ -70,6 +73,8 @@ constexpr char kTestPwaAppId[] = "test_pwa_app_id"; constexpr char kTestChromeAppId[] = "test_chrome_app_id"; constexpr char kUuidFormat[] = "9e186d5a-502e-49ce-9ee1-00000000000%d"; +constexpr char kAdminTemplateUuidFormat[] = + "59dbe2b8-671f-4fd0-92ec-11111111100%d"; constexpr char kNameFormat[] = "template %d"; constexpr char kTestUrlFormat[] = "https://www.testdomain%d.com/"; constexpr int kDefaultTemplateIndex = 1; @@ -82,6 +87,8 @@ base::GUID::ParseCaseInsensitive(base::StringPrintf(kUuidFormat, 8)); const base::GUID kTestUuid9 = base::GUID::ParseCaseInsensitive(base::StringPrintf(kUuidFormat, 9)); +const base::GUID kTestAdminTemplateUuid1 = base::GUID::ParseCaseInsensitive( + base::StringPrintf(kAdminTemplateUuidFormat, 1)); const std::string kPolicyWithTwoTemplates = "[{\"version\":1,\"uuid\":\"" + base::StringPrintf(kUuidFormat, 8) + @@ -433,6 +440,55 @@ loop2.Run(); } + void AddTwoTemplatesWithDuplicatedNames() { + // These two templates will have new UUIDs but with names that collides with + // "template 1" + auto desk_template1 = + DeskSyncBridge::FromSyncProto(ExampleWorkspaceDeskSpecifics( + kTestUuid8.AsLowercaseString(), "template 1", AdvanceAndGetTime())); + auto desk_template2 = + DeskSyncBridge::FromSyncProto(ExampleWorkspaceDeskSpecifics( + kTestUuid9.AsLowercaseString(), "template 1", AdvanceAndGetTime())); + + base::RunLoop loop1; + bridge()->AddOrUpdateEntry( + std::move(desk_template1), + base::BindLambdaForTesting( + [&](DeskModel::AddOrUpdateEntryStatus status) { + EXPECT_EQ(DeskModel::AddOrUpdateEntryStatus::kOk, status); + loop1.Quit(); + })); + loop1.Run(); + + base::RunLoop loop2; + bridge()->AddOrUpdateEntry( + std::move(desk_template2), + base::BindLambdaForTesting( + [&](DeskModel::AddOrUpdateEntryStatus status) { + EXPECT_EQ(DeskModel::AddOrUpdateEntryStatus::kOk, status); + loop2.Quit(); + })); + loop2.Run(); + } + + void SetOneAdminTemplate() { + auto admin_template1 = + DeskSyncBridge::FromSyncProto(ExampleWorkspaceDeskSpecifics( + kTestAdminTemplateUuid1.AsLowercaseString(), "admin template 1", + AdvanceAndGetTime())); + + std::string policy_json; + base::Value template_list(base::Value::Type::LIST); + template_list.Append( + desk_template_conversion::SerializeDeskTemplateAsPolicy( + admin_template1.get(), cache_.get())); + bool conversion_success = + base::JSONWriter::Write(template_list, &policy_json); + EXPECT_TRUE(conversion_success); + + bridge()->SetPolicyDeskTemplates(policy_json); + } + MockModelTypeChangeProcessor* processor() { return &mock_processor_; } DeskSyncBridge* bridge() { return bridge_.get(); } @@ -441,6 +497,8 @@ base::SimpleTestClock* clock() { return &clock_; } + apps::AppRegistryCache* app_cache() { return cache_.get(); } + private: base::SimpleTestClock clock_; @@ -524,17 +582,17 @@ EXPECT_EQ(2ul, bridge()->GetAllEntryUuids().size()); // Verify both local specifics are loaded correctly. - EXPECT_EQ(bridge() - ->ToSyncProto(bridge()->GetEntryByUUID( + EXPECT_EQ(template1.SerializeAsString(), + bridge() + ->ToSyncProto(bridge()->GetUserEntryByUUID( base::GUID::ParseCaseInsensitive(template1.uuid()))) - .SerializeAsString(), - template1.SerializeAsString()); + .SerializeAsString()); - EXPECT_EQ(bridge() - ->ToSyncProto(bridge()->GetEntryByUUID( + EXPECT_EQ(template2.SerializeAsString(), + bridge() + ->ToSyncProto(bridge()->GetUserEntryByUUID( base::GUID::ParseCaseInsensitive(template2.uuid()))) - .SerializeAsString(), - template2.SerializeAsString()); + .SerializeAsString()); } TEST_F(DeskSyncBridgeTest, GetAllEntriesIncludesPolicyEntries) { @@ -610,15 +668,15 @@ EXPECT_EQ(2ul, bridge()->GetAllEntryUuids().size()); // Verify the added desk template content. - EXPECT_EQ(bridge() - ->ToSyncProto(bridge()->GetEntryByUUID(kTestUuid1)) - .SerializeAsString(), - specifics1.SerializeAsString()); + EXPECT_EQ(specifics1.SerializeAsString(), + bridge() + ->ToSyncProto(bridge()->GetUserEntryByUUID(kTestUuid1)) + .SerializeAsString()); - EXPECT_EQ(bridge() - ->ToSyncProto(bridge()->GetEntryByUUID(kTestUuid2)) - .SerializeAsString(), - specifics2.SerializeAsString()); + EXPECT_EQ(specifics2.SerializeAsString(), + bridge() + ->ToSyncProto(bridge()->GetUserEntryByUUID(kTestUuid2)) + .SerializeAsString()); } TEST_F(DeskSyncBridgeTest, AddEntryShouldFailWhenEntryIsTooLarge) { @@ -690,6 +748,29 @@ loop.Run(); } +TEST_F(DeskSyncBridgeTest, AppendsDuplicateMarkingsCorrectly) { + InitializeBridge(); + + AddTwoTemplates(); + + EXPECT_EQ(2ul, bridge()->GetAllEntryUuids().size()); + + AddTwoTemplatesWithDuplicatedNames(); + + // The two duplicated templates should be added. + EXPECT_EQ(4ul, bridge()->GetAllEntryUuids().size()); + + // Template 8 should be renamed to avoid name collision. + EXPECT_EQ("template 1 (1)", + base::UTF16ToUTF8( + bridge()->GetUserEntryByUUID(kTestUuid8)->template_name())); + + // Template 9 should be renamed twice to avoid name collision. + EXPECT_EQ("template 1 (2)", + base::UTF16ToUTF8( + bridge()->GetUserEntryByUUID(kTestUuid9)->template_name())); +} + TEST_F(DeskSyncBridgeTest, GetEntryByUUIDShouldSucceed) { InitializeBridge(); @@ -709,6 +790,28 @@ loop.Run(); } +TEST_F(DeskSyncBridgeTest, GetEntryByUUIDShouldReturnAdminTemplate) { + InitializeBridge(); + + AddTwoTemplates(); + + SetOneAdminTemplate(); + + // There should be 3 templates: 2 user templates + 1 admin template. + EXPECT_EQ(3ul, bridge()->GetAllEntryUuids().size()); + + base::RunLoop loop; + bridge()->GetEntryByUUID( + kTestAdminTemplateUuid1.AsLowercaseString(), + base::BindLambdaForTesting([&](DeskModel::GetEntryByUuidStatus status, + std::unique_ptr<ash::DeskTemplate> entry) { + EXPECT_EQ(DeskModel::GetEntryByUuidStatus::kOk, status); + EXPECT_TRUE(entry); + loop.Quit(); + })); + loop.Run(); +} + TEST_F(DeskSyncBridgeTest, GetEntryByUUIDShouldFailWhenUuidIsNotFound) { InitializeBridge(); @@ -776,14 +879,14 @@ // We should still have both templates. EXPECT_EQ(2ul, bridge()->GetAllEntryUuids().size()); // Template 1 should be updated. - EXPECT_EQ( - base::UTF16ToUTF8(bridge()->GetEntryByUUID(kTestUuid1)->template_name()), - "updated template 1"); + EXPECT_EQ("updated template 1", + base::UTF16ToUTF8( + bridge()->GetUserEntryByUUID(kTestUuid1)->template_name())); // Template 2 should be unchanged. - EXPECT_EQ( - base::UTF16ToUTF8(bridge()->GetEntryByUUID(kTestUuid2)->template_name()), - "template 2"); + EXPECT_EQ("template 2", + base::UTF16ToUTF8( + bridge()->GetUserEntryByUUID(kTestUuid2)->template_name())); } TEST_F(DeskSyncBridgeTest, DeleteEntryLocally) { @@ -813,9 +916,9 @@ // We should have only 1 template. EXPECT_EQ(1ul, bridge()->GetAllEntryUuids().size()); // Template 2 should be unchanged. - EXPECT_EQ( - base::UTF16ToUTF8(bridge()->GetEntryByUUID(kTestUuid2)->template_name()), - "template 2"); + EXPECT_EQ("template 2", + base::UTF16ToUTF8( + bridge()->GetUserEntryByUUID(kTestUuid2)->template_name())); } TEST_F(DeskSyncBridgeTest, DeleteAllEntriesLocally) { @@ -898,16 +1001,16 @@ // We should still have both templates. EXPECT_EQ(2ul, bridge()->GetAllEntryUuids().size()); // Template 1 should be updated to new content. - EXPECT_EQ(bridge() - ->ToSyncProto(bridge()->GetEntryByUUID( + EXPECT_EQ(updated_template1.SerializeAsString(), + bridge() + ->ToSyncProto(bridge()->GetUserEntryByUUID( base::GUID::ParseCaseInsensitive(template1.uuid()))) - .SerializeAsString(), - updated_template1.SerializeAsString()); - EXPECT_EQ(bridge() - ->ToSyncProto(bridge()->GetEntryByUUID( + .SerializeAsString()); + EXPECT_EQ(template2.SerializeAsString(), + bridge() + ->ToSyncProto(bridge()->GetUserEntryByUUID( base::GUID::ParseCaseInsensitive(template2.uuid()))) - .SerializeAsString(), - template2.SerializeAsString()); + .SerializeAsString()); } // Tests that remote desk template can be correctly removed. @@ -934,11 +1037,11 @@ // Verify that we only have template 2. EXPECT_EQ(1ul, bridge()->GetAllEntryUuids().size()); - EXPECT_EQ(bridge() - ->ToSyncProto(bridge()->GetEntryByUUID( + EXPECT_EQ(template2.SerializeAsString(), + bridge() + ->ToSyncProto(bridge()->GetUserEntryByUUID( base::GUID::ParseCaseInsensitive(template2.uuid()))) - .SerializeAsString(), - template2.SerializeAsString()); + .SerializeAsString()); } TEST_F(DeskSyncBridgeTest, ApplySyncChangesDeleteNonexistent) { @@ -998,6 +1101,65 @@ EXPECT_EQ(3ul, bridge()->GetAllEntryUuids().size()); } +TEST_F(DeskSyncBridgeTest, + GetEntryCountShouldIncludeBothUserAndAdminTemplates) { + InitializeBridge(); + + AddTwoTemplates(); + + SetOneAdminTemplate(); + + // There should be 3 templates: 2 user templates + 1 admin template. + EXPECT_EQ(3ul, bridge()->GetEntryCount()); +} + +TEST_F(DeskSyncBridgeTest, GetMaxEntryCountShouldIncreaseWithAdminTemplates) { + InitializeBridge(); + + AddTwoTemplates(); + + std::size_t max_entry_count = bridge()->GetMaxEntryCount(); + + SetOneAdminTemplate(); + + // The max entry count should increase by 1 since we have set an admin + // template. + EXPECT_EQ(max_entry_count + 1ul, bridge()->GetMaxEntryCount()); +} + +TEST_F(DeskSyncBridgeTest, GetTemplateJsonShouldReturnList) { + InitializeBridge(); + + // Seed two templates. + // Seeded templates will be "template 1" and "template 2". + AddTwoTemplates(); + + // We should have seeded two templates. + EXPECT_EQ(2ul, bridge()->GetAllEntryUuids().size()); + + base::RunLoop loop; + bridge()->GetTemplateJson( + kTestUuid1.AsLowercaseString(), app_cache(), + base::BindLambdaForTesting([&](DeskModel::GetTemplateJsonStatus status, + const std::string& templates_json) { + EXPECT_EQ(DeskModel::GetTemplateJsonStatus::kOk, status); + + EXPECT_TRUE(!templates_json.empty()); + + base::JSONReader::ValueWithError parsed_json = + base::JSONReader::ReadAndReturnValueWithError( + base::StringPiece(templates_json)); + + EXPECT_TRUE(parsed_json.value.has_value()); + EXPECT_TRUE(parsed_json.value->is_list()); + + // Content of the conversion is tested in: + // components/desks_storage/core/desk_template_conversion_unittests.cc + loop.Quit(); + })); + loop.Run(); +} + } // namespace } // namespace desks_storage
diff --git a/components/desks_storage/core/desk_template_util.cc b/components/desks_storage/core/desk_template_util.cc new file mode 100644 index 0000000..ec2a105 --- /dev/null +++ b/components/desks_storage/core/desk_template_util.cc
@@ -0,0 +1,45 @@ +// Copyright 2022 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/desks_storage/core/desk_template_util.h" + +#include "base/strings/stringprintf.h" +#include "base/strings/utf_string_conversions.h" +#include "third_party/re2/src/re2/re2.h" + +namespace { + +// Duplicate value format. +constexpr char kDuplicateNumberFormat[] = "(%d)"; +// Initial duplicate number value. +constexpr char kInitialDuplicateNumberValue[] = " (1)"; +// Regex used in determining if duplicate name should be incremented. +constexpr char kDuplicateNumberRegex[] = "\\(([0-9]+)\\)$"; + +} // namespace + +namespace desks_storage { + +namespace desk_template_util { + +std::u16string AppendDuplicateNumberToDuplicateName( + const std::u16string& duplicate_name_u16) { + std::string duplicate_name = base::UTF16ToUTF8(duplicate_name_u16); + int found_duplicate_number; + + if (RE2::PartialMatch(duplicate_name, kDuplicateNumberRegex, + &found_duplicate_number)) { + RE2::Replace( + &duplicate_name, kDuplicateNumberRegex, + base::StringPrintf(kDuplicateNumberFormat, found_duplicate_number + 1)); + } else { + duplicate_name.append(kInitialDuplicateNumberValue); + } + + return base::UTF8ToUTF16(duplicate_name); +} + +} // namespace desk_template_util + +} // namespace desks_storage
diff --git a/components/desks_storage/core/desk_template_util.h b/components/desks_storage/core/desk_template_util.h new file mode 100644 index 0000000..77caedb --- /dev/null +++ b/components/desks_storage/core/desk_template_util.h
@@ -0,0 +1,25 @@ +// Copyright 2022 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_DESKS_STORAGE_CORE_DESK_TEMPLATE_UTIL_H_ +#define COMPONENTS_DESKS_STORAGE_CORE_DESK_TEMPLATE_UTIL_H_ + +#include <string> + +namespace desks_storage { + +namespace desk_template_util { + +// Returns a copy of a duplicated name to be stored. This function works by +// taking the name to be duplicated and adding a "(1)" to it. If the name +// already has "(1)" then the number inside of the parenthesis will be +// incremented. +std::u16string AppendDuplicateNumberToDuplicateName( + const std::u16string& duplicate_name_u16); + +} // namespace desk_template_util + +} // namespace desks_storage + +#endif // COMPONENTS_DESKS_STORAGE_CORE_DESK_TEMPLATE_UTIL_H_
diff --git a/components/desks_storage/core/desk_template_util_unittests.cc b/components/desks_storage/core/desk_template_util_unittests.cc new file mode 100644 index 0000000..0cedf515 --- /dev/null +++ b/components/desks_storage/core/desk_template_util_unittests.cc
@@ -0,0 +1,44 @@ +// Copyright 2022 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/desks_storage/core/desk_template_util.h" + +#include <string> + +#include "testing/gtest/include/gtest/gtest.h" + +namespace desks_storage { + +using DeskTemplateUtilTest = testing::Test; + +TEST_F(DeskTemplateUtilTest, AddSequenceNumberForFirstDuplicate) { + EXPECT_EQ(u"test (1)", + desk_template_util::AppendDuplicateNumberToDuplicateName(u"test")); +} + +TEST_F(DeskTemplateUtilTest, IncrementSequenceNumberOnSubsequentDuplicate) { + EXPECT_EQ( + u"test (2)", + desk_template_util::AppendDuplicateNumberToDuplicateName(u"test (1)")); + EXPECT_EQ( + u"test (10)", + desk_template_util::AppendDuplicateNumberToDuplicateName(u"test (9)")); + EXPECT_EQ( + u"test (11)", + desk_template_util::AppendDuplicateNumberToDuplicateName(u"test (10)")); + EXPECT_EQ( + u"test (101)", + desk_template_util::AppendDuplicateNumberToDuplicateName(u"test (100)")); +} + +TEST_F(DeskTemplateUtilTest, OnlyIncrementTheLastSequenceNumber) { + EXPECT_EQ(u"test (1) (2)", + desk_template_util::AppendDuplicateNumberToDuplicateName( + u"test (1) (1)")); + EXPECT_EQ(u"test (1) (10)", + desk_template_util::AppendDuplicateNumberToDuplicateName( + u"test (1) (9)")); +} + +} // namespace desks_storage
diff --git a/components/desks_storage/core/local_desk_data_manager.cc b/components/desks_storage/core/local_desk_data_manager.cc index 474afd9..e215b50 100644 --- a/components/desks_storage/core/local_desk_data_manager.cc +++ b/components/desks_storage/core/local_desk_data_manager.cc
@@ -7,6 +7,7 @@ #include "ash/public/cpp/desk_template.h" #include "base/files/dir_reader_posix.h" #include "base/files/file_util.h" +#include "base/guid.h" #include "base/json/json_string_value_serializer.h" #include "base/json/values_util.h" #include "base/logging.h" @@ -18,9 +19,9 @@ #include "components/app_restore/restore_data.h" #include "components/desks_storage/core/desk_model.h" #include "components/desks_storage/core/desk_template_conversion.h" +#include "components/desks_storage/core/desk_template_util.h" #include "components/sync/protocol/workspace_desk_specifics.pb.h" #include "third_party/abseil-cpp/absl/types/optional.h" -#include "third_party/re2/src/re2/re2.h" #include "third_party/re2/src/re2/stringpiece.h" #include "url/gurl.h" @@ -38,14 +39,7 @@ constexpr char kDeskTemplateTimeCreatedKey[] = "time_created"; // Key used in base::Value generation for the restore data field. constexpr char kDeskTemplateRestoreDataKey[] = "restore_data"; -// Duplicate value format -constexpr char kDuplicateNumberFormat[] = "(%d)"; -// Initial duplicate number value -constexpr char kInitialDuplicateNumberValue[] = " (1)"; -// The maximum number of templates the local storage can hold. constexpr std::size_t kMaxTemplateCount = 6u; -// Regex used in determining if duplicate name should be incremented. -constexpr char kDuplicateNumberRegex[] = "\\(([0-9])+\\)$"; // Converts ash::DeskTemplates to base::Value for serialization. base::Value ConvertDeskTemplateToValue(ash::DeskTemplate* desk_template) { @@ -167,27 +161,6 @@ return base::FilePath(file_path.Append(base::FilePath(filename))); } -// Returns a copy of a duplicated name to be stored. This function works by -// taking the name to be duplicated and adding a "(1)" to it. If the name -// already has "(1)" then the number inside of the parenthesis will be -// incremented. -std::u16string AppendDuplicateNumberToDuplicateName( - const std::u16string& duplicate_name_u16) { - std::string duplicate_name = base::UTF16ToUTF8(duplicate_name_u16); - int found_duplicate_number; - - if (RE2::PartialMatch(duplicate_name, kDuplicateNumberRegex, - &found_duplicate_number)) { - RE2::Replace( - &duplicate_name, kDuplicateNumberRegex, - base::StringPrintf(kDuplicateNumberFormat, found_duplicate_number + 1)); - } else { - duplicate_name.append(kInitialDuplicateNumberValue); - } - - return base::UTF8ToUTF16(duplicate_name); -} - } // namespace LocalDeskDataManager::LocalDeskDataManager(const base::FilePath& path) @@ -227,7 +200,7 @@ base::Unretained(this), uuid, status.get(), entry_ptr.get()), base::BindOnce(&LocalDeskDataManager::OnGetEntryByUuid, - weak_ptr_factory_.GetWeakPtr(), std::move(status), + weak_ptr_factory_.GetWeakPtr(), uuid, std::move(status), std::move(entry_ptr), std::move(callback))); } @@ -278,11 +251,11 @@ } std::size_t LocalDeskDataManager::GetEntryCount() const { - return templates_.size(); + return templates_.size() + policy_entries_.size(); } std::size_t LocalDeskDataManager::GetMaxEntryCount() const { - return kMaxTemplateCount; + return kMaxTemplateCount + policy_entries_.size(); } std::vector<base::GUID> LocalDeskDataManager::GetAllEntryUuids() const { @@ -394,11 +367,20 @@ } void LocalDeskDataManager::OnGetEntryByUuid( + const std::string& uuid_str, std::unique_ptr<DeskModel::GetEntryByUuidStatus> status_ptr, std::unique_ptr<ash::DeskTemplate*> entry_ptr_ptr, DeskModel::GetEntryByUuidCallback callback) { if (*entry_ptr_ptr == nullptr) { - std::move(callback).Run(*status_ptr, std::unique_ptr<ash::DeskTemplate>()); + std::unique_ptr<ash::DeskTemplate> policy_entry = + GetAdminDeskTemplateByUUID(uuid_str); + + if (policy_entry) { + std::move(callback).Run(DeskModel::GetEntryByUuidStatus::kOk, + std::move(policy_entry)); + } else { + std::move(callback).Run(*status_ptr, nullptr); + } } else { std::move(callback).Run(*status_ptr, (*entry_ptr_ptr)->Clone()); } @@ -430,7 +412,8 @@ // the current template will be named 5. while (HasTemplateWithName(new_entry->template_name())) { new_entry->set_template_name( - AppendDuplicateNumberToDuplicateName(new_entry->template_name())); + desk_template_util::AppendDuplicateNumberToDuplicateName( + new_entry->template_name())); } templates_[uuid] = std::move(new_entry);
diff --git a/components/desks_storage/core/local_desk_data_manager.h b/components/desks_storage/core/local_desk_data_manager.h index d7ac601..20ab24c0 100644 --- a/components/desks_storage/core/local_desk_data_manager.h +++ b/components/desks_storage/core/local_desk_data_manager.h
@@ -89,6 +89,7 @@ // Wrapper method to call GetEntryByUuidCallback. void OnGetEntryByUuid( + const std::string& uuid_str, std::unique_ptr<DeskModel::GetEntryByUuidStatus> status_ptr, std::unique_ptr<ash::DeskTemplate*> entry_ptr_ptr, DeskModel::GetEntryByUuidCallback callback);
diff --git a/components/desks_storage/core/local_desks_data_manager_unittests.cc b/components/desks_storage/core/local_desks_data_manager_unittests.cc index ba11cf1..616390c 100644 --- a/components/desks_storage/core/local_desks_data_manager_unittests.cc +++ b/components/desks_storage/core/local_desks_data_manager_unittests.cc
@@ -53,7 +53,7 @@ const std::string kPolicyWithOneTemplate = "[{\"version\":1,\"uuid\":\"" + kTestUuid9 + "\",\"name\":\"" - "Example Template" + "Admin Template 1" "\",\"created_time_usec\":\"1633535632\",\"updated_time_usec\": " "\"1633535632\",\"desk\":{\"apps\":[{\"window_" "bound\":{\"left\":0,\"top\":1,\"height\":121,\"width\":120},\"window_" @@ -209,6 +209,28 @@ testing::Test::SetUp(); } + void AddTwoTemplates() { + base::RunLoop loop1; + data_manager_->AddOrUpdateEntry( + std::move(sample_desk_template_one_), + base::BindLambdaForTesting( + [&](DeskModel::AddOrUpdateEntryStatus status) { + EXPECT_EQ(DeskModel::AddOrUpdateEntryStatus::kOk, status); + loop1.Quit(); + })); + loop1.Run(); + + base::RunLoop loop2; + data_manager_->AddOrUpdateEntry( + std::move(sample_desk_template_two_), + base::BindLambdaForTesting( + [&](DeskModel::AddOrUpdateEntryStatus status) { + EXPECT_EQ(DeskModel::AddOrUpdateEntryStatus::kOk, status); + loop2.Quit(); + })); + loop2.Run(); + } + base::ScopedTempDir temp_dir_; std::unique_ptr<ash::DeskTemplate> sample_desk_template_one_; std::unique_ptr<ash::DeskTemplate> sample_desk_template_one_duplicate_; @@ -409,6 +431,27 @@ task_environment_.RunUntilIdle(); } +TEST_F(LocalDeskDataManagerTest, GetEntryByUuidShouldReturnAdminTemplate) { + data_manager_->AddOrUpdateEntry(std::move(sample_desk_template_one_), + base::BindOnce(&VerifyEntryAddedCorrectly)); + + // Set admin template with UUID: kTestUuid9. + data_manager_->SetPolicyDeskTemplates(kPolicyWithOneTemplate); + + data_manager_->GetEntryByUUID( + kTestUuid9, + base::BindLambdaForTesting([&](DeskModel::GetEntryByUuidStatus status, + std::unique_ptr<ash::DeskTemplate> entry) { + EXPECT_EQ(DeskModel::GetEntryByUuidStatus::kOk, status); + EXPECT_EQ(base::GUID::ParseCaseInsensitive(kTestUuid9), entry->uuid()); + EXPECT_EQ(ash::DeskTemplateSource::kPolicy, entry->source()); + EXPECT_EQ(base::UTF8ToUTF16(std::string("Admin Template 1")), + entry->template_name()); + })); + + task_environment_.RunUntilIdle(); +} + TEST_F(LocalDeskDataManagerTest, GetEntryByUuidReturnsNotFoundIfEntryDoesNotExist) { base::RunLoop loop; @@ -526,4 +569,31 @@ loop.Run(); } +TEST_F(LocalDeskDataManagerTest, + GetEntryCountShouldIncludeBothUserAndAdminTemplates) { + // Add two user templates. + AddTwoTemplates(); + + // Set one admin template. + data_manager_->SetPolicyDeskTemplates(kPolicyWithOneTemplate); + + // There should be 3 templates: 2 user templates + 1 admin template. + EXPECT_EQ(3ul, data_manager_->GetEntryCount()); +} + +TEST_F(LocalDeskDataManagerTest, + GetMaxEntryCountShouldIncreaseWithAdminTemplates) { + // Add two user templates. + AddTwoTemplates(); + + std::size_t max_entry_count = data_manager_->GetMaxEntryCount(); + + // Set one admin template. + data_manager_->SetPolicyDeskTemplates(kPolicyWithOneTemplate); + + // The max entry count should increase by 1 since we have set an admin + // template. + EXPECT_EQ(max_entry_count + 1ul, data_manager_->GetMaxEntryCount()); +} + } // namespace desks_storage
diff --git a/components/history_clusters/core/clustering_test_utils.cc b/components/history_clusters/core/clustering_test_utils.cc index 2d6a65d1..dacbdbf 100644 --- a/components/history_clusters/core/clustering_test_utils.cc +++ b/components/history_clusters/core/clustering_test_utils.cc
@@ -4,6 +4,8 @@ #include "components/history_clusters/core/clustering_test_utils.h" +#include "base/strings/string_util.h" +#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" namespace history_clusters { @@ -29,8 +31,36 @@ VisitResult::VisitResult(const VisitResult& other) = default; VisitResult::~VisitResult() = default; +std::string VisitResult::ToString() const { + std::string duplicate_visits_string = "{}"; + if (!duplicate_visits_.empty()) { + std::vector<std::string> duplicate_visits_strings; + for (const auto& dup_visit : duplicate_visits_) { + // In case of multiple layers of nesting, indent inner layers a bit more. + std::string dup_visit_string = dup_visit.ToString(); + base::ReplaceChars(dup_visit_string, "\n", "\n ", &dup_visit_string); + duplicate_visits_strings.push_back(dup_visit_string); + } + duplicate_visits_string = base::StringPrintf( + "{\n %s\n}", + base::JoinString(duplicate_visits_strings, "\n ").c_str()); + } + return base::StringPrintf( + "VisitResult(visit_id=%d, score=%f, duplicate_visits=%s, " + "is_search_visit=%s)", + visit_id_, score_, duplicate_visits_string.c_str(), + (is_search_visit_ ? "true" : "false")); +} + +std::ostream& operator<<(std::ostream& os, const VisitResult& vr) { + os << vr.ToString(); + return os; +} + bool VisitResult::operator==(const VisitResult& rhs) const { - return visit_id_ == rhs.visit_id_ && score_ == rhs.score_ && + constexpr const double kScoreTolerance = 1e-6; + return visit_id_ == rhs.visit_id_ && + abs(score_ - rhs.score_) <= kScoreTolerance && duplicate_visits_ == rhs.duplicate_visits_ && is_search_visit_ == rhs.is_search_visit_; }
diff --git a/components/history_clusters/core/clustering_test_utils.h b/components/history_clusters/core/clustering_test_utils.h index 1a2980d..c24d51c 100644 --- a/components/history_clusters/core/clustering_test_utils.h +++ b/components/history_clusters/core/clustering_test_utils.h
@@ -5,6 +5,7 @@ #ifndef COMPONENTS_HISTORY_CLUSTERS_CORE_CLUSTERING_TEST_UTILS_H_ #define COMPONENTS_HISTORY_CLUSTERS_CORE_CLUSTERING_TEST_UTILS_H_ +#include <ostream> #include <vector> #include "base/time/time.h" @@ -27,13 +28,19 @@ bool operator==(const VisitResult& rhs) const; + std::string ToString() const; + private: + friend std::ostream& operator<<(std::ostream& os, const VisitResult& dt); + const int visit_id_; const float score_; std::vector<VisitResult> duplicate_visits_; const bool is_search_visit_; }; +std::ostream& operator<<(std::ostream& os, const VisitResult& dt); + // Converts |clusters| to VisitResults which are easier to test equality for. std::vector<std::vector<testing::VisitResult>> ToVisitResults( const std::vector<history::Cluster>& clusters);
diff --git a/components/history_clusters/core/on_device_clustering_features.cc b/components/history_clusters/core/on_device_clustering_features.cc index e49f8428..43fcc20 100644 --- a/components/history_clusters/core/on_device_clustering_features.cc +++ b/components/history_clusters/core/on_device_clustering_features.cc
@@ -114,6 +114,12 @@ return std::max(0.f, weight); } +float HasPageTitleRankingWeight() { + float weight = GetFieldTrialParamByFeatureAsDouble( + kOnDeviceClustering, "has_page_title_ranking_weight", 2.0); + return std::max(0.f, weight); +} + bool ContentClusterOnIntersectionSimilarity() { return GetFieldTrialParamByFeatureAsBool( kOnDeviceClustering, "use_content_clustering_intersection_similarity",
diff --git a/components/history_clusters/core/on_device_clustering_features.h b/components/history_clusters/core/on_device_clustering_features.h index 4923484..f5fac7d0 100644 --- a/components/history_clusters/core/on_device_clustering_features.h +++ b/components/history_clusters/core/on_device_clustering_features.h
@@ -81,6 +81,10 @@ // visits within a cluster. Will always be greater than or equal to 0. float SearchResultsPageRankingWeight(); +// Returns the weight to use for visits that have page titles ranking visits +// within a cluster. Will always be greater than or equal to 0. +float HasPageTitleRankingWeight(); + // Returns true if content clustering should use the intersection similarity // score. Note, if this is used, the threshold used for clustering by content // score should be < .5 (see ContentClusteringSimilarityThreshold above) or the
diff --git a/components/history_clusters/core/ranking_cluster_finalizer.cc b/components/history_clusters/core/ranking_cluster_finalizer.cc index a7e27b8..7653a12 100644 --- a/components/history_clusters/core/ranking_cluster_finalizer.cc +++ b/components/history_clusters/core/ranking_cluster_finalizer.cc
@@ -65,6 +65,10 @@ it->second.set_is_srp(); } + if (!visit.annotated_visit.url_row.title().empty()) { + it->second.set_has_page_title(); + } + // Additional/future attribute checks go here. } }
diff --git a/components/history_clusters/core/ranking_cluster_finalizer.h b/components/history_clusters/core/ranking_cluster_finalizer.h index e96e722..844dada 100644 --- a/components/history_clusters/core/ranking_cluster_finalizer.h +++ b/components/history_clusters/core/ranking_cluster_finalizer.h
@@ -25,7 +25,8 @@ foreground_duration_score_ * features::ForegroundDurationRankingWeight() + bookmark_score_ * features::BookmarkRankingWeight() + - srp_score_ * features::SearchResultsPageRankingWeight(); + srp_score_ * features::SearchResultsPageRankingWeight() + + page_title_score_ * features::HasPageTitleRankingWeight(); } void set_visit_duration_score(float score) { visit_duration_score_ = score; } @@ -38,6 +39,8 @@ void set_is_srp() { srp_score_ = 1.0; } + void set_has_page_title() { page_title_score_ = 1.0; } + private: // The score for the duration associated with a visit. float visit_duration_score_ = 0.0; @@ -47,6 +50,8 @@ float bookmark_score_ = 0.0; // The score for whether the visit was on a search results page. float srp_score_ = 0.0; + // The score for whether the visit had a page title. + float page_title_score_ = 0.0; }; // A cluster finalizer that scores visits based on visit duration.
diff --git a/components/history_clusters/core/ranking_cluster_finalizer_unittest.cc b/components/history_clusters/core/ranking_cluster_finalizer_unittest.cc index ebab797..468b44b 100644 --- a/components/history_clusters/core/ranking_cluster_finalizer_unittest.cc +++ b/components/history_clusters/core/ranking_cluster_finalizer_unittest.cc
@@ -229,5 +229,34 @@ 1, 1.0, {testing::VisitResult(2, 0.0, {}, true)}, true)))); } +TEST_F(RankingClusterFinalizerTest, ScoreVisitsOnHasPageTitle) { + history::ClusterVisit visit1 = testing::CreateClusterVisit( + testing::CreateDefaultAnnotatedVisit(1, GURL("https://foo.com/")), + GURL("https://foo.com/")); + visit1.annotated_visit.url_row.set_title(u"chocolate"); + + history::ClusterVisit visit2 = testing::CreateClusterVisit( + testing::CreateDefaultAnnotatedVisit(2, GURL("https://bar.com/")), + GURL("https://bar.com/")); + visit2.annotated_visit.url_row.set_title(std::u16string()); + + history::ClusterVisit visit3 = testing::CreateClusterVisit( + testing::CreateDefaultAnnotatedVisit(3, GURL("https://baz.com/")), + GURL("https://baz.com/")); + visit3.annotated_visit.url_row.set_title(u"vanilla"); + + history::Cluster cluster; + cluster.visits = {visit1, visit2, visit3}; + FinalizeCluster(cluster); + EXPECT_THAT(testing::ToVisitResults({cluster}), + ElementsAre(ElementsAre( + testing::VisitResult(/*visit_id=*/1, /*score=*/1.0, + /*duplicate_visits=*/{}), + testing::VisitResult(/*visit_id=*/2, /*score=*/0.333333, + /*duplicate_visits=*/{}), + testing::VisitResult(/*visit_id=*/3, /*score=*/1.0, + /*duplicate_visits=*/{})))); +} + } // namespace } // namespace history_clusters
diff --git a/components/messages/android/internal/BUILD.gn b/components/messages/android/internal/BUILD.gn index c6c7b83d..3d04eb0 100644 --- a/components/messages/android/internal/BUILD.gn +++ b/components/messages/android/internal/BUILD.gn
@@ -95,10 +95,8 @@ android_resources("java_resources") { sources = [ - "java/res/drawable-v24/message_bg_tinted.xml", "java/res/drawable/message_bg_tinted.xml", "java/res/layout/message_banner_view.xml", - "java/res/values-night/dimens.xml", "java/res/values/dimens.xml", ] deps = [
diff --git a/components/messages/android/internal/java/res/drawable-v24/message_bg_tinted.xml b/components/messages/android/internal/java/res/drawable-v24/message_bg_tinted.xml deleted file mode 100644 index 8601c314..0000000 --- a/components/messages/android/internal/java/res/drawable-v24/message_bg_tinted.xml +++ /dev/null
@@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2022 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. --> - -<org.chromium.components.browser_ui.widget.SurfaceColorDrawable - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:shape="rectangle" - app:surfaceElevation="@dimen/message_bg_tinted_elev"> - <corners android:radius="@dimen/message_banner_radius"/> -</org.chromium.components.browser_ui.widget.SurfaceColorDrawable>
diff --git a/components/messages/android/internal/java/res/values-night/dimens.xml b/components/messages/android/internal/java/res/values-night/dimens.xml deleted file mode 100644 index e18fbcd1..0000000 --- a/components/messages/android/internal/java/res/values-night/dimens.xml +++ /dev/null
@@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2022 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. --> - -<resources> - <dimen name="message_bg_tinted_elev">@dimen/default_elevation_3</dimen> -</resources>
diff --git a/components/messages/android/internal/java/res/values/dimens.xml b/components/messages/android/internal/java/res/values/dimens.xml index 19b6dd3..5b748f5 100644 --- a/components/messages/android/internal/java/res/values/dimens.xml +++ b/components/messages/android/internal/java/res/values/dimens.xml
@@ -22,6 +22,5 @@ <dimen name="message_horizontal_hide_threshold">24dp</dimen> <dimen name="message_max_horizontal_translation">360dp</dimen> <dimen name="message_max_width">380dp</dimen> - <dimen name="message_bg_tinted_elev">@dimen/default_elevation_0</dimen> </resources>
diff --git a/components/omnibox/browser/BUILD.gn b/components/omnibox/browser/BUILD.gn index 7a3d578..d1b5721 100644 --- a/components/omnibox/browser/BUILD.gn +++ b/components/omnibox/browser/BUILD.gn
@@ -272,7 +272,7 @@ "//components/url_formatter", "//components/variations", "//components/variations/net", - "//extensions/common:common_constants", + "//extensions/buildflags", "//net", "//services/network/public/cpp", "//services/network/public/mojom", @@ -293,6 +293,7 @@ } if (enable_extensions) { + deps += [ "//extensions/common:common_constants" ] sources += [ "omnibox_input_watcher.cc", "omnibox_input_watcher.h",
diff --git a/components/omnibox/browser/DEPS b/components/omnibox/browser/DEPS index c7c1585..18dc0e29 100644 --- a/components/omnibox/browser/DEPS +++ b/components/omnibox/browser/DEPS
@@ -39,6 +39,7 @@ "+content/public/android/java/src/org/chromium/content_public", "+content/public/browser", "+content/public/common", + "+extensions/buildflags/buildflags.h", "+extensions/common/constants.h", "+net", "+services/network/public/cpp",
diff --git a/components/omnibox/browser/omnibox_view.cc b/components/omnibox/browser/omnibox_view.cc index 3e88a80..d06f21f 100644 --- a/components/omnibox/browser/omnibox_view.cc +++ b/components/omnibox/browser/omnibox_view.cc
@@ -25,7 +25,7 @@ #include "components/omnibox/browser/omnibox_edit_model.h" #include "components/omnibox/browser/omnibox_field_trial.h" #include "components/omnibox/common/omnibox_features.h" -#include "extensions/common/constants.h" +#include "extensions/buildflags/buildflags.h" #include "ui/base/l10n/l10n_util.h" #include "url/url_constants.h" @@ -35,6 +35,11 @@ #endif +#if BUILDFLAG(ENABLE_EXTENSIONS) +// GN doesn't understand conditional includes, so we need nogncheck here. +#include "extensions/common/constants.h" // nogncheck +#endif + namespace { // Return true if either non prefix or split autocompletion is enabled. @@ -367,12 +372,20 @@ const std::u16string url_scheme = display_text.substr(scheme.begin, scheme.len); + + const bool is_extension_url = +#if BUILDFLAG(ENABLE_EXTENSIONS) + url_scheme == base::UTF8ToUTF16(extensions::kExtensionScheme); +#else + false; +#endif + // Extension IDs are not human-readable, so deemphasize everything to draw // attention to the human-readable name in the location icon text. // Data URLs are rarely human-readable and can be used for spoofing, so draw // attention to the scheme to emphasize "this is just a bunch of data". // For normal URLs, the host is the best proxy for "identity". - if (url_scheme == base::UTF8ToUTF16(extensions::kExtensionScheme)) + if (is_extension_url) deemphasize = EVERYTHING; else if (url_scheme == url::kDataScheme16) deemphasize = ALL_BUT_SCHEME;
diff --git a/components/omnibox/browser/zero_suggest_provider.cc b/components/omnibox/browser/zero_suggest_provider.cc index 30e6903..c484684 100644 --- a/components/omnibox/browser/zero_suggest_provider.cc +++ b/components/omnibox/browser/zero_suggest_provider.cc
@@ -287,27 +287,7 @@ AutocompleteProviderListener* listener) : BaseSearchProvider(AutocompleteProvider::TYPE_ZERO_SUGGEST, client), listener_(listener), - result_type_running_(NONE) { - // Record whether remote zero suggest is possible for this user / profile. - const TemplateURLService* template_url_service = - client->GetTemplateURLService(); - // Template URL service can be null in tests. - if (template_url_service != nullptr) { - GURL suggest_url = RemoteSuggestionsService::EndpointUrl( - TemplateURLRef::SearchTermsArgs(), template_url_service); - // To check whether this is allowed, use an arbitrary insecure (http) URL - // as the URL we'd want suggestions for. The value of OTHER as the current - // page classification is to correspond with that URL. - UMA_HISTOGRAM_BOOLEAN( - "Omnibox.ZeroSuggest.Eligible.OnProfileOpen", - suggest_url.is_valid() && - CanSendURL(GURL(kArbitraryInsecureUrlString), suggest_url, - template_url_service->GetDefaultSearchProvider(), - metrics::OmniboxEventProto::OTHER, - template_url_service->search_terms_data(), client, - false)); - } -} + result_type_running_(NONE) {} ZeroSuggestProvider::~ZeroSuggestProvider() = default;
diff --git a/components/optimization_guide/core/hints_manager.cc b/components/optimization_guide/core/hints_manager.cc index 7ae4f3a..a7d35d11 100644 --- a/components/optimization_guide/core/hints_manager.cc +++ b/components/optimization_guide/core/hints_manager.cc
@@ -710,8 +710,12 @@ const base::flat_set<GURL>& urls_fetched, absl::optional<std::unique_ptr<proto::GetHintsResponse>> get_hints_response) { - if (!get_hints_response) + if (!get_hints_response) { + if (switches::IsDebugLogsEnabled()) { + DVLOG(0) << "OptimizationGuide: OnHintsForActiveTabsFetched failed"; + } return; + } hint_cache_->UpdateFetchedHints( std::move(*get_hints_response), @@ -735,6 +739,10 @@ } if (!get_hints_response.has_value() || !get_hints_response.value()) { + if (switches::IsDebugLogsEnabled()) { + DVLOG(0) << "OptimizationGuide: OnPageNavigationHintsFetched failed"; + } + if (navigation_url) { PrepareToInvokeRegisteredCallbacks(*navigation_url); } @@ -748,6 +756,10 @@ base::BindOnce(&HintsManager::OnFetchedPageNavigationHintsStored, weak_ptr_factory_.GetWeakPtr(), navigation_data_weak_ptr, navigation_url, page_navigation_hosts_requested)); + + if (switches::IsDebugLogsEnabled()) { + DVLOG(0) << "OptimizationGuide: OnPageNavigationHintsFetched complete"; + } } void HintsManager::OnFetchedActiveTabsHintsStored() { @@ -1058,6 +1070,10 @@ CleanUpBatchUpdateHintsFetcher(request_id); if (!get_hints_response.has_value() || !get_hints_response.value()) { + if (switches::IsDebugLogsEnabled()) { + DVLOG(0) << "OptimizationGuide: OnBatchUpdateHintsFetched for " + << proto::RequestContext_Name(request_context) << " failed"; + } OnBatchUpdateHintsStored(urls_with_pending_callback, optimization_types, callback); return;
diff --git a/components/page_info/android/BUILD.gn b/components/page_info/android/BUILD.gn index d24c868..ed3d20d 100644 --- a/components/page_info/android/BUILD.gn +++ b/components/page_info/android/BUILD.gn
@@ -33,7 +33,6 @@ android_resources("java_resources") { sources = [ - "java/res/drawable-v24/page_info_bg.xml", "java/res/drawable/page_info_bg.xml", "java/res/layout/connection_info.xml", "java/res/layout/page_info.xml", @@ -41,7 +40,6 @@ "java/res/layout/page_info_row.xml", "java/res/layout/page_info_summary.xml", "java/res/layout/page_zoom_view.xml", - "java/res/values-night/dimens.xml", "java/res/values/colors.xml", "java/res/values/dimens.xml", "java/res/values/ids.xml",
diff --git a/components/page_info/android/java/res/drawable-v24/page_info_bg.xml b/components/page_info/android/java/res/drawable-v24/page_info_bg.xml deleted file mode 100644 index f37e0c3..0000000 --- a/components/page_info/android/java/res/drawable-v24/page_info_bg.xml +++ /dev/null
@@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2022 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. --> - -<org.chromium.components.browser_ui.widget.SurfaceColorDrawable - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:shape="rectangle" - app:surfaceElevation="@dimen/page_info_bg_elev"> - <corners - android:bottomLeftRadius="16dp" - android:bottomRightRadius="16dp" - android:topLeftRadius="0dp" - android:topRightRadius="0dp" /> -</org.chromium.components.browser_ui.widget.SurfaceColorDrawable> -
diff --git a/components/page_info/android/java/res/layout/page_info.xml b/components/page_info/android/java/res/layout/page_info.xml index 82b9a4cc..51b25ca 100644 --- a/components/page_info/android/java/res/layout/page_info.xml +++ b/components/page_info/android/java/res/layout/page_info.xml
@@ -10,7 +10,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/sheet_background" + android:background="@color/sheet_bg_color" android:orientation="vertical"> <LinearLayout
diff --git a/components/page_info/android/java/res/layout/page_info_container.xml b/components/page_info/android/java/res/layout/page_info_container.xml index 5c793741..18f4bef 100644 --- a/components/page_info/android/java/res/layout/page_info_container.xml +++ b/components/page_info/android/java/res/layout/page_info_container.xml
@@ -11,7 +11,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/sheet_background" + android:background="@color/sheet_bg_color" android:orientation="vertical"> <LinearLayout
diff --git a/components/page_info/android/java/res/values-night/dimens.xml b/components/page_info/android/java/res/values-night/dimens.xml deleted file mode 100644 index 8f945135ab..0000000 --- a/components/page_info/android/java/res/values-night/dimens.xml +++ /dev/null
@@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2022 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. --> - -<resources> - <!-- Page Info Background Elevation --> - <dimen name="page_info_bg_elev">@dimen/default_elevation_4</dimen> -</resources> \ No newline at end of file
diff --git a/components/page_info/android/java/res/values/dimens.xml b/components/page_info/android/java/res/values/dimens.xml index fa17bbb..dc9ea83 100644 --- a/components/page_info/android/java/res/values/dimens.xml +++ b/components/page_info/android/java/res/values/dimens.xml
@@ -11,9 +11,6 @@ <dimen name="page_info_popup_corners_radius">16dp</dimen> <dimen name="page_info_popup_button_padding_sides">8dp</dimen> - <!-- Page Info Background Elevation --> - <dimen name="page_info_bg_elev">@dimen/default_elevation_0</dimen> - <!-- Page Zoom dimensions --> <dimen name="page_zoom_min_touch_target_size">48dp</dimen> <dimen name="page_zoom_control_spacing">10dp</dimen>
diff --git a/components/page_load_metrics/browser/observers/layout_page_load_metrics_observer.cc b/components/page_load_metrics/browser/observers/layout_page_load_metrics_observer.cc index 75b477f..bfb9c40e 100644 --- a/components/page_load_metrics/browser/observers/layout_page_load_metrics_observer.cc +++ b/components/page_load_metrics/browser/observers/layout_page_load_metrics_observer.cc
@@ -15,13 +15,6 @@ base::UmaHistogramPercentageObsoleteDoNotUse( "Blink.Layout.NGRatio.Blocks", data.ng_layout_block_count * 100 / data.all_layout_block_count); - - base::UmaHistogramPercentage( - "Blink.Layout.NGRatio.FlexboxBlocks", - data.flexbox_ng_layout_block_count * 100 / data.all_layout_block_count); - base::UmaHistogramPercentage( - "Blink.Layout.NGRatio.GridBlocks", - data.grid_ng_layout_block_count * 100 / data.all_layout_block_count); } if (data.all_layout_call_count) { base::UmaHistogramPercentageObsoleteDoNotUse(
diff --git a/components/page_load_metrics/browser/page_load_metrics_observer.h b/components/page_load_metrics/browser/page_load_metrics_observer.h index 424d79c..cc121a9 100644 --- a/components/page_load_metrics/browser/page_load_metrics_observer.h +++ b/components/page_load_metrics/browser/page_load_metrics_observer.h
@@ -135,10 +135,6 @@ // How many times LayoutNG-based LayoutObject::UpdateLayout() is called. uint64_t ng_layout_call_count = 0; - - uint64_t flexbox_ng_layout_block_count = 0; - - uint64_t grid_ng_layout_block_count = 0; }; // Information related to layout shift normalization for different strategies.
diff --git a/components/page_load_metrics/browser/page_load_metrics_update_dispatcher.cc b/components/page_load_metrics/browser/page_load_metrics_update_dispatcher.cc index 2ba0be0..b7ac0bca 100644 --- a/components/page_load_metrics/browser/page_load_metrics_update_dispatcher.cc +++ b/components/page_load_metrics/browser/page_load_metrics_update_dispatcher.cc
@@ -782,10 +782,6 @@ render_data.all_layout_call_count_delta; page_render_data_.ng_layout_call_count += render_data.ng_layout_call_count_delta; - page_render_data_.flexbox_ng_layout_block_count += - render_data.flexbox_ng_layout_block_count_delta; - page_render_data_.grid_ng_layout_block_count += - render_data.grid_ng_layout_block_count_delta; } void PageLoadMetricsUpdateDispatcher::UpdateMainFrameRenderData( @@ -804,10 +800,6 @@ render_data.ng_layout_block_count_delta; main_frame_render_data_.all_layout_call_count += render_data.all_layout_call_count_delta; - main_frame_render_data_.flexbox_ng_layout_block_count += - render_data.flexbox_ng_layout_block_count_delta; - page_render_data_.grid_ng_layout_block_count += - render_data.grid_ng_layout_block_count_delta; } void PageLoadMetricsUpdateDispatcher::OnSubFrameRenderDataChanged(
diff --git a/components/page_load_metrics/common/page_load_metrics.mojom b/components/page_load_metrics/common/page_load_metrics.mojom index d51657a..d09e28c 100644 --- a/components/page_load_metrics/common/page_load_metrics.mojom +++ b/components/page_load_metrics/common/page_load_metrics.mojom
@@ -304,12 +304,6 @@ // How many times LayoutNG-based LayoutObject::UpdateLayout() is called. uint32 ng_layout_call_count_delta; - // How many LayoutNGFlexbox instances were created. - uint32 flexbox_ng_layout_block_count_delta; - - // How many LayoutNGGrid instances were created. - uint32 grid_ng_layout_block_count_delta; - // New layout shifts with timestamps. array<LayoutShift> new_layout_shifts; };
diff --git a/components/page_load_metrics/renderer/metrics_render_frame_observer.cc b/components/page_load_metrics/renderer/metrics_render_frame_observer.cc index 048e4de..0156bfa 100644 --- a/components/page_load_metrics/renderer/metrics_render_frame_observer.cc +++ b/components/page_load_metrics/renderer/metrics_render_frame_observer.cc
@@ -150,17 +150,13 @@ after_input_or_scroll); } -void MetricsRenderFrameObserver::DidObserveLayoutNg( - uint32_t all_block_count, - uint32_t ng_block_count, - uint32_t all_call_count, - uint32_t ng_call_count, - uint32_t flexbox_ng_block_count, - uint32_t grid_ng_block_count) { +void MetricsRenderFrameObserver::DidObserveLayoutNg(uint32_t all_block_count, + uint32_t ng_block_count, + uint32_t all_call_count, + uint32_t ng_call_count) { if (page_timing_metrics_sender_) page_timing_metrics_sender_->DidObserveLayoutNg( - all_block_count, ng_block_count, all_call_count, ng_call_count, - flexbox_ng_block_count, grid_ng_block_count); + all_block_count, ng_block_count, all_call_count, ng_call_count); } void MetricsRenderFrameObserver::DidObserveLazyLoadBehavior(
diff --git a/components/page_load_metrics/renderer/metrics_render_frame_observer.h b/components/page_load_metrics/renderer/metrics_render_frame_observer.h index 069353f..dc5644b 100644 --- a/components/page_load_metrics/renderer/metrics_render_frame_observer.h +++ b/components/page_load_metrics/renderer/metrics_render_frame_observer.h
@@ -62,9 +62,7 @@ void DidObserveLayoutNg(uint32_t all_block_count, uint32_t ng_block_count, uint32_t all_call_count, - uint32_t ng_call_count, - uint32_t flexbox_ng_block_count, - uint32_t grid_ng_block_count) override; + uint32_t ng_call_count) override; void DidObserveLazyLoadBehavior( blink::WebLocalFrameClient::LazyLoadBehavior lazy_load_behavior) override; void DidStartResponse(
diff --git a/components/page_load_metrics/renderer/page_timing_metrics_sender.cc b/components/page_load_metrics/renderer/page_timing_metrics_sender.cc index 870c781..1c9f5bf5 100644 --- a/components/page_load_metrics/renderer/page_timing_metrics_sender.cc +++ b/components/page_load_metrics/renderer/page_timing_metrics_sender.cc
@@ -108,19 +108,14 @@ EnsureSendTimer(); } -void PageTimingMetricsSender::DidObserveLayoutNg( - uint32_t all_block_count, - uint32_t ng_block_count, - uint32_t all_call_count, - uint32_t ng_call_count, - uint32_t flexbox_ng_block_count, - uint32_t grid_ng_block_count) { +void PageTimingMetricsSender::DidObserveLayoutNg(uint32_t all_block_count, + uint32_t ng_block_count, + uint32_t all_call_count, + uint32_t ng_call_count) { render_data_.all_layout_block_count_delta += all_block_count; render_data_.ng_layout_block_count_delta += ng_block_count; render_data_.all_layout_call_count_delta += all_call_count; render_data_.ng_layout_call_count_delta += ng_call_count; - render_data_.flexbox_ng_layout_block_count_delta += flexbox_ng_block_count; - render_data_.grid_ng_layout_block_count_delta += grid_ng_block_count; EnsureSendTimer(); }
diff --git a/components/page_load_metrics/renderer/page_timing_metrics_sender.h b/components/page_load_metrics/renderer/page_timing_metrics_sender.h index d5766260..7631b3801 100644 --- a/components/page_load_metrics/renderer/page_timing_metrics_sender.h +++ b/components/page_load_metrics/renderer/page_timing_metrics_sender.h
@@ -55,9 +55,7 @@ void DidObserveLayoutNg(uint32_t all_block_count, uint32_t ng_block_count, uint32_t all_call_count, - uint32_t ng_call_count, - uint32_t flexbox_ng_block_count, - uint32_t grid_ng_block_count); + uint32_t ng_call_count); void DidObserveLazyLoadBehavior( blink::WebLocalFrameClient::LazyLoadBehavior lazy_load_behavior); void DidObserveMobileFriendlinessChanged(const blink::MobileFriendliness&);
diff --git a/components/page_load_metrics/renderer/page_timing_metrics_sender_unittest.cc b/components/page_load_metrics/renderer/page_timing_metrics_sender_unittest.cc index 0c59de40..8cc6cf4d 100644 --- a/components/page_load_metrics/renderer/page_timing_metrics_sender_unittest.cc +++ b/components/page_load_metrics/renderer/page_timing_metrics_sender_unittest.cc
@@ -307,11 +307,11 @@ metrics_sender_->DidObserveLayoutShift(0.5, false); metrics_sender_->DidObserveLayoutShift(0.5, false); - metrics_sender_->DidObserveLayoutNg(3, 2, 10, 4, 9, 11); - metrics_sender_->DidObserveLayoutNg(2, 0, 7, 5, 13, 15); + metrics_sender_->DidObserveLayoutNg(3, 2, 10, 4); + metrics_sender_->DidObserveLayoutNg(2, 0, 7, 5); metrics_sender_->DidObserveLayoutShift(0.5, true); - mojom::FrameRenderDataUpdate render_data(1.5, 1.0, 5, 2, 17, 9, 21, 26, {}); + mojom::FrameRenderDataUpdate render_data(1.5, 1.0, 5, 2, 17, 9, {}); validator_.UpdateExpectFrameRenderDataUpdate(render_data); metrics_sender_->mock_timer()->Fire();
diff --git a/components/performance_manager/prerendering_browsertest.cc b/components/performance_manager/prerendering_browsertest.cc index a26d346..eb61056 100644 --- a/components/performance_manager/prerendering_browsertest.cc +++ b/components/performance_manager/prerendering_browsertest.cc
@@ -58,7 +58,7 @@ // and wait for the old RenderFrameHost to be deleted after we navigate away // from it. content::DisableBackForwardCacheForTesting( - web_contents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + web_contents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); } void TearDownOnMainThread() override {
diff --git a/components/permissions/android/res/layout/bluetooth_scanning_permission_dialog.xml b/components/permissions/android/res/layout/bluetooth_scanning_permission_dialog.xml index d104fbe..778e2e10 100644 --- a/components/permissions/android/res/layout/bluetooth_scanning_permission_dialog.xml +++ b/components/permissions/android/res/layout/bluetooth_scanning_permission_dialog.xml
@@ -11,7 +11,7 @@ android:orientation="vertical" android:paddingBottom="12dp" android:paddingTop="20dp" - android:background="@drawable/sheet_background"> + android:background="@color/sheet_bg_color"> <include layout="@layout/device_item_list" />
diff --git a/components/permissions/android/res/layout/item_chooser_dialog.xml b/components/permissions/android/res/layout/item_chooser_dialog.xml index a63af7b..78e5819 100644 --- a/components/permissions/android/res/layout/item_chooser_dialog.xml +++ b/components/permissions/android/res/layout/item_chooser_dialog.xml
@@ -10,7 +10,7 @@ android:orientation="vertical" android:paddingBottom="12dp" android:paddingTop="20dp" - android:background="@drawable/sheet_background"> + android:background="@color/sheet_bg_color"> <include layout="@layout/device_item_list" />
diff --git a/components/permissions/features.cc b/components/permissions/features.cc index c5905bcb..1650a20 100644 --- a/components/permissions/features.cc +++ b/components/permissions/features.cc
@@ -67,8 +67,9 @@ "kPermissionPredictionServiceUseUrlOverride", base::FEATURE_DISABLED_BY_DEFAULT}; -const base::Feature kPermissionOnDevicePredictions{ - "PermissionOnDevicePredictions", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kPermissionOnDeviceNotificationPredictions{ + "PermissionOnDeviceNotificationPredictions", + base::FEATURE_DISABLED_BY_DEFAULT}; } // namespace features namespace feature_params {
diff --git a/components/permissions/features.h b/components/permissions/features.h index 2d0c87f..b4d0eda 100644 --- a/components/permissions/features.h +++ b/components/permissions/features.h
@@ -50,7 +50,7 @@ extern const base::Feature kPermissionPredictionServiceUseUrlOverride; COMPONENT_EXPORT(PERMISSIONS_COMMON) -extern const base::Feature kPermissionOnDevicePredictions; +extern const base::Feature kPermissionOnDeviceNotificationPredictions; } // namespace features namespace feature_params {
diff --git a/components/permissions/permission_uma_util.cc b/components/permissions/permission_uma_util.cc index 9fc81d3..d530d78 100644 --- a/components/permissions/permission_uma_util.cc +++ b/components/permissions/permission_uma_util.cc
@@ -1053,6 +1053,13 @@ CONTENT_SETTING_NUM_SETTINGS); } +// static +void PermissionUmaUtil::RecordPermissionPredictionSource( + PermissionPredictionSource prediction_source) { + base::UmaHistogramEnumeration("Permissions.PredictionService.PredictionType", + prediction_source); +} + std::string PermissionUmaUtil::GetPermissionActionString( PermissionAction permission_action) { switch (permission_action) {
diff --git a/components/permissions/permission_uma_util.h b/components/permissions/permission_uma_util.h index a88bec1..c13ecbc 100644 --- a/components/permissions/permission_uma_util.h +++ b/components/permissions/permission_uma_util.h
@@ -241,6 +241,17 @@ kMaxValue = INVALID_END_STATE, }; +// This enum backs up the 'PermissionPredictionSource` histogram enum. It +// indicates whether the permission prediction was done by the local on device +// model or by the server side model. +enum class PermissionPredictionSource { + ON_DEVICE = 0, + SERVER_SIDE = 1, + + // Always keep at the end. + kMaxValue = SERVER_SIDE, +}; + // Provides a convenient way of logging UMA for permission related operations. class PermissionUmaUtil { public: @@ -344,6 +355,9 @@ static void RecordDSEEffectiveSetting(ContentSettingsType permission_type, ContentSetting setting); + static void RecordPermissionPredictionSource( + PermissionPredictionSource prediction_type); + static std::string GetPermissionActionString( PermissionAction permission_action);
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 79d92c6..84950a7 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -4991,7 +4991,7 @@ 'schema': { 'type': 'string' }, 'supported_on': ['chrome.*:9-','android:46-','chrome_os:62-'], 'features': { - 'dynamic_refresh': False, + 'dynamic_refresh': True, 'per_profile': False, }, 'example_value': 'basic,digest,ntlm,negotiate',
diff --git a/components/privacy_sandbox/privacy_sandbox_settings.cc b/components/privacy_sandbox/privacy_sandbox_settings.cc index b739a16..f544462 100644 --- a/components/privacy_sandbox/privacy_sandbox_settings.cc +++ b/components/privacy_sandbox/privacy_sandbox_settings.cc
@@ -233,7 +233,7 @@ bool PrivacySandboxSettings::IsFledgeAllowed( const url::Origin& top_frame_origin, - const GURL& auction_party) { + const url::Origin& auction_party) { // If the sandbox is disabled, then FLEDGE is never allowed. if (!pref_service_->GetBoolean(prefs::kPrivacySandboxApisEnabled)) return false; @@ -241,7 +241,7 @@ // Third party cookies must also be available for this context. An empty site // for cookies is provided so the context is always treated as a third party. return cookie_settings_->IsFullCookieAccessAllowed( - auction_party, net::SiteForCookies(), top_frame_origin); + auction_party.GetURL(), net::SiteForCookies(), top_frame_origin); } std::vector<GURL> PrivacySandboxSettings::FilterFledgeAllowedParties(
diff --git a/components/privacy_sandbox/privacy_sandbox_settings.h b/components/privacy_sandbox/privacy_sandbox_settings.h index ceb8bc25..0c25c67 100644 --- a/components/privacy_sandbox/privacy_sandbox_settings.h +++ b/components/privacy_sandbox/privacy_sandbox_settings.h
@@ -104,7 +104,7 @@ // Determine whether |auction_party| can register an interest group, or sell / // buy in an auction, on |top_frame_origin|. bool IsFledgeAllowed(const url::Origin& top_frame_origin, - const GURL& auction_party); + const url::Origin& auction_party); // Filter |auction_parties| down to those that may participate as a buyer for // auctions run on |top_frame_origin|. Logically equivalent to calling
diff --git a/components/privacy_sandbox/privacy_sandbox_settings_unittest.cc b/components/privacy_sandbox/privacy_sandbox_settings_unittest.cc index 634232e..4ec4dbf5 100644 --- a/components/privacy_sandbox/privacy_sandbox_settings_unittest.cc +++ b/components/privacy_sandbox/privacy_sandbox_settings_unittest.cc
@@ -97,7 +97,7 @@ EXPECT_FALSE(privacy_sandbox_settings()->IsFledgeAllowed( url::Origin::Create(GURL("https://test.com")), - GURL("https://embedded.com"))); + url::Origin::Create(GURL("https://embedded.com")))); EXPECT_EQ(std::vector<GURL>{}, privacy_sandbox_settings()->FilterFledgeAllowedParties( url::Origin::Create(GURL("https://test.com")), @@ -134,7 +134,7 @@ EXPECT_FALSE(privacy_sandbox_settings()->IsFledgeAllowed( url::Origin::Create(GURL("https://test.com")), - GURL("https://embedded.com"))); + url::Origin::Create(GURL("https://embedded.com")))); EXPECT_EQ(std::vector<GURL>{}, privacy_sandbox_settings()->FilterFledgeAllowedParties( url::Origin::Create(GURL("https://test.com")), @@ -172,7 +172,7 @@ EXPECT_FALSE(privacy_sandbox_settings()->IsFledgeAllowed( url::Origin::Create(GURL("https://test.com")), - GURL("https://embedded.com"))); + url::Origin::Create(GURL("https://embedded.com")))); EXPECT_EQ(std::vector<GURL>{}, privacy_sandbox_settings()->FilterFledgeAllowedParties( url::Origin::Create(GURL("https://test.com")), @@ -211,7 +211,7 @@ EXPECT_FALSE(privacy_sandbox_settings()->IsFledgeAllowed( url::Origin::Create(GURL("https://test.com")), - GURL("https://embedded.com"))); + url::Origin::Create(GURL("https://embedded.com")))); EXPECT_EQ(std::vector<GURL>{}, privacy_sandbox_settings()->FilterFledgeAllowedParties( url::Origin::Create(GURL("https://test.com")), @@ -260,7 +260,7 @@ EXPECT_FALSE(privacy_sandbox_settings()->IsFledgeAllowed( url::Origin::Create(GURL("https://test.com")), - GURL("https://embedded.com"))); + url::Origin::Create(GURL("https://embedded.com")))); EXPECT_EQ(std::vector<GURL>{GURL("https://another-embedded.com")}, privacy_sandbox_settings()->FilterFledgeAllowedParties( url::Origin::Create(GURL("https://test.com")), @@ -292,7 +292,7 @@ EXPECT_TRUE(privacy_sandbox_settings()->IsFledgeAllowed( url::Origin::Create(GURL("https://test.com")), - GURL("https://embedded.com"))); + url::Origin::Create(GURL("https://embedded.com")))); // Exceptions which specify a top frame origin should not match against other // top frame origins, or an empty origin. @@ -322,7 +322,7 @@ EXPECT_FALSE(privacy_sandbox_settings()->IsFledgeAllowed( url::Origin::Create(GURL("https://another-test.com")), - GURL("https://embedded.com"))); + url::Origin::Create(GURL("https://embedded.com")))); EXPECT_EQ(std::vector<GURL>{}, privacy_sandbox_settings()->FilterFledgeAllowedParties( url::Origin::Create(GURL("https://test.com")), @@ -357,7 +357,7 @@ EXPECT_FALSE(privacy_sandbox_settings()->IsFledgeAllowed( url::Origin::Create(GURL("https://test.com")), - GURL("https://embedded.com"))); + url::Origin::Create(GURL("https://embedded.com")))); EXPECT_EQ(std::vector<GURL>{GURL("https://another-embedded.com")}, privacy_sandbox_settings()->FilterFledgeAllowedParties( url::Origin::Create(GURL("https://test.com")), @@ -378,7 +378,7 @@ EXPECT_FALSE(privacy_sandbox_settings()->IsFledgeAllowed( url::Origin::Create(GURL("https://test.com")), - GURL("https://embedded.com"))); + url::Origin::Create(GURL("https://embedded.com")))); EXPECT_EQ(std::vector<GURL>{}, privacy_sandbox_settings()->FilterFledgeAllowedParties( url::Origin::Create(GURL("https://test.com")), @@ -396,7 +396,7 @@ EXPECT_FALSE(privacy_sandbox_settings()->IsFledgeAllowed( url::Origin::Create(GURL("https://test.com")), - GURL("https://embedded.com"))); + url::Origin::Create(GURL("https://embedded.com")))); EXPECT_EQ(std::vector<GURL>{}, privacy_sandbox_settings()->FilterFledgeAllowedParties( url::Origin::Create(GURL("https://test.com")), @@ -419,7 +419,7 @@ EXPECT_FALSE(privacy_sandbox_settings()->IsFledgeAllowed( url::Origin::Create(GURL("https://test.com")), - GURL("https://embedded.com"))); + url::Origin::Create(GURL("https://embedded.com")))); EXPECT_EQ(std::vector<GURL>{}, privacy_sandbox_settings()->FilterFledgeAllowedParties( url::Origin::Create(GURL("https://test.com")), @@ -438,7 +438,7 @@ EXPECT_FALSE(privacy_sandbox_settings()->IsFledgeAllowed( url::Origin::Create(GURL("https://test.com")), - GURL("https://embedded.com"))); + url::Origin::Create(GURL("https://embedded.com")))); EXPECT_EQ(std::vector<GURL>{}, privacy_sandbox_settings()->FilterFledgeAllowedParties( url::Origin::Create(GURL("https://test.com")),
diff --git a/components/reporting/metrics/fake_metric_report_queue.h b/components/reporting/metrics/fake_metric_report_queue.h index 9c81145..beee1d1 100644 --- a/components/reporting/metrics/fake_metric_report_queue.h +++ b/components/reporting/metrics/fake_metric_report_queue.h
@@ -32,13 +32,13 @@ void Enqueue(const MetricData& metric_data, ReportQueue::EnqueueCallback callback) override; - void Flush() override; - std::vector<MetricData> GetMetricDataReported() const; int GetNumFlush() const; private: + void Flush() override; + std::vector<MetricData> reported_data_; int num_flush_ = 0;
diff --git a/components/reporting/metrics/metric_data_collector.cc b/components/reporting/metrics/metric_data_collector.cc index 038d075..9858007 100644 --- a/components/reporting/metrics/metric_data_collector.cc +++ b/components/reporting/metrics/metric_data_collector.cc
@@ -119,6 +119,8 @@ void PeriodicCollector::StartPeriodicCollection() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + // Do initial collection at startup. + Collect(); rate_controller_->Start(); }
diff --git a/components/reporting/metrics/metric_data_collector_unittest.cc b/components/reporting/metrics/metric_data_collector_unittest.cc index 21431f2..9d1ab6f 100644 --- a/components/reporting/metrics/metric_data_collector_unittest.cc +++ b/components/reporting/metrics/metric_data_collector_unittest.cc
@@ -197,21 +197,29 @@ settings_->SetBoolean(kEnableSettingPath, true); settings_->SetInteger(kRateSettingPath, interval); - MetricData metric_data[3]; + MetricData metric_data[5]; metric_data[0].mutable_telemetry_data(); metric_data[1].mutable_info_data(); metric_data[2].mutable_event_data(); + metric_data[3].mutable_telemetry_data(); + metric_data[3].mutable_event_data(); + metric_data[4].mutable_info_data(); + metric_data[4].mutable_event_data(); + sampler_->SetMetricData(metric_data[0]); PeriodicCollector collector( sampler_.get(), metric_report_queue_.get(), settings_.get(), kEnableSettingPath, /*setting_enabled_default_value=*/false, kRateSettingPath, base::Milliseconds(interval / 2)); - EXPECT_EQ(sampler_->GetNumCollectCalls(), 0); + // One initial collection at startup. + EXPECT_EQ(sampler_->GetNumCollectCalls(), 1); + FlushTasks(); - int expected_collect_calls = 0; + // Expected calls count initialized to 1 to reflect the initial collection. + int expected_collect_calls = 1; for (int i = 0; i < 2; ++i) { - sampler_->SetMetricData(metric_data[i]); + sampler_->SetMetricData(metric_data[i + 1]); // 5 secs elapsed, no new data collected. task_environment_.FastForwardBy(base::Milliseconds(interval / 2)); EXPECT_EQ(sampler_->GetNumCollectCalls(), expected_collect_calls); @@ -220,15 +228,23 @@ // 10 secs elapsed, data should be collected. task_environment_.FastForwardBy(base::Milliseconds(interval / 2)); EXPECT_EQ(sampler_->GetNumCollectCalls(), expected_collect_calls); + FlushTasks(); } - sampler_->SetMetricData(metric_data[2]); + sampler_->SetMetricData(metric_data[3]); settings_->SetBoolean(kEnableSettingPath, false); // Setting disabled, no data should be collected. task_environment_.FastForwardBy(base::Milliseconds(interval)); EXPECT_EQ(sampler_->GetNumCollectCalls(), expected_collect_calls); + FlushTasks(); settings_->SetBoolean(kEnableSettingPath, true); + // Initial collection at policy enablement. + ++expected_collect_calls; + EXPECT_EQ(sampler_->GetNumCollectCalls(), expected_collect_calls); + FlushTasks(); + + sampler_->SetMetricData(metric_data[4]); // Setting enabled, data should be collected after interval. task_environment_.FastForwardBy(base::Milliseconds(interval / 2)); EXPECT_EQ(sampler_->GetNumCollectCalls(), expected_collect_calls); @@ -239,8 +255,8 @@ FlushTasks(); auto metric_data_reported = metric_report_queue_->GetMetricDataReported(); - ASSERT_EQ(metric_data_reported.size(), 3ul); - for (int i = 0; i < 3; ++i) { + ASSERT_EQ(metric_data_reported.size(), 5ul); + for (int i = 0; i < 5; ++i) { EXPECT_TRUE(metric_data_reported[i].has_timestamp_ms()); EXPECT_EQ(metric_data_reported[i].has_telemetry_data(), metric_data[i].has_telemetry_data()); @@ -259,26 +275,34 @@ MetricData metric_data; metric_data.mutable_telemetry_data(); + sampler_->SetMetricData(std::move(metric_data)); + PeriodicCollector collector( sampler_.get(), metric_report_queue_.get(), settings_.get(), kEnableSettingPath, /*setting_enabled_default_value=*/false, kRateSettingPath, base::Milliseconds(interval / 2)); - sampler_->SetMetricData(metric_data); task_environment_.FastForwardBy(base::Milliseconds(interval)); // Setting is disabled, no data collected. EXPECT_EQ(sampler_->GetNumCollectCalls(), 0); settings_->SetBoolean(kEnableSettingPath, true); - task_environment_.FastForwardBy(base::Milliseconds(interval)); + // One initial collection at policy enablement. EXPECT_EQ(sampler_->GetNumCollectCalls(), 1); + FlushTasks(); + + task_environment_.FastForwardBy(base::Milliseconds(interval)); + // 1 collection at policy enablement + 1 collection after interval. + EXPECT_EQ(sampler_->GetNumCollectCalls(), 2); FlushTasks(); auto metric_data_reported = metric_report_queue_->GetMetricDataReported(); - ASSERT_EQ(metric_data_reported.size(), 1ul); + ASSERT_EQ(metric_data_reported.size(), 2ul); EXPECT_TRUE(metric_data_reported[0].has_timestamp_ms()); EXPECT_TRUE(metric_data_reported[0].has_telemetry_data()); + EXPECT_TRUE(metric_data_reported[1].has_timestamp_ms()); + EXPECT_TRUE(metric_data_reported[1].has_telemetry_data()); } TEST_F(MetricDataCollectorTest, PeriodicCollector_DefaultEnabled) { @@ -288,24 +312,33 @@ MetricData metric_data; metric_data.mutable_telemetry_data(); + sampler_->SetMetricData(std::move(metric_data)); PeriodicCollector collector( sampler_.get(), metric_report_queue_.get(), settings_.get(), "invalid/path", /*setting_enabled_default_value=*/true, kRateSettingPath, base::Milliseconds(interval / 2)); - sampler_->SetMetricData(metric_data); - EXPECT_EQ(sampler_->GetNumCollectCalls(), 0); + // One initial collection at startup. + EXPECT_EQ(sampler_->GetNumCollectCalls(), 1); + FlushTasks(); + metric_data.Clear(); + metric_data.mutable_event_data(); + sampler_->SetMetricData(std::move(metric_data)); // 10 secs elapsed, data should be collected. task_environment_.FastForwardBy(base::Milliseconds(interval)); - EXPECT_EQ(sampler_->GetNumCollectCalls(), 1); + // 1 collection at startup + 1 collection after interval. + EXPECT_EQ(sampler_->GetNumCollectCalls(), 2); FlushTasks(); auto metric_data_reported = metric_report_queue_->GetMetricDataReported(); - ASSERT_EQ(metric_data_reported.size(), 1ul); + ASSERT_EQ(metric_data_reported.size(), 2ul); EXPECT_TRUE(metric_data_reported[0].has_timestamp_ms()); EXPECT_TRUE(metric_data_reported[0].has_telemetry_data()); + EXPECT_TRUE(metric_data_reported[1].has_timestamp_ms()); + EXPECT_FALSE(metric_data_reported[1].has_telemetry_data()); + EXPECT_TRUE(metric_data_reported[1].has_event_data()); } TEST_F(MetricDataCollectorTest, PeriodicCollector_DefaultDisabled) { @@ -320,7 +353,7 @@ "invalid/path", /*setting_enabled_default_value=*/false, kRateSettingPath, base::Milliseconds(interval / 2)); - sampler_->SetMetricData(metric_data); + sampler_->SetMetricData(std::move(metric_data)); task_environment_.FastForwardBy(base::Milliseconds(interval)); FlushTasks(); @@ -334,34 +367,41 @@ settings_->SetBoolean(kEnableSettingPath, true); settings_->SetInteger(kRateSettingPath, interval); - MetricData metric_data[2]; + MetricData metric_data[3]; metric_data[0].mutable_info_data(); metric_data[1].mutable_telemetry_data(); + metric_data[2].mutable_info_data(); auto event_detector = std::make_unique<test::FakeEventDetector>(); auto* event_detector_ptr = event_detector.get(); + sampler_->SetMetricData(metric_data[0]); PeriodicEventCollector collector(sampler_.get(), std::move(event_detector), {}, metric_report_queue_.get(), settings_.get(), kEnableSettingPath, /*setting_enabled_default_value=*/false, kRateSettingPath, base::Milliseconds(15000)); - sampler_->SetMetricData(metric_data[0]); - task_environment_.FastForwardBy(base::Milliseconds(interval)); - // Data collected but should not be reported. + // One initial collection at startup, data collected but not reported. EXPECT_EQ(sampler_->GetNumCollectCalls(), 1); + FlushTasks(); - sampler_->SetMetricData(metric_data[1]); + sampler_->SetMetricData(std::move(metric_data[1])); event_detector_ptr->SetHasEvent(true); task_environment_.FastForwardBy(base::Milliseconds(interval)); // Data collected and reported. EXPECT_EQ(sampler_->GetNumCollectCalls(), 2); + FlushTasks(); + sampler_->SetMetricData(std::move(metric_data[2])); + event_detector_ptr->SetHasEvent(false); + task_environment_.FastForwardBy(base::Milliseconds(interval)); + // Data collected but not reported. + EXPECT_EQ(sampler_->GetNumCollectCalls(), 3); FlushTasks(); auto previous_metric_list = event_detector_ptr->GetPreviousMetricList(); - ASSERT_EQ(previous_metric_list.size(), 2ul); + ASSERT_EQ(previous_metric_list.size(), 3ul); EXPECT_FALSE(previous_metric_list[0].has_timestamp_ms()); EXPECT_FALSE(previous_metric_list[0].has_info_data()); @@ -373,6 +413,11 @@ EXPECT_FALSE(previous_metric_list[1].has_telemetry_data()); EXPECT_FALSE(previous_metric_list[1].has_event_data()); + EXPECT_TRUE(previous_metric_list[2].has_timestamp_ms()); + EXPECT_FALSE(previous_metric_list[2].has_info_data()); + EXPECT_TRUE(previous_metric_list[2].has_telemetry_data()); + EXPECT_TRUE(previous_metric_list[2].has_event_data()); + auto metric_data_reported = metric_report_queue_->GetMetricDataReported(); ASSERT_EQ(metric_data_reported.size(), 1ul); @@ -383,9 +428,7 @@ } TEST_F(MetricDataCollectorTest, PeriodicEventCollector_WithAdditionalSamplers) { - constexpr int interval = 10000; settings_->SetBoolean(kEnableSettingPath, true); - settings_->SetInteger(kRateSettingPath, interval); MetricData metric_data; metric_data.mutable_telemetry_data(); @@ -415,8 +458,9 @@ } auto event_detector = std::make_unique<test::FakeEventDetector>(); - auto* event_detector_ptr = event_detector.get(); + sampler_->SetMetricData(std::move(metric_data)); + event_detector->SetHasEvent(true); PeriodicEventCollector collector(sampler_.get(), std::move(event_detector), std::move(additional_sampler_ptrs), metric_report_queue_.get(), settings_.get(), @@ -424,13 +468,10 @@ /*setting_enabled_default_value=*/false, kRateSettingPath, base::Milliseconds(15000)); - sampler_->SetMetricData(metric_data); - event_detector_ptr->SetHasEvent(true); - task_environment_.FastForwardBy(base::Milliseconds(interval)); // Data collected and reported. EXPECT_EQ(sampler_->GetNumCollectCalls(), 1); - FlushTasks(); + task_environment_.RunUntilIdle(); auto metric_data_reported = metric_report_queue_->GetMetricDataReported(); ASSERT_EQ(metric_data_reported.size(), 1ul);
diff --git a/components/reporting/metrics/metric_report_queue.cc b/components/reporting/metrics/metric_report_queue.cc index a0dbfa7..d571648f 100644 --- a/components/reporting/metrics/metric_report_queue.cc +++ b/components/reporting/metrics/metric_report_queue.cc
@@ -39,6 +39,15 @@ report_queue_->Enqueue(&metric_data, priority_, std::move(callback)); } +void MetricReportQueue::Upload() { + Flush(); + // Restart timer if the metric report queue flush is rate controlled. + if (rate_controller_) { + rate_controller_->Stop(); + rate_controller_->Start(); + } +} + void MetricReportQueue::Flush() { report_queue_->Flush( priority_, base::BindOnce([](Status status) {
diff --git a/components/reporting/metrics/metric_report_queue.h b/components/reporting/metrics/metric_report_queue.h index b279fc8f..ec45833 100644 --- a/components/reporting/metrics/metric_report_queue.h +++ b/components/reporting/metrics/metric_report_queue.h
@@ -46,10 +46,14 @@ virtual void Enqueue(const MetricData& metric_data, ReportQueue::EnqueueCallback callback); + // Initiate manual upload of records with `priority_` and restart timer if + // exists. + void Upload(); + + private: // Initiate upload of records with `priority_`. virtual void Flush(); - private: const std::unique_ptr<ReportQueue, base::OnTaskRunnerDeleter> report_queue_; const Priority priority_;
diff --git a/components/reporting/metrics/metric_report_queue_unittest.cc b/components/reporting/metrics/metric_report_queue_unittest.cc index 7f675a0..7a9a94d 100644 --- a/components/reporting/metrics/metric_report_queue_unittest.cc +++ b/components/reporting/metrics/metric_report_queue_unittest.cc
@@ -26,6 +26,10 @@ namespace reporting { namespace { +constexpr char kRateSettingPath[] = "rate_path"; +constexpr int kRateMs = 10000; +constexpr base::TimeDelta kDefaultRate = base::Milliseconds(100); + class MetricReportQueueTest : public ::testing::Test { public: void SetUp() override { @@ -34,8 +38,6 @@ } protected: - const std::string kRateSettingPath = "rate_path"; - std::unique_ptr<test::FakeReportingSettings> settings_; Priority priority_; @@ -44,7 +46,7 @@ base::test::TaskEnvironment::TimeSource::MOCK_TIME}; }; -TEST_F(MetricReportQueueTest, ManualFlush) { +TEST_F(MetricReportQueueTest, ManualUpload) { auto mock_queue = std::unique_ptr<::reporting::MockReportQueue, base::OnTaskRunnerDeleter>( new testing::StrictMock<::reporting::MockReportQueue>(), @@ -75,12 +77,63 @@ EXPECT_TRUE(callback_called); EXPECT_CALL(*mock_queue_ptr, Flush(priority_, _)).Times(1); - metric_report_queue.Flush(); + metric_report_queue.Upload(); +} + +TEST_F(MetricReportQueueTest, ManualUploadWithTimer) { + settings_->SetInteger(kRateSettingPath, kRateMs); + + int upload_count = 0; + auto mock_queue = + std::unique_ptr<::reporting::MockReportQueue, base::OnTaskRunnerDeleter>( + new testing::NiceMock<::reporting::MockReportQueue>(), + base::OnTaskRunnerDeleter( + base::ThreadPool::CreateSequencedTaskRunner({}))); + auto* mock_queue_ptr = mock_queue.get(); + MetricData record; + record.set_timestamp_ms(123456); + + MetricReportQueue metric_report_queue(std::move(mock_queue), priority_, + settings_.get(), kRateSettingPath, + kDefaultRate); + + EXPECT_CALL(*mock_queue_ptr, AddRecord(_, _, _)) + .WillOnce([&record, this](base::StringPiece record_string, + Priority actual_priority, + ReportQueue::EnqueueCallback cb) { + std::move(cb).Run(Status()); + MetricData actual_record; + + EXPECT_TRUE(actual_record.ParseFromArray(record_string.data(), + record_string.size())); + EXPECT_EQ(actual_record.timestamp_ms(), record.timestamp_ms()); + EXPECT_EQ(actual_priority, priority_); + }); + bool callback_called = false; + metric_report_queue.Enqueue( + record, base::BindLambdaForTesting( + [&callback_called](Status) { callback_called = true; })); + EXPECT_TRUE(callback_called); + + ON_CALL(*mock_queue_ptr, Flush(priority_, _)).WillByDefault([&]() { + ++upload_count; + }); + task_environment_.FastForwardBy(base::Milliseconds(kRateMs / 2)); + metric_report_queue.Upload(); + ASSERT_EQ(upload_count, 1); + + // Manual upload should have reset the timer so no upload should be expected + // after the time is elapsed. + task_environment_.FastForwardBy(base::Milliseconds(kRateMs / 2)); + ASSERT_EQ(upload_count, 1); + + // Full time elapsed after manual upload, new upload should be initiated. + task_environment_.FastForwardBy(base::Milliseconds(kRateMs / 2)); + ASSERT_EQ(upload_count, 2); } TEST_F(MetricReportQueueTest, RateControlledFlush_TimeNotElapsed) { - constexpr int rate_ms = 10000; - settings_->SetInteger(kRateSettingPath, rate_ms); + settings_->SetInteger(kRateSettingPath, kRateMs); auto mock_queue = std::unique_ptr<::reporting::MockReportQueue, base::OnTaskRunnerDeleter>( new testing::StrictMock<::reporting::MockReportQueue>(), @@ -92,7 +145,7 @@ MetricReportQueue metric_report_queue(std::move(mock_queue), priority_, settings_.get(), kRateSettingPath, - /*default_rate=*/base::Milliseconds(1)); + kDefaultRate); EXPECT_CALL(*mock_queue_ptr, AddRecord(_, _, _)) .WillOnce([&record, this](base::StringPiece record_string, @@ -113,12 +166,11 @@ EXPECT_TRUE(callback_called); EXPECT_CALL(*mock_queue_ptr, Flush).Times(0); - task_environment_.FastForwardBy(base::Milliseconds(rate_ms - 1)); + task_environment_.FastForwardBy(base::Milliseconds(kRateMs - 1)); } TEST_F(MetricReportQueueTest, RateControlledFlush_TimeElapsed) { - constexpr int rate_ms = 10000; - settings_->SetInteger(kRateSettingPath, rate_ms); + settings_->SetInteger(kRateSettingPath, kRateMs); auto mock_queue = std::unique_ptr<::reporting::MockReportQueue, base::OnTaskRunnerDeleter>( new testing::StrictMock<::reporting::MockReportQueue>(), @@ -130,7 +182,7 @@ MetricReportQueue metric_report_queue(std::move(mock_queue), priority_, settings_.get(), kRateSettingPath, - /*default_rate=*/base::Milliseconds(1)); + kDefaultRate); EXPECT_CALL(*mock_queue_ptr, AddRecord(_, _, _)) .WillOnce([&record, this](base::StringPiece record_string, @@ -151,7 +203,7 @@ EXPECT_TRUE(callback_called); EXPECT_CALL(*mock_queue_ptr, Flush(priority_, _)).Times(1); - task_environment_.FastForwardBy(base::Milliseconds(rate_ms)); + task_environment_.FastForwardBy(base::Milliseconds(kRateMs)); } } // namespace } // namespace reporting
diff --git a/components/segmentation_platform/internal/segmentation_platform_service_impl.cc b/components/segmentation_platform/internal/segmentation_platform_service_impl.cc index a29d9ef0..5b1bb28 100644 --- a/components/segmentation_platform/internal/segmentation_platform_service_impl.cc +++ b/components/segmentation_platform/internal/segmentation_platform_service_impl.cc
@@ -104,7 +104,6 @@ std::move(signal_storage_config_db), clock); segmentation_result_prefs_ = std::make_unique<SegmentationResultPrefs>(pref_service); - proxy_ = std::make_unique<ServiceProxyImpl>(segment_info_database_.get()); // Construct signal processors. user_action_signal_handler_ = @@ -123,6 +122,9 @@ platform_options_); } + proxy_ = std::make_unique<ServiceProxyImpl>(segment_info_database_.get(), + signal_storage_config_.get(), + &configs_, &segment_selectors_); for (const auto& config : configs_) { for (const auto& segment_id : config->segment_ids) all_segment_ids_.insert(segment_id); @@ -241,6 +243,8 @@ &SegmentationPlatformServiceImpl::OnExecuteDatabaseMaintenanceTasks, weak_ptr_factory_.GetWeakPtr()), kDatabaseMaintenanceDelay); + + proxy_->SetModelExecutionScheduler(model_execution_scheduler_.get()); } void SegmentationPlatformServiceImpl::OnSegmentationModelUpdated(
diff --git a/components/segmentation_platform/internal/segmentation_platform_service_impl_unittest.cc b/components/segmentation_platform/internal/segmentation_platform_service_impl_unittest.cc index 0a058e7..49e2c10 100644 --- a/components/segmentation_platform/internal/segmentation_platform_service_impl_unittest.cc +++ b/components/segmentation_platform/internal/segmentation_platform_service_impl_unittest.cc
@@ -106,8 +106,8 @@ MOCK_METHOD(void, OnServiceStatusChanged, (bool, int), (override)); MOCK_METHOD(void, - OnSegmentInfoAvailable, - ((const std::vector<std::pair<std::string, std::string>>&)), + OnClientInfoAvailable, + (const std::vector<ServiceProxy::ClientInfo>& client_info), (override)); }; @@ -295,7 +295,7 @@ AssertCachedSegment(kTestSegmentationKey3, false); // ServiceProxy will load new segment info from the DB. - EXPECT_CALL(observer_, OnSegmentInfoAvailable(_)); + EXPECT_CALL(observer_, OnClientInfoAvailable(_)); task_environment_.RunUntilIdle(); segment_db_->LoadCallback(true); @@ -313,7 +313,7 @@ "SegmentationPlatform.Signals.ListeningCount.HistogramValue", 1)); // ServiceProxy will load new segment info from the DB. - EXPECT_CALL(observer_, OnSegmentInfoAvailable(_)); + EXPECT_CALL(observer_, OnClientInfoAvailable(_)); task_environment_.RunUntilIdle(); segment_db_->LoadCallback(true); #endif // BUILDFLAG(BUILD_WITH_TFLITE_LIB)
diff --git a/components/segmentation_platform/internal/selection/segment_selector_impl.h b/components/segmentation_platform/internal/selection/segment_selector_impl.h index a7614ab6..08dd2797 100644 --- a/components/segmentation_platform/internal/selection/segment_selector_impl.h +++ b/components/segmentation_platform/internal/selection/segment_selector_impl.h
@@ -45,7 +45,7 @@ // Helper function to update the selected segment in the prefs. Auto-extends // the selection if the new result is unknown. - void UpdateSelectedSegment(OptimizationTarget new_selection); + virtual void UpdateSelectedSegment(OptimizationTarget new_selection); // ModelExecutionScheduler::Observer overrides.
diff --git a/components/segmentation_platform/internal/service_proxy_impl.cc b/components/segmentation_platform/internal/service_proxy_impl.cc index 9b9dae0..0beee89e 100644 --- a/components/segmentation_platform/internal/service_proxy_impl.cc +++ b/components/segmentation_platform/internal/service_proxy_impl.cc
@@ -5,46 +5,62 @@ #include "components/segmentation_platform/internal/service_proxy_impl.h" #include <inttypes.h> +#include <sstream> +#include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" +#include "base/time/time.h" #include "components/optimization_guide/core/model_util.h" +#include "components/optimization_guide/core/optimization_guide_util.h" #include "components/segmentation_platform/internal/database/metadata_utils.h" +#include "components/segmentation_platform/internal/database/signal_storage_config.h" +#include "components/segmentation_platform/internal/scheduler/model_execution_scheduler_impl.h" #include "components/segmentation_platform/internal/segmentation_platform_service_impl.h" +#include "components/segmentation_platform/internal/selection/segment_selector_impl.h" +#include "components/segmentation_platform/public/config.h" +#include "base/logging.h" namespace segmentation_platform { -// static -std::string ServiceProxyImpl::SegmentInfoToString( - const proto::SegmentInfo& segment_info) { - std::string result; - if (segment_info.has_segment_id()) { - result = "segment_id: " + - optimization_guide::GetStringNameForOptimizationTarget( - segment_info.segment_id()) + - "\n"; - } - if (segment_info.has_model_metadata()) { - result.append("model_metadata: { " + - metadata_utils::SegmetationModelMetadataToString( - segment_info.model_metadata()) + - " }\n"); - } - if (segment_info.has_prediction_result()) { - const auto prediction_result = segment_info.prediction_result(); - std::string prediction_result_str = base::StringPrintf( - "prediction_result: { result: %f, timestamp_us: %" PRId64 " }\n", - prediction_result.has_result() ? prediction_result.result() : 0, - prediction_result.has_timestamp_us() ? prediction_result.timestamp_us() - : 0); - result.append(prediction_result_str); - } - return result; +namespace { +std::string SegmentMetadataToString(const proto::SegmentInfo& segment_info) { + if (!segment_info.has_model_metadata()) + return std::string(); + + return "model_metadata: { " + + metadata_utils::SegmetationModelMetadataToString( + segment_info.model_metadata()) + + " }"; } -ServiceProxyImpl::ServiceProxyImpl(SegmentInfoDatabase* segment_db) - : is_service_initialized_(false), - service_status_flag_(0), - segment_db_(segment_db) {} +std::string PredictionResultToString(const proto::SegmentInfo& segment_info) { + if (!segment_info.has_prediction_result()) + return std::string(); + const auto prediction_result = segment_info.prediction_result(); + base::Time time; + if (prediction_result.has_timestamp_us()) { + time = base::Time::FromDeltaSinceWindowsEpoch( + base::Microseconds(prediction_result.timestamp_us())); + } + std::ostringstream time_string; + time_string << time; + return base::StringPrintf( + "result: %f, time: %s", + prediction_result.has_result() ? prediction_result.result() : 0, + time_string.str().c_str()); +} +} // namespace + +ServiceProxyImpl::ServiceProxyImpl( + SegmentInfoDatabase* segment_db, + SignalStorageConfig* signal_storage_config, + std::vector<std::unique_ptr<Config>>* configs, + base::flat_map<std::string, std::unique_ptr<SegmentSelectorImpl>>* + segment_selectors) + : segment_db_(segment_db), + signal_storage_config_(signal_storage_config), + configs_(configs), + segment_selectors_(segment_selectors) {} ServiceProxyImpl::~ServiceProxyImpl() = default; @@ -62,37 +78,111 @@ (service_status_flag_ != status_flag); is_service_initialized_ = is_initialized; service_status_flag_ = status_flag; - if (changed) { + UpdateObservers(changed); +} + +void ServiceProxyImpl::UpdateObservers(bool update_service_status) { + if (update_service_status) { for (Observer& obs : observers_) - obs.OnServiceStatusChanged(is_initialized, status_flag); + obs.OnServiceStatusChanged(is_service_initialized_, service_status_flag_); } if (segment_db_ && (static_cast<int>(ServiceStatus::kSegmentationInfoDbInitialized) & - status_flag)) { + service_status_flag_)) { segment_db_->GetAllSegmentInfo( base::BindOnce(&ServiceProxyImpl::OnGetAllSegmentationInfo, weak_ptr_factory_.GetWeakPtr())); } } -void ServiceProxyImpl::GetServiceStatus() { - OnServiceStatusChanged(is_service_initialized_, service_status_flag_); +void ServiceProxyImpl::SetModelExecutionScheduler( + ModelExecutionScheduler* model_execution_scheduler) { + model_execution_scheduler_ = model_execution_scheduler; } -// Called after retrieving all the segmentation info from the DB. +void ServiceProxyImpl::GetServiceStatus() { + UpdateObservers(true /* update_service_status */); +} + +void ServiceProxyImpl::ExecuteModel(OptimizationTarget segment_id) { + if (!model_execution_scheduler_) + return; + if (segment_id != OptimizationTarget::OPTIMIZATION_TARGET_UNKNOWN) { + model_execution_scheduler_->RequestModelExecution(segment_id); + } +} + +void ServiceProxyImpl::OverwriteResult(OptimizationTarget segment_id, + float result) { + if (!model_execution_scheduler_) + return; + + if (result < 0 || result > 1) + return; + + if (segment_id != OptimizationTarget::OPTIMIZATION_TARGET_UNKNOWN) { + model_execution_scheduler_->OnModelExecutionCompleted( + segment_id, std::make_pair(result, ModelExecutionStatus::kSuccess)); + } +} + +void ServiceProxyImpl::SetSelectedSegment(const std::string& segmentation_key, + OptimizationTarget segment_id) { + if (!segment_selectors_ || + segment_selectors_->find(segmentation_key) == segment_selectors_->end()) { + return; + } + if (segment_id != OptimizationTarget::OPTIMIZATION_TARGET_UNKNOWN) { + auto& selector = segment_selectors_->at(segmentation_key); + selector->UpdateSelectedSegment(segment_id); + } +} + void ServiceProxyImpl::OnGetAllSegmentationInfo( std::vector<std::pair<OptimizationTarget, proto::SegmentInfo>> segment_info) { - std::vector<std::pair<std::string, std::string>> result; + if (!configs_) + return; + + // Convert the |segment_info| vector to a map for quick lookup. + base::flat_map<OptimizationTarget, proto::SegmentInfo> optimization_targets; for (const auto& info : segment_info) { - result.emplace_back(std::make_pair( - optimization_guide::GetStringNameForOptimizationTarget(info.first), - SegmentInfoToString(info.second))); + optimization_targets[info.first] = info.second; + } + + std::vector<ServiceProxy::ClientInfo> result; + for (const auto& config : *configs_) { + OptimizationTarget selected = + OptimizationTarget::OPTIMIZATION_TARGET_UNKNOWN; + if (segment_selectors_ && + segment_selectors_->find(config->segmentation_key) != + segment_selectors_->end()) { + absl::optional<optimization_guide::proto::OptimizationTarget> target = + segment_selectors_->at(config->segmentation_key) + ->GetCachedSegmentResult() + .segment; + if (target.has_value()) { + selected = target.value(); + } + } + result.emplace_back(config->segmentation_key, selected); + for (const auto& segment_id : config->segment_ids) { + if (!optimization_targets.contains(segment_id)) + continue; + const auto& info = optimization_targets[segment_id]; + result.back().segment_status.emplace_back( + segment_id, SegmentMetadataToString(info), + PredictionResultToString(info), + signal_storage_config_ + ? signal_storage_config_->MeetsSignalCollectionRequirement( + info.model_metadata()) + : false); + } } for (Observer& obs : observers_) - obs.OnSegmentInfoAvailable(result); + obs.OnClientInfoAvailable(result); } } // namespace segmentation_platform
diff --git a/components/segmentation_platform/internal/service_proxy_impl.h b/components/segmentation_platform/internal/service_proxy_impl.h index 067a99e..0b2d117 100644 --- a/components/segmentation_platform/internal/service_proxy_impl.h +++ b/components/segmentation_platform/internal/service_proxy_impl.h
@@ -7,6 +7,8 @@ #include <vector> +#include "base/containers/flat_map.h" +#include "base/memory/raw_ptr.h" #include "base/observer_list.h" #include "components/leveldb_proto/public/proto_database.h" #include "components/optimization_guide/proto/models.pb.h" @@ -16,41 +18,62 @@ using optimization_guide::proto::OptimizationTarget; namespace segmentation_platform { +struct Config; +class SignalStorageConfig; +class ModelExecutionScheduler; +class SegmentSelectorImpl; // A helper class to expose internals of the segmentationss service to a logging // component and/or debug UI. class ServiceProxyImpl : public ServiceProxy { public: - explicit ServiceProxyImpl(SegmentInfoDatabase* segment_db); + ServiceProxyImpl( + SegmentInfoDatabase* segment_db, + SignalStorageConfig* signal_storage_config, + std::vector<std::unique_ptr<Config>>* configs, + base::flat_map<std::string, std::unique_ptr<SegmentSelectorImpl>>* + segment_selectors); ~ServiceProxyImpl() override; - // Helper method to convert |segment_info| to string. - // TODO(qinmin): move this to a common utility class. - static std::string SegmentInfoToString( - const proto::SegmentInfo& segment_info); - void AddObserver(ServiceProxy::Observer* observer) override; void RemoveObserver(ServiceProxy::Observer* observer) override; ServiceProxyImpl(const ServiceProxyImpl& other) = delete; ServiceProxyImpl& operator=(const ServiceProxyImpl& other) = delete; - // Returns the current status of the segmentation service. + void SetModelExecutionScheduler( + ModelExecutionScheduler* model_execution_scheduler); + + // ServiceProxy impl. void GetServiceStatus() override; + void ExecuteModel(OptimizationTarget segment_id) override; + void OverwriteResult(OptimizationTarget segment_id, float result) override; + void SetSelectedSegment(const std::string& segmentation_key, + OptimizationTarget segment_id) override; // Called when segmentation service status changed. void OnServiceStatusChanged(bool is_initialized, int status_flag); private: + // Called to update observers with new segmentation info. If + // |update_service_status| is true, status about the segmentation service will + // be sent. + void UpdateObservers(bool update_service_status); + // Called after retrieving all the segmentation info from the DB. void OnGetAllSegmentationInfo( std::vector<std::pair<OptimizationTarget, proto::SegmentInfo>> segment_info); - bool is_service_initialized_; - int service_status_flag_; - SegmentInfoDatabase* segment_db_; + bool is_service_initialized_ = false; + int service_status_flag_ = 0; + raw_ptr<SegmentInfoDatabase> segment_db_; + raw_ptr<SignalStorageConfig> signal_storage_config_; + raw_ptr<std::vector<std::unique_ptr<Config>>> configs_; base::ObserverList<ServiceProxy::Observer> observers_; + raw_ptr<ModelExecutionScheduler> model_execution_scheduler_{nullptr}; + raw_ptr<base::flat_map<std::string, std::unique_ptr<SegmentSelectorImpl>>> + segment_selectors_; base::WeakPtrFactory<ServiceProxyImpl> weak_ptr_factory_{this}; };
diff --git a/components/segmentation_platform/internal/service_proxy_impl_unittest.cc b/components/segmentation_platform/internal/service_proxy_impl_unittest.cc index 08763c6..d6e200f 100644 --- a/components/segmentation_platform/internal/service_proxy_impl_unittest.cc +++ b/components/segmentation_platform/internal/service_proxy_impl_unittest.cc
@@ -8,39 +8,99 @@ #include "components/leveldb_proto/public/proto_database.h" #include "components/leveldb_proto/testing/fake_db.h" #include "components/optimization_guide/core/model_util.h" +#include "components/optimization_guide/core/optimization_guide_util.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/testing_pref_service.h" +#include "components/segmentation_platform/internal/constants.h" +#include "components/segmentation_platform/internal/platform_options.h" +#include "components/segmentation_platform/internal/scheduler/model_execution_scheduler.h" +#include "components/segmentation_platform/internal/selection/segment_selector_impl.h" +#include "components/segmentation_platform/internal/selection/segmentation_result_prefs.h" +#include "components/segmentation_platform/public/config.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +using testing::_; + namespace segmentation_platform { namespace { // Adds a segment info into a map, and return a copy of it. proto::SegmentInfo AddSegmentInfo( std::map<std::string, proto::SegmentInfo>* db_entries, + Config* config, OptimizationTarget segment_id) { proto::SegmentInfo info; info.set_segment_id(segment_id); db_entries->insert( std::make_pair(base::NumberToString(static_cast<int>(segment_id)), info)); + config->segment_ids.emplace_back(segment_id); return info; } +class MockModelExecutionScheduler : public ModelExecutionScheduler { + public: + MockModelExecutionScheduler() = default; + MOCK_METHOD(void, RequestModelExecution, (OptimizationTarget)); + MOCK_METHOD(void, OnNewModelInfoReady, (const proto::SegmentInfo&)); + MOCK_METHOD(void, RequestModelExecutionForEligibleSegments, (bool)); + MOCK_METHOD(void, + OnModelExecutionCompleted, + (OptimizationTarget, + (const std::pair<float, ModelExecutionStatus>&))); +}; + } // namespace +class FakeSegmentSelectorImpl : public SegmentSelectorImpl { + public: + FakeSegmentSelectorImpl(SegmentationResultPrefs* result_prefs, + const Config* config) + : SegmentSelectorImpl(nullptr, + nullptr, + result_prefs, + config, + nullptr, + PlatformOptions::CreateDefault()) {} + ~FakeSegmentSelectorImpl() override = default; + + void UpdateSelectedSegment(OptimizationTarget new_selection) override { + new_selection_ = new_selection; + } + + OptimizationTarget new_selection() const { return new_selection_; } + + private: + OptimizationTarget new_selection_; +}; + class ServiceProxyImplTest : public testing::Test, public ServiceProxy::Observer { public: ServiceProxyImplTest() = default; ~ServiceProxyImplTest() override = default; + void SetUp() override { + auto config = std::make_unique<Config>(); + config->segmentation_key = "test"; + configs_.emplace_back(std::move(config)); + pref_service_.registry()->RegisterDictionaryPref(kSegmentationResultPref); + } + void SetUpProxy() { DCHECK(!db_); DCHECK(!segment_db_); + auto db = std::make_unique<leveldb_proto::test::FakeDB<proto::SegmentInfo>>( &db_entries_); db_ = db.get(); segment_db_ = std::make_unique<SegmentInfoDatabase>(std::move(db)); - service_proxy_impl_ = std::make_unique<ServiceProxyImpl>(segment_db_.get()); + result_prefs_ = std::make_unique<SegmentationResultPrefs>(&pref_service_); + segment_selectors_["test"] = std::make_unique<FakeSegmentSelectorImpl>( + result_prefs_.get(), configs_.at(0).get()); + service_proxy_impl_ = std::make_unique<ServiceProxyImpl>( + segment_db_.get(), nullptr, &configs_, &segment_selectors_); service_proxy_impl_->AddObserver(this); } @@ -48,6 +108,8 @@ db_entries_.clear(); db_ = nullptr; segment_db_.reset(); + configs_.clear(); + client_info_.clear(); } void OnServiceStatusChanged(bool is_initialized, int status_flag) override { @@ -55,10 +117,9 @@ status_flag_ = status_flag; } - void OnSegmentInfoAvailable( - const std::vector<std::pair<std::string, std::string>>& segment_info) - override { - segment_info_ = segment_info; + void OnClientInfoAvailable( + const std::vector<ServiceProxy::ClientInfo>& client_info) override { + client_info_ = client_info; } protected: @@ -69,7 +130,12 @@ raw_ptr<leveldb_proto::test::FakeDB<proto::SegmentInfo>> db_{nullptr}; std::unique_ptr<SegmentInfoDatabase> segment_db_; std::unique_ptr<ServiceProxyImpl> service_proxy_impl_; - std::vector<std::pair<std::string, std::string>> segment_info_; + std::vector<ServiceProxy::ClientInfo> client_info_; + std::vector<std::unique_ptr<Config>> configs_; + base::flat_map<std::string, std::unique_ptr<SegmentSelectorImpl>> + segment_selectors_; + TestingPrefServiceSimple pref_service_; + std::unique_ptr<SegmentationResultPrefs> result_prefs_; }; TEST_F(ServiceProxyImplTest, GetServiceStatus) { @@ -87,23 +153,108 @@ ASSERT_EQ(status_flag_, 7); db_->LoadCallback(true); - ASSERT_TRUE(segment_info_.empty()); + ASSERT_FALSE(client_info_.empty()); + ASSERT_EQ(client_info_.size(), 1u); } TEST_F(ServiceProxyImplTest, GetSegmentationInfoFromDB) { proto::SegmentInfo info = AddSegmentInfo( - &db_entries_, + &db_entries_, configs_.at(0).get(), OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB); SetUpProxy(); service_proxy_impl_->OnServiceStatusChanged(true, 7); db_->LoadCallback(true); - ASSERT_EQ(segment_info_.size(), 1u); - ASSERT_EQ(segment_info_.at(0).first, - optimization_guide::GetStringNameForOptimizationTarget( - OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB)); - ASSERT_EQ(segment_info_.at(0).second, - ServiceProxyImpl::SegmentInfoToString(info)); + ASSERT_EQ(client_info_.size(), 1u); + ASSERT_EQ(client_info_.at(0).segmentation_key, "test"); + ASSERT_EQ(client_info_.at(0).segment_status.size(), 1u); + ServiceProxy::SegmentStatus status = client_info_.at(0).segment_status.at(0); + ASSERT_EQ(status.segment_id, + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB); + ASSERT_EQ(status.can_execute_segment, false); + ASSERT_TRUE(status.segment_metadata.empty()); + ASSERT_TRUE(status.prediction_result.empty()); } +TEST_F(ServiceProxyImplTest, ExecuteModel) { + proto::SegmentInfo info = AddSegmentInfo( + &db_entries_, configs_.at(0).get(), + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB); + SetUpProxy(); + + service_proxy_impl_->OnServiceStatusChanged(true, 7); + db_->LoadCallback(true); + + MockModelExecutionScheduler scheduler; + // Scheduler is not set, ExecuteModel() will do nothing. + EXPECT_CALL(scheduler, RequestModelExecution(_)).Times(0); + service_proxy_impl_->ExecuteModel( + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB); + + service_proxy_impl_->SetModelExecutionScheduler(&scheduler); + EXPECT_CALL(scheduler, + RequestModelExecution( + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB)) + .Times(1); + service_proxy_impl_->ExecuteModel( + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB); + + EXPECT_CALL(scheduler, RequestModelExecution(_)).Times(0); + service_proxy_impl_->ExecuteModel( + OptimizationTarget::OPTIMIZATION_TARGET_UNKNOWN); +} + +TEST_F(ServiceProxyImplTest, OverwriteResult) { + proto::SegmentInfo info = AddSegmentInfo( + &db_entries_, configs_.at(0).get(), + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB); + SetUpProxy(); + + service_proxy_impl_->OnServiceStatusChanged(true, 7); + db_->LoadCallback(true); + + MockModelExecutionScheduler scheduler; + + // Scheduler is not set, OverwriteValue() will do nothing. + EXPECT_CALL(scheduler, OnModelExecutionCompleted(_, _)).Times(0); + service_proxy_impl_->OverwriteResult( + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB, 0.7); + + // Test with invalid values. + service_proxy_impl_->SetModelExecutionScheduler(&scheduler); + EXPECT_CALL(scheduler, OnModelExecutionCompleted(_, _)).Times(0); + service_proxy_impl_->OverwriteResult( + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB, 1.1); + service_proxy_impl_->OverwriteResult( + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB, -0.1); + + EXPECT_CALL( + scheduler, + OnModelExecutionCompleted( + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB, _)) + .Times(1); + service_proxy_impl_->OverwriteResult( + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB, 0.7); + + EXPECT_CALL(scheduler, OnModelExecutionCompleted(_, _)).Times(0); + service_proxy_impl_->OverwriteResult( + OptimizationTarget::OPTIMIZATION_TARGET_UNKNOWN, 0.7); +} + +TEST_F(ServiceProxyImplTest, SetSelectSegment) { + proto::SegmentInfo info = AddSegmentInfo( + &db_entries_, configs_.at(0).get(), + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB); + SetUpProxy(); + + service_proxy_impl_->OnServiceStatusChanged(true, 7); + db_->LoadCallback(true); + + service_proxy_impl_->SetSelectedSegment( + "test", OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB); + ASSERT_EQ( + OptimizationTarget::OPTIMIZATION_TARGET_SEGMENTATION_NEW_TAB, + static_cast<FakeSegmentSelectorImpl*>(segment_selectors_["test"].get()) + ->new_selection()); +} } // namespace segmentation_platform
diff --git a/components/segmentation_platform/public/BUILD.gn b/components/segmentation_platform/public/BUILD.gn index 3862db2..4f325522 100644 --- a/components/segmentation_platform/public/BUILD.gn +++ b/components/segmentation_platform/public/BUILD.gn
@@ -17,6 +17,7 @@ "segment_selection_result.h", "segmentation_platform_service.cc", "segmentation_platform_service.h", + "service_proxy.cc", "service_proxy.h", ]
diff --git a/components/segmentation_platform/public/service_proxy.cc b/components/segmentation_platform/public/service_proxy.cc new file mode 100644 index 0000000..616fbe3 --- /dev/null +++ b/components/segmentation_platform/public/service_proxy.cc
@@ -0,0 +1,26 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/segmentation_platform/public/service_proxy.h" + +namespace segmentation_platform { + +ServiceProxy::SegmentStatus::SegmentStatus(OptimizationTarget segment_id, + const std::string& segment_metadata, + const std::string& prediction_result, + bool can_execute_segment) + : segment_id(segment_id), + segment_metadata(segment_metadata), + prediction_result(prediction_result), + can_execute_segment(can_execute_segment) {} + +ServiceProxy::ClientInfo::ClientInfo(const std::string& segmentation_key, + OptimizationTarget selected_segment) + : segmentation_key(segmentation_key), selected_segment(selected_segment) {} + +ServiceProxy::ClientInfo::~ClientInfo() = default; + +ServiceProxy::ClientInfo::ClientInfo(const ClientInfo& other) = default; + +} // namespace segmentation_platform \ No newline at end of file
diff --git a/components/segmentation_platform/public/service_proxy.h b/components/segmentation_platform/public/service_proxy.h index 6e9711d1..10f96e4 100644 --- a/components/segmentation_platform/public/service_proxy.h +++ b/components/segmentation_platform/public/service_proxy.h
@@ -5,10 +5,13 @@ #ifndef COMPONENTS_SEGMENTATION_PLATFORM_PUBLIC_SERVICE_PROXY_H_ #define COMPONENTS_SEGMENTATION_PLATFORM_PUBLIC_SERVICE_PROXY_H_ -#include <utility> +#include <string> #include <vector> #include "base/observer_list_types.h" +#include "components/optimization_guide/proto/models.pb.h" + +using optimization_guide::proto::OptimizationTarget; namespace segmentation_platform { @@ -16,12 +19,36 @@ // component and/or debug UI. class ServiceProxy { public: + // Status about a segment. + struct SegmentStatus { + SegmentStatus(OptimizationTarget segment_id, + const std::string& segment_metadata, + const std::string& prediction_result, + bool can_execute_segment); + OptimizationTarget segment_id; + std::string segment_metadata; + std::string prediction_result; + bool can_execute_segment; + }; + + // Information about a client to the segmentation platform. + struct ClientInfo { + ClientInfo(const std::string& segmentation_key, + OptimizationTarget selected_segment); + ~ClientInfo(); + ClientInfo(const ClientInfo& other); + + std::string segmentation_key; + OptimizationTarget selected_segment; + std::vector<SegmentStatus> segment_status; + }; + class Observer : public base::CheckedObserver { public: // Called whenever the servoice status changes. virtual void OnServiceStatusChanged(bool is_initialized, int status_flag) {} - virtual void OnSegmentInfoAvailable( - const std::vector<std::pair<std::string, std::string>>& segment_info) {} + virtual void OnClientInfoAvailable( + const std::vector<ClientInfo>& config_info) {} }; virtual ~ServiceProxy() = default; @@ -35,6 +62,18 @@ // Returns the current status of the segmentation service. virtual void GetServiceStatus() = 0; + // Executes the given segment identified by |segment_id|. + virtual void ExecuteModel(OptimizationTarget segment_id) = 0; + + // Overwrites the result for the given segment identified by |segment_id|. + // This will trigger a new round of segment selection and update the existing + // result in Prefs. + virtual void OverwriteResult(OptimizationTarget segment_id, float result) = 0; + + // Sets the selected segment for the config identified by |segment_id|. + virtual void SetSelectedSegment(const std::string& segmentation_key, + OptimizationTarget segment_id) = 0; + protected: ServiceProxy() = default; };
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager_unittest.cc b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager_unittest.cc index f2344a9..ceb8b12 100644 --- a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager_unittest.cc +++ b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager_unittest.cc
@@ -744,7 +744,7 @@ // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting( RenderViewHostTestHarness::web_contents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); // This test assumes that we're not in DryRun mode. base::test::ScopedFeatureList scoped_feature; scoped_feature.InitAndDisableFeature(kAdTagging);
diff --git a/components/system_media_controls/linux/system_media_controls_linux.cc b/components/system_media_controls/linux/system_media_controls_linux.cc index 4c33825..df55ccef 100644 --- a/components/system_media_controls/linux/system_media_controls_linux.cc +++ b/components/system_media_controls/linux/system_media_controls_linux.cc
@@ -42,6 +42,11 @@ constexpr base::TimeDelta kUpdatePositionInterval = base::Milliseconds(100); +const char kMprisAPINoTrackPath[] = "/org/mpris/MediaPlayer2/TrackList/NoTrack"; + +const char kMprisAPICurrentTrackPathFormatString[] = + "/org/chromium/MediaPlayer2/TrackList/Track%s"; + } // namespace const char kMprisAPIServiceNameFormatString[] = @@ -123,6 +128,19 @@ StopPositionUpdateTimer(); } +void SystemMediaControlsLinux::SetID(const std::string* value) { + if (!value) { + ClearTrackId(); + return; + } + + const std::string track_id = + base::StringPrintf(kMprisAPICurrentTrackPathFormatString, value->c_str()); + SetMetadataPropertyInternal( + "mpris:trackid", + MakeDbusVariant(DbusObjectPath(dbus::ObjectPath(track_id)))); +} + void SystemMediaControlsLinux::SetTitle(const std::u16string& value) { SetMetadataPropertyInternal( "xesam:title", MakeDbusVariant(DbusString(base::UTF16ToUTF8(value)))); @@ -152,6 +170,7 @@ SetTitle(std::u16string()); SetArtist(std::u16string()); SetAlbum(std::u16string()); + ClearTrackId(); ClearPosition(); } @@ -362,6 +381,12 @@ properties_->PropertyUpdated(kMprisAPIPlayerInterfaceName, "Metadata"); } +void SystemMediaControlsLinux::ClearTrackId() { + SetMetadataPropertyInternal( + "mpris:trackid", + MakeDbusVariant(DbusObjectPath(dbus::ObjectPath(kMprisAPINoTrackPath)))); +} + void SystemMediaControlsLinux::ClearPosition() { position_ = absl::nullopt; StopPositionUpdateTimer();
diff --git a/components/system_media_controls/linux/system_media_controls_linux.h b/components/system_media_controls/linux/system_media_controls_linux.h index 7d338ab6..167eafb 100644 --- a/components/system_media_controls/linux/system_media_controls_linux.h +++ b/components/system_media_controls/linux/system_media_controls_linux.h
@@ -62,6 +62,7 @@ void SetIsPlayPauseEnabled(bool value) override; void SetIsStopEnabled(bool value) override {} void SetPlaybackStatus(PlaybackStatus value) override; + void SetID(const std::string* value) override; void SetTitle(const std::u16string& value) override; void SetArtist(const std::u16string& value) override; void SetAlbum(const std::u16string& value) override; @@ -109,6 +110,8 @@ void SetMetadataPropertyInternal(const std::string& property_name, DbusVariant&& new_value); + void ClearTrackId(); + void ClearPosition(); // Updates MPRIS with our current position.
diff --git a/components/system_media_controls/linux/system_media_controls_linux_unittest.cc b/components/system_media_controls/linux/system_media_controls_linux_unittest.cc index 2cc7b32..339772c5 100644 --- a/components/system_media_controls/linux/system_media_controls_linux_unittest.cc +++ b/components/system_media_controls/linux/system_media_controls_linux_unittest.cc
@@ -516,6 +516,61 @@ wait_for_seeked_signal.Run(); } +TEST_F(SystemMediaControlsLinuxTest, ChangingIdEmitsSignal) { + base::RunLoop wait_for_signal; + + // The returned signal should give the new Id. + EXPECT_CALL(*GetExportedObject(), SendSignal(_)) + .WillOnce(WithArg<0>([&wait_for_signal](dbus::Signal* signal) { + ASSERT_NE(nullptr, signal); + dbus::MessageReader reader(signal); + + std::string interface_name; + ASSERT_TRUE(reader.PopString(&interface_name)); + EXPECT_EQ(kMprisAPIPlayerInterfaceName, interface_name); + + dbus::MessageReader changed_properties_reader(nullptr); + ASSERT_TRUE(reader.PopArray(&changed_properties_reader)); + + dbus::MessageReader dict_entry_reader(nullptr); + ASSERT_TRUE(changed_properties_reader.PopDictEntry(&dict_entry_reader)); + + // The changed property name should be "Metadata". + std::string property_name; + ASSERT_TRUE(dict_entry_reader.PopString(&property_name)); + EXPECT_EQ("Metadata", property_name); + + // The new metadata should have the new Id. + dbus::MessageReader metadata_variant_reader(nullptr); + ASSERT_TRUE(dict_entry_reader.PopVariant(&metadata_variant_reader)); + dbus::MessageReader metadata_reader(nullptr); + ASSERT_TRUE(metadata_variant_reader.PopArray(&metadata_reader)); + + dbus::MessageReader metadata_entry_reader(nullptr); + ASSERT_TRUE(metadata_reader.PopDictEntry(&metadata_entry_reader)); + + std::string metadata_property_name; + ASSERT_TRUE(metadata_entry_reader.PopString(&metadata_property_name)); + EXPECT_EQ("mpris:trackid", metadata_property_name); + + dbus::ObjectPath value; + ASSERT_TRUE(metadata_entry_reader.PopVariantOfObjectPath(&value)); + EXPECT_EQ("/org/chromium/MediaPlayer2/TrackList/TrackFooId", + value.value()); + + // Metadata should be the only changed property. + EXPECT_FALSE(changed_properties_reader.HasMoreData()); + + wait_for_signal.Quit(); + })); + + // Setting the ID should emit an + // org.freedesktop.DBus.Properties.PropertiesChanged signal. + const std::string given_id("FooId"); + GetService()->SetID(&given_id); + wait_for_signal.Run(); +} + } // namespace internal } // namespace system_media_controls
diff --git a/components/system_media_controls/mock_system_media_controls.h b/components/system_media_controls/mock_system_media_controls.h index c5649e2..bb782c3 100644 --- a/components/system_media_controls/mock_system_media_controls.h +++ b/components/system_media_controls/mock_system_media_controls.h
@@ -34,6 +34,7 @@ MOCK_METHOD1(SetIsStopEnabled, void(bool value)); MOCK_METHOD1(SetIsSeekToEnabled, void(bool value)); MOCK_METHOD1(SetPlaybackStatus, void(PlaybackStatus value)); + MOCK_METHOD1(SetID, void(const std::string* value)); MOCK_METHOD1(SetTitle, void(const std::u16string& title)); MOCK_METHOD1(SetArtist, void(const std::u16string& artist)); MOCK_METHOD1(SetAlbum, void(const std::u16string& artist));
diff --git a/components/system_media_controls/system_media_controls.h b/components/system_media_controls/system_media_controls.h index 5cad961e..cf583ba 100644 --- a/components/system_media_controls/system_media_controls.h +++ b/components/system_media_controls/system_media_controls.h
@@ -48,6 +48,7 @@ // Setters for metadata. virtual void SetPlaybackStatus(PlaybackStatus value) = 0; + virtual void SetID(const std::string* value) {} virtual void SetTitle(const std::u16string& value) = 0; virtual void SetArtist(const std::u16string& value) = 0; virtual void SetAlbum(const std::u16string& value) = 0;
diff --git a/components/viz/service/display/display_resource_provider_skia.cc b/components/viz/service/display/display_resource_provider_skia.cc index ff13003..1c3a3a2 100644 --- a/components/viz/service/display/display_resource_provider_skia.cc +++ b/components/viz/service/display/display_resource_provider_skia.cc
@@ -129,7 +129,8 @@ ResourceId id, bool maybe_concurrent_reads, bool is_video_plane, - const absl::optional<gfx::ColorSpace>& override_color_space) { + const absl::optional<gfx::ColorSpace>& override_color_space, + bool raw_draw_is_possible) { auto it = resource_provider_->resources_.find(id); DCHECK(it != resource_provider_->resources_.end()); @@ -159,7 +160,8 @@ resource_provider_->external_use_client_->CreateImageContext( resource.transferable.mailbox_holder, resource.transferable.size, resource.transferable.format, maybe_concurrent_reads, - resource.transferable.ycbcr_info, std::move(image_color_space)); + resource.transferable.ycbcr_info, std::move(image_color_space), + raw_draw_is_possible); } resource.locked_for_external_use = true;
diff --git a/components/viz/service/display/display_resource_provider_skia.h b/components/viz/service/display/display_resource_provider_skia.h index 871f818f..3298247 100644 --- a/components/viz/service/display/display_resource_provider_skia.h +++ b/components/viz/service/display/display_resource_provider_skia.h
@@ -59,7 +59,8 @@ bool maybe_concurrent_reads, bool is_video_plane, const absl::optional<gfx::ColorSpace>& override_color_space = - absl::nullopt); + absl::nullopt, + bool raw_draw_if_possible = false); // Unlock all locked resources with a |sync_token|. The |sync_token| should // be waited on before reusing the resource's backing to ensure that any
diff --git a/components/viz/service/display/display_resource_provider_skia_unittest.cc b/components/viz/service/display/display_resource_provider_skia_unittest.cc index e516a37..a3f5f6a9 100644 --- a/components/viz/service/display/display_resource_provider_skia_unittest.cc +++ b/components/viz/service/display/display_resource_provider_skia_unittest.cc
@@ -59,14 +59,15 @@ MOCK_METHOD1(ReleaseImageContexts, gpu::SyncToken( std::vector<std::unique_ptr<ImageContext>> image_contexts)); - MOCK_METHOD6(CreateImageContext, - std::unique_ptr<ImageContext>( - const gpu::MailboxHolder&, - const gfx::Size&, - ResourceFormat, - bool, - const absl::optional<gpu::VulkanYCbCrInfo>& ycbcr_info, - sk_sp<SkColorSpace>)); + MOCK_METHOD7( + CreateImageContext, + std::unique_ptr<ImageContext>(const gpu::MailboxHolder&, + const gfx::Size&, + ResourceFormat, + bool, + const absl::optional<gpu::VulkanYCbCrInfo>&, + sk_sp<SkColorSpace>, + bool)); }; class DisplayResourceProviderSkiaTest : public testing::Test { @@ -158,7 +159,7 @@ auto* image_context = owned_image_context.get(); gpu::MailboxHolder holder; - EXPECT_CALL(client_, CreateImageContext(_, _, _, _, _, _)) + EXPECT_CALL(client_, CreateImageContext(_, _, _, _, _, _, _)) .WillOnce(DoAll(SaveArg<0>(&holder), Return(ByMove(std::move(owned_image_context))))); @@ -238,7 +239,7 @@ auto* image_context = owned_image_context.get(); gpu::MailboxHolder holder; - EXPECT_CALL(client_, CreateImageContext(_, _, _, _, _, _)) + EXPECT_CALL(client_, CreateImageContext(_, _, _, _, _, _, _)) .WillOnce(DoAll(SaveArg<0>(&holder), Return(ByMove(std::move(owned_image_context)))));
diff --git a/components/viz/service/display/external_use_client.h b/components/viz/service/display/external_use_client.h index 80c603e..85e9d09 100644 --- a/components/viz/service/display/external_use_client.h +++ b/components/viz/service/display/external_use_client.h
@@ -121,7 +121,8 @@ ResourceFormat format, bool maybe_concurrent_reads, const absl::optional<gpu::VulkanYCbCrInfo>& ycbcr_info, - sk_sp<SkColorSpace> color_space) = 0; + sk_sp<SkColorSpace> color_space, + bool raw_draw_if_possible) = 0; virtual gpu::SyncToken ReleaseImageContexts( std::vector<std::unique_ptr<ImageContext>> image_contexts) = 0;
diff --git a/components/viz/service/display/skia_renderer.cc b/components/viz/service/display/skia_renderer.cc index 23ba463..ca66736a0 100644 --- a/components/viz/service/display/skia_renderer.cc +++ b/components/viz/service/display/skia_renderer.cc
@@ -574,7 +574,8 @@ SkAlphaType alpha_type = kPremul_SkAlphaType, GrSurfaceOrigin origin = kTopLeft_GrSurfaceOrigin, const absl::optional<gfx::ColorSpace>& - override_colorspace = absl::nullopt); + override_colorspace = absl::nullopt, + bool raw_draw_if_possible = false); ScopedSkImageBuilder(const ScopedSkImageBuilder&) = delete; ScopedSkImageBuilder& operator=(const ScopedSkImageBuilder&) = delete; @@ -597,7 +598,8 @@ bool maybe_concurrent_reads, SkAlphaType alpha_type, GrSurfaceOrigin origin, - const absl::optional<gfx::ColorSpace>& override_color_space) { + const absl::optional<gfx::ColorSpace>& override_color_space, + bool raw_draw_if_possible) { if (!resource_id) return; auto* resource_provider = skia_renderer->resource_provider(); @@ -605,7 +607,7 @@ auto* image_context = skia_renderer->lock_set_for_external_use_->LockResource( resource_id, maybe_concurrent_reads, /*is_video_plane=*/false, - override_color_space); + override_color_space, raw_draw_if_possible); // |ImageContext::image| provides thread safety: (a) this ImageContext is // only accessed by GPU thread after |image| is set and (b) the fields of @@ -2206,9 +2208,18 @@ // |resource_provider()| can be NULL in resourceless software draws, which // should never produce tile quads in the first place. DCHECK(resource_provider()); + + // If quad->ShouldDrawWithBlending() is true, we need to raster tile paint ops + // to an offscreen texture first, and then blend it with content behind the + // tile. Since a tile could be used cross frames, so it would better to not + // use raw draw. + bool raw_draw_if_possible = + is_using_raw_draw_ && !quad->ShouldDrawWithBlending(); ScopedSkImageBuilder builder( this, quad->resource_id(), /*maybe_concurrent_reads=*/false, - quad->is_premultiplied ? kPremul_SkAlphaType : kUnpremul_SkAlphaType); + quad->is_premultiplied ? kPremul_SkAlphaType : kUnpremul_SkAlphaType, + /*origin=*/kTopLeft_GrSurfaceOrigin, + /*override_colorspace=*/absl::nullopt, raw_draw_if_possible); params->vis_tex_coords = cc::MathUtil::ScaleRectProportional( quad->tex_coord_rect, gfx::RectF(quad->rect), params->visible_rect);
diff --git a/components/viz/service/display_embedder/image_context_impl.cc b/components/viz/service/display_embedder/image_context_impl.cc index dcb7dd2..fa08459 100644 --- a/components/viz/service/display_embedder/image_context_impl.cc +++ b/components/viz/service/display_embedder/image_context_impl.cc
@@ -26,14 +26,16 @@ bool maybe_concurrent_reads, const absl::optional<gpu::VulkanYCbCrInfo>& ycbcr_info, sk_sp<SkColorSpace> color_space, - const bool allow_keeping_read_access) + bool allow_keeping_read_access, + bool raw_draw_if_possible) : ImageContext(mailbox_holder, size, resource_format, ycbcr_info, color_space), maybe_concurrent_reads_(maybe_concurrent_reads), - allow_keeping_read_access_(allow_keeping_read_access) {} + allow_keeping_read_access_(allow_keeping_read_access), + raw_draw_if_possible_(raw_draw_if_possible) {} ImageContextImpl::~ImageContextImpl() { if (fallback_context_state_) @@ -169,7 +171,10 @@ return true; } - auto raster = representation_factory->ProduceRaster(mailbox_holder().mailbox); + auto raster = + raw_draw_if_possible_ + ? representation_factory->ProduceRaster(mailbox_holder().mailbox) + : nullptr; if (!raster) return false;
diff --git a/components/viz/service/display_embedder/image_context_impl.h b/components/viz/service/display_embedder/image_context_impl.h index ecc8dc9..00a51c95 100644 --- a/components/viz/service/display_embedder/image_context_impl.h +++ b/components/viz/service/display_embedder/image_context_impl.h
@@ -52,7 +52,8 @@ bool maybe_concurrent_reads, const absl::optional<gpu::VulkanYCbCrInfo>& ycbcr_info, sk_sp<SkColorSpace> color_space, - const bool allow_keeping_read_access = true); + bool allow_keeping_read_access = true, + bool raw_draw_if_possible = false); ImageContextImpl(const ImageContextImpl&) = delete; ImageContextImpl& operator=(const ImageContextImpl&) = delete; @@ -104,6 +105,7 @@ const bool maybe_concurrent_reads_ = false; const bool allow_keeping_read_access_ = true; + const bool raw_draw_if_possible_ = false; // Fallback in case we cannot produce a |representation_|. raw_ptr<gpu::SharedContextState> fallback_context_state_ = nullptr;
diff --git a/components/viz/service/display_embedder/skia_output_surface_impl.cc b/components/viz/service/display_embedder/skia_output_surface_impl.cc index af05aa5..c641d13 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl.cc +++ b/components/viz/service/display_embedder/skia_output_surface_impl.cc
@@ -495,10 +495,12 @@ ResourceFormat format, bool maybe_concurrent_reads, const absl::optional<gpu::VulkanYCbCrInfo>& ycbcr_info, - sk_sp<SkColorSpace> color_space) { - return std::make_unique<ImageContextImpl>(holder, size, format, - maybe_concurrent_reads, ycbcr_info, - std::move(color_space)); + sk_sp<SkColorSpace> color_space, + bool raw_draw_if_possible) { + return std::make_unique<ImageContextImpl>( + holder, size, format, maybe_concurrent_reads, ycbcr_info, + std::move(color_space), + /*allow_keeping_read_access=*/true, raw_draw_if_possible); } void SkiaOutputSurfaceImpl::SwapBuffers(OutputSurfaceFrame frame) {
diff --git a/components/viz/service/display_embedder/skia_output_surface_impl.h b/components/viz/service/display_embedder/skia_output_surface_impl.h index 44a652e..f5dabb9 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl.h +++ b/components/viz/service/display_embedder/skia_output_surface_impl.h
@@ -171,7 +171,8 @@ ResourceFormat format, bool maybe_concurrent_reads, const absl::optional<gpu::VulkanYCbCrInfo>& ycbcr_info, - sk_sp<SkColorSpace> color_space) override; + sk_sp<SkColorSpace> color_space, + bool raw_draw_if_possible) override; void InitDelegatedInkPointRendererReceiver( mojo::PendingReceiver<gfx::mojom::DelegatedInkPointRenderer>
diff --git a/components/viz/test/fake_skia_output_surface.cc b/components/viz/test/fake_skia_output_surface.cc index fa42c11..2701186 100644 --- a/components/viz/test/fake_skia_output_surface.cc +++ b/components/viz/test/fake_skia_output_surface.cc
@@ -184,7 +184,8 @@ ResourceFormat format, bool concurrent_reads, const absl::optional<gpu::VulkanYCbCrInfo>& ycbcr_info, - sk_sp<SkColorSpace> color_space) { + sk_sp<SkColorSpace> color_space, + bool raw_draw_if_possible) { return std::make_unique<ExternalUseClient::ImageContext>( holder, size, format, ycbcr_info, std::move(color_space)); }
diff --git a/components/viz/test/fake_skia_output_surface.h b/components/viz/test/fake_skia_output_surface.h index b881107d..17a6823 100644 --- a/components/viz/test/fake_skia_output_surface.h +++ b/components/viz/test/fake_skia_output_surface.h
@@ -131,7 +131,8 @@ ResourceFormat format, bool concurrent_reads, const absl::optional<gpu::VulkanYCbCrInfo>& ycbcr_info, - sk_sp<SkColorSpace> color_space) override; + sk_sp<SkColorSpace> color_space, + bool raw_draw_if_possible) override; // If set true, callbacks triggering will be in a reverse order as SignalQuery // calls.
diff --git a/content/browser/accessibility/dump_accessibility_browsertest_base.cc b/content/browser/accessibility/dump_accessibility_browsertest_base.cc index 47496f2..4fb5b00 100644 --- a/content/browser/accessibility/dump_accessibility_browsertest_base.cc +++ b/content/browser/accessibility/dump_accessibility_browsertest_base.cc
@@ -314,7 +314,7 @@ // Execute and wait for specified string for (const auto& function_name : scenario_.execute) { - DLOG(INFO) << "executing: " << function_name; + VLOG(1) << "executing: " << function_name; base::Value result = ExecuteScriptAndGetValue(web_contents->GetMainFrame(), function_name); const std::string& str = result.is_string() ? result.GetString() : "";
diff --git a/content/browser/aggregation_service/aggregation_service.h b/content/browser/aggregation_service/aggregation_service.h index cfc09d81..550dded3 100644 --- a/content/browser/aggregation_service/aggregation_service.h +++ b/content/browser/aggregation_service/aggregation_service.h
@@ -5,7 +5,6 @@ #ifndef CONTENT_BROWSER_AGGREGATION_SERVICE_AGGREGATION_SERVICE_H_ #define CONTENT_BROWSER_AGGREGATION_SERVICE_AGGREGATION_SERVICE_H_ -#include "base/callback_forward.h" #include "content/browser/aggregation_service/aggregatable_report_assembler.h" #include "content/browser/aggregation_service/aggregatable_report_sender.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -13,6 +12,7 @@ class GURL; namespace base { +class Time; class Value; } // namespace base @@ -55,6 +55,13 @@ virtual void SendReport(const GURL& url, const base::Value& contents, SendCallback callback) = 0; + + // Deletes all data in storage that were fetched between `delete_begin` and + // `delete_end` time (inclusive). Null times are treated as unbounded lower or + // upper range. + virtual void ClearData(base::Time delete_begin, + base::Time delete_end, + base::OnceClosure done) = 0; }; } // namespace content
diff --git a/content/browser/aggregation_service/aggregation_service_impl.cc b/content/browser/aggregation_service/aggregation_service_impl.cc index c913313..42e009b 100644 --- a/content/browser/aggregation_service/aggregation_service_impl.cc +++ b/content/browser/aggregation_service/aggregation_service_impl.cc
@@ -15,6 +15,7 @@ #include "base/task/lazy_thread_pool_task_runner.h" #include "base/task/task_traits.h" #include "base/time/default_clock.h" +#include "base/time/time.h" #include "base/values.h" #include "content/browser/aggregation_service/aggregatable_report_assembler.h" #include "content/browser/aggregation_service/aggregation_service_storage_sql.h" @@ -104,4 +105,13 @@ return key_storage_; } +void AggregationServiceImpl::ClearData(base::Time delete_begin, + base::Time delete_end, + base::OnceClosure done) { + key_storage_ + .AsyncCall(&AggregationServiceKeyStorage::ClearPublicKeysFetchedBetween) + .WithArgs(delete_begin, delete_end) + .Then(std::move(done)); +} + } // namespace content \ No newline at end of file
diff --git a/content/browser/aggregation_service/aggregation_service_impl.h b/content/browser/aggregation_service/aggregation_service_impl.h index bf010d8..cbb3e641 100644 --- a/content/browser/aggregation_service/aggregation_service_impl.h +++ b/content/browser/aggregation_service/aggregation_service_impl.h
@@ -61,6 +61,9 @@ void SendReport(const GURL& url, const base::Value& contents, SendCallback callback) override; + void ClearData(base::Time delete_begin, + base::Time delete_end, + base::OnceClosure done) override; // AggregationServiceStorageContext: const base::SequenceBound<AggregationServiceKeyStorage>& GetKeyStorage()
diff --git a/content/browser/aggregation_service/aggregation_service_storage_sql.cc b/content/browser/aggregation_service/aggregation_service_storage_sql.cc index 5b1ea31..bd0e6496 100644 --- a/content/browser/aggregation_service/aggregation_service_storage_sql.cc +++ b/content/browser/aggregation_service/aggregation_service_storage_sql.cc
@@ -49,8 +49,6 @@ // currently deprecated. constexpr int kDeprecatedVersionNumber = 0; -constexpr size_t kDeleteStepSize = 100; - bool UpgradeAggregationServiceStorageSqlSchema(sql::Database& db, sql::MetaTable& meta_table) { // Placeholder for database migration logic. @@ -216,34 +214,23 @@ if (!transaction.Begin()) return; - static constexpr char kSelectOriginRangeSql[] = - "SELECT origin_id FROM origins WHERE fetch_time BETWEEN ? AND ? " - " ORDER by fetch_time, origin_id"; - sql::Statement select_origins_statement( - db_.GetCachedStatement(SQL_FROM_HERE, kSelectOriginRangeSql)); - select_origins_statement.BindTime(0, delete_begin); - select_origins_statement.BindTime(1, delete_end); + static constexpr char kDeleteCandidateData[] = + "DELETE FROM origins WHERE fetch_time BETWEEN ? AND ? " + "RETURNING origin_id"; + sql::Statement statement( + db_.GetCachedStatement(SQL_FROM_HERE, kDeleteCandidateData)); + statement.BindTime(0, delete_begin); + statement.BindTime(1, delete_end); - while (true) { // Delete at most kDeleteStepSize origins at a time. - std::vector<int64_t> origin_ids_to_delete; - while (origin_ids_to_delete.size() < kDeleteStepSize && - select_origins_statement.Step()) { - int64_t origin_id = select_origins_statement.ColumnInt64(0); - origin_ids_to_delete.push_back(origin_id); - } - - // Don't proceed to delete partial results if one of the statements fails. - if (!select_origins_statement.Succeeded()) + while (statement.Step()) { + if (!ClearPublicKeysByOriginId(/*origin_id=*/statement.ColumnInt64(0))) { return; - - ClearPublicKeysByOriginIds(origin_ids_to_delete); - - if (origin_ids_to_delete.size() < kDeleteStepSize) - break; - - select_origins_statement.Reset(/*clear_bound_vars = */ false); + } } + if (!statement.Succeeded()) + return; + transaction.Commit(); } @@ -259,33 +246,23 @@ if (!transaction.Begin()) return; - static constexpr char kSelectOriginRangeSql[] = - "SELECT origin_id FROM origins WHERE expiry_time <= ? " - " ORDER BY expiry_time, origin_id"; - sql::Statement select_origins_statement( - db_.GetCachedStatement(SQL_FROM_HERE, kSelectOriginRangeSql)); - select_origins_statement.BindTime(0, delete_end); + static constexpr char kDeleteOriginRangeSql[] = + "DELETE FROM origins WHERE expiry_time <= ? " + "RETURNING origin_id"; + sql::Statement delete_origins_statement( + db_.GetCachedStatement(SQL_FROM_HERE, kDeleteOriginRangeSql)); + delete_origins_statement.BindTime(0, delete_end); - while (true) { // Delete at most kDeleteStepSize origins at a time. - std::vector<int64_t> origin_ids_to_delete; - while (origin_ids_to_delete.size() < kDeleteStepSize && - select_origins_statement.Step()) { - int64_t origin_id = select_origins_statement.ColumnInt64(0); - origin_ids_to_delete.push_back(origin_id); - } - - // Don't proceed to delete partial results if one of the statements fails. - if (!select_origins_statement.Succeeded()) + while (delete_origins_statement.Step()) { + if (!ClearPublicKeysByOriginId( + /*origin_id=*/delete_origins_statement.ColumnInt64(0))) { return; - - ClearPublicKeysByOriginIds(origin_ids_to_delete); - - if (origin_ids_to_delete.size() < kDeleteStepSize) - break; - - select_origins_statement.Reset(/*clear_bound_vars=*/false); + } } + if (!delete_origins_statement.Succeeded()) + return; + transaction.Commit(); } @@ -335,53 +312,35 @@ const url::Origin& origin) { DCHECK(db_.HasActiveTransactions()); - static constexpr char kSelectOriginSql[] = - "SELECT origin_id FROM origins WHERE origin = ? ORDER BY origin_id"; - sql::Statement select_origin_statement( - db_.GetCachedStatement(SQL_FROM_HERE, kSelectOriginSql)); - select_origin_statement.BindString(0, origin.Serialize()); + static constexpr char kDeleteOriginSql[] = + "DELETE FROM origins WHERE origin = ? " + "RETURNING origin_id"; + sql::Statement delete_origin_statement( + db_.GetCachedStatement(SQL_FROM_HERE, kDeleteOriginSql)); + delete_origin_statement.BindString(0, origin.Serialize()); - bool has_matched_origin = select_origin_statement.Step(); + bool has_matched_origin = delete_origin_statement.Step(); - if (!select_origin_statement.Succeeded()) + if (!delete_origin_statement.Succeeded()) return false; if (!has_matched_origin) return true; - int64_t origin_id = select_origin_statement.ColumnInt64(0); - return ClearPublicKeysByOriginIds({origin_id}); + return ClearPublicKeysByOriginId( + /*origin_id=*/delete_origin_statement.ColumnInt64(0)); } -bool AggregationServiceStorageSql::ClearPublicKeysByOriginIds( - const std::vector<int64_t>& origin_ids) { +bool AggregationServiceStorageSql::ClearPublicKeysByOriginId( + int64_t origin_id) { DCHECK(db_.HasActiveTransactions()); - static constexpr char kDeleteOriginSql[] = - "DELETE FROM origins WHERE origin_id = ?"; - sql::Statement delete_origin_statement( - db_.GetCachedStatement(SQL_FROM_HERE, kDeleteOriginSql)); - - for (int64_t origin_id : origin_ids) { - delete_origin_statement.Reset(/*clear_bound_vars=*/true); - delete_origin_statement.BindInt64(0, origin_id); - if (!delete_origin_statement.Run()) - return false; - } - static constexpr char kDeleteKeysSql[] = "DELETE FROM keys WHERE origin_id = ?"; sql::Statement delete_keys_statement( db_.GetCachedStatement(SQL_FROM_HERE, kDeleteKeysSql)); - - for (int64_t origin_id : origin_ids) { - delete_keys_statement.Reset(/*clear_bound_vars=*/true); - delete_keys_statement.BindInt64(0, origin_id); - if (!delete_keys_statement.Run()) - return false; - } - - return true; + delete_keys_statement.BindInt64(0, origin_id); + return delete_keys_statement.Run(); } void AggregationServiceStorageSql::ClearAllPublicKeys() {
diff --git a/content/browser/aggregation_service/aggregation_service_storage_sql.h b/content/browser/aggregation_service/aggregation_service_storage_sql.h index 6e34098ff..12bf37a 100644 --- a/content/browser/aggregation_service/aggregation_service_storage_sql.h +++ b/content/browser/aggregation_service/aggregation_service_storage_sql.h
@@ -107,8 +107,8 @@ bool ClearPublicKeysImpl(const url::Origin& origin) VALID_CONTEXT_REQUIRED(sequence_checker_); - // Deletes all stored public keys for origins from database. - bool ClearPublicKeysByOriginIds(const std::vector<int64_t>& origin_ids) + // Deletes all stored public keys for `origin_id` from database. + bool ClearPublicKeysByOriginId(int64_t origin_id) VALID_CONTEXT_REQUIRED(sequence_checker_); // Clears all stored public keys.
diff --git a/content/browser/audio/audio_service.cc b/content/browser/audio/audio_service.cc index 352f0bb..7f79c7e 100644 --- a/content/browser/audio/audio_service.cc +++ b/content/browser/audio/audio_service.cc
@@ -123,12 +123,12 @@ std::move(receiver), ServiceProcessHost::Options() .WithDisplayName("Audio Service") -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) // On Mac, the audio service requires a CFRunLoop provided by a // UI MessageLoop type, to run AVFoundation and CoreAudio code. // See https://crbug.com/834581. .WithExtraCommandLineSwitches({switches::kMessageLoopTypeUi}) -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) .WithExtraCommandLineSwitches( GetContentClient() ->browser()
diff --git a/content/browser/back_forward_cache_browsertest.cc b/content/browser/back_forward_cache_browsertest.cc index f0b455e..7f6fca06 100644 --- a/content/browser/back_forward_cache_browsertest.cc +++ b/content/browser/back_forward_cache_browsertest.cc
@@ -179,9 +179,9 @@ blink::features::kLoadingTasksUnfreezable, "grace_period_to_finish_loading_in_seconds", base::NumberToString(kGracePeriodToFinishLoading.InSeconds())); -#if defined(OS_ANDROID) - EnableFeatureAndSetParams(features::kBackForwardCache, - "process_binding_strength", "NORMAL"); +#if BUILDFLAG(IS_ANDROID) + EnableFeatureAndSetParams(features::kBackForwardCache, + "process_binding_strength", "NORMAL"); #endif // Allow BackForwardCache for all devices regardless of their memory. DisableFeature(features::kBackForwardCacheMemoryControls); @@ -1123,7 +1123,7 @@ // alive in the same BrowsingInstance does not cause anything to blow up. // TODO(crbug.com/1127979): Flaky on Linux and Windows -#if defined(OS_LINUX) || defined(OS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) #define MAYBE_NavigateToTwoPagesOnSameSite DISABLED_NavigateToTwoPagesOnSameSite #else #define MAYBE_NavigateToTwoPagesOnSameSite NavigateToTwoPagesOnSameSite @@ -1835,7 +1835,7 @@ // Disabled on Linux and Win because of flakiness, see crbug.com/1170802. // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. -#if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || defined(OS_WIN) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_WIN) #define MAYBE_PagehideRunsWhenPageIsHidden DISABLED_PagehideRunsWhenPageIsHidden #else #define MAYBE_PagehideRunsWhenPageIsHidden PagehideRunsWhenPageIsHidden
diff --git a/content/browser/back_forward_cache_features_browsertest.cc b/content/browser/back_forward_cache_features_browsertest.cc index c4b55e9..daa973f 100644 --- a/content/browser/back_forward_cache_features_browsertest.cc +++ b/content/browser/back_forward_cache_features_browsertest.cc
@@ -1028,7 +1028,7 @@ } // TODO(https://crbug.com/154571): Shared workers are not available on Android. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_PageWithSharedWorkerNotCached \ DISABLED_PageWithSharedWorkerNotCached #else @@ -1249,7 +1249,7 @@ // Since blink::mojom::HidService binder is not added in // content/browser/browser_interface_binders.cc for Android, this test is not // applicable for this OS. -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(BackForwardCacheBrowserTest, DoesNotCacheIfWebHID) { ASSERT_TRUE(embedded_test_server()->Start()); @@ -1281,7 +1281,7 @@ {blink::scheduler::WebSchedulerTrackedFeature::kWebHID}, {}, {}, {}, FROM_HERE); } -#endif // !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(BackForwardCacheBrowserTest, WakeLockReleasedUponEnteringBfcache) { @@ -2241,7 +2241,7 @@ // Disabled on Android, since we have problems starting up the websocket test // server in the host -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_WebSocketCachedIfClosed DISABLED_WebSocketCachedIfClosed #else #define MAYBE_WebSocketCachedIfClosed WebSocketCachedIfClosed @@ -2369,7 +2369,7 @@ // Disabled on Android, since we have problems starting up the websocket test // server in the host -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_WebSocketNotCached DISABLED_WebSocketNotCached #else #define MAYBE_WebSocketNotCached WebSocketNotCached @@ -3115,7 +3115,7 @@ } } -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // Check that the back-forward cache is disabled when the Serial API is used. IN_PROC_BROWSER_TEST_F(BackForwardCacheBrowserTest, Serial) { // Serial API requires HTTPS. @@ -3586,11 +3586,11 @@ // long as it doesn't make a connection. // On the Android test environments, the test might fail due to IP restrictions. // See the discussion at http://crrev.com/c/2564926. -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // TODO(https://crbug.com/1213145): The test is consistently failing on some Mac // bots. -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #define MAYBE_TrivialRTCPeerConnectionCached \ DISABLED_TrivialRTCPeerConnectionCached #else @@ -3662,17 +3662,17 @@ }); )")); } -#endif // !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) // This tests that a page using WebRTC and creating actual connections cannot be // cached. // On the Android test environments, the test might fail due to IP restrictions. // See the discussion at http://crrev.com/c/2564926. -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // TODO(https://crbug.com/1213145): The test is consistently failing on some Mac // bots. -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #define MAYBE_NonTrivialRTCPeerConnectionNotCached \ DISABLED_NonTrivialRTCPeerConnectionNotCached #else @@ -3749,7 +3749,7 @@ {blink::scheduler::WebSchedulerTrackedFeature::kWebRTC}, {}, {}, {}, FROM_HERE); } -#endif // !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(BackForwardCacheBrowserTest, WebLocksNotCached) { ASSERT_TRUE(embedded_test_server()->Start()); @@ -3816,11 +3816,11 @@ } // TODO(https://crbug.com/1286474): This test is flaking on some Android bots. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_PresentationConnectionClosed DISABLED_PresentationConnectionClosed #else #define MAYBE_PresentationConnectionClosed PresentationConnectionClosed -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(BackForwardCacheBrowserTest, MAYBE_PresentationConnectionClosed) { ASSERT_TRUE(CreateHttpsServer()->Start()); @@ -3954,7 +3954,7 @@ // This test is not important for Chrome OS if TTS is called in content. For // more details refer (content/browser/speech/tts_platform_impl.cc). -#if defined(OS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) #define MAYBE_DoesNotCacheIfUsingSpeechSynthesis \ DISABLED_DoesNotCacheIfUsingSpeechSynthesis #else
diff --git a/content/browser/back_forward_cache_internal_browsertest.cc b/content/browser/back_forward_cache_internal_browsertest.cc index 26077b08..cc2bc0f 100644 --- a/content/browser/back_forward_cache_internal_browsertest.cc +++ b/content/browser/back_forward_cache_internal_browsertest.cc
@@ -546,7 +546,7 @@ // Disable the BackForwardCache. web_contents()->GetController().GetBackForwardCache().DisableForTesting( - BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); // Navigate to a page that would normally be cacheable. EXPECT_TRUE(NavigateToURL( @@ -2150,7 +2150,7 @@ EXPECT_EQ(rfh_a, current_frame_host()); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(BackForwardCacheBrowserTest, ChildImportanceTestForBackForwardCachedPagesTest) { web_contents()->SetPrimaryMainFrameImportance(
diff --git a/content/browser/back_forward_cache_no_store_browsertest.cc b/content/browser/back_forward_cache_no_store_browsertest.cc index a68aebc..9b360fd 100644 --- a/content/browser/back_forward_cache_no_store_browsertest.cc +++ b/content/browser/back_forward_cache_no_store_browsertest.cc
@@ -767,7 +767,7 @@ } // TODO(https://crbug.com/1231849): flaky on Cast Linux. -#if defined(OS_LINUX) +#if BUILDFLAG(IS_LINUX) #define MAYBE_PagesWithCacheControlNoStoreEvictedWithBothCookieReasons \ DISABLED_PagesWithCacheControlNoStoreEvictedWithBothCookieReasons #else @@ -846,7 +846,7 @@ }; // TODO(https://crbug.com/1231849): flaky on Cast Linux. -#if defined(OS_LINUX) +#if BUILDFLAG(IS_LINUX) #define MAYBE_NoCacheControlNoStoreButHTTPOnlyCookieChange \ DISABLED_NoCacheControlNoStoreButHTTPOnlyCookieChange #else @@ -888,7 +888,7 @@ } // TODO(https://crbug.com/1231849): flaky on Cast Linux. -#if defined(OS_LINUX) +#if BUILDFLAG(IS_LINUX) #define MAYBE_PagesWithCacheControlNoStoreNotEvictedIfNormalCookieChange \ DISABLED_PagesWithCacheControlNoStoreNotEvictedIfNormalCookieChange #else @@ -936,7 +936,7 @@ } // TODO(https://crbug.com/1231849): flaky on Cast Linux. -#if defined(OS_LINUX) +#if BUILDFLAG(IS_LINUX) #define MAYBE_PagesWithCacheControlNoStoreEvictedIfHTTPOnlyCookieChange \ DISABLED_PagesWithCacheControlNoStoreEvictedIfHTTPOnlyCookieChange #else @@ -999,7 +999,7 @@ } // TODO(https://crbug.com/1231849): flaky on Cast Linux. -#if defined(OS_LINUX) +#if BUILDFLAG(IS_LINUX) #define MAYBE_PagesWithCacheControlNoStoreEvictedIfJSAndHTTPOnlyCookieChange \ DISABLED_PagesWithCacheControlNoStoreEvictedIfJSAndHTTPOnlyCookieChange #else
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc index ba3ca51..d13c92e 100644 --- a/content/browser/browser_child_process_host_impl.cc +++ b/content/browser/browser_child_process_host_impl.cc
@@ -51,17 +51,17 @@ #include "mojo/public/cpp/system/platform_handle.h" #include "services/tracing/public/cpp/trace_startup.h" -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "content/browser/child_process_task_port_provider_mac.h" #include "content/browser/sandbox_support_mac_impl.h" #include "content/common/sandbox_support_mac.mojom.h" #endif -#if defined(OS_POSIX) && !defined(OS_ANDROID) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) #include "services/tracing/public/cpp/system_tracing_service.h" #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "content/browser/renderer_host/dwrite_font_proxy_impl_win.h" #include "content/public/common/font_cache_dispatcher_win.h" #include "content/public/common/font_cache_win.mojom.h" @@ -141,7 +141,7 @@ return nullptr; } -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) base::PortProvider* BrowserChildProcessHost::GetPortProvider() { return ChildProcessTaskPortProvider::GetInstance(); } @@ -318,7 +318,7 @@ notify_child_connection_status_ = true; #if BUILDFLAG(CLANG_PROFILING_INSIDE_SANDBOX) bool is_elevated = false; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) is_elevated = (delegate->GetSandboxType() == sandbox::mojom::Sandbox::kNoSandboxAndElevatedPrivileges); #endif @@ -345,7 +345,7 @@ PROCESS_TYPE_MAX); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void BrowserChildProcessHostImpl::EnableWarmUpConnection() { can_use_warm_up_connection_ = true; } @@ -388,7 +388,7 @@ void BrowserChildProcessHostImpl::OnProcessConnected() { DCHECK_CURRENTLY_ON(BrowserThread::UI); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // From this point onward, the exit of the child process is detected by an // error on the IPC channel or ChildProcessHost pipe. early_exit_watcher_.StopWatching(); @@ -437,7 +437,7 @@ tracing_registration_.reset(); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // OnChildDisconnected may be called without OnChannelConnected, so stop the // early exit watcher so GetTerminationStatus can close the process handle. early_exit_watcher_.StopWatching(); @@ -446,14 +446,14 @@ if (child_process_.get() || (process.IsValid() && !process.is_current())) { ChildProcessTerminationInfo info = GetTerminationInfo(true /* known_dead */); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Do not treat clean_exit, ie when child process exited due to quitting // its main loop, as a crash. if (!info.clean_exit) { delegate_->OnProcessCrashed(info.exit_code); } NotifyProcessKilled(data_.Duplicate(), info); -#else // OS_ANDROID +#else // BUILDFLAG(IS_ANDROID) switch (info.status) { case base::TERMINATION_STATUS_PROCESS_CRASHED: case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: { @@ -466,7 +466,7 @@ PROCESS_TYPE_MAX); break; } -#if defined(OS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) case base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM: #endif case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: { @@ -497,22 +497,22 @@ // TODO(wfh): Decide to what to do with OOMs here. break; } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) case base::TERMINATION_STATUS_INTEGRITY_FAILURE: { // TODO(wfh): Decide to what to do with CIG failures here. break; } -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) case base::TERMINATION_STATUS_MAX_ENUM: { NOTREACHED(); break; } } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) UMA_HISTOGRAM_ENUMERATION("ChildProcess.Disconnected2", static_cast<ProcessType>(data_.process_type), PROCESS_TYPE_MAX); -#if defined(OS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) if (info.status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM) { UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed2.OOM", static_cast<ProcessType>(data_.process_type), @@ -614,7 +614,7 @@ delete delegate_; // Will delete us } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool BrowserChildProcessHostImpl::CanUseWarmUpConnection() { return can_use_warm_up_connection_; } @@ -626,14 +626,14 @@ const base::Process& process = child_process_->GetProcess(); DCHECK(process.IsValid()); -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) ChildProcessTaskPortProvider::GetInstance()->OnChildProcessLaunched( process.Pid(), static_cast<ChildProcessHostImpl*>(child_process_host_.get()) ->child_process()); #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Start a WaitableEventWatcher that will invoke OnProcessExitedEarly if the // child process exits. This watcher is stopped once the IPC channel is // connected and the exit of the child process is detecter by an error on the @@ -663,7 +663,7 @@ GetData().id, static_cast<ChildProcessHostImpl*>(GetHost())->child_process()); -#if defined(OS_POSIX) && !defined(OS_ANDROID) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) system_tracing_service_ = std::make_unique<tracing::SystemTracingService>(); child_process()->EnableSystemTracingService( system_tracing_service_->BindAndPassPendingRemote()); @@ -753,7 +753,7 @@ process->child_process_->Terminate(RESULT_CODE_KILLED_BAD_MESSAGE); } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { OnChildDisconnected();
diff --git a/content/browser/browser_child_process_host_impl.h b/content/browser/browser_child_process_host_impl.h index ff9285c8d3b..e505ea12 100644 --- a/content/browser/browser_child_process_host_impl.h +++ b/content/browser/browser_child_process_host_impl.h
@@ -29,7 +29,7 @@ #include "mojo/public/cpp/system/invitation.h" #include "services/resource_coordinator/public/mojom/memory_instrumentation/memory_instrumentation.mojom.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "base/win/object_watcher.h" #endif @@ -53,7 +53,7 @@ class BrowserChildProcessHostImpl : public BrowserChildProcessHost, public ChildProcessHostDelegate, -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) public base::win::ObjectWatcher::Delegate, #endif public ChildProcessLauncher::Client, @@ -125,7 +125,7 @@ static void HistogramBadMessageTerminated(ProcessType process_type); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void EnableWarmUpConnection(); void DumpProcessStack(); #endif @@ -164,7 +164,7 @@ // ChildProcessLauncher::Client implementation. void OnProcessLaunched() override; void OnProcessLaunchFailed(int error_code) override; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool CanUseWarmUpConnection() override; #endif @@ -187,7 +187,7 @@ base::WeakPtr<BrowserChildProcessHostImpl> process, const std::string& error); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // ObjectWatcher::Delegate implementation. void OnObjectSignaled(HANDLE object) override; #endif @@ -201,7 +201,7 @@ std::unique_ptr<ChildProcessLauncher> child_process_; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Watches to see if the child process exits before the IPC channel has // been connected. Thereafter, its exit is determined by an error on the // IPC channel. @@ -218,7 +218,7 @@ bool has_legacy_ipc_channel_ = false; bool notify_child_connection_status_ = true; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // whether the child process can use pre-warmed up connection for better // performance. bool can_use_warm_up_connection_ = false; @@ -228,7 +228,7 @@ std::unique_ptr<TracingServiceController::ClientRegistration> tracing_registration_; -#if defined(OS_POSIX) && !defined(OS_ANDROID) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) // For child process to connect to the system tracing service. std::unique_ptr<tracing::SystemTracingService> system_tracing_service_; #endif
diff --git a/content/browser/browser_child_process_host_impl_receiver_bindings.cc b/content/browser/browser_child_process_host_impl_receiver_bindings.cc index 604f56a..70b7b17 100644 --- a/content/browser/browser_child_process_host_impl_receiver_bindings.cc +++ b/content/browser/browser_child_process_host_impl_receiver_bindings.cc
@@ -24,12 +24,12 @@ #include "services/metrics/public/mojom/ukm_interface.mojom.h" #include "services/metrics/ukm_recorder_interface.h" -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "content/browser/sandbox_support_mac_impl.h" #include "content/common/sandbox_support_mac.mojom.h" #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "content/browser/renderer_host/dwrite_font_proxy_impl_win.h" #include "content/public/common/font_cache_dispatcher_win.h" #include "content/public/common/font_cache_win.mojom.h" @@ -65,7 +65,7 @@ return; } -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) if (auto r = receiver.As<mojom::SandboxSupportMac>()) { static base::NoDestructor<SandboxSupportMacImpl> sandbox_support; sandbox_support->BindReceiver(std::move(r)); @@ -73,7 +73,7 @@ } #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) if (auto r = receiver.As<mojom::FontCacheWin>()) { FontCacheDispatcher::Create(std::move(r)); return;
diff --git a/content/browser/browser_interface_binders.cc b/content/browser/browser_interface_binders.cc index fe037f2..8c797ba2 100644 --- a/content/browser/browser_interface_binders.cc +++ b/content/browser/browser_interface_binders.cc
@@ -154,20 +154,20 @@ #include "third_party/blink/public/public_buildflags.h" #include "url/origin.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "content/browser/android/date_time_chooser_android.h" #include "content/browser/android/text_suggestion_host_android.h" #include "content/browser/renderer_host/render_widget_host_view_android.h" #include "services/device/public/mojom/nfc.mojom.h" #include "third_party/blink/public/mojom/hid/hid.mojom.h" #include "third_party/blink/public/mojom/unhandled_tap_notifier/unhandled_tap_notifier.mojom.h" -#else // !defined(OS_ANDROID) +#else // BUILDFLAG(IS_ANDROID) #include "content/browser/direct_sockets/direct_sockets_service_impl.h" #include "media/mojo/mojom/speech_recognition_service.mojom.h" #include "third_party/blink/public/mojom/hid/hid.mojom.h" #include "third_party/blink/public/mojom/installedapp/installed_app_provider.mojom.h" #include "third_party/blink/public/mojom/serial/serial.mojom.h" -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(ENABLE_MEDIA_REMOTING) #include "media/mojo/mojom/remoting.mojom-forward.h" @@ -184,15 +184,15 @@ #include "content/browser/gpu/gpu_process_host.h" #endif -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "content/browser/renderer_host/text_input_host_impl.h" #include "third_party/blink/public/mojom/input/text_input_host.mojom.h" #endif -#if defined(OS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) #include "content/browser/lock_screen/lock_screen_service_impl.h" #include "third_party/blink/public/mojom/lock_screen/lock_screen.mojom.h" -#endif // defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_CHROMEOS) namespace blink { class StorageKey; @@ -243,7 +243,7 @@ GetShapeDetectionService()->BindTextDetection(std::move(receiver)); } -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) void BindTextInputHost( mojo::PendingReceiver<blink::mojom::TextInputHost> receiver) { GetIOThreadTaskRunner({})->PostTask( @@ -395,7 +395,7 @@ SharedWorkerConnectorImpl::Create(host->GetGlobalId(), std::move(receiver)); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void BindDateTimeChooserForFrame( RenderFrameHost* host, mojo::PendingReceiver<blink::mojom::DateTimeChooser> receiver) { @@ -639,7 +639,7 @@ const auto& binder = GetDevicePostureProviderBinderOverride(); if (binder) binder.Run(std::move(receiver)); -#if defined(OS_ANDROID) || defined(OS_WIN) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) else if (base::FeatureList::IsEnabled(features::kDevicePosture)) GetDeviceService().BindDevicePostureProvider(std::move(receiver)); #endif @@ -796,13 +796,13 @@ map->Add<blink::mojom::SpeechSynthesis>(base::BindRepeating( &RenderFrameHostImpl::GetSpeechSynthesis, base::Unretained(host))); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) map->Add<blink::mojom::DeviceAPIService>(base::BindRepeating( &RenderFrameHostImpl::GetDeviceInfoService, base::Unretained(host))); map->Add<blink::mojom::ManagedConfigurationService>( base::BindRepeating(&RenderFrameHostImpl::GetManagedConfigurationService, base::Unretained(host))); -#endif // !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) if (base::FeatureList::IsEnabled(features::kWebOTP)) { map->Add<blink::mojom::WebOTPService>( @@ -984,7 +984,7 @@ base::Unretained(host))); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) if (base::FeatureList::IsEnabled(features::kWebNfc)) { map->Add<device::mojom::NFC>(base::BindRepeating( &RenderFrameHostImpl::BindNFCReceiver, base::Unretained(host))); @@ -999,9 +999,9 @@ map->Add<blink::mojom::SerialService>(base::BindRepeating( &RenderFrameHostImpl::BindSerialService, base::Unretained(host))); -#endif // !defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) map->Add<blink::mojom::TextInputHost>( base::BindRepeating(&BindTextInputHost)); #endif @@ -1028,7 +1028,7 @@ &EmptyBinderForFrame<blink::mojom::AnchorElementMetricsHost>)); map->Add<blink::mojom::CredentialManager>(base::BindRepeating( &EmptyBinderForFrame<blink::mojom::CredentialManager>)); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) if (base::FeatureList::IsEnabled(features::kDirectSockets)) { map->Add<blink::mojom::DirectSocketsService>( base::BindRepeating(&DirectSocketsServiceImpl::CreateForFrame)); @@ -1086,7 +1086,7 @@ base::BindRepeating(&BindProcessInternalsHandler)); map->Add<storage::mojom::QuotaInternalsHandler>( base::BindRepeating(&BindQuotaInternalsHandler)); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) map->Add<blink::mojom::DateTimeChooser>( base::BindRepeating(&BindDateTimeChooserForFrame)); map->Add<blink::mojom::TextSuggestionHost>( @@ -1094,7 +1094,7 @@ #else map->Add<blink::mojom::TextSuggestionHost>(base::BindRepeating( &EmptyBinderForFrame<blink::mojom::TextSuggestionHost>)); -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) map->Add<blink::mojom::ClipboardHost>( base::BindRepeating(&ClipboardHostImpl::Create)); @@ -1103,7 +1103,7 @@ GetContentClient()->browser()->RegisterBrowserInterfaceBindersForFrame(host, map); -#if defined(OS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) if (base::FeatureList::IsEnabled(features::kWebLockScreenApi)) { map->Add<blink::mojom::LockScreenService>( base::BindRepeating(&LockScreenServiceImpl::Create)); @@ -1178,10 +1178,10 @@ map->Add<blink::mojom::ReportingServiceProxy>(base::BindRepeating( &CreateReportingServiceProxyForDedicatedWorker, base::Unretained(host))); #endif -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) map->Add<blink::mojom::SerialService>(base::BindRepeating( &DedicatedWorkerHost::BindSerialService, base::Unretained(host))); -#endif // !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) // RenderProcessHost binders map->Add<media::mojom::VideoDecodePerfHistory>(BindWorkerReceiver(
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 7217202..14230035 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc
@@ -145,7 +145,7 @@ #include "ui/gfx/font_render_params.h" #include "ui/gfx/switches.h" -#if defined(USE_AURA) || defined(OS_MAC) +#if defined(USE_AURA) || BUILDFLAG(IS_MAC) #include "content/browser/compositor/image_transport_factory.h" #endif @@ -154,7 +154,7 @@ #include "ui/aura/env.h" #endif -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/jni_android.h" #include "base/trace_event/cpufreq_monitor_android.h" #include "components/tracing/common/graphics_memory_dump_provider_android.h" @@ -171,14 +171,14 @@ #include "ui/gl/gl_surface.h" #endif -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "base/mac/scoped_nsautorelease_pool.h" #include "content/browser/renderer_host/browser_compositor_view_mac.h" #include "content/browser/theme_helper_mac.h" #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <commctrl.h> #include <shellapi.h> #include <windows.h> @@ -198,23 +198,23 @@ #include <glib-object.h> #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "media/device_monitors/system_message_window_win.h" #include "sandbox/win/src/process_mitigations.h" -#elif (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(USE_UDEV) +#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_UDEV) #include "media/device_monitors/device_monitor_udev.h" -#elif defined(OS_MAC) +#elif BUILDFLAG(IS_MAC) #include "media/device_monitors/device_monitor_mac.h" #endif -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) #include <lib/zx/job.h> #include "base/fuchsia/default_job.h" #include "base/fuchsia/fuchsia_logging.h" -#endif // defined(OS_FUCHSIA) +#endif // BUILDFLAG(IS_FUCHSIA) -#if defined(OS_POSIX) && !defined(OS_MAC) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) #include "content/browser/sandbox_host_linux.h" #endif @@ -230,7 +230,7 @@ #include "crypto/nss_util.h" #endif -#if defined(ENABLE_IPC_FUZZER) && defined(OS_MAC) +#if defined(ENABLE_IPC_FUZZER) && BUILDFLAG(IS_MAC) #include "base/mac/foundation_util.h" #endif @@ -306,7 +306,7 @@ WORKER_POOL_COUNT // Always last. }; -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) // Create and register the job which will contain all child processes // of the browser process as well as their descendents. void InitDefaultJob() { @@ -315,14 +315,14 @@ ZX_CHECK(ZX_OK == result, result) << "zx_job_create"; base::SetDefaultJob(std::move(job)); } -#endif // defined(OS_FUCHSIA) +#endif // BUILDFLAG(IS_FUCHSIA) #if defined(ENABLE_IPC_FUZZER) bool GetBuildDirectory(base::FilePath* result) { if (!base::PathService::Get(base::DIR_EXE, result)) return false; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) if (base::mac::AmIBundled()) { // The bundled app executables (Chromium, TestShell, etc) live three // levels down from the build directory, eg: @@ -360,8 +360,8 @@ std::unique_ptr<memory_pressure::MultiSourceMemoryPressureMonitor> monitor; -#if defined(OS_MAC) || defined(OS_WIN) || defined(OS_FUCHSIA) || \ - defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) || \ + BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) monitor = std::make_unique<memory_pressure::MultiSourceMemoryPressureMonitor>(); #endif @@ -383,14 +383,14 @@ } #endif // BUILDFLAG(IS_CHROMEOS_ASH) -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Disable dynamic code using ACG. Prevents the browser process from generating // dynamic code or modifying executable code. See comments in // sandbox/win/src/security_level.h. Only available on Windows 10 RS1 (1607, // Build 14393) onwards. const base::Feature kBrowserDynamicCodeDisabled{ "BrowserDynamicCodeDisabled", base::FEATURE_DISABLED_BY_DEFAULT}; -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) class OopDataDecoder : public data_decoder::ServiceProvider { public: @@ -414,7 +414,7 @@ }; void BindHidManager(mojo::PendingReceiver<device::mojom::HidManager> receiver) { -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { GetUIThreadTaskRunner({})->PostTask( FROM_HERE, base::BindOnce(&BindHidManager, std::move(receiver))); @@ -430,7 +430,7 @@ // The currently-running BrowserMainLoop. There can be one or zero. BrowserMainLoop* g_current_browser_main_loop = nullptr; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) namespace { // Whether or not BrowserMainLoop::CreateStartupTasks() posts any tasks. @@ -465,7 +465,7 @@ result_code_(RESULT_CODE_NORMAL_EXIT), created_threads_(false), scoped_execution_fence_(std::move(scoped_execution_fence)) -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) , // TODO(fdoray): Create the fence on Android too. Not enabled yet because // tests timeout. https://crbug.com/887407 @@ -525,7 +525,7 @@ int BrowserMainLoop::EarlyInitialization() { TRACE_EVENT0("startup", "BrowserMainLoop::EarlyInitialization"); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) if (base::GetFieldTrialParamByFeatureAsBool( features::kBigLittleScheduling, features::kBigLittleSchedulingBrowserMainBiggerParam, false)) { @@ -572,7 +572,7 @@ // Up the priority of the UI thread unless it was already high (since Mac // and recent versions of Android (O+) do this automatically). -#if !defined(OS_MAC) +#if !BUILDFLAG(IS_MAC) if (base::FeatureList::IsEnabled( features::kBrowserUseDisplayThreadPriority) && base::PlatformThread::GetCurrentThreadPriority() < @@ -580,10 +580,10 @@ base::PlatformThread::SetCurrentThreadPriority( base::ThreadPriority::DISPLAY); } -#endif // !defined(OS_MAC) +#endif // !BUILDFLAG(IS_MAC) -#if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ - defined(OS_ANDROID) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ + BUILDFLAG(IS_ANDROID) // We use quite a few file descriptors for our IPC as well as disk the disk // cache,and the default limit on the Mac is low (256), so bump it up. @@ -592,10 +592,10 @@ // users can easily hit this limit with many open tabs. Bump up the limit to // an arbitrarily high number. See https://crbug.com/539567 base::IncreaseFdLimitTo(8192); -#endif // defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) || - // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || + // BUILDFLAG(IS_ANDROID) -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) net::EnsureWinsockInit(); #endif @@ -604,7 +604,7 @@ crypto::EnsureNSPRInit(); #endif -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) InitDefaultJob(); // Have child processes & jobs terminate automatically if the browser process @@ -614,7 +614,7 @@ ZX_CHECK(ZX_OK == result, result) << "zx_job_set_critical"; #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) { if (base::FeatureList::IsEnabled(kBrowserDynamicCodeDisabled)) { sandbox::ApplyProcessMitigationsToCurrentProcess( @@ -718,7 +718,7 @@ if (parts_) parts_->PostCreateMainMessageLoop(); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) { TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:ScopedSurfaceRequestManager"); @@ -801,7 +801,7 @@ CdmRegistry::GetInstance()->Init(); #endif -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) // The WindowResizeHelper allows the UI thread to wait on specific renderer // and GPU messages from the IO thread. Initializing it before the IO thread // starts ensures the affected IO thread messages always have somewhere to go. @@ -820,7 +820,7 @@ // while avoiding doing so in unit tests by making it explicitly enabled here. GpuDataManagerImpl::GetInstance()->StartUmaTimer(); -#if !BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(OS_ANDROID) +#if !BUILDFLAG(GOOGLE_CHROME_BRANDING) || BUILDFLAG(IS_ANDROID) // Single-process is an unsupported and not fully tested mode, so // don't enable it for official Chrome builds (except on Android). if (parsed_command_line_.HasSwitch(switches::kSingleProcess)) @@ -839,7 +839,7 @@ TRACE_EVENT0("startup", "BrowserMainLoop::CreateStartupTasks"); DCHECK(!startup_task_runner_); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Some java scheduler tests need to test migration to C++, but the browser // environment isn't set up fully and if these tasks run they may crash. if (!g_post_startup_tasks) @@ -872,7 +872,7 @@ // entered and startup tasks are run asynchrously from it. // InterceptMainMessageLoopRun() thus needs to be forced instead of happening // from MainMessageLoopRun(). -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) StartupTask intercept_main_message_loop_run = base::BindOnce( [](BrowserMainLoop* self) { // Lambda to ignore the return value and always keep a clean exit code @@ -884,7 +884,7 @@ startup_task_runner_->AddTask(std::move(intercept_main_message_loop_run)); #endif -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) startup_task_runner_->StartRunningTasksAsync(); #else startup_task_runner_->RunAllTasksNow(); @@ -893,7 +893,7 @@ scoped_refptr<base::SingleThreadTaskRunner> BrowserMainLoop::GetResizeTaskRunner() { -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) scoped_refptr<base::SingleThreadTaskRunner> task_runner = ui::WindowResizeHelperMac::Get()->task_runner(); // In tests, WindowResizeHelperMac task runner might not be initialized. @@ -908,11 +908,11 @@ return BrowserGpuChannelHostFactory::instance(); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void BrowserMainLoop::SynchronouslyFlushStartupTasks() { startup_task_runner_->RunAllTasksNow(); } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) int BrowserMainLoop::CreateThreads() { TRACE_EVENT0("startup,rail", "BrowserMainLoop::CreateThreads"); @@ -970,18 +970,18 @@ int BrowserMainLoop::PreMainMessageLoopRun() { TRACE_EVENT0("startup", "BrowserMainLoop::PreMainMessageLoopRun"); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool use_display_wide_color_gamut = GetContentClient()->browser()->GetWideColorGamutHeuristic() == ContentBrowserClient::WideColorGamutHeuristic::kUseDisplay; // Let screen instance be overridable by parts. ui::SetScreenAndroid(use_display_wide_color_gamut); -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) if (parts_) result_code_ = parts_->PreMainMessageLoopRun(); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // ShellBrowserMainParts initializes a ShellBrowserContext with a profile // directory only in PreMainMessageLoopRun(). DWriteFontLookupTableBuilder // needs to access this directory, hence triggering after this stage has run. @@ -989,7 +989,7 @@ content::DWriteFontLookupTableBuilder::GetInstance() ->SchedulePrepareFontUniqueNameTableIfNeeded(); } -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) // Unretained(this) is safe as the main message loop expected to run it is // stopped before ~BrowserMainLoop (in the event the message loop doesn't @@ -1029,10 +1029,10 @@ } void BrowserMainLoop::RunMainMessageLoop() { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Android's main message loop is the Java message loop. NOTREACHED(); -#else // defined(OS_ANDROID) +#else // BUILDFLAG(IS_ANDROID) if (InterceptMainMessageLoopRun() != ProceedWithMainMessageLoopRun(true)) return; @@ -1040,17 +1040,17 @@ if (parts_) parts_->WillRunMainMessageLoop(main_run_loop); -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) // Call Recycle() here as late as possible, before going into the loop because // previous steps may have added things to it (e.g. while creating the main // window). if (parameters_.autorelease_pool) parameters_.autorelease_pool->Recycle(); -#endif // defined(OS_MAC) +#endif // BUILDFLAG(IS_MAC) DCHECK(main_run_loop); main_run_loop->Run(); -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) } void BrowserMainLoop::PreShutdown() { @@ -1112,11 +1112,11 @@ BrowserProcessIOThread::ProcessHostCleanUp(); -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) BrowserCompositorMac::DisableRecyclingForShutdown(); #endif -#if defined(USE_AURA) || defined(OS_MAC) +#if defined(USE_AURA) || BUILDFLAG(IS_MAC) { TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:ImageTransportFactory"); @@ -1124,7 +1124,7 @@ } #endif -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) host_frame_sink_manager_.reset(); compositing_mode_reporter_impl_.reset(); #endif @@ -1134,9 +1134,9 @@ // On Mac and windows, the monitor needs to be destroyed on the same thread // as they were created. On Linux, the monitor will be deleted when IO thread // goes away. -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) system_message_window_.reset(); -#elif defined(OS_MAC) +#elif BUILDFLAG(IS_MAC) device_monitor_mac_.reset(); #endif @@ -1207,7 +1207,7 @@ void BrowserMainLoop::GetCompositingModeReporter( mojo::PendingReceiver<viz::mojom::CompositingModeReporter> receiver) { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Android doesn't support non-gpu compositing modes, and doesn't make a // CompositingModeReporter. return; @@ -1254,7 +1254,7 @@ bool always_uses_gpu = true; bool established_gpu_channel = false; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // TODO(crbug.com/439322): This should be set to |true|. established_gpu_channel = false; always_uses_gpu = ShouldStartGpuProcessOnBrowserStartup(); @@ -1281,9 +1281,9 @@ #if defined(USE_AURA) env_->set_context_factory(GetContextFactory()); #endif // defined(USE_AURA) -#endif // !defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( tracing::GraphicsMemoryDumpProvider::GetInstance(), "AndroidGraphics", nullptr); @@ -1303,17 +1303,17 @@ TRACE_EVENT0("startup", "PostCreateThreads::Subsystem:Devices"); device::GamepadService::GetInstance()->StartUp( base::BindRepeating(&BindHidManager)); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) device::FidoHidDiscovery::SetHidManagerBinder( base::BindRepeating(&BindHidManager)); #endif } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) system_message_window_ = std::make_unique<media::SystemMessageWindowWin>(); -#elif (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(USE_UDEV) +#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_UDEV) device_monitor_linux_ = std::make_unique<media::DeviceMonitorLinux>(); -#elif defined(OS_MAC) +#elif BUILDFLAG(IS_MAC) // On Mac, the audio task runner must belong to the main thread. // See audio_thread_impl.cc and https://crbug.com/158170. DCHECK(!audio_manager_ || @@ -1337,7 +1337,7 @@ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner = audio_manager_ ? audio_manager_->GetTaskRunner() : nullptr; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) // On Mac, the audio task runner must belong to the main thread. // See audio_thread_impl.cc and https://crbug.com/158170. if (audio_task_runner) { @@ -1376,7 +1376,7 @@ std::vector<base::PlatformThreadId> allowed_clipboard_threads; // The current thread is the UI thread. allowed_clipboard_threads.push_back(base::PlatformThread::CurrentId()); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // On Windows, clipboard is also used on the IO thread. allowed_clipboard_threads.push_back(io_thread_->GetThreadId()); #endif @@ -1388,7 +1388,7 @@ GpuProcessHost::Get(GPU_PROCESS_KIND_SANDBOXED, true /* force_create */); } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) GpuDataManagerImpl::GetInstance()->PostCreateThreads(); #endif @@ -1397,11 +1397,11 @@ std::make_unique<MediaKeysListenerManagerImpl>(); } -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) ThemeHelperMac::GetInstance(); -#endif // defined(OS_MAC) +#endif // BUILDFLAG(IS_MAC) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) media::SetMediaDrmBridgeClient(GetContentClient()->GetMediaDrmBridgeClient()); if (base::FeatureList::IsEnabled(features::kFontSrcLocalMatching)) { FontUniqueNameLookup::GetInstance(); @@ -1432,7 +1432,7 @@ // (Need to add InitializeToolkit stage to BrowserParts). // See also GTK setup in EarlyInitialization, above, and associated comments. -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) INITCOMMONCONTROLSEX config; config.dwSize = sizeof(config); config.dwICC = ICC_WIN95_CLASSES;
diff --git a/content/browser/browser_main_loop.h b/content/browser/browser_main_loop.h index 717ab1e..a8c8c6b 100644 --- a/content/browser/browser_main_loop.h +++ b/content/browser/browser_main_loop.h
@@ -54,13 +54,13 @@ namespace media { class AudioManager; class AudioSystem; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) class SystemMessageWindowWin; -#elif (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(USE_UDEV) +#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_UDEV) class DeviceMonitorLinux; #endif class UserInputMonitor; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) class DeviceMonitorMac; #endif } // namespace media @@ -102,7 +102,7 @@ class Watcher; } // namespace responsiveness -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) class ScreenOrientationDelegate; #endif @@ -200,7 +200,7 @@ gpu::GpuChannelEstablishFactory* gpu_channel_establish_factory() const; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void SynchronouslyFlushStartupTasks(); // |enabled| Whether or not CreateStartupTasks() posts any tasks. This is @@ -208,9 +208,9 @@ // whole browser loaded. In that scenario tasks posted by CreateStartupTasks() // may crash if run. static void EnableStartupTasks(bool enabled); -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // TODO(fsamuel): We should find an object to own HostFrameSinkManager on all // platforms including Android. See http://crbug.com/732507. viz::HostFrameSinkManager* host_frame_sink_manager() const { @@ -222,7 +222,7 @@ void GetCompositingModeReporter( mojo::PendingReceiver<viz::mojom::CompositingModeReporter> receiver); -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) media::DeviceMonitorMac* device_monitor_mac() const { return device_monitor_mac_.get(); } @@ -326,7 +326,7 @@ std::unique_ptr<ScreenlockMonitor> screenlock_monitor_; // Per-process listener for online state changes. std::unique_ptr<BrowserOnlineStateObserver> online_state_observer_; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Android implementation of ScreenOrientationDelegate std::unique_ptr<ScreenOrientationDelegate> screen_orientation_delegate_; #endif @@ -370,18 +370,18 @@ // Must be deleted on the IO thread. std::unique_ptr<SpeechRecognitionManagerImpl> speech_recognition_manager_; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) std::unique_ptr<media::SystemMessageWindowWin> system_message_window_; -#elif (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(USE_UDEV) +#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_UDEV) std::unique_ptr<media::DeviceMonitorLinux> device_monitor_linux_; -#elif defined(OS_MAC) +#elif BUILDFLAG(IS_MAC) std::unique_ptr<media::DeviceMonitorMac> device_monitor_mac_; #endif std::unique_ptr<MediaStreamManager> media_stream_manager_; scoped_refptr<SaveFileManager> save_file_manager_; std::unique_ptr<content::TracingControllerImpl> tracing_controller_; -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) std::unique_ptr<viz::HostFrameSinkManager> host_frame_sink_manager_; // Reports on the compositing mode in the system for clients to submit
diff --git a/content/browser/browser_main_runner_impl.cc b/content/browser/browser_main_runner_impl.cc index be2a83a..a312dca 100644 --- a/content/browser/browser_main_runner_impl.cc +++ b/content/browser/browser_main_runner_impl.cc
@@ -31,11 +31,11 @@ #include "ui/base/ime/init/input_method_initializer.h" #include "ui/gfx/font_util.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "content/browser/android/tracing_controller_android.h" #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "base/win/windows_version.h" #include "ui/base/win/scoped_ole_initializer.h" #endif @@ -87,12 +87,12 @@ notification_service_ = std::make_unique<NotificationServiceImpl>(); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Ole must be initialized before starting message pump, so that TSF // (Text Services Framework) module can interact with the message pump // on Windows 8 Metro mode. ole_initializer_ = std::make_unique<ui::ScopedOleInitializer>(); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) gfx::InitializeFonts(); @@ -143,7 +143,7 @@ return -1; } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void BrowserMainRunnerImpl::SynchronouslyFlushStartupTasks() { main_loop_->SynchronouslyFlushStartupTasks(); } @@ -182,10 +182,10 @@ main_loop_->ShutdownThreadsAndCleanUp(); ui::ShutdownInputMethod(); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) ole_initializer_.reset(NULL); #endif -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Forcefully terminates the RunLoop inside MessagePumpForUI, ensuring // proper shutdown for content_browsertests. Shutdown() is not used by // the actual browser.
diff --git a/content/browser/browser_main_runner_impl.h b/content/browser/browser_main_runner_impl.h index 3aa95c42..188f913 100644 --- a/content/browser/browser_main_runner_impl.h +++ b/content/browser/browser_main_runner_impl.h
@@ -11,7 +11,7 @@ #include "build/build_config.h" #include "content/public/browser/browser_main_runner.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) namespace ui { class ScopedOleInitializer; } @@ -35,7 +35,7 @@ // BrowserMainRunner: int Initialize(MainFunctionParams parameters) override; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void SynchronouslyFlushStartupTasks() override; #endif int Run() override; @@ -56,7 +56,7 @@ std::unique_ptr<NotificationServiceImpl> notification_service_; std::unique_ptr<BrowserMainLoop> main_loop_; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) std::unique_ptr<ui::ScopedOleInitializer> ole_initializer_; #endif };
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc index bee05c3..b02eceb 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.cc +++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -25,7 +25,7 @@ #include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h" #include "third_party/blink/public/mojom/input/focus_type.mojom.h" -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "content/browser/browser_plugin/browser_plugin_popup_menu_helper_mac.h" #endif @@ -195,7 +195,7 @@ void BrowserPluginGuest::PrimaryMainFrameRenderProcessGone( base::TerminationStatus status) { switch (status) { -#if defined(OS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) case base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM: #endif case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: @@ -216,7 +216,7 @@ } } -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) void BrowserPluginGuest::ShowPopupMenu( RenderFrameHost* render_frame_host, mojo::PendingRemote<blink::mojom::PopupMenuClient>* popup_client,
diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h index 8b87024..b58cdd1 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.h +++ b/content/browser/browser_plugin/browser_plugin_guest.h
@@ -93,7 +93,7 @@ void PrimaryMainFrameRenderProcessGone( base::TerminationStatus status) override; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) // On MacOS X popups are painted by the browser process. We handle them here // so that they are positioned correctly. void ShowPopupMenu(
diff --git a/content/browser/browser_process_io_thread.cc b/content/browser/browser_process_io_thread.cc index 787395f..8239049 100644 --- a/content/browser/browser_process_io_thread.cc +++ b/content/browser/browser_process_io_thread.cc
@@ -14,6 +14,7 @@ #include "base/threading/hang_watcher.h" #include "base/threading/thread_restrictions.h" #include "base/trace_event/memory_dump_manager.h" +#include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "content/browser/browser_child_process_host_impl.h" #include "content/browser/browser_thread_impl.h" @@ -26,12 +27,12 @@ #include "net/url_request/url_fetcher.h" #include "services/network/public/mojom/network_service.mojom.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/jni_android.h" #include "content/common/android/cpu_affinity_setter.h" #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "base/win/scoped_com_initializer.h" #endif @@ -70,7 +71,7 @@ void BrowserProcessIOThread::Init() { DCHECK_CALLED_ON_VALID_THREAD(browser_thread_checker_); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) com_initializer_ = std::make_unique<base::win::ScopedCOMInitializer>(); #endif @@ -82,7 +83,7 @@ void BrowserProcessIOThread::Run(base::RunLoop* run_loop) { DCHECK_CALLED_ON_VALID_THREAD(browser_thread_checker_); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Not to reset thread name to "Thread-???" by VM, attach VM with thread name. // Though it may create unnecessary VM thread objects, keeping thread name // gives more benefit in debugging in the platform. @@ -110,7 +111,7 @@ notification_service_.reset(); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) com_initializer_.reset(); #endif }
diff --git a/content/browser/browser_process_io_thread.h b/content/browser/browser_process_io_thread.h index 0c96be69..ccc1229 100644 --- a/content/browser/browser_process_io_thread.h +++ b/content/browser/browser_process_io_thread.h
@@ -13,7 +13,7 @@ #include "content/common/content_export.h" #include "content/public/browser/browser_thread.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) namespace base { namespace win { class ScopedCOMInitializer; @@ -81,7 +81,7 @@ // RegisterAsBrowserThread(). std::unique_ptr<BrowserThreadImpl> browser_thread_; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) std::unique_ptr<base::win::ScopedCOMInitializer> com_initializer_; #endif
diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc index 93ff47fd..aa9f7532 100644 --- a/content/browser/browser_thread_impl.cc +++ b/content/browser/browser_thread_impl.cc
@@ -114,7 +114,7 @@ globals.task_runners[identifier_] = std::move(task_runner); if (identifier_ == BrowserThread::ID::UI) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) // Allow usage of the FileDescriptorWatcher API on the UI thread, using the // IO thread to watch the file descriptors. //
diff --git a/content/browser/browser_thread_impl.h b/content/browser/browser_thread_impl.h index 5d6350b..1df1cf021 100644 --- a/content/browser/browser_thread_impl.h +++ b/content/browser/browser_thread_impl.h
@@ -11,7 +11,7 @@ #include "content/common/content_export.h" #include "content/public/browser/browser_thread.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #include "base/files/file_descriptor_watcher_posix.h" #include "third_party/abseil-cpp/absl/types/optional.h" #endif @@ -69,7 +69,7 @@ // identifier at a given time. ID identifier_; -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) // Allows usage of the FileDescriptorWatcher API on the UI thread. absl::optional<base::FileDescriptorWatcher> file_descriptor_watcher_; #endif
diff --git a/content/browser/browsing_data/browsing_data_remover_impl.cc b/content/browser/browsing_data/browsing_data_remover_impl.cc index f5ee91e..aba1800 100644 --- a/content/browser/browsing_data/browsing_data_remover_impl.cc +++ b/content/browser/browsing_data/browsing_data_remover_impl.cc
@@ -409,6 +409,10 @@ storage_partition_remove_mask |= StoragePartition::REMOVE_DATA_MASK_CONVERSIONS; } + if (remove_mask & DATA_TYPE_AGGREGATION_SERVICE) { + storage_partition_remove_mask |= + StoragePartition::REMOVE_DATA_MASK_AGGREGATION_SERVICE; + } StoragePartition* storage_partition = GetStoragePartition();
diff --git a/content/browser/browsing_data/browsing_data_remover_impl_unittest.cc b/content/browser/browsing_data/browsing_data_remover_impl_unittest.cc index 5a70d89..75f9309 100644 --- a/content/browser/browsing_data/browsing_data_remover_impl_unittest.cc +++ b/content/browser/browsing_data/browsing_data_remover_impl_unittest.cc
@@ -1326,6 +1326,15 @@ StoragePartition::REMOVE_DATA_MASK_CONVERSIONS); } +TEST_F(BrowsingDataRemoverImplTest, RemoveAggregationServiceData) { + BlockUntilBrowsingDataRemoved( + base::Time(), base::Time::Max(), + BrowsingDataRemover::DATA_TYPE_AGGREGATION_SERVICE, false); + StoragePartitionRemovalData removal_data = GetStoragePartitionRemovalData(); + EXPECT_EQ(removal_data.remove_mask, + StoragePartition::REMOVE_DATA_MASK_AGGREGATION_SERVICE); +} + class MultipleTasksObserver { public: // A simple implementation of BrowsingDataRemover::Observer.
diff --git a/content/browser/browsing_data/clear_site_data_handler_browsertest.cc b/content/browser/browsing_data/clear_site_data_handler_browsertest.cc index e45b109f..8c013e1e 100644 --- a/content/browser/browsing_data/clear_site_data_handler_browsertest.cc +++ b/content/browser/browsing_data/clear_site_data_handler_browsertest.cc
@@ -329,7 +329,7 @@ // may or may not send the header, so there are 8 configurations to test. // Crashes on Win only. https://crbug.com/741189 -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #define MAYBE_RedirectNavigation DISABLED_RedirectNavigation #else #define MAYBE_RedirectNavigation RedirectNavigation @@ -378,7 +378,7 @@ // chain may or may not send the header, so there are 8 configurations to test. // Crashes on Win only. https://crbug.com/741189 -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #define MAYBE_RedirectResourceLoad DISABLED_RedirectResourceLoad #else #define MAYBE_RedirectResourceLoad RedirectResourceLoad @@ -572,7 +572,7 @@ // if credentials are allowed in that fetch. // Crashes on Win only. https://crbug.com/741189 -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #define MAYBE_Credentials DISABLED_Credentials #else #define MAYBE_Credentials Credentials
diff --git a/content/browser/browsing_data/conditional_cache_deletion_helper_browsertest.cc b/content/browser/browsing_data/conditional_cache_deletion_helper_browsertest.cc index 5a3351b..c5d9f741 100644 --- a/content/browser/browsing_data/conditional_cache_deletion_helper_browsertest.cc +++ b/content/browser/browsing_data/conditional_cache_deletion_helper_browsertest.cc
@@ -148,7 +148,7 @@ // Tests that ConditionalCacheDeletionHelper correctly constructs a condition // for time and URL. // crbug.com/1010102: fails on win. -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #define MAYBE_TimeAndURL DISABLED_TimeAndURL #else #define MAYBE_TimeAndURL TimeAndURL
diff --git a/content/browser/cache_storage/cache_storage_cache_unittest.cc b/content/browser/cache_storage/cache_storage_cache_unittest.cc index e82a4cf..f5bfcab 100644 --- a/content/browser/cache_storage/cache_storage_cache_unittest.cc +++ b/content/browser/cache_storage/cache_storage_cache_unittest.cc
@@ -2458,7 +2458,7 @@ EXPECT_EQ(2, sequence_out); } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // TODO(crbug.com/936129): Flaky on Windows. #define MAYBE_KeysWithManyCacheEntries DISABLED_KeysWithManyCacheEntries #else
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage.cc b/content/browser/cache_storage/legacy/legacy_cache_storage.cc index 839e322..a21d4f7 100644 --- a/content/browser/cache_storage/legacy/legacy_cache_storage.cc +++ b/content/browser/cache_storage/legacy/legacy_cache_storage.cc
@@ -34,6 +34,7 @@ #include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "base/trace_event/traced_value.h" +#include "build/build_config.h" #include "content/browser/cache_storage/cache_storage.pb.h" #include "content/browser/cache_storage/cache_storage_cache.h" #include "content/browser/cache_storage/cache_storage_cache_handle.h" @@ -607,7 +608,7 @@ origin_path_, cache_task_runner_.get(), std::move(scheduler_task_runner), quota_manager_proxy, blob_storage_context_, this, storage_key, owner)); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) app_status_listener_ = base::android::ApplicationStatusListener::New( base::BindRepeating(&LegacyCacheStorage::OnApplicationStateChange, weak_factory_.GetWeakPtr())); @@ -1457,7 +1458,7 @@ cache_loader_->WriteIndex(*cache_index_, base::DoNothing()); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void LegacyCacheStorage::OnApplicationStateChange( base::android::ApplicationState state) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage.h b/content/browser/cache_storage/legacy/legacy_cache_storage.h index 8bf3e00..8e055c9 100644 --- a/content/browser/cache_storage/legacy/legacy_cache_storage.h +++ b/content/browser/cache_storage/legacy/legacy_cache_storage.h
@@ -28,7 +28,7 @@ #include "mojo/public/cpp/bindings/remote.h" #include "third_party/blink/public/common/storage_key/storage_key.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/application_status_listener.h" #endif @@ -282,7 +282,7 @@ void FlushIndexIfDirty(); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void OnApplicationStateChange(base::android::ApplicationState state); #endif @@ -334,7 +334,7 @@ base::CancelableOnceClosure index_write_task_; size_t handle_ref_count_ = 0; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) std::unique_ptr<base::android::ApplicationStatusListener> app_status_listener_; #endif
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc index 9468bea..63fa84d 100644 --- a/content/browser/child_process_launcher.cc +++ b/content/browser/child_process_launcher.cc
@@ -23,7 +23,7 @@ #include "content/public/common/content_switches.h" #include "content/public/common/sandboxed_process_launcher_delegate.h" -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "content/browser/child_process_task_port_provider_mac.h" #endif @@ -37,7 +37,7 @@ proto->set_is_backgrounded(is_background()); proto->set_has_pending_views(boost_for_pending_views); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) using PriorityProto = perfetto::protos::pbzero::ChildProcessLauncherPriority; switch (importance) { case ChildProcessImportance::IMPORTANT: @@ -53,7 +53,7 @@ #endif } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool ChildProcessLauncher::Client::CanUseWarmUpConnection() { return true; } @@ -83,7 +83,7 @@ helper_ = base::MakeRefCounted<ChildProcessLauncherHelper>( child_process_id, std::move(command_line), std::move(delegate), weak_factory_.GetWeakPtr(), terminate_on_shutdown, -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) client_->CanUseWarmUpConnection(), #endif std::move(mojo_invitation), process_error_callback, @@ -112,7 +112,7 @@ } void ChildProcessLauncher::Notify(ChildProcessLauncherHelper::Process process, -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) DWORD last_error, #endif int error_code) { @@ -126,7 +126,7 @@ } else { termination_info_.status = base::TERMINATION_STATUS_LAUNCH_FAILED; termination_info_.exit_code = error_code; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) termination_info_.last_error = last_error; #endif @@ -161,7 +161,7 @@ return termination_info_; } -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // GetTerminationInfo() invokes base::GetTerminationStatus() which reaps the // zombie process info, after which it's not longer readable. This is why // RecordProcessLifetimeMetrics() needs to called before that happens. @@ -199,7 +199,7 @@ // processes. if (helper_->GetProcessType() != switches::kRendererProcess) return; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) std::unique_ptr<base::ProcessMetrics> process_metrics = base::ProcessMetrics::CreateProcessMetrics( process_.process.Handle(), @@ -241,7 +241,7 @@ return ChildProcessLauncherHelper::TerminateProcess(process, exit_code); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void ChildProcessLauncher::DumpProcessStack() { base::Process to_pass = process_.process.Duplicate(); GetProcessLauncherTaskRunner()->PostTask( @@ -270,7 +270,7 @@ frame_depth == other.frame_depth && intersects_viewport == other.intersects_viewport && boost_for_pending_views == other.boost_for_pending_views -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) && importance == other.importance #endif ;
diff --git a/content/browser/child_process_launcher.h b/content/browser/child_process_launcher.h index ac5b59e..a46c4058 100644 --- a/content/browser/child_process_launcher.h +++ b/content/browser/child_process_launcher.h
@@ -25,11 +25,11 @@ #include "mojo/public/cpp/system/invitation.h" #include "third_party/perfetto/include/perfetto/tracing/traced_proto.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "content/public/browser/android/child_process_importance.h" #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "base/win/windows_types.h" #endif @@ -62,7 +62,7 @@ LAUNCH_RESULT_CODE_LAST_CODE }; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) static_assert(static_cast<int>(LAUNCH_RESULT_START) > static_cast<int>(sandbox::SBOX_ERROR_LAST), "LaunchResultCode must not overlap with sandbox::ResultCode"); @@ -75,7 +75,7 @@ unsigned int frame_depth, bool intersects_viewport, bool boost_for_pending_views -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) , ChildProcessImportance importance #endif @@ -86,7 +86,7 @@ frame_depth(frame_depth), intersects_viewport(intersects_viewport), boost_for_pending_views(boost_for_pending_views) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) , importance(importance) #endif @@ -141,7 +141,7 @@ // during navigation). bool boost_for_pending_views; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) ChildProcessImportance importance; #endif }; @@ -159,7 +159,7 @@ virtual void OnProcessLaunchFailed(int error_code) {} -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Whether the process can use pre-warmed up connection. virtual bool CanUseWarmUpConnection(); #endif @@ -236,7 +236,7 @@ // previous client. Client* ReplaceClientForTest(Client* client); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Dumps the stack of the child process without crashing it. void DumpProcessStack(); #endif @@ -245,7 +245,7 @@ // Notifies the client about the result of the operation. void Notify(internal::ChildProcessLauncherHelper::Process process, -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) DWORD last_error, #endif int error_code);
diff --git a/content/browser/child_process_launcher_browsertest.cc b/content/browser/child_process_launcher_browsertest.cc index f4ed49a5..658dfcc 100644 --- a/content/browser/child_process_launcher_browsertest.cc +++ b/content/browser/child_process_launcher_browsertest.cc
@@ -37,7 +37,7 @@ client_->OnProcessLaunchFailed(error_code); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool CanUseWarmUpConnection() override { return true; } #endif
diff --git a/content/browser/child_process_launcher_helper.cc b/content/browser/child_process_launcher_helper.cc index 31f3f1fd..5fed6514 100644 --- a/content/browser/child_process_launcher_helper.cc +++ b/content/browser/child_process_launcher_helper.cc
@@ -16,6 +16,7 @@ #include "base/task/single_thread_task_runner_thread_mode.h" #include "base/task/task_traits.h" #include "base/threading/sequenced_task_runner_handle.h" +#include "build/build_config.h" #include "content/browser/child_process_launcher.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/child_process_launcher_utils.h" @@ -23,7 +24,7 @@ #include "content/public/common/sandboxed_process_launcher_delegate.h" #include "mojo/public/cpp/platform/platform_channel.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "content/browser/android/launcher_thread.h" #endif @@ -73,7 +74,7 @@ std::unique_ptr<SandboxedProcessLauncherDelegate> delegate, const base::WeakPtr<ChildProcessLauncher>& child_process_launcher, bool terminate_on_shutdown, -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool can_use_warm_up_connection, #endif mojo::OutgoingInvitation mojo_invitation, @@ -88,7 +89,7 @@ mojo_invitation_(std::move(mojo_invitation)), process_error_callback_(process_error_callback), files_to_preload_(std::move(files_to_preload)) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) , can_use_warm_up_connection_(can_use_warm_up_connection) #endif @@ -102,13 +103,13 @@ BeforeLaunchOnClientThread(); -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) mojo_channel_.emplace(); -#else // !defined(OS_FUCHSIA) +#else // BUILDFLAG(IS_FUCHSIA) mojo_named_channel_ = CreateNamedPlatformChannelOnClientThread(); if (!mojo_named_channel_) mojo_channel_.emplace(); -#endif // !defined(OS_FUCHSIA) +#endif // BUILDFLAG(IS_FUCHSIA) GetProcessLauncherTaskRunner()->PostTask( FROM_HERE, @@ -140,7 +141,7 @@ command_line(), &options); process = LaunchProcessOnLauncherThread(options, std::move(files_to_register), -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) can_use_warm_up_connection_, #endif &is_synchronous_launch, &launch_result); @@ -155,7 +156,7 @@ void ChildProcessLauncherHelper::PostLaunchOnLauncherThread( ChildProcessLauncherHelper::Process process, int launch_result) { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // The LastError is set on the launcher thread, but needs to be transferred to // the Client thread. DWORD last_error = ::GetLastError(); @@ -172,7 +173,7 @@ // we go out of scope regardless of the outcome below. mojo::OutgoingInvitation invitation = std::move(mojo_invitation_); if (process.process.IsValid()) { -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) if (mojo_named_channel_) { DCHECK(!mojo_channel_); mojo::OutgoingInvitation::Send( @@ -194,7 +195,7 @@ FROM_HERE, base::BindOnce(&ChildProcessLauncherHelper::PostLaunchOnClientThread, this, std::move(process), -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) last_error, #endif launch_result)); @@ -202,13 +203,13 @@ void ChildProcessLauncherHelper::PostLaunchOnClientThread( ChildProcessLauncherHelper::Process process, -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) DWORD last_error, #endif int error_code) { if (child_process_launcher_) { child_process_launcher_->Notify(std::move(process), -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) last_error, #endif error_code); @@ -242,7 +243,7 @@ // static base::SingleThreadTaskRunner* GetProcessLauncherTaskRunner() { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Android specializes Launcher thread so it is accessible in java. // Note Android never does clean shutdown, so shutdown use-after-free // concerns are not a problem in practice. @@ -254,7 +255,7 @@ static base::NoDestructor<scoped_refptr<base::SingleThreadTaskRunner>> launcher_task_runner(android::LauncherThread::GetTaskRunner()); return (*launcher_task_runner).get(); -#else // defined(OS_ANDROID) +#else // BUILDFLAG(IS_ANDROID) // TODO(http://crbug.com/820200): Investigate whether we could use // SequencedTaskRunner on platforms other than Windows. static base::LazyThreadPoolSingleThreadTaskRunner launcher_task_runner = @@ -263,7 +264,7 @@ base::TaskShutdownBehavior::BLOCK_SHUTDOWN), base::SingleThreadTaskRunnerThreadMode::DEDICATED); return launcher_task_runner.Get().get(); -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) } // static
diff --git a/content/browser/child_process_launcher_helper.h b/content/browser/child_process_launcher_helper.h index 4ef383e..d882f4b 100644 --- a/content/browser/child_process_launcher_helper.h +++ b/content/browser/child_process_launcher_helper.h
@@ -20,26 +20,26 @@ #include "mojo/public/cpp/system/invitation.h" #include "third_party/abseil-cpp/absl/types/optional.h" -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) #include "mojo/public/cpp/platform/named_platform_channel.h" #endif -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/scoped_java_ref.h" #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "base/win/windows_types.h" #include "sandbox/win/src/sandbox_types.h" #else #include "content/public/browser/posix_file_descriptor_info.h" #endif -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "sandbox/mac/seatbelt_exec.h" #endif -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) #include "sandbox/policy/fuchsia/sandbox_policy_fuchsia.h" #endif @@ -58,13 +58,13 @@ struct ChildProcessLauncherPriority; struct ChildProcessTerminationInfo; -#if defined(OS_POSIX) || defined(OS_FUCHSIA) +#if BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) class PosixFileDescriptorInfo; #endif namespace internal { -#if defined(OS_POSIX) || defined(OS_FUCHSIA) +#if BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) using FileMappedForLaunch = PosixFileDescriptorInfo; #else using FileMappedForLaunch = base::HandlesToInheritVector; @@ -98,7 +98,7 @@ std::unique_ptr<SandboxedProcessLauncherDelegate> delegate, const base::WeakPtr<ChildProcessLauncher>& child_process_launcher, bool terminate_on_shutdown, -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool is_pre_warmup_required, #endif mojo::OutgoingInvitation mojo_invitation, @@ -113,7 +113,7 @@ // Platform specific. void BeforeLaunchOnClientThread(); -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) // Called to give implementors a chance at creating a server pipe. Platform- // specific. Returns |absl::nullopt| if the helper should initialize // a regular PlatformChannel for communication instead. @@ -141,7 +141,7 @@ ChildProcessLauncherHelper::Process LaunchProcessOnLauncherThread( const base::LaunchOptions& options, std::unique_ptr<FileMappedForLaunch> files_to_register, -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool is_pre_warmup_required, #endif bool* is_synchronous_launch, @@ -160,7 +160,7 @@ // Posted by PostLaunchOnLauncherThread onto the client thread. void PostLaunchOnClientThread(ChildProcessLauncherHelper::Process process, -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) DWORD last_error, #endif int error_code); @@ -187,13 +187,13 @@ base::Process process, const ChildProcessLauncherPriority& priority); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void OnChildProcessStarted(JNIEnv* env, jint handle); // Dumps the stack of the child process without crashing it. void DumpProcessStack(const base::Process& process); -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) std::string GetProcessType(); @@ -210,7 +210,7 @@ static void ForceNormalProcessTerminationSync( ChildProcessLauncherHelper::Process process); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void set_java_peer_available_on_client_thread() { java_peer_avaiable_on_client_thread_ = true; } @@ -229,7 +229,7 @@ // |CreateNamedPlatformChannelOnClientThread()|. absl::optional<mojo::PlatformChannel> mojo_channel_; -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) // May be used in exclusion to the above if the platform helper implementation // returns a valid server endpoint from // |CreateNamedPlatformChannelOnClientThread()|. @@ -241,18 +241,18 @@ const mojo::ProcessErrorCallback process_error_callback_; const std::map<std::string, base::FilePath> files_to_preload_; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) std::unique_ptr<sandbox::SeatbeltExecClient> seatbelt_exec_client_; -#endif // defined(OS_MAC) +#endif // BUILDFLAG(IS_MAC) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) base::android::ScopedJavaGlobalRef<jobject> java_peer_; bool java_peer_avaiable_on_client_thread_ = false; // Whether the process can use warmed up connection. bool can_use_warm_up_connection_; #endif -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) std::unique_ptr<sandbox::policy::SandboxPolicyFuchsia> sandbox_policy_; #endif };
diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc index bbc1d4d..f60ad777 100644 --- a/content/browser/child_process_launcher_helper_linux.cc +++ b/content/browser/child_process_launcher_helper_linux.cc
@@ -81,7 +81,7 @@ GetProcessType()); *launch_result = LAUNCH_RESULT_SUCCESS; -#if !defined(OS_OPENBSD) +#if !BUILDFLAG(IS_OPENBSD) if (handle) { // It could be a renderer process or an utility process. int oom_score = content::kMiscOomScore;
diff --git a/content/browser/child_process_launcher_helper_posix.cc b/content/browser/child_process_launcher_helper_posix.cc index 689f5b9..7f5b6494 100644 --- a/content/browser/child_process_launcher_helper_posix.cc +++ b/content/browser/child_process_launcher_helper_posix.cc
@@ -56,7 +56,7 @@ PosixFileDescriptorInfoImpl::Create()); // Mac shared memory doesn't use file descriptors. -#if !defined(OS_MAC) +#if !BUILDFLAG(IS_MAC) int fd = base::FieldTrialList::GetFieldTrialDescriptor(); DCHECK_NE(fd, -1); files_to_register->Share(kFieldTrialDescriptor, fd);
diff --git a/content/browser/child_process_security_policy_browsertest.cc b/content/browser/child_process_security_policy_browsertest.cc index 08d57955..f017c2b3 100644 --- a/content/browser/child_process_security_policy_browsertest.cc +++ b/content/browser/child_process_security_policy_browsertest.cc
@@ -43,7 +43,7 @@ } }; -#if !defined(NDEBUG) && defined(OS_MAC) +#if !defined(NDEBUG) && BUILDFLAG(IS_MAC) IN_PROC_BROWSER_TEST_F(ChildProcessSecurityPolicyInProcessBrowserTest, DISABLED_NoLeak) { #else IN_PROC_BROWSER_TEST_F(ChildProcessSecurityPolicyInProcessBrowserTest, NoLeak) {
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc index b8f42c0..620b3fd 100644 --- a/content/browser/child_process_security_policy_impl.cc +++ b/content/browser/child_process_security_policy_impl.cc
@@ -384,7 +384,7 @@ return (it->second & permissions) == permissions; } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Determine if the certain permissions have been granted to a content URI. bool HasPermissionsForContentUri(const base::FilePath& file, int permissions) { @@ -462,7 +462,7 @@ // Determine if the certain permissions have been granted to a file. bool HasPermissionsForFile(const base::FilePath& file, int permissions) { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) if (file.IsContentUri()) return HasPermissionsForContentUri(file, permissions); #endif @@ -1758,7 +1758,7 @@ } else { // Citadel-style enforcement - an unlocked process should not be // able to access data from origins that require a lock. -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // TODO(lukasza): https://crbug.com/566091: Once remote NTP is // capable of embedding OOPIFs, start enforcing citadel-style checks // on desktop platforms.
diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc index da0334a..f90e707 100644 --- a/content/browser/child_process_security_policy_unittest.cc +++ b/content/browser/child_process_security_policy_unittest.cc
@@ -81,7 +81,7 @@ }; bool IsCitadelProtectionEnabled() { -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // TODO(lukasza): https://crbug.com/566091: Once remote NTP is capable of // embedding OOPIFs, start enforcing citadel-style checks on desktop // platforms.
diff --git a/content/browser/client_hints/client_hints.cc b/content/browser/client_hints/client_hints.cc index ca70fa7..a8a0b26 100644 --- a/content/browser/client_hints/client_hints.cc +++ b/content/browser/client_hints/client_hints.cc
@@ -141,7 +141,7 @@ // Returns the zoom factor for a given |url|. double GetZoomFactor(BrowserContext* context, const GURL& url) { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // On Android, use the default value when the AccessibilityPageZoom // feature is not enabled. if (!base::FeatureList::IsEnabled(features::kAccessibilityPageZoom)) @@ -270,7 +270,7 @@ // https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/viewportAndroid.css. double viewport_width = 980; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // On Android, use the default value when the AccessibilityPageZoom // feature is not enabled. if (!base::FeatureList::IsEnabled(features::kAccessibilityPageZoom)) { @@ -313,7 +313,7 @@ .GetSizeInPixel() .height()) / overall_scale_factor; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // On Android, the viewport is scaled so the width is 980 and the height // maintains the same ratio. // TODO(1246208): Improve the usefulness of the viewport client hints for @@ -324,7 +324,7 @@ .width()) / overall_scale_factor; viewport_height *= 980.0 / viewport_width; -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) DCHECK_LT(0, viewport_height);
diff --git a/content/browser/compositor/surface_utils.cc b/content/browser/compositor/surface_utils.cc index 78fe7b2..e2884bd 100644 --- a/content/browser/compositor/surface_utils.cc +++ b/content/browser/compositor/surface_utils.cc
@@ -7,7 +7,7 @@ #include "build/build_config.h" #include "components/viz/host/host_frame_sink_manager.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "content/browser/renderer_host/compositor_dependencies_android.h" #else #include "content/browser/compositor/image_transport_factory.h" @@ -17,7 +17,7 @@ namespace content { viz::FrameSinkId AllocateFrameSinkId() { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) return CompositorDependenciesAndroid::Get().AllocateFrameSinkId(); #else ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); @@ -26,7 +26,7 @@ } viz::HostFrameSinkManager* GetHostFrameSinkManager() { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) return CompositorDependenciesAndroid::Get().host_frame_sink_manager(); #else ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc index a9655d5..c0c712c 100644 --- a/content/browser/compositor/viz_process_transport_factory.cc +++ b/content/browser/compositor/viz_process_transport_factory.cc
@@ -12,6 +12,7 @@ #include "base/debug/dump_without_crashing.h" #include "base/memory/raw_ptr.h" #include "base/task/single_thread_task_runner.h" +#include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "cc/mojo_embedder/async_layer_tree_frame_sink.h" #include "cc/raster/single_thread_task_graph_runner.h" @@ -42,7 +43,7 @@ #include "services/viz/public/cpp/gpu/context_provider_command_buffer.h" #include "ui/base/ui_base_features.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "ui/gfx/win/rendering_window_manager.h" #endif @@ -111,7 +112,7 @@ // viz::HostDisplayClient: // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. -#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) void DidCompleteSwapWithNewSize(const gfx::Size& size) override { compositor_->OnCompleteSwapWithNewSize(size); } @@ -181,7 +182,7 @@ void VizProcessTransportFactory::CreateLayerTreeFrameSink( base::WeakPtr<ui::Compositor> compositor) { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) gfx::RenderingWindowManager::GetInstance()->UnregisterParent( compositor->widget()); #endif @@ -227,7 +228,7 @@ } void VizProcessTransportFactory::RemoveCompositor(ui::Compositor* compositor) { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) gfx::RenderingWindowManager::GetInstance()->UnregisterParent( compositor->widget()); #endif @@ -363,7 +364,7 @@ worker_context_provider = worker_context_provider_; } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) gfx::RenderingWindowManager::GetInstance()->RegisterParent( compositor->widget()); #endif @@ -404,10 +405,10 @@ root_params->use_preferred_interval_for_video = features::IsUsingPreferredIntervalForVideo(); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) root_params->set_present_duration_allowed = features::ShouldUseSetPresentDuration(); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) // Connects the viz process end of CompositorFrameSink message pipes. The // browser compositor may request a new CompositorFrameSink on context loss, @@ -434,7 +435,7 @@ compositor_data.external_begin_frame_controller.get()); } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Windows using the ANGLE D3D backend for compositing needs to disable swap // on resize to avoid D3D scaling the framebuffer texture. This isn't a // problem with software compositing or ANGLE D3D with direct composition.
diff --git a/content/browser/contacts/contacts_manager_impl.cc b/content/browser/contacts/contacts_manager_impl.cc index e6bd719..2b7e6b6 100644 --- a/content/browser/contacts/contacts_manager_impl.cc +++ b/content/browser/contacts/contacts_manager_impl.cc
@@ -16,7 +16,7 @@ #include "services/metrics/public/cpp/metrics_utils.h" #include "services/metrics/public/cpp/ukm_builders.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "content/browser/contacts/contacts_provider_android.h" #endif @@ -28,7 +28,7 @@ RenderFrameHostImpl* render_frame_host) { if (render_frame_host->GetParentOrOuterDocument()) return nullptr; // This API is only supported on the main frame. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) return std::make_unique<ContactsProviderAndroid>(render_frame_host); #else return nullptr;
diff --git a/content/browser/cross_origin_opener_policy_browsertest.cc b/content/browser/cross_origin_opener_policy_browsertest.cc index cda93cc..586c8ea 100644 --- a/content/browser/cross_origin_opener_policy_browsertest.cc +++ b/content/browser/cross_origin_opener_policy_browsertest.cc
@@ -2628,8 +2628,8 @@ } // This test is flaky on Win, Mac, Linux and ChromeOS: https://crbug.com/1125998 -#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ - defined(OS_CHROMEOS) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ + BUILDFLAG(IS_CHROMEOS) #define MAYBE_CrossOriginIsolatedSiteInstance_MainFrame \ DISABLED_CrossOriginIsolatedSiteInstance_MainFrame #else @@ -3596,13 +3596,13 @@ EXPECT_TRUE(NavigateToURL(shell(), OriginTrialURL())); EXPECT_EQ(false, EvalJs(current_frame_host(), "self.crossOriginIsolated")); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) EXPECT_EQ(true, EvalJs(current_frame_host(), "'SharedArrayBuffer' in globalThis")); -#else // defined(OS_ANDROID) +#else // !BUILDFLAG(IS_ANDROID) EXPECT_EQ(false, EvalJs(current_frame_host(), "'SharedArrayBuffer' in globalThis")); -#endif // defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) } // Check setting the OriginTrial works, even in popups where the javascript @@ -3647,7 +3647,7 @@ shell_observer.GetShell()->web_contents()); WaitForLoadStop(popup); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) EXPECT_EQ(false, EvalJs(popup, "'SharedArrayBuffer' in globalThis")); #else EXPECT_EQ(true, EvalJs(popup, "'SharedArrayBuffer' in globalThis")); @@ -3672,7 +3672,7 @@ EXPECT_EQ(false, EvalJs(current_frame_host(), "self.crossOriginIsolated")); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) EXPECT_EQ(false, EvalJs(current_frame_host(), "'SharedArrayBuffer' in globalThis")); #else @@ -3709,7 +3709,7 @@ EXPECT_EQ(false, EvalJs(main_document, "self.crossOriginIsolated")); EXPECT_EQ(false, EvalJs(sub_document, "self.crossOriginIsolated")); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) EXPECT_TRUE(ExecJs(sub_document, R"( g_sab_size = new Promise(resolve => { addEventListener("message", event => resolve(event.data.byteLength)); @@ -3723,7 +3723,7 @@ )")); EXPECT_EQ(1234, EvalJs(sub_document, "g_sab_size")); -#else // defined(OS_ANDROID) +#else // !BUILDFLAG(IS_ANDROID) auto postSharedArrayBuffer = EvalJs(main_document, R"( // Create a WebAssembly Memory to bypass the SAB constructor restriction. const sab = @@ -3733,13 +3733,14 @@ EXPECT_THAT(postSharedArrayBuffer.error, HasSubstr("Failed to execute 'postMessage' on 'Window'")); -#endif // defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) } // Enable the reverse OriginTrial via a <meta> tag. Then send a Webassembly's // SharedArrayBuffer toward the iframe. // Regression test for https://crbug.com/1201589). -#if !defined(OS_ANDROID) // The SAB reverse origin trial only work on Desktop. +// The SAB reverse origin trial only work on Desktop. +#if !BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(UnrestrictedSharedArrayBufferOriginTrialBrowserTest, CrashForBug1201589) { URLLoaderInterceptor interceptor(base::BindLambdaForTesting( @@ -3817,13 +3818,13 @@ GURL url = https_server()->GetURL("a.test", "/empty.html"); EXPECT_TRUE(NavigateToURL(shell(), url)); EXPECT_EQ(false, EvalJs(current_frame_host(), "self.crossOriginIsolated")); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) EXPECT_EQ(true, EvalJs(current_frame_host(), "'SharedArrayBuffer' in globalThis")); -#else // defined(OS_ANDROID) +#else // !BUILDFLAG(IS_ANDROID) EXPECT_EQ(false, EvalJs(current_frame_host(), "'SharedArrayBuffer' in globalThis")); -#endif // defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) } IN_PROC_BROWSER_TEST_P(SharedArrayBufferOnDesktopBrowserTest, @@ -3853,19 +3854,19 @@ )", EXECUTE_SCRIPT_NO_RESOLVE_PROMISES)); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) EXPECT_TRUE(ExecJs(sub_document, R"( const sab = new SharedArrayBuffer(1234); parent.postMessage(sab, "*"); )")); EXPECT_EQ(1234, EvalJs(main_document, "g_sab_size")); -#else // defined(OS_ANDROID) +#else // !BUILDFLAG(IS_ANDROID) EXPECT_FALSE(ExecJs(sub_document, R"( const sab = new SharedArrayBuffer(1234); parent.postMessage(sab, "*"); )")); -#endif // defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) } // Regression test for https://crbug.com/1238282#c16
diff --git a/content/browser/device/device_service.cc b/content/browser/device/device_service.cc index 6b645f0..cd156ee 100644 --- a/content/browser/device/device_service.cc +++ b/content/browser/device/device_service.cc
@@ -20,7 +20,7 @@ #include "services/network/public/mojom/network_service_test.mojom.h" #include "services/network/public/mojom/url_loader.mojom.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/jni_android.h" #include "base/android/scoped_java_ref.h" #include "content/browser/wake_lock/wake_lock_context_host.h" @@ -111,7 +111,7 @@ params->geolocation_manager = GetContentClient()->browser()->GetGeolocationManager(); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) JNIEnv* env = base::android::AttachCurrentThread(); params->java_nfc_delegate = Java_ContentNfcDelegate_create(env); DCHECK(!params->java_nfc_delegate.is_null());
diff --git a/content/browser/devtools/render_frame_devtools_agent_host.h b/content/browser/devtools/render_frame_devtools_agent_host.h index 8f48e58..a77ba39 100644 --- a/content/browser/devtools/render_frame_devtools_agent_host.h +++ b/content/browser/devtools/render_frame_devtools_agent_host.h
@@ -22,7 +22,7 @@ #include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/wake_lock.mojom.h" #include "ui/android/view_android.h" -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) namespace cc { class RenderFrameMetadata;
diff --git a/content/browser/direct_sockets/direct_sockets_service_impl.cc b/content/browser/direct_sockets/direct_sockets_service_impl.cc index d012efe..7c6c619 100644 --- a/content/browser/direct_sockets/direct_sockets_service_impl.cc +++ b/content/browser/direct_sockets/direct_sockets_service_impl.cc
@@ -30,7 +30,7 @@ #include "services/network/public/mojom/tcp_socket.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" -#if defined(OS_WIN) || defined(OS_MAC) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) #include "base/enterprise_util.h" #elif BUILDFLAG(IS_CHROMEOS_ASH) #include "chromeos/tpm/install_attributes.h" @@ -148,7 +148,7 @@ if (g_is_enterprise_managed_for_testing.has_value()) return g_is_enterprise_managed_for_testing.value(); -#if defined(OS_WIN) || defined(OS_MAC) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) return base::IsMachineExternallyManaged(); #elif BUILDFLAG(IS_CHROMEOS_ASH) return chromeos::InstallAttributes::IsInitialized() &&
diff --git a/content/browser/direct_sockets/direct_sockets_tcp_browsertest.cc b/content/browser/direct_sockets/direct_sockets_tcp_browsertest.cc index cb3c9ad..872a28c 100644 --- a/content/browser/direct_sockets/direct_sockets_tcp_browsertest.cc +++ b/content/browser/direct_sockets/direct_sockets_tcp_browsertest.cc
@@ -326,7 +326,7 @@ StartsWith("openTcp succeeded")); } -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) // https://crbug.com/1211492 Keep failing on Mac11.3 #define MAYBE_OpenTcp_MDNS DISABLED_OpenTcp_MDNS #else
diff --git a/content/browser/display_cutout/display_cutout_browsertest.cc b/content/browser/display_cutout/display_cutout_browsertest.cc index f5fefc74..3627aad 100644 --- a/content/browser/display_cutout/display_cutout_browsertest.cc +++ b/content/browser/display_cutout/display_cutout_browsertest.cc
@@ -36,7 +36,7 @@ namespace { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // These inset and flags simulate when we are not extending into the cutout. const gfx::Insets kNoCutoutInsets = gfx::Insets(); @@ -223,7 +223,7 @@ }; // The viewport meta tag is only enabled on Android. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(DisplayCutoutBrowserTest, ViewportFit_Fullscreen) { LoadTestPageWithViewportFitFromMeta("cover");
diff --git a/content/browser/do_not_track_browsertest.cc b/content/browser/do_not_track_browsertest.cc index dc304b8c66..6650524 100644 --- a/content/browser/do_not_track_browsertest.cc +++ b/content/browser/do_not_track_browsertest.cc
@@ -20,7 +20,7 @@ #include "net/test/embedded_test_server/http_response.h" #include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/system/sys_info.h" #endif @@ -48,7 +48,7 @@ class DoNotTrackTest : public ContentBrowserTest { protected: void SetUpOnMainThread() override { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // TODO(crbug.com/864403): It seems that we call unsupported Android APIs on // KitKat when we set a ContentBrowserClient. Don't call such APIs and make // this test available on KitKat. @@ -184,7 +184,7 @@ // Checks that the DNT header is sent in a request for shared worker script. // Disabled on Android since a shared worker is not available on Android: // crbug.com/869745. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_SharedWorker DISABLED_SharedWorker #else #define MAYBE_SharedWorker SharedWorker @@ -407,7 +407,7 @@ // // Disabled on Android since a shared worker is not available on Android: // crbug.com/869745. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_FetchFromSharedWorker DISABLED_FetchFromSharedWorker #else #define MAYBE_FetchFromSharedWorker FetchFromSharedWorker
diff --git a/content/browser/dom_storage/dom_storage_browsertest.cc b/content/browser/dom_storage/dom_storage_browsertest.cc index b69fe7b6..4f3ce64 100644 --- a/content/browser/dom_storage/dom_storage_browsertest.cc +++ b/content/browser/dom_storage/dom_storage_browsertest.cc
@@ -98,7 +98,7 @@ } // http://crbug.com/654704 PRE_ tests aren't supported on Android. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_DataPersists DISABLED_DataPersists #else #define MAYBE_DataPersists DataPersists @@ -136,7 +136,7 @@ // On Windows file://localhost/C:/src/chromium/src/content/test/data/title1.html // doesn't work. -#if !defined(OS_WIN) +#if !BUILDFLAG(IS_WIN) // Regression test for https://crbug.com/776160. The test verifies that there // is no disagreement between 1) site URL used for browser-side isolation // enforcement and 2) the origin requested by Blink. Before this bug was fixed,
diff --git a/content/browser/file_system/file_system_url_loader_factory.cc b/content/browser/file_system/file_system_url_loader_factory.cc index 68363cf..e67b9bc 100644 --- a/content/browser/file_system/file_system_url_loader_factory.cc +++ b/content/browser/file_system/file_system_url_loader_factory.cc
@@ -300,7 +300,7 @@ if (data_.empty()) { base::FilePath relative_path = url_.path(); -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) relative_path = base::FilePath(FILE_PATH_LITERAL("/") + relative_path.value()); #endif
diff --git a/content/browser/file_system/file_system_url_loader_factory_browsertest.cc b/content/browser/file_system/file_system_url_loader_factory_browsertest.cc index 01d4998..9be7b7e 100644 --- a/content/browser/file_system/file_system_url_loader_factory_browsertest.cc +++ b/content/browser/file_system/file_system_url_loader_factory_browsertest.cc
@@ -544,9 +544,9 @@ listing_entries.push_back(line); } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) EXPECT_EQ("<script>start(\"foo\\\\bar\");</script>", listing_header); -#elif defined(OS_POSIX) +#elif BUILDFLAG(IS_POSIX) EXPECT_EQ("<script>start(\"/foo/bar\");</script>", listing_header); #endif
diff --git a/content/browser/find_request_manager.cc b/content/browser/find_request_manager.cc index 57b78a3..11d7cc8 100644 --- a/content/browser/find_request_manager.cc +++ b/content/browser/find_request_manager.cc
@@ -12,6 +12,7 @@ #include "base/containers/queue.h" #include "base/memory/raw_ptr.h" #include "base/metrics/histogram_macros.h" +#include "build/build_config.h" #include "content/browser/find_in_page_client.h" #include "content/browser/renderer_host/render_frame_host_impl.h" #include "content/browser/web_contents/web_contents_impl.h" @@ -267,7 +268,7 @@ return *this; } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) FindRequestManager::ActivateNearestFindResultState:: ActivateNearestFindResultState() = default; FindRequestManager::ActivateNearestFindResultState:: @@ -392,7 +393,7 @@ action)); current_session_id_ = kInvalidId; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // It is important that these pending replies are cleared whenever a find // session ends, so that subsequent replies for the old session are ignored. activate_.pending_replies.clear(); @@ -521,7 +522,7 @@ } UpdateActiveMatchOrdinal(); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // The removed frame may contain the nearest find result known so far. Note // that once all queried frames have responded, if this result was the overall // nearest, then no activation will occur. @@ -565,7 +566,7 @@ active_frame_->GetFindInPage()->ClearActiveFindMatch(); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void FindRequestManager::ActivateNearestFindResult(float x, float y) { if (current_session_id_ == kInvalidId) return; @@ -656,7 +657,7 @@ selection_rect_ = gfx::Rect(); last_reported_id_ = kInvalidId; frame_observers_.clear(); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) activate_ = ActivateNearestFindResultState(); match_rects_.pending_replies.clear(); #endif @@ -928,7 +929,7 @@ return std::make_unique<FindInPageClient>(this, rfh); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void FindRequestManager::RemoveNearestFindResultPendingReply( RenderFrameHost* rfh) { auto it = activate_.pending_replies.find(rfh); @@ -975,6 +976,6 @@ contents_->NotifyFindMatchRectsReply( match_rects_.known_version, aggregate_rects, match_rects_.active_rect); } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) } // namespace content
diff --git a/content/browser/find_request_manager.h b/content/browser/find_request_manager.h index 9e02495..bf21abb 100644 --- a/content/browser/find_request_manager.h +++ b/content/browser/find_request_manager.h
@@ -85,7 +85,7 @@ // Tells active frame to clear the active match highlighting. void ClearActiveFindMatch(); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Selects and zooms to the find result nearest to the point (x, y), defined // in find-in-page coordinates. void ActivateNearestFindResult(float x, float y); @@ -222,7 +222,7 @@ const std::u16string& search_text, blink::mojom::FindOptionsPtr options); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Called when a nearest find result reply is no longer pending for a frame. void RemoveNearestFindResultPendingReply(RenderFrameHost* rfh);
diff --git a/content/browser/find_request_manager_browsertest.cc b/content/browser/find_request_manager_browsertest.cc index e790417..ffa7ec93 100644 --- a/content/browser/find_request_manager_browsertest.cc +++ b/content/browser/find_request_manager_browsertest.cc
@@ -32,7 +32,7 @@ #include "third_party/blink/public/mojom/page/widget.mojom-test-utils.h" #include "url/origin.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "ui/android/view_android.h" #endif @@ -46,11 +46,11 @@ return node->current_frame_host()->GetLastCommittedOrigin(); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) double GetFrameDeviceScaleFactor(const ToRenderFrameHost& adapter) { return EvalJs(adapter, "window.devicePixelRatio;").ExtractDouble(); } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) } // namespace @@ -172,7 +172,7 @@ testing::Bool()); // TODO(crbug.com/615291): These tests frequently fail on Android. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE(x) DISABLED_##x #else #define MAYBE(x) x @@ -278,11 +278,11 @@ LoadAndWait("/find_in_page_desktop.html"); // Note: for now, don't run this test on Android in OOPIF mode. if (GetParam()) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) return; #else MakeChildFrameCrossProcess(); -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) ->GetPrimaryFrameTree() @@ -621,7 +621,7 @@ // TODO(crbug.com/615291): These tests frequently fail on Android. // TODO(crbug.com/779912): Flaky timeout on Win7 (dbg). // TODO(crbug.com/875306): Flaky on Win10. -#if defined(OS_ANDROID) || defined(OS_WIN) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) #define MAYBE_FindInPage_Issue627799 DISABLED_FindInPage_Issue627799 #else #define MAYBE_FindInPage_Issue627799 FindInPage_Issue627799 @@ -712,7 +712,7 @@ EXPECT_EQ(5, results.number_of_matches); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Tests empty active match rect when kWrapAround is false. IN_PROC_BROWSER_TEST_F(FindRequestManagerTest, EmptyActiveMatchRect) { LoadAndWait("/find_in_page.html"); @@ -1018,7 +1018,7 @@ EXPECT_EQ(order[i] + 1, delegate()->GetFindResults().active_match_ordinal); } } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) // Test basic find-in-page functionality after going back and forth to the same // page. In particular, find-in-page should continue to work after going back to
diff --git a/content/browser/font_access/font_access_manager_impl_browsertest.cc b/content/browser/font_access/font_access_manager_impl_browsertest.cc index aef2663..66c52195 100644 --- a/content/browser/font_access/font_access_manager_impl_browsertest.cc +++ b/content/browser/font_access/font_access_manager_impl_browsertest.cc
@@ -133,7 +133,7 @@ EXPECT_GT(result, 0) << "Expected at least one font. Got: " << result; } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) IN_PROC_BROWSER_TEST_F(FontAccessManagerImplBrowserTest, LocaleTest) { ASSERT_TRUE(NavigateToURL(shell(), GetTestUrl(nullptr, "simple_page.html"))); OverrideFontAccessLocale("zh-cn");
diff --git a/content/browser/font_access/font_enumeration_cache.h b/content/browser/font_access/font_enumeration_cache.h index 399f806..31243ee2 100644 --- a/content/browser/font_access/font_enumeration_cache.h +++ b/content/browser/font_access/font_enumeration_cache.h
@@ -23,8 +23,8 @@ #include "third_party/blink/public/common/font_access/font_enumeration_table.pb.h" #include "third_party/blink/public/mojom/font_access/font_access.mojom.h" -#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ - defined(OS_MAC) || defined(OS_FUCHSIA) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ + BUILDFLAG(IS_MAC) || BUILDFLAG(IS_FUCHSIA) #define PLATFORM_HAS_LOCAL_FONT_ENUMERATION_IMPL 1 #endif
diff --git a/content/browser/font_unique_name_lookup/font_unique_name_browsertest.cc b/content/browser/font_unique_name_lookup/font_unique_name_browsertest.cc index 4110dec..9649edd1 100644 --- a/content/browser/font_unique_name_lookup/font_unique_name_browsertest.cc +++ b/content/browser/font_unique_name_lookup/font_unique_name_browsertest.cc
@@ -17,7 +17,7 @@ #include "content/public/test/test_navigation_observer.h" #include "content/shell/browser/shell.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "base/files/scoped_temp_dir.h" #include "content/browser/renderer_host/dwrite_font_lookup_table_builder_win.h" #endif @@ -25,7 +25,7 @@ namespace content { namespace { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) const char* kExpectedFontFamilyNames[] = {"AndroidClock", "Roboto", "Droid Sans Mono", @@ -67,7 +67,7 @@ "Roboto Condensed", "Roboto Condensed", "Roboto"}; -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) const char* kExpectedFontFamilyNames[] = {"Ahem", "Arimo", "Arimo", @@ -94,7 +94,7 @@ "Tinos", "Mukti Narrow", "Tinos"}; -#elif defined(OS_MAC) +#elif BUILDFLAG(IS_MAC) const char* kExpectedFontFamilyNames[] = {"American Typewriter", "Arial Narrow", "Baskerville", @@ -105,7 +105,7 @@ "Malayalam Sangam MN", "Hiragino Maru Gothic Pro", "Hiragino Kaku Gothic StdN"}; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) const char* kExpectedFontFamilyNames[] = {"Cambria Math", "MingLiU_HKSCS-ExtB", "NSimSun", "Calibri"}; #endif @@ -131,15 +131,15 @@ private: base::test::ScopedFeatureList feature_list_; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) base::ScopedTempDir cache_directory_; #endif }; // TODO(crbug.com/949181): Make this work on Fuchsia. -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) // TODO(crbug.com/1270151): Fix this on Android 11 and 12. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_ContentLocalFontsMatching DISABLED_ContentLocalFontsMatching #else #define MAYBE_ContentLocalFontsMatching ContentLocalFontsMatching
diff --git a/content/browser/form_controls_browsertest.cc b/content/browser/form_controls_browsertest.cc index 6d66e83..dd042f8 100644 --- a/content/browser/form_controls_browsertest.cc +++ b/content/browser/form_controls_browsertest.cc
@@ -20,11 +20,11 @@ #include "ui/base/ui_base_features.h" #include "ui/base/ui_base_switches.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/build_info.h" #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "base/win/windows_version.h" #endif @@ -66,22 +66,22 @@ base::ScopedAllowBlockingForTesting allow_blocking; std::string platform_suffix; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) platform_suffix = "_mac"; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) platform_suffix = "_win"; -#elif defined(OS_LINUX) +#elif BUILDFLAG(IS_LINUX) platform_suffix = "_linux"; -#elif defined(OS_CHROMEOS) +#elif BUILDFLAG(IS_CHROMEOS) platform_suffix = "_chromeos"; -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) int sdk_int = base::android::BuildInfo::GetInstance()->sdk_int(); if (sdk_int == base::android::SDK_VERSION_KITKAT) { platform_suffix = "_android_kitkat"; } else { platform_suffix = "_android"; } -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) platform_suffix = "_fuchsia"; #endif @@ -101,7 +101,7 @@ NavigateToURL(shell()->web_contents(), GURL("data:text/html,<!DOCTYPE html>" + body_html))); -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) // This fuzzy pixel comparator handles several mac behaviors: // - Different font rendering after 10.14 // - 10.12 subpixel rendering differences: crbug.com/1037971 @@ -113,8 +113,8 @@ /* avg_abs_error_limit */ 20.f, /* max_abs_error_limit */ 120.f, /* small_error_threshold */ 0); -#elif defined(OS_ANDROID) || defined(OS_WIN) || (OS_LINUX) || \ - defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) || (OS_LINUX) || \ + BUILDFLAG(IS_FUCHSIA) // Different versions of android may have slight differences in rendering. // Some versions have more significant differences than others, which are // tracked separately in separate baseline image files. The less significant @@ -137,7 +137,7 @@ // Check if the test can run on the current system. bool SkipTestForOldAndroidVersions() const { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Lower versions of android running on older devices, ex Nexus 5, render // form controls with a too large of a difference -- >20% error -- to // pixel compare. @@ -145,23 +145,23 @@ base::android::SDK_VERSION_OREO) { return true; } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) return false; } bool SkipTestForOldWinVersion() const { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Win7 font rendering causes too large of rendering diff for pixel // comparison. if (base::win::GetVersion() <= base::win::Version::WIN7) return true; -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) return false; } }; // Checkbox renders differently on Android x86. crbug.com/1238283 -#if defined(OS_ANDROID) && defined(ARCH_CPU_X86) +#if BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_X86) #define MAYBE_Checkbox DISABLED_Checkbox #else #define MAYBE_Checkbox Checkbox @@ -202,7 +202,7 @@ } IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, DarkModeTextSelection) { -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) if (!MacOSVersionSupportsDarkMode()) return; #endif @@ -298,7 +298,7 @@ // TODO(crbug.com/1160104/#25) This test creates large average_error_rate on // Android FYI SkiaRenderer Vulkan. Disable it until a resolution for is // found. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_ColorInput DISABLED_ColorInput #else #define MAYBE_ColorInput ColorInput
diff --git a/content/browser/handwriting/handwriting_recognition_service_factory.cc b/content/browser/handwriting/handwriting_recognition_service_factory.cc index 0fdb22d..a0f32cb 100644 --- a/content/browser/handwriting/handwriting_recognition_service_factory.cc +++ b/content/browser/handwriting/handwriting_recognition_service_factory.cc
@@ -6,26 +6,27 @@ #include <utility> +#include "build/build_config.h" #include "build/buildflag.h" -#if defined(OS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) #include "content/browser/handwriting/handwriting_recognition_service_impl_cros.h" #else // The default service which does not have any real handwriting recognition // backend. #include "content/browser/handwriting/handwriting_recognition_service_impl.h" -#endif // defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_CHROMEOS) namespace content { void CreateHandwritingRecognitionService( mojo::PendingReceiver<handwriting::mojom::HandwritingRecognitionService> pending_receiver) { -#if defined(OS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) CrOSHandwritingRecognitionServiceImpl::Create(std::move(pending_receiver)); #else HandwritingRecognitionServiceImpl::Create(std::move(pending_receiver)); -#endif // defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_CHROMEOS) } } // namespace content
diff --git a/content/browser/host_zoom_map_impl.cc b/content/browser/host_zoom_map_impl.cc index e201eee4..0774c15 100644 --- a/content/browser/host_zoom_map_impl.cc +++ b/content/browser/host_zoom_map_impl.cc
@@ -29,7 +29,7 @@ #include "net/base/url_util.h" #include "third_party/blink/public/common/page/page_zoom.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "content/public/android/content_jni_headers/HostZoomMapImpl_jni.h" #endif @@ -491,7 +491,7 @@ clock_ = clock; } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void JNI_HostZoomMapImpl_SetZoomLevel( JNIEnv* env, const base::android::JavaParamRef<jobject>& j_web_contents,
diff --git a/content/browser/hyphenation/hyphenation_impl.cc b/content/browser/hyphenation/hyphenation_impl.cc index ac859ab6..2fbef70 100644 --- a/content/browser/hyphenation/hyphenation_impl.cc +++ b/content/browser/hyphenation/hyphenation_impl.cc
@@ -18,6 +18,7 @@ #include "base/task/post_task.h" #include "base/task/thread_pool.h" #include "base/timer/elapsed_timer.h" +#include "build/build_config.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" #include "content/public/common/content_client.h" @@ -31,7 +32,7 @@ return dictionaries.get(); } -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) void SetDirectory(const base::FilePath& new_dir) { DVLOG(1) << __func__ << " " << new_dir; DCHECK(hyphenation::HyphenationImpl::GetTaskRunner() @@ -60,7 +61,7 @@ DCHECK(hyphenation::HyphenationImpl::GetTaskRunner() ->RunsTasksInCurrentSequence()); Dictionaries* dictionaries = Dictionaries::Get(); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) const base::FilePath& dir = dictionaries->dir; if (dir.empty()) return base::File(); @@ -74,7 +75,7 @@ return file.Duplicate(); DCHECK(!file.IsValid()); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) base::FilePath dir("/system/usr/hyphen-data"); #endif std::string filename = base::StringPrintf("hyph-%s.hyb", locale.c_str()); @@ -109,7 +110,7 @@ return *runner; } -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // static void HyphenationImpl::RegisterGetDictionary() { content::ContentBrowserClient* content_browser_client =
diff --git a/content/browser/hyphenation/hyphenation_impl.h b/content/browser/hyphenation/hyphenation_impl.h index 7118182..2436f10 100644 --- a/content/browser/hyphenation/hyphenation_impl.h +++ b/content/browser/hyphenation/hyphenation_impl.h
@@ -25,7 +25,7 @@ static scoped_refptr<base::SequencedTaskRunner> GetTaskRunner(); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) static void RegisterGetDictionary(); #endif @@ -34,7 +34,7 @@ OpenDictionaryCallback callback) override; private: -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) static void SetDirectory(const base::FilePath& dir); #endif };
diff --git a/content/browser/indexed_db/indexed_db_feature_observer_browsertest.cc b/content/browser/indexed_db/indexed_db_feature_observer_browsertest.cc index f39a036..e0e47143 100644 --- a/content/browser/indexed_db/indexed_db_feature_observer_browsertest.cc +++ b/content/browser/indexed_db/indexed_db_feature_observer_browsertest.cc
@@ -274,7 +274,7 @@ ->web_contents() ->GetController() .GetBackForwardCache() - .DisableForTesting(content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + .DisableForTesting(content::BackForwardCache::TEST_REQUIRES_NO_CACHING); if (!CheckShouldRunTestAndNavigate()) return;
diff --git a/content/browser/installedapp/installed_app_provider_impl.cc b/content/browser/installedapp/installed_app_provider_impl.cc index 13ed57c..7b68bed 100644 --- a/content/browser/installedapp/installed_app_provider_impl.cc +++ b/content/browser/installedapp/installed_app_provider_impl.cc
@@ -15,7 +15,7 @@ namespace { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) void DidGetInstalledApps( bool is_off_the_record, InstalledAppProviderImpl::FilterInstalledAppsCallback callback, @@ -45,7 +45,7 @@ FilterInstalledAppsCallback callback) { bool is_implemented = false; if (base::FeatureList::IsEnabled(features::kInstalledAppProvider)) { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) is_implemented = true; bool is_off_the_record = render_frame_host() ->GetProcess()
diff --git a/content/browser/interest_group/ad_auction_service_impl.cc b/content/browser/interest_group/ad_auction_service_impl.cc index f379c9a..14dedc7 100644 --- a/content/browser/interest_group/ad_auction_service_impl.cc +++ b/content/browser/interest_group/ad_auction_service_impl.cc
@@ -220,8 +220,9 @@ } // If the interest group API is not allowed for this origin do nothing. if (!GetContentClient()->browser()->IsInterestGroupAPIAllowed( - render_frame_host()->GetBrowserContext(), main_frame_origin_, - group.owner.GetURL())) { + render_frame_host(), + ContentBrowserClient::InterestGroupApiOperation::kJoin, + main_frame_origin_, group.owner)) { return; } @@ -250,8 +251,9 @@ } // If the interest group API is not allowed for this origin do nothing. if (!GetContentClient()->browser()->IsInterestGroupAPIAllowed( - render_frame_host()->GetBrowserContext(), main_frame_origin_, - origin().GetURL())) { + render_frame_host(), + ContentBrowserClient::InterestGroupApiOperation::kLeave, + main_frame_origin_, origin())) { return; } @@ -274,8 +276,9 @@ } // If the interest group API is not allowed for this origin do nothing. if (!GetContentClient()->browser()->IsInterestGroupAPIAllowed( - render_frame_host()->GetBrowserContext(), main_frame_origin_, - origin().GetURL())) { + render_frame_host(), + ContentBrowserClient::InterestGroupApiOperation::kUpdate, + main_frame_origin_, origin())) { return; } GetInterestGroupManager().UpdateInterestGroupsOfOwner( @@ -297,10 +300,11 @@ } const url::Origin& frame_origin = origin(); - BrowserContext* browser_context = render_frame_host()->GetBrowserContext(); + auto* rfh = render_frame_host(); // If the interest group API is not allowed for this seller do nothing. if (!GetContentClient()->browser()->IsInterestGroupAPIAllowed( - browser_context, frame_origin, config->seller.GetURL())) { + rfh, ContentBrowserClient::InterestGroupApiOperation::kSell, + frame_origin, config->seller)) { std::move(callback).Run(absl::nullopt); return; } @@ -311,9 +315,10 @@ ->interest_group_buyers->get_buyers(); std::copy_if( buyers.begin(), buyers.end(), std::back_inserter(filtered_buyers), - [browser_context, &frame_origin](const url::Origin& buyer) { + [rfh, &frame_origin](const url::Origin& buyer) { return GetContentClient()->browser()->IsInterestGroupAPIAllowed( - browser_context, frame_origin, buyer.GetURL()); + rfh, ContentBrowserClient::InterestGroupApiOperation::kBuy, + frame_origin, buyer); }); // If there are no buyers (either due to filtering, or in the original auction
diff --git a/content/browser/interest_group/ad_auction_service_impl_unittest.cc b/content/browser/interest_group/ad_auction_service_impl_unittest.cc index 6bd4fcd..cb787b3a 100644 --- a/content/browser/interest_group/ad_auction_service_impl_unittest.cc +++ b/content/browser/interest_group/ad_auction_service_impl_unittest.cc
@@ -80,21 +80,21 @@ const AllowInterestGroupContentBrowserClient&) = delete; // ContentBrowserClient overrides: - bool IsInterestGroupAPIAllowed(content::BrowserContext* browser_context, + bool IsInterestGroupAPIAllowed(content::RenderFrameHost* render_frame_host, + InterestGroupApiOperation operation, const url::Origin& top_frame_origin, - const GURL& owner_url) override { - const url::Origin owner_origin = url::Origin::Create(owner_url); + const url::Origin& api_origin) override { // Can join A interest groups on A top frames, B interest groups on B top // frames, C interest groups on C top frames, and C interest groups on A top // frames. return (top_frame_origin.host() == "a.test" && - owner_origin.host() == "a.test") || + api_origin.host() == "a.test") || (top_frame_origin.host() == "b.test" && - owner_origin.host() == "b.test") || + api_origin.host() == "b.test") || (top_frame_origin.host() == "c.test" && - owner_origin.host() == "c.test") || + api_origin.host() == "c.test") || (top_frame_origin.host() == "a.test" && - owner_origin.host() == "c.test"); + api_origin.host() == "c.test"); } };
diff --git a/content/browser/interest_group/interest_group_browsertest.cc b/content/browser/interest_group/interest_group_browsertest.cc index c17bd47..8d335c5c 100644 --- a/content/browser/interest_group/interest_group_browsertest.cc +++ b/content/browser/interest_group/interest_group_browsertest.cc
@@ -115,11 +115,13 @@ } // ContentBrowserClient overrides: - bool IsInterestGroupAPIAllowed(content::BrowserContext* browser_context, - const url::Origin& top_frame_origin, - const GURL& api_url) override { + bool IsInterestGroupAPIAllowed( + content::RenderFrameHost* render_frame_host, + ContentBrowserClient::InterestGroupApiOperation operation, + const url::Origin& top_frame_origin, + const url::Origin& api_origin) override { return allow_list_.contains(top_frame_origin) && - allow_list_.contains(url::Origin::Create(api_url)); + allow_list_.contains(api_origin); } private:
diff --git a/content/browser/isolated_origin_browsertest.cc b/content/browser/isolated_origin_browsertest.cc index 81abc90..fa8d0cf 100644 --- a/content/browser/isolated_origin_browsertest.cc +++ b/content/browser/isolated_origin_browsertest.cc
@@ -2212,7 +2212,7 @@ }; // TODO(crbug.com/1110767): flaky on Android builders since 2020-07-28. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_FrameTreeTestBeforeDidCommit DISABLED_FrameTreeTestBeforeDidCommit #else #define MAYBE_FrameTreeTestBeforeDidCommit FrameTreeTestBeforeDidCommit @@ -3741,7 +3741,7 @@ EXPECT_EQ(bad_message::RPH_MOJO_PROCESS_ERROR, kill_waiter.Wait()); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_LocalStorageOriginEnforcement_NonIsolatedAccessingIsolated \ LocalStorageOriginEnforcement_NonIsolatedAccessingIsolated #else @@ -4185,7 +4185,7 @@ void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kDisableSiteIsolation); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) command_line->AppendSwitch(switches::kDisableSiteIsolationForPolicy); #endif } @@ -4213,7 +4213,7 @@ void SetUpCommandLine(base::CommandLine* command_line) override { IsolatedOriginTest::SetUpCommandLine(command_line); command_line->AppendSwitch(switches::kDisableSiteIsolation); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) command_line->AppendSwitch(switches::kDisableSiteIsolationForPolicy); #endif } @@ -4747,7 +4747,7 @@ // TODO(alexmos): We use EXPECT_FALSE() on platforms that support citadel // enforcements. Currently this is only on Android, but will be extended to // desktop, at which time the EXPECT_TRUE() case below can be removed. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) EXPECT_FALSE(policy->CanAccessDataForOrigin(old_process_id, url::Origin::Create(bar_url))); #else @@ -4782,7 +4782,7 @@ // Disable the BackForwardCache to ensure the old process is going to be // released. DisableBackForwardCacheForTesting(web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); GURL isolated_bar_url( embedded_test_server()->GetURL("isolated.bar.com", "/title1.html"));
diff --git a/content/browser/launch_as_mojo_client_browsertest.cc b/content/browser/launch_as_mojo_client_browsertest.cc index 496c7fb6..9df0cd2 100644 --- a/content/browser/launch_as_mojo_client_browsertest.cc +++ b/content/browser/launch_as_mojo_client_browsertest.cc
@@ -34,7 +34,7 @@ namespace content { namespace { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) const char kShellExecutableName[] = "content_shell.exe"; #else const char kShellExecutableName[] = "content_shell"; @@ -103,7 +103,7 @@ return controller; } -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) base::FilePath GetMojoCoreLibraryPath() { return GetFilePathNextToCurrentExecutable(kMojoCoreLibraryName); } @@ -157,7 +157,7 @@ shell_controller->ShutDown(); } -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) // TODO(crbug.com/1259557): This test implementation fundamentally conflicts // with a fix for the linked bug because it causes a browser process to behave // partially as a broker and partially as a non-broker. This can be re-enabled @@ -193,7 +193,7 @@ shell_controller->ShutDown(); } -#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) } // namespace } // namespace content
diff --git a/content/browser/locks/lock_manager_browsertest.cc b/content/browser/locks/lock_manager_browsertest.cc index fe1a8f6..ef903cfb 100644 --- a/content/browser/locks/lock_manager_browsertest.cc +++ b/content/browser/locks/lock_manager_browsertest.cc
@@ -23,7 +23,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/build_info.h" #endif @@ -112,7 +112,7 @@ } bool CheckShouldRunTestAndNavigate() const { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Don't run the test if we couldn't override BrowserClient. It happens only // on Android Kitkat or older systems. if (!original_client_) @@ -124,7 +124,7 @@ base::android::SDK_VERSION_KITKAT) { return false; } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) EXPECT_TRUE(NavigateToURL(shell(), GetLocksURL("a.com"))); return true; } @@ -229,7 +229,7 @@ // Verify that content::FeatureObserver is notified that a frame stopped holding // locks when it is navigated away. // TODO(crbug.com/1286329): Flakes on Linux, Chrome OS, and Mac. -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) #define MAYBE_ObserverNavigate DISABLED_ObserverNavigate #else #define MAYBE_ObserverNavigate ObserverNavigate @@ -361,7 +361,7 @@ } // SharedWorkers are not enabled on Android. https://crbug.com/154571 -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // Verify that content::FeatureObserver is *not* notified when a lock is // acquired by a shared worker. IN_PROC_BROWSER_TEST_F(LockManagerBrowserTest, ObserverSharedWorker) { @@ -383,7 +383,7 @@ // Wait a short timeout to make sure that the observer is not notified. RunLoopWithTimeout(); } -#endif // !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) // Verify that content::FeatureObserver is *not* notified when a lock is // acquired by a service worker.
diff --git a/content/browser/media/media_web_contents_observer.h b/content/browser/media/media_web_contents_observer.h index 91d6cdc..837d9e5 100644 --- a/content/browser/media/media_web_contents_observer.h +++ b/content/browser/media/media_web_contents_observer.h
@@ -34,7 +34,7 @@ #if BUILDFLAG(IS_ANDROID) #include "ui/android/view_android.h" -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) namespace blink { enum class WebFullscreenVideoStatus;
diff --git a/content/browser/media/system_media_controls_notifier.cc b/content/browser/media/system_media_controls_notifier.cc index 707b5899..694e686 100644 --- a/content/browser/media/system_media_controls_notifier.cc +++ b/content/browser/media/system_media_controls_notifier.cc
@@ -147,6 +147,16 @@ system_media_controls_->SetIsSeekToEnabled(seek_available); } +void SystemMediaControlsNotifier::MediaSessionChanged( + const absl::optional<base::UnguessableToken>& request_id) { + if (!request_id.has_value()) { + system_media_controls_->SetID(nullptr); + return; + } + auto string_id = request_id->ToString(); + system_media_controls_->SetID(&string_id); +} + void SystemMediaControlsNotifier::MediaControllerImageChanged( media_session::mojom::MediaSessionImageType type, const SkBitmap& bitmap) {
diff --git a/content/browser/media/system_media_controls_notifier.h b/content/browser/media/system_media_controls_notifier.h index b448adb..ce2fb62 100644 --- a/content/browser/media/system_media_controls_notifier.h +++ b/content/browser/media/system_media_controls_notifier.h
@@ -52,7 +52,7 @@ const std::vector<media_session::mojom::MediaSessionAction>& actions) override; void MediaSessionChanged( - const absl::optional<base::UnguessableToken>& request_id) override {} + const absl::optional<base::UnguessableToken>& request_id) override; void MediaSessionPositionChanged( const absl::optional<media_session::MediaPosition>& position) override;
diff --git a/content/browser/media/system_media_controls_notifier_unittest.cc b/content/browser/media/system_media_controls_notifier_unittest.cc index 60751f2..ab03f1f 100644 --- a/content/browser/media/system_media_controls_notifier_unittest.cc +++ b/content/browser/media/system_media_controls_notifier_unittest.cc
@@ -28,6 +28,7 @@ system_media_controls::SystemMediaControls::PlaybackStatus; using testing::_; using testing::Expectation; +using testing::WithArg; class SystemMediaControlsNotifierTest : public testing::Test { public: @@ -147,6 +148,23 @@ SimulateImageChanged(); } +TEST_F(SystemMediaControlsNotifierTest, ProperlyUpdatesID) { + // When a request ID is set, the system media controls should receive that ID. + auto request_id = base::UnguessableToken::Create(); + EXPECT_CALL(mock_system_media_controls(), SetID(_)) + .WillOnce(WithArg<0>([request_id](const std::string* value) { + ASSERT_NE(nullptr, value); + EXPECT_EQ(request_id.ToString(), *value); + })); + notifier().MediaSessionChanged(request_id); + testing::Mock::VerifyAndClearExpectations(&mock_system_media_controls()); + + // When the request ID is cleared, the system media controls should receive + // null. + EXPECT_CALL(mock_system_media_controls(), SetID(nullptr)); + notifier().MediaSessionChanged(absl::nullopt); +} + #if BUILDFLAG(IS_WIN) TEST_F(SystemMediaControlsNotifierTest, DisablesOnLockAndEnablesOnUnlock) { EXPECT_CALL(mock_system_media_controls(), SetEnabled(false));
diff --git a/content/browser/message_port_provider.cc b/content/browser/message_port_provider.cc index edf25ce..a46b8700 100644 --- a/content/browser/message_port_provider.cc +++ b/content/browser/message_port_provider.cc
@@ -17,7 +17,7 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/common/messaging/string_message_codec.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/jni_string.h" #include "content/public/browser/android/app_web_message_port.h" #endif @@ -52,7 +52,7 @@ std::move(message)); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) std::u16string ToString16(JNIEnv* env, const base::android::JavaParamRef<jstring>& s) { if (s.is_null()) @@ -73,7 +73,7 @@ std::vector<blink::MessagePortDescriptor>()); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void MessagePortProvider::PostMessageToFrame( Page& page, JNIEnv* env, @@ -87,7 +87,7 @@ } #endif -#if defined(OS_FUCHSIA) || BUILDFLAG(IS_CHROMECAST) +#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_CHROMECAST) // static void MessagePortProvider::PostMessageToFrame( Page& page,
diff --git a/content/browser/mojo_sandbox_browsertest.cc b/content/browser/mojo_sandbox_browsertest.cc index 07475ae..daa48aa 100644 --- a/content/browser/mojo_sandbox_browsertest.cc +++ b/content/browser/mojo_sandbox_browsertest.cc
@@ -177,7 +177,7 @@ })); run_loop.Run(); ASSERT_TRUE(maybe_is_sandboxed.has_value()); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Android does not support unsandboxed utility processes. See // org.chromium.content.browser.ChildProcessLauncherHelperImpl#createAndStart EXPECT_TRUE(maybe_is_sandboxed.value());
diff --git a/content/browser/navigation_browsertest.cc b/content/browser/navigation_browsertest.cc index c85ddb6f..19eb8b7 100644 --- a/content/browser/navigation_browsertest.cc +++ b/content/browser/navigation_browsertest.cc
@@ -2277,7 +2277,7 @@ // See BackForwardCacheBrowserTest.RestoreWhilePendingCommit which covers the // same scenario for back-forward cache. web_contents()->GetController().GetBackForwardCache().DisableForTesting( - BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); using Response = net::test_server::ControllableHttpResponse; Response response_A1(embedded_test_server(), "/A"); @@ -3944,7 +3944,7 @@ // so that the document policy to force-load-at-top will run. This will not // happen if the document is back-forward cached, so we need to disable it. DisableBackForwardCacheForTesting(web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // Load the document with document policy force-load-at-top shell()->LoadURL(url); @@ -5470,7 +5470,7 @@ // TODO(crbug.com/1233836, crbug.com/1238886): Test is flaky on Mac 11, Linux // and ChromeOS. -#if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #define MAYBE_BeginNewNavigationAfterCommitNavigationInMainFrame \ DISABLED_BeginNewNavigationAfterCommitNavigationInMainFrame #else @@ -5534,7 +5534,7 @@ } // TODO(crbug.com/1233836): Test is flaky on Mac. -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #define MAYBE_BeginNewNavigationAfterCommitNavigationInSubFrame \ DISABLED_BeginNewNavigationAfterCommitNavigationInSubFrame #else @@ -5715,12 +5715,12 @@ // new NavigationRequest, because it was trying to access the current // RenderFrameHost's PolicyContainerHost, which had not been set up yet by // RenderFrameHostImpl::DidNavigate. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Flaky on Android: https://crbug.com/1222320. #define MAYBE_Bug1210234 DISABLED_Bug1210234 #else #define MAYBE_Bug1210234 Bug1210234 -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(NavigationBrowserTest, MAYBE_Bug1210234) { class NavigationWebContentsDelegate : public WebContentsDelegate { public:
diff --git a/content/browser/network_context_client_base_impl.cc b/content/browser/network_context_client_base_impl.cc index def773f..6a1bef4 100644 --- a/content/browser/network_context_client_base_impl.cc +++ b/content/browser/network_context_client_base_impl.cc
@@ -16,7 +16,7 @@ #include "mojo/public/cpp/bindings/remote.h" #include "services/network/public/mojom/trust_tokens.mojom.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/content_uri_utils.h" #endif @@ -43,7 +43,7 @@ std::vector<base::File>())); return; } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) if (file_path.IsContentUri()) { files.push_back(base::OpenContentUriForRead(file_path)); } else { @@ -104,7 +104,7 @@ std::move(callback).Run(false); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void NetworkContextClientBase::OnGenerateHttpNegotiateAuthToken( const std::string& server_auth_token, bool can_delegate,
diff --git a/content/browser/network_context_client_base_impl_unittest.cc b/content/browser/network_context_client_base_impl_unittest.cc index 82e0c6c0..5f2bdd5 100644 --- a/content/browser/network_context_client_base_impl_unittest.cc +++ b/content/browser/network_context_client_base_impl_unittest.cc
@@ -124,7 +124,7 @@ ValidateFileContents(response.opened_files[0], kFileContent1); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Flakily fails on Android bots. See http://crbug.com/1027790 TEST_F(NetworkContextClientBaseTest, DISABLED_UploadOneValidFileWithContentUri) {
diff --git a/content/browser/network_service_browsertest.cc b/content/browser/network_service_browsertest.cc index 70e3f453d..708ff1e 100644 --- a/content/browser/network_service_browsertest.cc +++ b/content/browser/network_service_browsertest.cc
@@ -59,11 +59,11 @@ #include "sql/database.h" #include "sql/sql_features.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/application_status_listener.h" #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "sandbox/policy/features.h" #endif @@ -332,7 +332,7 @@ ASSERT_EQ(headers->response_code(), 401); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(NetworkServiceBrowserTest, HttpCacheWrittenToDiskOnApplicationStateChange) { base::ScopedAllowBlockingForTesting allow_blocking; @@ -685,7 +685,7 @@ // Android doesn't support PRE_ tests. // TODO(wfh): Enable this test when https://crbug.com/1257820 is fixed. // TODO(crbug.com/1266222): Fix disk cache error on Fuchsia -#if !defined(OS_ANDROID) && !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) class NetworkServiceBrowserCacheResetTest : public NetworkServiceBrowserTest { public: NetworkServiceBrowserCacheResetTest() = default; @@ -839,7 +839,7 @@ /*load_only_from_cache=*/true, url), net::test::IsError(net::ERR_CACHE_MISS)); } -#endif // !defined(OS_ANDROID) && !defined(OS_FUCHSIA) +#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) enum class FailureType { kNoFailures = 0, @@ -851,7 +851,7 @@ // A file called 'TestCookies' already exists in the migration target // directory. kCookieFileAlreadyThere = 3, -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // The 'TestCookies' file in the destination directory is locked and cannot be // written to. This is only valid on Windows where files can actually be // locked. @@ -860,7 +860,7 @@ // from (during the migration). This failure is only valid on Windows where // files can actually be locked. kSourceCookieFileIsLocked = 5, -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) // A file exists with the same name as the Cache dir. This will cause the // creation of the cache dir to fail, and cache to not function either // (although we don't test for that here). @@ -872,10 +872,10 @@ FailureType::kDirIsAFile, FailureType::kDirAlreadyThere, FailureType::kCookieFileAlreadyThere, -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) FailureType::kDestCookieFileIsLocked, FailureType::kSourceCookieFileIsLocked, -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) FailureType::kCacheDirIsAFile}; static const base::FilePath::CharType kCookieDatabaseName[] = @@ -892,7 +892,7 @@ // in MaybeGrantSandboxAccessToNetworkContextData will need to be updated. EXPECT_FALSE( base::FeatureList::IsEnabled(sql::features::kEnableWALModeByDefault)); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // On Windows, the network sandbox needs to be disabled. This is because the // code that performs the migration on Windows DCHECKs if network sandbox is // enabled and migration is not requested, but this is used in the tests to @@ -905,7 +905,7 @@ protected: bool in_process_network_service_ = false; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) private: base::test::ScopedFeatureList win_network_sandbox_feature_; #endif @@ -1006,7 +1006,7 @@ // Verify cookie file is there, copied across from the tempdir 'one'. EXPECT_TRUE(base::PathExists(tempdir_two.Append(kCookieDatabaseName))); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) base::File longer_lived_file; #endif @@ -1033,7 +1033,7 @@ base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); EXPECT_TRUE(scoped_file.IsValid()); } break; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) case FailureType::kDestCookieFileIsLocked: // Create a file called 'TestCookies' in the destination path and hold a // write lock on it so it can't be written to. @@ -1057,7 +1057,7 @@ base::File::FLAG_WIN_EXCLUSIVE_READ); EXPECT_TRUE(longer_lived_file.IsValid()); break; -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) case FailureType::kCacheDirIsAFile: { // Make the cache directory invalid by deleting it and making it a file, // so it can't be created or used. @@ -1134,7 +1134,7 @@ /*sample=kFailedToCreateDataDirectory=*/2, /*expected_bucket_count=*/1); break; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) case FailureType::kDestCookieFileIsLocked: // Cookie file should still be in the original `unsandboxed_data_path` as // it could not be moved as the destination was locked or not writable. @@ -1177,7 +1177,7 @@ // totally broken. :( cookies_should_work = false; break; -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) case FailureType::kCacheDirIsAFile: histogram_tester.ExpectUniqueSample( "NetworkService.GrantSandboxToCacheResult",
diff --git a/content/browser/network_service_client.cc b/content/browser/network_service_client.cc index 5a737d91..bbecf68 100644 --- a/content/browser/network_service_client.cc +++ b/content/browser/network_service_client.cc
@@ -11,6 +11,7 @@ #include "base/task/post_task.h" #include "base/threading/sequence_bound.h" #include "base/unguessable_token.h" +#include "build/build_config.h" #include "content/browser/browsing_data/clear_site_data_handler.h" #include "content/browser/renderer_host/frame_tree_node.h" #include "content/browser/ssl/ssl_manager.h" @@ -31,25 +32,25 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/mojom/web_feature/web_feature.mojom.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/content_uri_utils.h" #endif -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "base/task/current_thread.h" #endif namespace content { NetworkServiceClient::NetworkServiceClient() -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) : app_status_listener_(base::android::ApplicationStatusListener::New( base::BindRepeating(&NetworkServiceClient::OnApplicationStateChange, base::Unretained(this)))) #endif { -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) if (base::CurrentUIThread::IsSet()) // Not set in some unit tests. net::CertDatabase::GetInstance()->StartListeningForKeychainEvents(); #endif @@ -60,7 +61,7 @@ FROM_HERE, base::BindRepeating(&NetworkServiceClient::OnMemoryPressure, base::Unretained(this))); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) DCHECK(!net::NetworkChangeNotifier::CreateIfNeeded()); GetNetworkService()->GetNetworkChangeManager( network_change_manager_.BindNewPipeAndPassReceiver()); @@ -80,7 +81,7 @@ NetworkServiceClient::~NetworkServiceClient() { if (IsOutOfProcessNetworkService()) { net::CertDatabase::GetInstance()->RemoveObserver(this); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); net::NetworkChangeNotifier::RemoveMaxBandwidthObserver(this); net::NetworkChangeNotifier::RemoveIPAddressObserver(this); @@ -102,7 +103,7 @@ GetNetworkService()->OnPeerToPeerConnectionsCountChange(count); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void NetworkServiceClient::OnApplicationStateChange( base::android::ApplicationState state) { GetNetworkService()->OnApplicationStateChange(state);
diff --git a/content/browser/network_service_client.h b/content/browser/network_service_client.h index 7c94ff78..d1f72e7 100644 --- a/content/browser/network_service_client.h +++ b/content/browser/network_service_client.h
@@ -22,7 +22,7 @@ #include "services/network/public/mojom/url_loader_network_service_observer.mojom.h" #include "url/gurl.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/application_status_listener.h" #endif @@ -32,7 +32,7 @@ class NetworkServiceClient : public network::mojom::URLLoaderNetworkServiceObserver, -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) public net::NetworkChangeNotifier::ConnectionTypeObserver, public net::NetworkChangeNotifier::MaxBandwidthObserver, public net::NetworkChangeNotifier::IPAddressObserver, @@ -60,7 +60,7 @@ // require low network latency. void OnPeerToPeerConnectionsCountChange(uint32_t count); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void OnApplicationStateChange(base::android::ApplicationState state); // net::NetworkChangeNotifier::ConnectionTypeObserver implementation: @@ -119,7 +119,7 @@ std::unique_ptr<WebRtcConnectionsObserver> webrtc_connections_observer_; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) std::unique_ptr<base::android::ApplicationStatusListener> app_status_listener_; mojo::Remote<network::mojom::NetworkChangeManager> network_change_manager_;
diff --git a/content/browser/network_service_instance_impl.cc b/content/browser/network_service_instance_impl.cc index a9874632..6348997b 100644 --- a/content/browser/network_service_instance_impl.cc +++ b/content/browser/network_service_instance_impl.cc
@@ -56,7 +56,7 @@ #include "services/network/public/mojom/network_service_test.mojom.h" #include "sql/database.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <windows.h> #include "base/win/registry.h" @@ -64,15 +64,15 @@ #include "base/win/sid.h" #include "base/win/windows_version.h" #include "sandbox/policy/features.h" -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) #include "content/common/android/cpu_affinity_setter.h" -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) namespace content { namespace { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) // Environment variable pointing to credential cache file. constexpr char kKrb5CCEnvName[] = "KRB5CCNAME"; // Environment variable pointing to Kerberos config file. @@ -103,12 +103,12 @@ // A platform specific set of parameters that is used when granting the sandbox // access to the network context data. struct SandboxParameters { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) std::wstring lpac_capability_name; #if DCHECK_IS_ON() bool sandbox_enabled; #endif // DCHECK_IS_ON() -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) }; // The outcome of attempting to allow the sandbox access to network context data @@ -189,7 +189,7 @@ void CreateInProcessNetworkServiceOnThread( mojo::PendingReceiver<network::mojom::NetworkService> receiver) { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) if (base::GetFieldTrialParamByFeatureAsBool( features::kBigLittleScheduling, features::kBigLittleSchedulingNetworkMainBigParam, false)) { @@ -363,7 +363,7 @@ // Only do this on directories. if (!base::DirectoryExists(path)) return false; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // On platforms that don't support the LPAC sandbox, do nothing. if (!sandbox::policy::features::IsWinNetworkServiceSandboxSupported()) return true; @@ -382,7 +382,7 @@ CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE, /*recursive=*/true); #else return true; -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) } // Copies data file called `filename` from `old_path` to `new_path` (which must @@ -579,7 +579,7 @@ network_service_params->first_party_sets_enabled = GetContentClient()->browser()->IsFirstPartySetsEnabled(); -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) // Send Kerberos environment variables to the network service. if (IsOutOfProcessNetworkService()) { std::unique_ptr<base::Environment> env(base::Environment::Create()); @@ -704,11 +704,11 @@ const SandboxParameters& sandbox_params, network::mojom::NetworkContextParams* params) { DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #if DCHECK_IS_ON() params->win_permissions_set = true; #endif -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) // HTTP cache path is special, and not under `data_path` so must also be // granted access. Continue attempting to grant access to the other files if @@ -746,7 +746,7 @@ DCHECK(!params->file_paths->data_path.empty()); if (!params->file_paths->unsandboxed_data_path.has_value()) { -#if defined(OS_WIN) && DCHECK_IS_ON() +#if BUILDFLAG(IS_WIN) && DCHECK_IS_ON() // On Windows, if network sandbox is enabled then there a migration must // happen, so a `unsandboxed_data_path` must be specified. DCHECK(!sandbox_params.sandbox_enabled); @@ -785,7 +785,7 @@ // Case 1. above where nothing is done. if (!params->file_paths->trigger_migration && !migration_already_happened) { -#if defined(OS_WIN) && DCHECK_IS_ON() +#if BUILDFLAG(IS_WIN) && DCHECK_IS_ON() // On Windows, if network sandbox is enabled then there a migration must // happen, so `trigger_migration` must be true, or a migration must have // already happened. @@ -1060,7 +1060,7 @@ if (env->GetVar("SSLKEYLOGFILE", &env_str)) { UMA_HISTOGRAM_ENUMERATION(kSSLKeyLogFileHistogram, SSLKeyLogFileAction::kEnvVarFound); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // base::Environment returns environment variables in UTF-8 on // Windows. ssl_key_log_path = base::FilePath(base::UTF8ToWide(env_str)); @@ -1292,7 +1292,7 @@ network::mojom::NetworkContextParamsPtr params) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); SandboxParameters sandbox_params = {}; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // On Android, if a cookie_manager pending receiver was passed then migration // should not be attempted as the cookie file is already being accessed by the // browser instance. @@ -1306,15 +1306,15 @@ SandboxGrantResult::kDidNotAttemptToGrantSandboxAccess); return; } -#endif // defined(OS_ANDROID) -#if defined(OS_WIN) +#endif // BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_WIN) sandbox_params.lpac_capability_name = GetContentClient()->browser()->GetLPACCapabilityNameForNetworkService(); #if DCHECK_IS_ON() sandbox_params.sandbox_enabled = GetContentClient()->browser()->ShouldSandboxNetworkService(); #endif // DCHECK_IS_ON() -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) base::OnceCallback<SandboxGrantResult()> worker_task = base::BindOnce(&MaybeGrantSandboxAccessToNetworkContextData, sandbox_params, params.get());
diff --git a/content/browser/network_service_restart_browsertest.cc b/content/browser/network_service_restart_browsertest.cc index c6212b4..ff2f5fdd 100644 --- a/content/browser/network_service_restart_browsertest.cc +++ b/content/browser/network_service_restart_browsertest.cc
@@ -558,7 +558,7 @@ // |StoragePartition::GetURLLoaderFactoryForBrowserProcessIOThread()| can be // used after crashes. // Flaky on Windows. https://crbug.com/840127 -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #define MAYBE_BrowserIOPendingFactory DISABLED_BrowserIOPendingFactory #else #define MAYBE_BrowserIOPendingFactory BrowserIOPendingFactory @@ -894,7 +894,7 @@ } // TODO(crbug.com/154571): Shared workers are not available on Android. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_SharedWorker DISABLED_SharedWorker #else #define MAYBE_SharedWorker SharedWorker @@ -947,7 +947,7 @@ base::FilePath log_file_path; base::CreateTemporaryFile(&log_file_path); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // On Windows, FilePath::value() returns std::wstring, so convert. std::string log_file_path_str = base::WideToUTF8(log_file_path.value()); #else @@ -1094,7 +1094,7 @@ #endif // TODO(crbug.com/901026): Fix deadlock on process startup on Android. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(NetworkServiceRestartBrowserTest, DISABLED_SyncCallDuringRestart) { if (IsInProcessNetworkService()) @@ -1126,7 +1126,7 @@ // // TODO(lukasza): https://crbug.com/1129592: Flaky on Android and Mac. No // flakiness observed whatsoever on Windows, Linux or CrOS. -#if defined(OS_ANDROID) || defined(OS_MAC) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_MAC) #define MAYBE_BetweenCommitNavigationAndDidCommit \ DISABLED_BetweenCommitNavigationAndDidCommit #else
diff --git a/content/browser/notifications/notification_event_dispatcher_impl.cc b/content/browser/notifications/notification_event_dispatcher_impl.cc index d351e78..aeb8e32 100644 --- a/content/browser/notifications/notification_event_dispatcher_impl.cc +++ b/content/browser/notifications/notification_event_dispatcher_impl.cc
@@ -45,7 +45,7 @@ // Derives a PersistentNotificationStatus from the ServiceWorkerStatusCode. PersistentNotificationStatus ConvertServiceWorkerStatus( blink::ServiceWorkerStatusCode service_worker_status) { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // This LOG(INFO) deliberately exists to help track down the cause of // https://crbug.com/534537, where notifications sometimes do not react to // the user clicking on them. It should be removed once that's fixed. @@ -104,7 +104,7 @@ blink::ServiceWorkerStatusCode service_worker_status, scoped_refptr<ServiceWorkerRegistration> service_worker_registration) { DCHECK_CURRENTLY_ON(BrowserThread::UI); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // This LOG(INFO) deliberately exists to help track down the cause of // https://crbug.com/534537, where notifications sometimes do not react to // the user clicking on them. It should be removed once that's fixed. @@ -166,7 +166,7 @@ bool success, const NotificationDatabaseData& notification_database_data) { DCHECK_CURRENTLY_ON(BrowserThread::UI); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // This LOG(INFO) deliberately exists to help track down the cause of // https://crbug.com/534537, where notifications sometimes do not react to // the user clicking on them. It should be removed once that's fixed.
diff --git a/content/browser/picture_in_picture/picture_in_picture_service_impl_unittest.cc b/content/browser/picture_in_picture/picture_in_picture_service_impl_unittest.cc index c1b4d1b..3c94092 100644 --- a/content/browser/picture_in_picture/picture_in_picture_service_impl_unittest.cc +++ b/content/browser/picture_in_picture/picture_in_picture_service_impl_unittest.cc
@@ -189,7 +189,7 @@ }; // Flaky on Android. https://crbug.com/970866 -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_EnterPictureInPicture DISABLED_EnterPictureInPicture #else #define MAYBE_EnterPictureInPicture EnterPictureInPicture
diff --git a/content/browser/plugin_private_storage_helper.cc b/content/browser/plugin_private_storage_helper.cc index 99fc364..f8e05505 100644 --- a/content/browser/plugin_private_storage_helper.cc +++ b/content/browser/plugin_private_storage_helper.cc
@@ -40,9 +40,9 @@ namespace { std::string StringTypeToString(const base::FilePath::StringType& value) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) return value; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) return base::WideToUTF8(value); #endif }
diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index 00106b9..8074a84 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc
@@ -281,13 +281,13 @@ if (PluginService::GetInstance()->GetPluginInfoByPath(path, &info) && !info.name.empty()) { plugin_name = info.name; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) // Many plugins on the Mac have .plugin in the actual name, which looks // terrible, so look for that and strip it off if present. static constexpr base::StringPiece16 kPluginExtension = u".plugin"; if (base::EndsWith(plugin_name, kPluginExtension)) plugin_name.erase(plugin_name.size() - kPluginExtension.size()); -#endif // defined(OS_MAC) +#endif // BUILDFLAG(IS_MAC) } return plugin_name; }
diff --git a/content/browser/pointer_lock_browsertest.cc b/content/browser/pointer_lock_browsertest.cc index 1a3c774..2bf3974 100644 --- a/content/browser/pointer_lock_browsertest.cc +++ b/content/browser/pointer_lock_browsertest.cc
@@ -282,7 +282,7 @@ } // crbug.com/1210940: flaky on Linux -#if defined(OS_LINUX) +#if BUILDFLAG(IS_LINUX) #define MAYBE_PointerLockEventRouting DISABLED_PointerLockEventRouting #else #define MAYBE_PointerLockEventRouting PointerLockEventRouting @@ -537,7 +537,7 @@ } } -#if defined(OS_LINUX) +#if BUILDFLAG(IS_LINUX) #define MAYBE_PointerLockWheelEventRouting DISABLED_PointerLockWheelEventRouting #else #define MAYBE_PointerLockWheelEventRouting PointerLockWheelEventRouting @@ -748,7 +748,7 @@ // Release pointer lock. EXPECT_EQ(true, PointerLockHelper::ExitPointerLock(root)); -#if defined(USE_AURA) || defined(OS_MAC) +#if defined(USE_AURA) || BUILDFLAG(IS_MAC) // Request a pointer lock with unadjustedMovement. EXPECT_EQ( true, @@ -855,7 +855,7 @@ #if defined(USE_AURA) // TODO(https://crbug.com/982379): Remove failure test when fully implemented -#if defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH) #define MAYBE_ChangeUnadjustedMovementFailure \ DISABLED_ChangeUnadjustedMovementFailure #else @@ -908,7 +908,7 @@ #endif #if defined(USE_AURA) -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Tests that a subsequent request to RequestPointerLock with different // options inside a Child view gets piped to the proper places and updates // the option(this option is only supported on Windows).
diff --git a/content/browser/portal/portal_browsertest.cc b/content/browser/portal/portal_browsertest.cc index 4dc8191..89da137 100644 --- a/content/browser/portal/portal_browsertest.cc +++ b/content/browser/portal/portal_browsertest.cc
@@ -266,7 +266,7 @@ } } -#if defined(OS_MAC) && defined(ARCH_CPU_ARM64) +#if BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64) // Bulk disabled as part of arm64 bot stabilization: https://crbug.com/1154345 #define MAYBE_ActivatePortal DISABLED_ActivatePortal #else @@ -317,7 +317,7 @@ } }; -#if defined(OS_MAC) && defined(ARCH_CPU_ARM64) +#if BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64) // Bulk disabled as part of arm64 bot stabilization: https://crbug.com/1154345 #define MAYBE_DefaultActivatePortal DISABLED_DefaultActivatePortal #else @@ -359,7 +359,7 @@ VerifyActivationTraceEvents(StopTracing()); } -#if defined(OS_MAC) && defined(ARCH_CPU_ARM64) +#if BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64) // https://crbug.com/1222682 #define MAYBE_AdoptPredecessor DISABLED_AdoptPredecessor #else @@ -626,7 +626,7 @@ // Tests that an OOPIF inside a portal receives input events after the portal is // activated. // Flaky on macOS: https://crbug.com/1042703 -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #define MAYBE_InputToOOPIFAfterActivation DISABLED_InputToOOPIFAfterActivation #else #define MAYBE_InputToOOPIFAfterActivation InputToOOPIFAfterActivation @@ -982,7 +982,7 @@ // TODO(crbug.com/985078): Fix on Mac. // TODO(crbug.com/1191782): Test is flaky. -#if !defined(OS_MAC) +#if !BUILDFLAG(IS_MAC) IN_PROC_BROWSER_TEST_F(PortalBrowserTest, DISABLED_TouchStateClearedBeforeActivation) { EXPECT_TRUE(NavigateToURL( @@ -1053,7 +1053,7 @@ #endif // TODO(crbug.com/985078): Fix on Mac. -#if !defined(OS_MAC) +#if !BUILDFLAG(IS_MAC) IN_PROC_BROWSER_TEST_F(PortalBrowserTest, GestureCleanedUpBeforeActivation) { EXPECT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL("portal.test", "/title1.html"))); @@ -2500,7 +2500,7 @@ // The following tests check code paths that won't be hit on Android as we // do not create DevTools windows on Android. -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(PortalBrowserTest, CallActivateOnTwoPortals) { EXPECT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL("portal.test", "/title1.html"))); @@ -2752,7 +2752,7 @@ // as be re-rastered for the embedder's zoom so it should appear crisp. // // Flaky on Android: https://crbug.com/1120213 -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_PageScaleRaster DISABLED_PageScaleRaster #else #define MAYBE_PageScaleRaster PageScaleRaster
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index d46e03bc..4ff64cf 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc
@@ -39,7 +39,7 @@ #include "services/network/public/cpp/network_connection_tracker.h" #include "ui/base/ui_base_switches.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "base/win/windows_version.h" #include "sandbox/policy/win/sandbox_win.h" #include "sandbox/win/src/process_mitigations.h" @@ -216,7 +216,7 @@ base::CommandLine::StringType plugin_launcher = browser_command_line.GetSwitchValueNative(switches::kPpapiPluginLauncher); -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) int flags = plugin_launcher.empty() ? ChildProcessHost::CHILD_ALLOW_SELF : ChildProcessHost::CHILD_NORMAL; #else @@ -235,9 +235,9 @@ switches::kPpapiPluginProcess); BrowserChildProcessHostImpl::CopyTraceStartupFlags(cmd_line.get()); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) cmd_line->AppendArg(switches::kPrefetchArgumentPpapi); -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) // These switches are forwarded to plugin pocesses. static const char* const kCommonForwardSwitches[] = { @@ -249,7 +249,7 @@ static const char* const kPluginForwardSwitches[] = { sandbox::policy::switches::kDisableSeccompFilterSandbox, sandbox::policy::switches::kNoSandbox, -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) sandbox::policy::switches::kEnableSandboxLogging, #endif switches::kPpapiStartupDialog, @@ -264,7 +264,7 @@ cmd_line->AppendSwitchASCII(switches::kLang, locale); } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) cmd_line->AppendSwitchASCII( switches::kDeviceScaleFactor, base::NumberToString(display::win::GetDPIScale()));
diff --git a/content/browser/ppapi_plugin_process_host_receiver_bindings.cc b/content/browser/ppapi_plugin_process_host_receiver_bindings.cc index 97917b5..36518f1f 100644 --- a/content/browser/ppapi_plugin_process_host_receiver_bindings.cc +++ b/content/browser/ppapi_plugin_process_host_receiver_bindings.cc
@@ -8,7 +8,7 @@ #include "build/build_config.h" -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #include "components/services/font/public/mojom/font_service.mojom.h" // nogncheck #include "content/browser/font_service.h" // nogncheck #endif @@ -17,7 +17,7 @@ void PpapiPluginProcessHost::BindHostReceiver( mojo::GenericPendingReceiver receiver) { -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) if (auto font_receiver = receiver.As<font_service::mojom::FontService>()) ConnectToFontService(std::move(font_receiver)); #endif
diff --git a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc index 833c207..a0d6f03 100644 --- a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc +++ b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc
@@ -4,10 +4,11 @@ #include "content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.h" +#include "build/build_config.h" #include "content/public/common/content_switches.h" #include "sandbox/policy/mojom/sandbox.mojom.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "base/win/windows_version.h" #include "sandbox/policy/win/sandbox_win.h" #include "sandbox/win/src/process_mitigations.h" @@ -21,13 +22,13 @@ PpapiPluginSandboxedProcessLauncherDelegate:: PpapiPluginSandboxedProcessLauncherDelegate( const ppapi::PpapiPermissions& permissions) -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) : permissions_(permissions) #endif { } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) bool PpapiPluginSandboxedProcessLauncherDelegate::PreSpawnTarget( sandbox::TargetPolicy* policy) { // The Pepper process is as locked-down as a renderer except that it can @@ -56,7 +57,7 @@ return true; } -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) #if BUILDFLAG(USE_ZYGOTE_HANDLE) ZygoteHandle PpapiPluginSandboxedProcessLauncherDelegate::GetZygote() { @@ -75,7 +76,7 @@ return sandbox::mojom::Sandbox::kPpapi; } -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) bool PpapiPluginSandboxedProcessLauncherDelegate::DisclaimResponsibility() { return true; } @@ -85,4 +86,4 @@ } #endif -} // namespace content \ No newline at end of file +} // namespace content
diff --git a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.h b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.h index d6f48ab..3b71e27 100644 --- a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.h +++ b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.h
@@ -30,9 +30,9 @@ ~PpapiPluginSandboxedProcessLauncherDelegate() override = default; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) bool PreSpawnTarget(sandbox::TargetPolicy* policy) override; -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) #if BUILDFLAG(USE_ZYGOTE_HANDLE) ZygoteHandle GetZygote() override; @@ -40,13 +40,13 @@ sandbox::mojom::Sandbox GetSandboxType() override; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) bool DisclaimResponsibility() override; bool EnableCpuSecurityMitigations() override; #endif private: -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) const ppapi::PpapiPermissions permissions_; #endif };
diff --git a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate_unittest.cc b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate_unittest.cc index 235bb6b..31834b8 100644 --- a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate_unittest.cc +++ b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate_unittest.cc
@@ -11,7 +11,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "base/win/windows_version.h" #include "sandbox/policy/win/sandbox_policy_feature_test.h" #include "sandbox/policy/win/sandbox_test_utils.h" @@ -32,7 +32,7 @@ namespace sandbox { namespace policy { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) class PpapiPluginFeatureSandboxWinTest : public ::sandbox::policy::SandboxFeatureTest { public:
diff --git a/content/browser/prerender/prerender_browsertest.cc b/content/browser/prerender/prerender_browsertest.cc index 95806f7..5d74c98 100644 --- a/content/browser/prerender/prerender_browsertest.cc +++ b/content/browser/prerender/prerender_browsertest.cc
@@ -4006,7 +4006,7 @@ // this test is checking the behavior of a new renderer process which is // created for a back forward navigation from a prerendered page. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const GURL kInitialUrl = GetUrl("/prerender/session_storage.html"); const GURL kPrerenderingUrl =
diff --git a/content/browser/profiling_utils.cc b/content/browser/profiling_utils.cc index b20792d4..9a7012a 100644 --- a/content/browser/profiling_utils.cc +++ b/content/browser/profiling_utils.cc
@@ -26,7 +26,7 @@ #include "content/public/common/content_switches.h" #include "content/public/common/profiling_utils.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "sandbox/policy/mojom/sandbox.mojom-shared.h" #endif @@ -121,7 +121,7 @@ // Ask all the other child processes to dump their profiling data for (content::BrowserChildProcessHostIterator browser_child_iter; !browser_child_iter.Done(); ++browser_child_iter) { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // On Windows, elevated processes are never passed the profiling data file // so cannot dump their data. if (browser_child_iter.GetData().sandbox_type ==
diff --git a/content/browser/renderer_host/document_service_unittest.cc b/content/browser/renderer_host/document_service_unittest.cc index d199ff1..38c8aac 100644 --- a/content/browser/renderer_host/document_service_unittest.cc +++ b/content/browser/renderer_host/document_service_unittest.cc
@@ -105,7 +105,7 @@ // When a page enters the BackForwardCache, the RenderFrameHost is not // deleted. web_contents()->GetController().GetBackForwardCache().DisableForTesting( - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); CreateEchoImpl(main_rfh_); SimulateNavigation(main_rfh_, GURL(kBarOrigin)); EXPECT_FALSE(is_echo_impl_alive_);
diff --git a/content/browser/renderer_host/document_user_data_browsertest.cc b/content/browser/renderer_host/document_user_data_browsertest.cc index 848fa72..16813f3 100644 --- a/content/browser/renderer_host/document_user_data_browsertest.cc +++ b/content/browser/renderer_host/document_user_data_browsertest.cc
@@ -268,7 +268,7 @@ // TODO(sreejakshetty): Investigate why the data is being deleted after crash // when BackForwardCache is enabled. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); ASSERT_TRUE(embedded_test_server()->Start()); GURL url_a(embedded_test_server()->GetURL("a.com", "/title1.html")); @@ -590,7 +590,7 @@ // "DocumentUserDataWithBackForwardCacheTest. // BackForwardCacheNavigation" test. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // 2) Leave both rfh_a and rfh_b in pending deletion state. LeaveInPendingDeletionState(rfh_a); @@ -719,7 +719,7 @@ // error page, disable back-forward cache to ensure that RenderFrameHost gets // deleted. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // 3) Browser-initiated navigation to an error page. NavigationHandleObserver observer(shell()->web_contents(), error_url); @@ -751,7 +751,7 @@ EXPECT_TRUE(data); DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // 3) Navigate to B. EXPECT_TRUE(NavigateToURL(shell(), url_b)); @@ -769,7 +769,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back-forward cache to ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // 1) Navigate to A1. EXPECT_TRUE(NavigateToURL(shell(), url_a1));
diff --git a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc index f055daf..c9562a9 100644 --- a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc +++ b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc
@@ -6772,7 +6772,7 @@ // recreated on history navigation, disable back/forward cache to force a // reload and a URL fetch. DisableBackForwardCacheForTesting(contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // 4. Go back, recreating the iframe. The subframe entry won't be found, and // we should fall back to the default URL. @@ -6869,7 +6869,7 @@ // recreated on history navigation, disable back/forward cache to force a // reload and a URL fetch. DisableBackForwardCacheForTesting(contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // 3. Go back, recreating the iframe. The subframe will have a new name this // time, so we won't find a history item for it. We should let the new data @@ -6978,7 +6978,7 @@ // later recreated on history navigations. Disable back/forward cache to // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // 1. Start on a page that injects a nested iframe into an injected // about:blank iframe. @@ -7081,7 +7081,7 @@ // later recreated on history navigations. Disable back/forward cache to // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // 1. Start on a page that injects a nested iframe srcdoc which contains a // nested iframe. GURL main_url(embedded_test_server()->GetURL( @@ -7309,7 +7309,7 @@ // later recreated on history navigations. Disable back/forward cache to // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // 1. Start on a page with two frames. GURL initial_url( @@ -7489,7 +7489,7 @@ // later recreated on history navigations. Disable back/forward cache to // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // 1. Start on a page with an iframe. GURL initial_url(embedded_test_server()->GetURL( @@ -8168,7 +8168,7 @@ // later recreated on history navigations. Disable back/forward cache to // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) ->GetPrimaryFrameTree() @@ -11656,7 +11656,7 @@ // start another forward navigation while another forward navigation has // already started. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // Navigate to a page with an iframe. GURL url_a(embedded_test_server()->GetURL( "/navigation_controller/page_with_data_iframe.html")); @@ -13820,7 +13820,7 @@ // later recreated on history navigations. Disable back/forward cache to // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); NavigationControllerImpl& controller = static_cast<NavigationControllerImpl&>( shell()->web_contents()->GetController()); @@ -13934,7 +13934,7 @@ // (which would fail with a 404 error). Disable back/forward cache to ensure // that it doesn't happen. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); NavigationControllerImpl& controller = static_cast<NavigationControllerImpl&>( shell()->web_contents()->GetController()); @@ -14416,7 +14416,7 @@ // is still in use by the bfcached document, disable back/forward cache to // ensure that the process gets deleted. DisableBackForwardCacheForTesting(contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); RenderProcessHostWatcher prev_host_watcher( prev_host, RenderProcessHostWatcher::WATCH_FOR_HOST_DESTRUCTION); @@ -15301,7 +15301,7 @@ // instead of redirecting, disable back/forward cache to ensure that redirect // happens on history navigation. DisableBackForwardCacheForTesting(contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // Back, which should redirect to |url3|. FrameNavigateParamsCapturer capturer(root); @@ -15755,7 +15755,7 @@ // on navigation as it is stored in bfcache, disable back/forward cache to // ensure that the RFH will enter pending deletion state. DisableBackForwardCacheForTesting(contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // Navigate the main frame cross-process and wait for the unload event to // fire. @@ -18993,7 +18993,7 @@ // navigation and later recreated on the back navigation. Disable back/forward // cache to ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // Navigate main frame to another url. EXPECT_TRUE(NavigateToURL( @@ -19255,7 +19255,7 @@ // This test specifically observes behavior of creating a new frame during a // history navigation, so disable the back forward cache. DisableBackForwardCacheForTesting(contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); NavigationControllerImpl& controller = static_cast<NavigationControllerImpl&>( shell()->web_contents()->GetController()); @@ -19290,7 +19290,7 @@ // This test specifically observes behavior of creating a new frame during a // history navigation, so disable the back forward cache. DisableBackForwardCacheForTesting(contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); NavigationControllerImpl& controller = static_cast<NavigationControllerImpl&>( shell()->web_contents()->GetController());
diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc index c3d8249..fb914dc 100644 --- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc +++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
@@ -989,7 +989,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(RenderViewHostTestHarness::web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // First make some history. const GURL kExistingURL1("http://foo/eh"); @@ -1548,7 +1548,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(RenderViewHostTestHarness::web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const GURL url1("http://foo/1"); const GURL url2("http://foo/2"); @@ -4020,7 +4020,7 @@ // navigation to page C not prune the entry to B. Disable back/forward cache // to ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(RenderViewHostTestHarness::web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // Start on page A. const GURL url_a("http://foo.com/a");
diff --git a/content/browser/renderer_host/page_impl_browsertest.cc b/content/browser/renderer_host/page_impl_browsertest.cc index 61eb788..a488d84 100644 --- a/content/browser/renderer_host/page_impl_browsertest.cc +++ b/content/browser/renderer_host/page_impl_browsertest.cc
@@ -183,7 +183,7 @@ // Test needs rfh_a to be deleted after navigating but it doesn't happen with // BackForwardCache as it is stored in cache. DisableBackForwardCacheForTesting(web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // 3) Navigate to B, deleting rfh_a. EXPECT_TRUE(NavigateToURL(shell(), url_b));
diff --git a/content/browser/renderer_host/policy_container_navigation_bundle_browsertest.cc b/content/browser/renderer_host/policy_container_navigation_bundle_browsertest.cc index 0cf1f88..47f6f31d 100644 --- a/content/browser/renderer_host/policy_container_navigation_bundle_browsertest.cc +++ b/content/browser/renderer_host/policy_container_navigation_bundle_browsertest.cc
@@ -356,7 +356,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, NoHistoryPoliciesInheritedForNetworkUrlsOnBack) { DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // Start by navigating to a network URL with one policy. WebContents* tab = shell()->web_contents();
diff --git a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc index a53a6aa..7406965 100644 --- a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc +++ b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc
@@ -5989,7 +5989,7 @@ MainFrameSameSiteNavigationDestructorLifetime) { // The test assumes that the main frame RFH will be reused when navigating. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL("a.com", "/title1.html"))); @@ -6030,7 +6030,7 @@ // The test assumes that the main frame RFH will be replaced during // navigation. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // All sites must be isolated in order for the navigatino code to replace the // navigated RFH. IsolateAllSitesForTesting(base::CommandLine::ForCurrentProcess());
diff --git a/content/browser/renderer_host/render_frame_host_manager_browsertest.cc b/content/browser/renderer_host/render_frame_host_manager_browsertest.cc index 7f09580..2e2ff6f 100644 --- a/content/browser/renderer_host/render_frame_host_manager_browsertest.cc +++ b/content/browser/renderer_host/render_frame_host_manager_browsertest.cc
@@ -2748,7 +2748,7 @@ // With BackForwardCache, old process won't get deleted on navigation as it is // still in use by the bfcached document, disable back-forward cache to ensure // that the process gets deleted. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL(shell(), GetCrossSiteURL("/title1.html"))); exit_observer.Wait(); @@ -2810,7 +2810,7 @@ // With BackForwardCache, old process won't get deleted on navigation as it is // still in use by the bfcached document, disable back-forward cache to ensure // that the process gets deleted. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL(shell(), GetCrossSiteURL("/title1.html"))); exit_observer.Wait(); @@ -2979,7 +2979,7 @@ // With BackForwardCache, old process won't get deleted on navigation as it is // still in use by the bfcached document, disable back-forward cache to ensure // that the process gets deleted. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL(shell(), GetCrossSiteURL("/title1.html"))); exit_observer.Wait(); @@ -3110,7 +3110,7 @@ // The old RenderFrameHost might have entered the BackForwardCache. Disable // back-forward cache to ensure that the RenderFrameHost gets deleted. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL(shell(), cross_site_url)); rfh_observer.Wait(); @@ -3508,7 +3508,7 @@ // With BackForwardCache, swapped out RenderFrameHost won't have a // replacement proxy as the document is stored in cache. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); // Navigate the tab to a different site, and only wait for commit, not load // stop. @@ -3885,7 +3885,7 @@ // Disable the back-forward cache so that documents are always deleted when // navigating. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); GURL url_a(embedded_test_server()->GetURL("a.com", "/title1.html")); EXPECT_TRUE(NavigateToURL(shell(), url_a)); @@ -5376,7 +5376,7 @@ // Ensure that previous document won't be restored from the BackForwardCache, // to force a network fetch, which would result in a network error. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); // Create an interceptor to cause navigations to url1 to fail and go back // in session history. @@ -6356,7 +6356,7 @@ // navigate away from the page using it, which won't happen if the page is // kept alive in the back-forward cache. So, we should disable back-forward // cache for this test. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); ASSERT_TRUE(embedded_test_server()->Start()); GURL url_1(embedded_test_server()->GetURL("/title1.html")); @@ -6442,7 +6442,7 @@ // navigate away from the page using it, which won't happen if the page is // kept alive in the back-forward cache. So, we should disable back-forward // cache for this test. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); ASSERT_TRUE(embedded_test_server()->Start()); GURL url_1(embedded_test_server()->GetURL("/title1.html")); @@ -6529,7 +6529,7 @@ // navigate away from the page using it, which won't happen if the page is // kept alive in the back-forward cache. So, we should disable back-forward // cache for this test. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); ASSERT_TRUE(embedded_test_server()->Start()); GURL url_1(embedded_test_server()->GetURL("/title1.html")); @@ -6604,7 +6604,7 @@ // navigate away from the page using it, which won't happen if the page is // kept alive in the back-forward cache. So, we should disable back-forward // cache for this test. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); ASSERT_TRUE(embedded_test_server()->Start()); GURL url_1(embedded_test_server()->GetURL("/title1.html")); @@ -6733,7 +6733,7 @@ // navigate away from the page using it, which won't happen if the page is // kept alive in the back-forward cache. So, we should disable back-forward // cache for this test. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); GURL url_1(https_server()->GetURL("a.com", "/title1.html")); GURL url_2(https_server()->GetURL("a.com", "/title2.html")); @@ -8480,7 +8480,7 @@ // With BackForwardCache, old process won't be deleted on navigation as it is // still in use by the bfcached document, disable back-forward cache to ensure // that the process gets deleted. - DisableBackForwardCache(BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + DisableBackForwardCache(BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL(shell(), url3)); exit_observer.Wait();
diff --git a/content/browser/renderer_host/render_frame_host_manager_unittest.cc b/content/browser/renderer_host/render_frame_host_manager_unittest.cc index 007c8ce..2b3faa5 100644 --- a/content/browser/renderer_host/render_frame_host_manager_unittest.cc +++ b/content/browser/renderer_host/render_frame_host_manager_unittest.cc
@@ -1135,7 +1135,7 @@ // deleted. Similarly, no // mojo::AgentSchedulingGroupHost::DidUnloadRenderFrame message is sent. contents()->GetController().GetBackForwardCache().DisableForTesting( - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const GURL kUrl1("http://www.google.com/"); const GURL kUrl2 = isolated_cross_site_url(); @@ -1630,7 +1630,7 @@ // deleted. Similarly, no // mojo::AgentSchedulingGroupHost::DidUnloadRenderFrame message is sent. contents()->GetController().GetBackForwardCache().DisableForTesting( - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const GURL kUrl1("http://www.google.com/"); const GURL kUrl2("http://www.chromium.org/"); @@ -1681,7 +1681,7 @@ // deleted. Similarly, no // mojo::AgentSchedulingGroupHost::DidUnloadRenderFrame message is sent. contents()->GetController().GetBackForwardCache().DisableForTesting( - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const GURL kUrl1("http://www.google.com/"); const GURL kUrl2("http://www.chromium.org/"); @@ -1729,7 +1729,7 @@ // deleted. Similarly, no // mojo::AgentSchedulingGroupHost::DidUnloadRenderFrame message is sent. contents()->GetController().GetBackForwardCache().DisableForTesting( - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const GURL kUrl1("http://www.google.com/"); const GURL kUrl2("http://www.chromium.org/"); @@ -3388,7 +3388,7 @@ // deleted and is in BackForwardCache instead of being in pending deletion. // Disabling to consider this scenario. contents()->GetController().GetBackForwardCache().DisableForTesting( - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const GURL kUrl1("http://www.google.com"); const GURL kUrl2("http://www.chromium.org");
diff --git a/content/browser/renderer_host/render_process_host_browsertest.cc b/content/browser/renderer_host/render_process_host_browsertest.cc index ac4a850c..eddc413f 100644 --- a/content/browser/renderer_host/render_process_host_browsertest.cc +++ b/content/browser/renderer_host/render_process_host_browsertest.cc
@@ -1067,7 +1067,7 @@ // Disable the BackForwardCache to ensure the old process is going to be // released. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); host_destructions_ = 0; process_exits_ = 0; @@ -1133,7 +1133,7 @@ // BFCache for this test. content::DisableBackForwardCacheForTesting( shell()->web_contents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); embedded_test_server()->RegisterRequestHandler( base::BindRepeating(HandleHungBeacon, base::RepeatingClosure())); @@ -1156,7 +1156,7 @@ // Disable the BackForwardCache to ensure the old process is going to be // released. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); host_destructions_ = 0; process_exits_ = 0; Observe(rph); @@ -1189,7 +1189,7 @@ // BFCache for this test. content::DisableBackForwardCacheForTesting( shell()->web_contents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); embedded_test_server()->RegisterRequestHandler( base::BindRepeating(HandleHungBeacon, base::RepeatingClosure())); @@ -1213,7 +1213,7 @@ // Disable the BackForwardCache to ensure the old process is going to be // released. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); host_destructions_ = 0; process_exits_ = 0; @@ -1558,7 +1558,7 @@ // BFCache for this test. content::DisableBackForwardCacheForTesting( shell()->web_contents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); // Ensure the initial tab has not loaded yet. FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
diff --git a/content/browser/renderer_host/render_process_host_unittest.cc b/content/browser/renderer_host/render_process_host_unittest.cc index 957c267..54acf20 100644 --- a/content/browser/renderer_host/render_process_host_unittest.cc +++ b/content/browser/renderer_host/render_process_host_unittest.cc
@@ -124,7 +124,7 @@ // cached and reused after the navigation to |kUrl2| with BFCache enabled. The // test expects that a new process (either spare or created) is used instead. contents()->GetController().GetBackForwardCache().DisableForTesting( - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // At first, trying to get a RenderProcessHost with the // REUSE_PENDING_OR_COMMITTED_SITE policy should return a new process. @@ -436,7 +436,7 @@ // This cannot happen if the page is restored from the back-forward // cache, because no network requests would be made. contents()->GetController().GetBackForwardCache().DisableForTesting( - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const GURL kUrl1("http://foo.com"); const GURL kUrl2("http://bar.com");
diff --git a/content/browser/renderer_host/render_widget_host_input_event_router_unittest.cc b/content/browser/renderer_host/render_widget_host_input_event_router_unittest.cc index b77d0940..44247f71 100644 --- a/content/browser/renderer_host/render_widget_host_input_event_router_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_input_event_router_unittest.cc
@@ -1497,7 +1497,12 @@ // This test confirms that points can be forwarded when using delegated ink in // a child frame, such as an OOPIF. -TEST_P(DelegatedInkPointTest, ForwardPointsToChildFrame) { +#if defined(OS_LINUX) +#define MAYBE_ForwardPointsToChildFrame DISABLED_ForwardPointsToChildFrame +#else +#define MAYBE_ForwardPointsToChildFrame ForwardPointsToChildFrame +#endif +TEST_P(DelegatedInkPointTest, MAYBE_ForwardPointsToChildFrame) { // Make the child frame, set the delegated ink flag on it, give it a // compositor, and set it as the hit test result so that the input router // sends points to it.
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_child_frame_browsertest.cc index 2769d1b..bfcb10a 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_view_child_frame_browsertest.cc
@@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/callback_helpers.h" +#include "base/logging.h" #include "base/run_loop.h" #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" @@ -379,14 +380,8 @@ } // Validate that OOPIFs receive presentation feedbacks. -// TODO(crbug.com/1270981): Flaky. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) -#define MAYBE_PresentationFeedback DISABLED_PresentationFeedback -#else -#define MAYBE_PresentationFeedback PresentationFeedback -#endif IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewChildFrameBrowserTest, - MAYBE_PresentationFeedback) { + PresentationFeedback) { base::HistogramTester histogram_tester; GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); EXPECT_TRUE(NavigateToURL(shell(), main_url)); @@ -399,21 +394,26 @@ embedded_test_server()->GetURL("foo.com", "/title2.html")); EXPECT_TRUE(NavigateToURLFromRenderer(root->child_at(0), cross_site_url)); - auto* child_rwh_impl = - root->child_at(0)->current_frame_host()->GetRenderWidgetHost(); - // Hide the frame and make it visible again, to force it to record the - // tab-switch time, which is generated from presentation-feedback. - child_rwh_impl->WasHidden(); - child_rwh_impl->WasShown(blink::mojom::RecordContentToVisibleTimeRequest::New( - base::TimeTicks::Now(), - /* destination_is_loaded */ true, - /* show_reason_tab_switching */ true, - /* show_reason_unoccluded */ false, - /* show_reason_bfcache_restore */ false)); - // Force the child to submit a new frame. - ASSERT_TRUE(ExecJs(root->child_at(0)->current_frame_host(), - "document.write('Force a new frame.');")); + const auto trigger_subframe_tab_switch = [&root]() -> bool { + auto* child_rwh_impl = + root->child_at(0)->current_frame_host()->GetRenderWidgetHost(); + // Hide the frame and make it visible again, to force it to record the + // tab-switch time, which is generated from presentation-feedback. + child_rwh_impl->WasHidden(); + child_rwh_impl->WasShown( + blink::mojom::RecordContentToVisibleTimeRequest::New( + base::TimeTicks::Now(), + /* destination_is_loaded */ true, + /* show_reason_tab_switching */ true, + /* show_reason_unoccluded */ false, + /* show_reason_bfcache_restore */ false)); + // Force the child to submit a new frame. + return ExecJs(root->child_at(0)->current_frame_host(), + "document.write('Force a new frame.');"); + }; + ASSERT_TRUE(trigger_subframe_tab_switch()); + bool got_incomplete_tab_switch = false; const base::TimeTicks start_time = base::TimeTicks::Now(); do { if (base::TimeTicks::Now() - start_time > TestTimeouts::action_timeout()) { @@ -426,6 +426,40 @@ FetchHistogramsFromChildProcesses(); GiveItSomeTime(); + // Work around a race condition while loading the cross-site iframe. + // + // The NavigateToURLFromRenderer call above replaces the + // LocalFrame/LocalFrameView in renderer process A with a + // RemoteFrame/RemoteFrameView proxy for the frame which is now hosted in + // renderer process B. During initialization the RemoteFrameView sends a + // series of VisibilityChanged messages to the browser process, which cause + // CrossProcessFrameConnector to call WasHidden and then WasShown on + // `child_rwh_impl`. Depending on the timing these might arrive during the + // NavigateToURLFromRenderer call or the ExecJS call above, both of which + // pump the message loop. If CrossProcessFrameConnector calls WasHidden + // after the WasShown call above, it will cancel the simulated tab switch. + // This causes ContentToVisibleTimeReporter to log + // TotalIncompleteSwitchDuration, which is not based on + // PresentationFeedback, instead of TotalSwitchDuration. See + // crbug.com/1288560 for more details. + // + // The race condition can only cause a single incomplete tab switch, so + // only check for this once. If the second simulated tab switch is also + // cancelled something else is wrong, so the loop will time out and fail + // the test. + // + // TODO(crbug.com/1288560): Remove this once the race condition is + // fixed. + if (!got_incomplete_tab_switch && + histogram_tester + .GetTotalCountsForPrefix( + "Browser.Tabs.TotalIncompleteSwitchDuration") + .size() == 1) { + LOG(ERROR) << "Incomplete tab switch - try again."; + got_incomplete_tab_switch = true; + ASSERT_TRUE(trigger_subframe_tab_switch()); + } + // Once the tab switch completes the PresentationFeedback should cause a // single TotalSwitchDuration histogram to be logged. } while (histogram_tester
diff --git a/content/browser/screen_enumeration/screen_enumeration_browsertest.cc b/content/browser/screen_enumeration/screen_enumeration_browsertest.cc index ced80d3..6267f67 100644 --- a/content/browser/screen_enumeration/screen_enumeration_browsertest.cc +++ b/content/browser/screen_enumeration/screen_enumeration_browsertest.cc
@@ -161,7 +161,7 @@ // TODO(crbug.com/1042990): Windows crashes static casting to ScreenWin. // TODO(crbug.com/1042990): Android requires a GetDisplayNearestView overload. -#if defined(OS_ANDROID) || defined(OS_WIN) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) #define MAYBE_GetScreensFaked DISABLED_GetScreensFaked #else // TODO(crbug.com/1119974): Need content_browsertests permission controls. @@ -182,7 +182,7 @@ // TODO(crbug.com/1042990): Windows crashes static casting to ScreenWin. // TODO(crbug.com/1042990): Android requires a GetDisplayNearestView overload. -#if defined(OS_ANDROID) || defined(OS_WIN) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) #define MAYBE_IsExtendedFaked DISABLED_IsExtendedFaked #else #define MAYBE_IsExtendedFaked IsExtendedFaked @@ -201,7 +201,7 @@ // TODO(crbug.com/1042990): Windows crashes static casting to ScreenWin. // TODO(crbug.com/1042990): Android requires a GetDisplayNearestView overload. -#if defined(OS_ANDROID) || defined(OS_WIN) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) #define MAYBE_ScreenOnchangeNoPermission DISABLED_ScreenOnchangeNoPermission #else #define MAYBE_ScreenOnchangeNoPermission ScreenOnchangeNoPermission @@ -252,7 +252,7 @@ // TODO(crbug.com/1042990): Windows crashes static casting to ScreenWin. // TODO(crbug.com/1042990): Android requires a GetDisplayNearestView overload. -#if defined(OS_ANDROID) || defined(OS_WIN) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) #define MAYBE_ScreenOnChangeForIsExtended DISABLED_ScreenOnChangeForIsExtended #else #define MAYBE_ScreenOnChangeForIsExtended ScreenOnChangeForIsExtended @@ -301,7 +301,7 @@ // TODO(crbug.com/1042990): Windows crashes static casting to ScreenWin. // TODO(crbug.com/1042990): Android requires a GetDisplayNearestView overload. -#if defined(OS_ANDROID) || defined(OS_WIN) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) #define MAYBE_ScreenOnChangeForAttributes DISABLED_ScreenOnChangeForAttributes #else #define MAYBE_ScreenOnChangeForAttributes ScreenOnChangeForAttributes
diff --git a/content/browser/screen_orientation/screen_orientation_browsertest.cc b/content/browser/screen_orientation/screen_orientation_browsertest.cc index c581545..5daf5e7 100644 --- a/content/browser/screen_orientation/screen_orientation_browsertest.cc +++ b/content/browser/screen_orientation/screen_orientation_browsertest.cc
@@ -137,9 +137,9 @@ }; // This test doesn't work on MacOS X but the reason is mostly because it is not -// used Aura. It could be set as !defined(OS_MAC) but the rule below will +// used Aura. It could be set as !BUILDFLAG(IS_MAC) but the rule below will // actually support MacOS X if and when it switches to Aura. -#if defined(USE_AURA) || defined(OS_ANDROID) +#if defined(USE_AURA) || BUILDFLAG(IS_ANDROID) // Flaky on Chrome OS: http://crbug.com/468259 #if BUILDFLAG(IS_CHROMEOS_ASH) #define MAYBE_ScreenOrientationChange DISABLED_ScreenOrientationChange @@ -174,7 +174,7 @@ EXPECT_EQ(types[i], GetOrientationType()); } } -#endif // defined(USE_AURA) || defined(OS_ANDROID) +#endif // defined(USE_AURA) || BUILDFLAG(IS_ANDROID) // Flaky on Chrome OS: http://crbug.com/468259 #if BUILDFLAG(IS_CHROMEOS_ASH) @@ -191,9 +191,9 @@ TestNavigationObserver navigation_observer(shell()->web_contents(), 1); shell()->LoadURL(test_url); navigation_observer.Wait(); -#if USE_AURA || defined(OS_ANDROID) +#if USE_AURA || BUILDFLAG(IS_ANDROID) WaitForResizeComplete(shell()->web_contents()); -#endif // USE_AURA || defined(OS_ANDROID) +#endif // USE_AURA || BUILDFLAG(IS_ANDROID) } if (!WindowOrientationSupported()) @@ -222,13 +222,13 @@ shell()->LoadURL(test_url); navigation_observer.Wait(); -#if USE_AURA || defined(OS_ANDROID) +#if USE_AURA || BUILDFLAG(IS_ANDROID) WaitForResizeComplete(shell()->web_contents()); -#endif // USE_AURA || defined(OS_ANDROID) +#endif // USE_AURA || BUILDFLAG(IS_ANDROID) std::string expected = -#if defined(OS_ANDROID) - "SecurityError"; // WebContents need to be fullscreen. +#if BUILDFLAG(IS_ANDROID) + "SecurityError"; // WebContents need to be fullscreen. #else "NotSupportedError"; // Locking isn't supported. #endif @@ -253,7 +253,7 @@ // here. } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) class ScreenOrientationLockDisabledBrowserTest : public ContentBrowserTest { public: ScreenOrientationLockDisabledBrowserTest() {} @@ -284,15 +284,15 @@ shell()->web_contents()->GetLastCommittedURL().ref()); } } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(ScreenOrientationOOPIFBrowserTest, ScreenOrientation) { GURL main_url(embedded_test_server()->GetURL( "a.com", "/cross_site_iframe_factory.html?a(b)")); EXPECT_TRUE(NavigateToURL(shell(), main_url)); -#if USE_AURA || defined(OS_ANDROID) +#if USE_AURA || BUILDFLAG(IS_ANDROID) WaitForResizeComplete(shell()->web_contents()); -#endif // USE_AURA || defined(OS_ANDROID) +#endif // USE_AURA || BUILDFLAG(IS_ANDROID) std::string types[] = {"portrait-primary", "portrait-secondary", "landscape-primary", "landscape-secondary"}; @@ -341,9 +341,9 @@ MAYBE_ScreenOrientationInPendingMainFrame) { GURL main_url(embedded_test_server()->GetURL("a.com", "/title1.html")); EXPECT_TRUE(NavigateToURL(shell(), main_url)); -#if USE_AURA || defined(OS_ANDROID) +#if USE_AURA || BUILDFLAG(IS_ANDROID) WaitForResizeComplete(shell()->web_contents()); -#endif // USE_AURA || defined(OS_ANDROID) +#endif // USE_AURA || BUILDFLAG(IS_ANDROID) // Set up a fake Resize message with a screen orientation change. RenderWidgetHost* main_frame_rwh = @@ -370,9 +370,9 @@ delayer.WaitForNavigationFinished(); EXPECT_EQ(second_url, web_contents()->GetMainFrame()->GetLastCommittedURL()); -#if USE_AURA || defined(OS_ANDROID) +#if USE_AURA || BUILDFLAG(IS_ANDROID) WaitForResizeComplete(shell()->web_contents()); -#endif // USE_AURA || defined(OS_ANDROID) +#endif // USE_AURA || BUILDFLAG(IS_ANDROID) EXPECT_EQ(expected_angle, EvalJs(root->current_frame_host(), "screen.orientation.angle")); @@ -415,7 +415,7 @@ ExecJs(child->current_frame_host(), "screen.orientation.unlock()")); } } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) class ScreenOrientationLockForPrerenderBrowserTest : public ScreenOrientationBrowserTest {
diff --git a/content/browser/screenlock_monitor/screenlock_monitor_device_source.cc b/content/browser/screenlock_monitor/screenlock_monitor_device_source.cc index 01dc8893..7c448ca 100644 --- a/content/browser/screenlock_monitor/screenlock_monitor_device_source.cc +++ b/content/browser/screenlock_monitor/screenlock_monitor_device_source.cc
@@ -4,18 +4,20 @@ #include "content/browser/screenlock_monitor/screenlock_monitor_device_source.h" +#include "build/build_config.h" + namespace content { ScreenlockMonitorDeviceSource::ScreenlockMonitorDeviceSource() { -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) StartListeningForScreenlock(); -#endif // OS_MAC +#endif // BUILDFLAG(IS_MAC) } ScreenlockMonitorDeviceSource::~ScreenlockMonitorDeviceSource() { -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) StopListeningForScreenlock(); -#endif // OS_MAC +#endif // BUILDFLAG(IS_MAC) } } // namespace content
diff --git a/content/browser/screenlock_monitor/screenlock_monitor_device_source.h b/content/browser/screenlock_monitor/screenlock_monitor_device_source.h index 4ce578b..caf2a59 100644 --- a/content/browser/screenlock_monitor/screenlock_monitor_device_source.h +++ b/content/browser/screenlock_monitor/screenlock_monitor_device_source.h
@@ -12,22 +12,22 @@ #include "content/browser/screenlock_monitor/screenlock_monitor_source.h" #include "content/common/content_export.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <windows.h> #include <wtsapi32.h> -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_CHROMEOS_ASH) #include "components/session_manager/core/session_manager_observer.h" #endif // BUILDFLAG(IS_CHROMEOS_ASH) -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) namespace base { namespace win { class MessageWindow; } } // namespace base -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) namespace content { @@ -44,7 +44,7 @@ ~ScreenlockMonitorDeviceSource() override; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Fake session notification registration/unregistration APIs allow us to test // receiving and handling messages that look as if they are sent by other // sessions, without having to create a session host and a second session. @@ -54,10 +54,10 @@ static void SetFakeNotificationAPIsForTesting( WTSRegisterSessionNotificationFunction register_function, WTSUnRegisterSessionNotificationFunction unregister_function); -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) private: -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Represents a message-only window for screenlock message handling on Win. // Only allow ScreenlockMonitor to create it. class SessionMessageWindow { @@ -85,12 +85,12 @@ }; SessionMessageWindow session_message_window_; -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) void StartListeningForScreenlock(); void StopListeningForScreenlock(); -#endif // OS_MAC +#endif // BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_CHROMEOS_ASH) class ScreenLockListener : public session_manager::SessionManagerObserver {
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc index 331fbda..53713fc 100644 --- a/content/browser/security_exploit_browsertest.cc +++ b/content/browser/security_exploit_browsertest.cc
@@ -385,7 +385,7 @@ IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, AttemptRunFileChoosers) { TestFileChooserWithPath(base::FilePath(FILE_PATH_LITERAL("../../*.txt"))); TestFileChooserWithPath(base::FilePath(FILE_PATH_LITERAL("/etc/*.conf"))); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) TestFileChooserWithPath( base::FilePath(FILE_PATH_LITERAL("\\\\evilserver\\evilshare\\*.txt"))); TestFileChooserWithPath(base::FilePath(FILE_PATH_LITERAL("c:\\*.txt"))); @@ -1175,7 +1175,7 @@ // Test assumes the initial RenderFrameHost to be deleted. Disable // back-forward cache to ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // Navigate to foo.com initially. GURL foo_url(embedded_test_server()->GetURL("foo.com", "/title1.html")); @@ -1218,7 +1218,7 @@ // Test assumes the initial RenderFrameHost to be deleted. Disable // back-forward cache to ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // Navigate to foo.com initially. GURL foo_url(embedded_test_server()->GetURL("foo.com",
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc index bce10b22..fd161ae 100644 --- a/content/browser/service_worker/service_worker_browsertest.cc +++ b/content/browser/service_worker/service_worker_browsertest.cc
@@ -2728,7 +2728,7 @@ RunTestWithCrossOriginURL(kPageUrl, kScopeUrl); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Flaky on Android, http://crbug.com/1141870. #define MAYBE_RegisterNoCrash DISABLED_RegisterNoCrash #else @@ -3619,7 +3619,7 @@ }; // Fails on Android. https://crbug.com/1216619 -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_EvictionOfBackForwardCacheWithMultipleServiceWorkers \ DISABLED_EvictionOfBackForwardCacheWithMultipleServiceWorkers #else
diff --git a/content/browser/session_history_browsertest.cc b/content/browser/session_history_browsertest.cc index 0f297ee..aa66606ff 100644 --- a/content/browser/session_history_browsertest.cc +++ b/content/browser/session_history_browsertest.cc
@@ -406,7 +406,7 @@ // TODO(brettw) bug 50648: fix flakyness. This test seems like it was failing // about 1/4 of the time on Vista by failing to execute JavascriptGo (see bug). // TODO(crbug.com/1280512): Flaky on Linux and Lacros. -#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) #define MAYBE_JavascriptHistory DISABLED_JavascriptHistory #else #define MAYBE_JavascriptHistory JavascriptHistory
diff --git a/content/browser/shape_detection/shape_detection_browsertest.cc b/content/browser/shape_detection/shape_detection_browsertest.cc index 0fd8e25..462c060 100644 --- a/content/browser/shape_detection/shape_detection_browsertest.cc +++ b/content/browser/shape_detection/shape_detection_browsertest.cc
@@ -4,6 +4,7 @@ #include "base/command_line.h" #include "base/strings/string_tokenizer.h" +#include "build/build_config.h" #include "content/public/common/content_switches.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" @@ -27,7 +28,7 @@ {"FaceDetector", "/blank.jpg", std::vector<std::vector<float>>{}}, {"FaceDetector", "/single_face.jpg", -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) {{23, 20, 42, 42}} #else {{23, 26, 42, 42}} @@ -97,7 +98,7 @@ }; // TODO(https://crbug.com/659138): Enable the test on other platforms. -#if defined(OS_ANDROID) || defined(OS_MAC) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_MAC) #define MAYBE_DetectShapesInImage DetectShapesInImage #else #define MAYBE_DetectShapesInImage DISABLED_DetectShapesInImage
diff --git a/content/browser/shared_storage/shared_storage_browsertest.cc b/content/browser/shared_storage/shared_storage_browsertest.cc index 374dc0c..5384790e 100644 --- a/content/browser/shared_storage/shared_storage_browsertest.cc +++ b/content/browser/shared_storage/shared_storage_browsertest.cc
@@ -572,7 +572,7 @@ // disable back/forward cache. content::DisableBackForwardCacheForTesting( shell()->web_contents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL("a.com", kSimplePagePath))); @@ -595,7 +595,7 @@ // disable back/forward cache. content::DisableBackForwardCacheForTesting( shell()->web_contents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL( "a.com", kPageWithBlankIframePath))); @@ -645,7 +645,7 @@ // disable back/forward cache. content::DisableBackForwardCacheForTesting( shell()->web_contents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL("a.com", kSimplePagePath))); @@ -695,7 +695,7 @@ // disable back/forward cache. content::DisableBackForwardCacheForTesting( shell()->web_contents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL("a.com", kSimplePagePath))); @@ -742,7 +742,7 @@ // disable back/forward cache. content::DisableBackForwardCacheForTesting( shell()->web_contents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL("a.com", kSimplePagePath))); @@ -800,7 +800,7 @@ // disable back/forward cache. content::DisableBackForwardCacheForTesting( shell()->web_contents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL( "a.com", kPageWithBlankIframePath))); @@ -874,7 +874,7 @@ // enter keep-alive phase. To ensure this, disable back/forward cache. content::DisableBackForwardCacheForTesting( shell()->web_contents(), - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); EXPECT_TRUE(NavigateToURL( shell(), embedded_test_server()->GetURL("a.com", kSimplePagePath)));
diff --git a/content/browser/site_isolation_policy_unittest.cc b/content/browser/site_isolation_policy_unittest.cc index 3f1c7cc1..b782316 100644 --- a/content/browser/site_isolation_policy_unittest.cc +++ b/content/browser/site_isolation_policy_unittest.cc
@@ -38,7 +38,7 @@ EXPECT_TRUE(SiteIsolationPolicy::IsErrorPageIsolationEnabled(true)); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Since https://crbug.com/910273, the kDisableSiteIsolationForPolicy switch is // only available/used on Android. TEST(SiteIsolationPolicyTest, DisableSiteIsolationForPolicySwitch) {
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index c594526a..9df4e4c 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -168,7 +168,7 @@ #include "ui/aura/window.h" #endif -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/jni_android.h" #include "base/android/jni_string.h" #include "base/android/scoped_java_ref.h" @@ -502,7 +502,7 @@ // SitePerProcessBrowserTestBase::SitePerProcessBrowserTestBase() { -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // TODO(bokan): Needed for scrollability check in // FrameOwnerPropertiesPropagationScrolling. crbug.com/662196. feature_list_.InitAndDisableFeature(features::kOverlayScrollbar); @@ -968,7 +968,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back-forward cache to ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting( - web_contents(), content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + web_contents(), content::BackForwardCache::TEST_REQUIRES_NO_CACHING); GURL main_url(embedded_test_server()->GetURL( "a.com", "/cross_site_iframe_factory.html?a(a,a(a,a(a)))")); EXPECT_TRUE(NavigateToURL(shell(), main_url)); @@ -3740,7 +3740,7 @@ // the first page receives the // mojo::AgentSchedulingGroupHost::DidUnloadRenderFrame. Ensure that this // doesn't crash and that the RVH(A1) is not reused in that case. -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #define MAYBE_RenderViewHostIsNotReusedAfterDelayedUnloadACK \ DISABLED_RenderViewHostIsNotReusedAfterDelayedUnloadACK #else @@ -4160,7 +4160,7 @@ } // crbug.com/1281755 -#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) #define MAYBE_NavigateProxyAndDetachBeforeProvisionalFrameCreation \ DISABLED_NavigateProxyAndDetachBeforeProvisionalFrameCreation #else @@ -4405,7 +4405,7 @@ // Disable the BackForwardCache to ensure the old process is going to be // released. DisableBackForwardCacheForTesting(web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // The test must wait for the process to exit, but if there is no leak, the // RenderFrame will be properly created and there will be no crash. @@ -5960,9 +5960,9 @@ // where popup menus don't create a popup RenderWidget, but rather they trigger // a FrameHostMsg_ShowPopup to ask the browser to build and display the actual // popup using native controls. -#if !defined(OS_MAC) && !defined(OS_ANDROID) +#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID) // Disable the test due to flaky: https://crbug.com/1126165 -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #define MAYBE_TwoSubframesCreatePopupMenuWidgetsSimultaneously \ DISABLED_TwoSubframesCreatePopupMenuWidgetsSimultaneously #else @@ -7337,7 +7337,7 @@ EvalJs(shell(), "createFrames()", EXECUTE_SCRIPT_USE_MANUAL_REPLY)); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) class TextSelectionObserver : public TextInputManager::Observer { public: explicit TextSelectionObserver(TextInputManager* text_input_manager) @@ -7460,7 +7460,7 @@ selection_observer.WaitForSelectedText(text); } } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) // Test that an OOPIF at b.com can navigate to a cross-site a.com URL that // transfers back to b.com. See https://crbug.com/681077#c10 and @@ -7695,7 +7695,7 @@ } // The test is flaky on Linux, Chrome OS, etc; cf https://crbug.com/1170583. -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #define MAYBE_CrossProcessInertSubframe DISABLED_CrossProcessInertSubframe #else #define MAYBE_CrossProcessInertSubframe CrossProcessInertSubframe @@ -8754,7 +8754,7 @@ } } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) namespace { @@ -9240,7 +9240,7 @@ // This test verifies that the handles associated with an active touch selection // are still correctly positioned after a pinch-zoom operation. -#if defined(OS_ANDROID) // Flaky on Android. See https://crbug.com/906204. +#if BUILDFLAG(IS_ANDROID) // Flaky on Android. See https://crbug.com/906204. #define MAYBE_SelectionThenPinchInOOPIF DISABLED_SelectionThenPinchInOOPIF #else #define MAYBE_SelectionThenPinchInOOPIF SelectionThenPinchInOOPIF @@ -9310,7 +9310,7 @@ // Cleanup before shutting down. ShutdownTest(); } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) class TouchEventObserver : public RenderWidgetHost::InputEventObserver { public: @@ -10090,7 +10090,7 @@ // its layout/animate phase. See https://crbug.com/802932. // // TODO(809580): Disabled on Android, Mac, and ChromeOS due to flakiness. -#if defined(OS_ANDROID) || defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH) #define MAYBE_OOPIFDetachDuringAnimation DISABLED_OOPIFDetachDuringAnimation #else #define MAYBE_OOPIFDetachDuringAnimation OOPIFDetachDuringAnimation @@ -10329,7 +10329,7 @@ } // Disabled due to flakiness. crbug.com/1146083 -#if defined(OS_WIN) || defined(OS_MAC) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) #define MAYBE_VisibilityFrameDepthTest DISABLED_VisibilityFrameDepthTest #else #define MAYBE_VisibilityFrameDepthTest VisibilityFrameDepthTest @@ -10482,7 +10482,7 @@ EXPECT_EQ(start_url, rfh->GetLastCommittedURL()); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // This test ensures that gestures from child frames notify the gesture manager // which exists only on the root frame. i.e. the gesture manager knows we're in @@ -10582,7 +10582,7 @@ rwhv_root->gesture_listener_manager_->IsScrollInProgressForTesting()); } } -#endif // if defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_P(SitePerProcessBrowserTest, DisplayLockThrottlesOOPIF) { GURL url_a(embedded_test_server()->GetURL( @@ -10805,7 +10805,7 @@ } }; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Class to set |force_enable_zoom| to true in WebkitPrefs. class EnableForceZoomContentClient : public TestContentBrowserClient { public: @@ -10900,7 +10900,7 @@ SetBrowserClientForTesting(old_client); } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) // Flaky on every platform, failing most of the time on Android. // See https://crbug.com/945734 @@ -11605,7 +11605,7 @@ // (typically during session restore when many navigations would be happening in // backgrounded processes). // TODO(crbug.com/1246541): Flaky on LaCrOS, Mac, and Windows. -#if defined(OS_MAC) || defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS_LACROS) #define MAYBE_NoCommitTimeoutForInvisibleWebContents \ DISABLED_NoCommitTimeoutForInvisibleWebContents #else @@ -11781,7 +11781,7 @@ } // Touchscreen DoubleTapZoom is only supported on Android & ChromeOS at present. -#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_ANDROID) +#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_ANDROID) // A test ContentBrowserClient implementation which enforces // WebPreferences' |double_tap_to_zoom_enabled| to be true. class DoubleTapZoomContentBrowserClient : public TestContentBrowserClient { @@ -11885,7 +11885,7 @@ SetBrowserClientForTesting(old_client); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_ANDROID) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_ANDROID) class CrossProcessNavigationObjectElementTest : public SitePerProcessBrowserTestBase, @@ -11942,7 +11942,7 @@ std::make_tuple("a", "b", "b"), std::make_tuple("a", "b", "c"))); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // This test verifies that after occluding a WebContents the RAF inside a // cross-process child frame is throttled. IN_PROC_BROWSER_TEST_P(SitePerProcessBrowserTest, @@ -12694,11 +12694,11 @@ INSTANTIATE_TEST_SUITE_P(All, RequestDelayingSitePerProcessBrowserTest, testing::ValuesIn(RenderDocumentFeatureLevelValues())); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) INSTANTIATE_TEST_SUITE_P(All, SitePerProcessAndroidImeTest, testing::ValuesIn(RenderDocumentFeatureLevelValues())); -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) INSTANTIATE_TEST_SUITE_P(All, SitePerProcessAndProcessPerSiteBrowserTest, testing::ValuesIn(RenderDocumentFeatureLevelValues())); @@ -12717,11 +12717,11 @@ INSTANTIATE_TEST_SUITE_P(All, DisableProcessReusePolicyTest, testing::ValuesIn(RenderDocumentFeatureLevelValues())); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) INSTANTIATE_TEST_SUITE_P(All, TouchSelectionControllerClientAndroidSiteIsolationTest, testing::ValuesIn(RenderDocumentFeatureLevelValues())); -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) INSTANTIATE_TEST_SUITE_P(All, SitePerProcessBrowserTestWithLeakDetector, testing::ValuesIn(RenderDocumentFeatureLevelValues()));
diff --git a/content/browser/site_per_process_hit_test_browsertest.cc b/content/browser/site_per_process_hit_test_browsertest.cc index 38631dbd..a949ca98 100644 --- a/content/browser/site_per_process_hit_test_browsertest.cc +++ b/content/browser/site_per_process_hit_test_browsertest.cc
@@ -67,11 +67,11 @@ #include "ui/events/event_rewriter.h" #endif -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "ui/base/test/scoped_preferred_scroller_style_mac.h" #endif -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "content/browser/renderer_host/render_widget_host_view_android.h" #include "content/test/mock_overscroll_refresh_handler_android.h" #endif @@ -777,7 +777,7 @@ kSurfaceLayer, }; -#if !defined(OS_MAC) && !defined(OS_ANDROID) +#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID) bool IsScreenTooSmallForPopup(const display::ScreenInfo& screen_info) { // Small display size will cause popup positions to be adjusted, // causing test failures. @@ -1299,7 +1299,7 @@ // subframe. // https://crbug.com/959848: Flaky on Linux MSAN bots // https://crbug.com/959924: Flaky on Android MSAN bots -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #define MAYBE_TouchAndGestureEventPositionChange \ DISABLED_TouchAndGestureEventPositionChange #else @@ -2070,7 +2070,7 @@ ASSERT_TRUE(false); } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) { gfx::Rect view_bounds = root_rwhv->GetViewBounds(); LOG(ERROR) << "Root view bounds = (" << view_bounds.x() << "," @@ -2183,7 +2183,7 @@ // Regression test for https://crbug.com/851644. The test passes as long as it // doesn't crash. // Touch action ack timeout is enabled on Android only. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, TouchActionAckTimeout) { GURL main_url( @@ -2244,9 +2244,9 @@ })); ack_observer.Wait(); } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) -#if defined(USE_AURA) || defined(OS_ANDROID) +#if defined(USE_AURA) || BUILDFLAG(IS_ANDROID) // When unconsumed scrolls in a child bubble to the root and start an // overscroll gesture, the subsequent gesture scroll update events should be @@ -2273,7 +2273,7 @@ #if defined(USE_AURA) // The child must be horizontally scrollable. GURL child_url(embedded_test_server()->GetURL("b.com", "/wide_page.html")); -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) // The child must be vertically scrollable. GURL child_url(embedded_test_server()->GetURL("b.com", "/tall_page.html")); #endif @@ -2354,7 +2354,7 @@ mock_overscroll_delegate->GetWeakPtr()); MockOverscrollObserver* mock_overscroll_observer = mock_overscroll_delegate.get(); -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) RenderWidgetHostViewAndroid* rwhv_android = static_cast<RenderWidgetHostViewAndroid*>(rwhv_root); std::unique_ptr<MockOverscrollRefreshHandlerAndroid> mock_overscroll_handler = @@ -2375,7 +2375,7 @@ #if defined(USE_AURA) const float overscroll_threshold = OverscrollConfig::kStartTouchscreenThresholdDips; -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) const float overscroll_threshold = 0.f; #endif @@ -2395,7 +2395,7 @@ // For aura, we scroll horizontally to activate an overscroll navigation. gesture_scroll_begin.data.scroll_begin.delta_x_hint = overscroll_threshold + 1; -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) // For android, we scroll vertically to activate pull-to-refresh. gesture_scroll_begin.data.scroll_begin.delta_y_hint = overscroll_threshold + 1; @@ -2418,7 +2418,7 @@ gesture_scroll_update.data.scroll_update.delta_y = 0.f; #if defined(USE_AURA) float* delta = &gesture_scroll_update.data.scroll_update.delta_x; -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) float* delta = &gesture_scroll_update.data.scroll_update.delta_y; #endif *delta = overscroll_threshold + 1; @@ -2464,7 +2464,7 @@ // does not leave the child in an invalid state. gesture_end_observer_child.Wait(); } -#endif // defined(USE_AURA) || defined(OS_ANDROID) +#endif // defined(USE_AURA) || BUILDFLAG(IS_ANDROID) // Test that an ET_SCROLL event sent to an out-of-process iframe correctly // results in a scroll. This is only handled by RenderWidgetHostViewAura @@ -2682,7 +2682,7 @@ } // Same test as above, but runs in high-dpi mode. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // High DPI browser tests are not needed on Android, and confuse some of the // coordinate calculations. Android uses fixed device scale factor. #define MAYBE_SurfaceHitTestTest DISABLED_SurfaceHitTestTest @@ -2720,7 +2720,7 @@ // transformed event coordinates when we do manual calculation of expected // values. We can't rely on browser side transformation because it is broken // for perspective transforms. See https://crbug.com/854247. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_PerspectiveTransformedSurfaceHitTestTest \ DISABLED_PerspectiveTransformedSurfaceHitTestTest #else @@ -3270,7 +3270,7 @@ // Tooltips aren't used on Android, so no need to compile/run this test in that // case. -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) class TooltipMonitor : public RenderWidgetHostViewBase::TooltipObserver { public: explicit TooltipMonitor(RenderWidgetHostViewBase* rwhv) @@ -3401,9 +3401,9 @@ rwhv_a->SetTooltipObserverForTesting(nullptr); } -#endif // !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // The following test ensures that we don't get a crash if a tooltip is // triggered on Android. This test is nearly identical to // SitePerProcessHitTestBrowserTest.CrossProcessTooltipTestAndroid, except @@ -3505,12 +3505,12 @@ FROM_HERE, run_loop.QuitClosure(), TestTimeouts::action_max_timeout()); run_loop.Run(); } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) // This test verifies that MouseEnter and MouseLeave events fire correctly // when the mouse cursor moves between processes. // Flaky (timeout): https://crbug.com/1006635. -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #define MAYBE_CrossProcessMouseEnterAndLeaveTest \ DISABLED_CrossProcessMouseEnterAndLeaveTest #else @@ -3799,7 +3799,7 @@ // a scrollbar thumb or a subframe, and does not trigger mouse // capture if it hits an element in the main frame. // Flaky, https://crbug.com/1269160 -#if defined(OS_LINUX) || defined(OS_MAC) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) #define MAYBE_CrossProcessMouseCapture DISABLED_CrossProcessMouseCapture #else #define MAYBE_CrossProcessMouseCapture CrossProcessMouseCapture @@ -3956,7 +3956,7 @@ base::RunLoop().RunUntilIdle(); // Targeting a scrollbar with a click doesn't work on Mac or Android. -#if !defined(OS_MAC) && !defined(OS_ANDROID) +#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID) scoped_refptr<SetMouseCaptureInterceptor> root_interceptor = new SetMouseCaptureInterceptor(static_cast<RenderWidgetHostImpl*>( root->current_frame_host()->GetRenderWidgetHost())); @@ -4004,7 +4004,7 @@ root_interceptor->Wait(); EXPECT_FALSE(root_interceptor->Capturing()); -#endif // !defined(OS_MAC) && !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID) } IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, @@ -4343,7 +4343,7 @@ } // There are no cursors on Android. -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) namespace { class SetCursorInterceptor @@ -4546,7 +4546,7 @@ EXPECT_NE(120, set_cursor_interceptor->cursor()->custom_bitmap().height()); } } -#endif // !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) #if defined(USE_AURA) // Browser process hit testing is not implemented on Android, and these tests @@ -4659,7 +4659,7 @@ }; // Fails on Windows official build, see // https://crbug.com/800822 -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #define MAYBE_MultipleSubframeWheelEventsOnMainThread \ DISABLED_MultipleSubframeWheelEventsOnMainThread #else @@ -4706,7 +4706,7 @@ // Verifies that test in SubframeWheelEventsOnMainThread also makes sense for // the same page loaded in the mainframe. // Fails on Windows official build, see // https://crbug.com/800822 -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #define MAYBE_MainframeWheelEventsOnMainThread \ DISABLED_MainframeWheelEventsOnMainThread #else @@ -4785,7 +4785,7 @@ EXPECT_EQ(nullptr, router->wheel_target_); } -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #define MAYBE_MouseWheelEventPositionChange \ DISABLED_MouseWheelEventPositionChange #else @@ -4900,7 +4900,7 @@ thread_observer.Wait(); } -#if !defined(OS_WIN) +#if !BUILDFLAG(IS_WIN) { ui::ScrollEvent fling_start(ui::ET_SCROLL_FLING_START, child_point_in_root, ui::EventTimeForNow(), 0, 10, 0, 10, 0, 1); @@ -5270,7 +5270,7 @@ EXPECT_EQ(nullptr, router_touchpad_gesture_target); } -#if !defined(OS_WIN) +#if !BUILDFLAG(IS_WIN) // Sending touchpad fling events is not supported on Windows. void SendTouchpadFlingSequenceWithExpectedTarget( RenderWidgetHostViewBase* root_view, @@ -5319,7 +5319,7 @@ gestrue_scroll_end_waiter.GetAckStateWaitIfNecessary(); fling_cancel_waiter.Wait(); } -#endif // !defined(OS_WIN) +#endif // !BUILDFLAG(IS_WIN) } // anonymous namespace @@ -5400,14 +5400,14 @@ } // TODO: Flaking test crbug.com/802827 -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #define MAYBE_InputEventRouterGesturePreventDefaultTargetMapTest \ DISABLED_InputEventRouterGesturePreventDefaultTargetMapTest #else #define MAYBE_InputEventRouterGesturePreventDefaultTargetMapTest \ InputEventRouterGesturePreventDefaultTargetMapTest #endif -#if defined(USE_AURA) || defined(OS_ANDROID) +#if defined(USE_AURA) || BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F( SitePerProcessHitTestBrowserTest, MAYBE_InputEventRouterGesturePreventDefaultTargetMapTest) { @@ -5481,7 +5481,7 @@ rwhv_parent, thirdId); EXPECT_EQ(0u, router->touchscreen_gesture_target_map_.size()); } -#endif // defined(USE_AURA) || defined(OS_ANDROID) +#endif // defined(USE_AURA) || BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, InputEventRouterTouchpadGestureTargetTest) { @@ -5556,7 +5556,7 @@ router->touchpad_gesture_target_, rwhv_parent); -#if !defined(OS_WIN) +#if !BUILDFLAG(IS_WIN) // Sending touchpad fling events is not supported on Windows. // Send touchpad fling sequence to main-frame. @@ -5576,7 +5576,7 @@ // Test that performing a touchpad pinch over an OOPIF offers the synthetic // wheel events to the child and causes the page scale factor to change for // the main frame (given that the child did not consume the wheel). -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) // Flaky on Windows: https://crbug.com/947193 #define MAYBE_TouchpadPinchOverOOPIF DISABLED_TouchpadPinchOverOOPIF #else @@ -5686,8 +5686,8 @@ // Tests that performing a touchpad double-tap zoom over an OOPIF offers the // synthetic wheel event to the child. -#if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ - defined(OS_WIN) || defined(OS_ANDROID) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ + BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) // Flaky on mac, linux and win. crbug.com/947193 #define MAYBE_TouchpadDoubleTapZoomOverOOPIF \ DISABLED_TouchpadDoubleTapZoomOverOOPIF @@ -5880,7 +5880,7 @@ EXPECT_NEAR(point.y(), params.y, kHitTestTolerance); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // High DPI tests don't work properly on Android, which has fixed scale factor. #define MAYBE_CreateContextMenuTest DISABLED_CreateContextMenuTest #else @@ -5902,7 +5902,7 @@ CreateContextMenuTestHelper(shell(), embedded_test_server()); } -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) // The Popup menu test often times out on linux. https://crbug.com/1111402 #define MAYBE_PopupMenuTest DISABLED_PopupMenuTest #else @@ -5962,7 +5962,7 @@ popup_rect = gfx::ScaleToRoundedRect(popup_rect, 1 / screen_info.device_scale_factor); } -#if defined(OS_MAC) || defined(OS_ANDROID) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) // On Mac and Android we receive the coordinates before they are transformed, // so they are still relative to the out-of-process iframe origin. EXPECT_EQ(popup_rect.x(), 9); @@ -5974,7 +5974,7 @@ } #endif -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) // Verify click-and-drag selection of popups still works on Linux with // OOPIFs enabled. This is only necessary to test on Aura because Mac and // Android use native widgets. Windows does not support this as UI @@ -6015,7 +6015,7 @@ // This verifies that the popup actually received the event, and it wasn't // diverted to a different RenderWidgetHostView due to mouse capture. EXPECT_TRUE(popup_monitor.EventWasReceived()); -#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) // There are posted tasks that must be run before the test shuts down, lest // they access deleted state. @@ -6084,7 +6084,7 @@ gfx::Rect popup_rect = popup_waiter->last_initial_rect(); -#if defined(OS_MAC) || defined(OS_ANDROID) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) EXPECT_EQ(popup_rect.x(), 9); EXPECT_EQ(popup_rect.y(), 9); #else @@ -6137,7 +6137,7 @@ popup_rect = popup_waiter->last_initial_rect(); -#if defined(OS_MAC) || defined(OS_ANDROID) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) EXPECT_EQ(popup_rect.x(), 9); EXPECT_EQ(popup_rect.y(), 9); #else @@ -6158,7 +6158,7 @@ // On Mac and Android, the reported menu coordinates are relative to the // OOPIF, and its screen position is computed later, so this test isn't // relevant on those platforms. -#if !defined(OS_ANDROID) && !defined(OS_MAC) +#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC) IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, ScrolledNestedPopupMenuTest) { GURL main_url(embedded_test_server()->GetURL( @@ -6268,7 +6268,7 @@ // they access deleted state. RunPostedTasks(); } -#endif // !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) #if defined(USE_AURA) class SitePerProcessGestureHitTestBrowserTest @@ -6573,7 +6573,7 @@ // Android uses fixed scale factor, which makes this test unnecessary. // MacOSX does not have fractional device scales. -#if defined(OS_ANDROID) || defined(OS_MAC) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_MAC) #define MAYBE_MouseClickWithNonIntegerScaleFactor \ DISABLED_MouseClickWithNonIntegerScaleFactor #else @@ -6633,7 +6633,7 @@ } // MacOSX does not have fractional device scales. -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #define MAYBE_NestedSurfaceHitTestTest DISABLED_NestedSurfaceHitTestTest #else #define MAYBE_NestedSurfaceHitTestTest NestedSurfaceHitTestTest
diff --git a/content/browser/site_per_process_layout_browsertest.cc b/content/browser/site_per_process_layout_browsertest.cc index 99ed28a..635c0c5 100644 --- a/content/browser/site_per_process_layout_browsertest.cc +++ b/content/browser/site_per_process_layout_browsertest.cc
@@ -24,7 +24,7 @@ #include "ui/aura/window_tree_host.h" #endif -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "content/browser/renderer_host/input/synthetic_touchpad_pinch_gesture.h" #include "ui/base/test/scoped_preferred_scroller_style_mac.h" #endif @@ -292,7 +292,7 @@ // we ensure that make frame and iframe have the same DIP scale there, but // not necessarily kDeviceScaleFactor. const double expected_dip_scale = -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) GetFrameDeviceScaleFactor(web_contents()); #else SitePerProcessHighDPIBrowserTest::kDeviceScaleFactor; @@ -380,7 +380,7 @@ EXPECT_LT(30000, child_rwhv->GetViewBounds().height()); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Android doesn't support forcing device scale factor in tests. INSTANTIATE_TEST_SUITE_P(SitePerProcess, SitePerProcessCompositorViewportBrowserTest, @@ -443,7 +443,7 @@ // Tests that when a large OOPIF has been scaled, the compositor raster area // sent from the embedder is correct. -#if defined(OS_ANDROID) || defined(OS_MAC) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_MAC) // Temporarily disabled on Android because this doesn't account for browser // control height or page scale factor. // Flaky on Mac. https://crbug.com/840314 @@ -520,7 +520,7 @@ // Similar to ScaledIFrameRasterSize but with nested OOPIFs to ensure // propagation works correctly. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Temporarily disabled on Android because this doesn't account for browser // control height or page scale factor. #define MAYBE_ScaledNestedIframeRasterSize DISABLED_ScaledNestedIframeRasterSize @@ -1254,7 +1254,7 @@ blink::mojom::TextAutosizerPageInfo received_page_info; auto interceptor = std::make_unique<TextAutosizerPageInfoInterceptor>( web_contents()->GetMainFrame()); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) prefs.device_scale_adjustment += 0.05f; // Change the device scale adjustment to trigger a RemotePageInfo update. web_contents()->SetWebPreferences(prefs); @@ -1282,7 +1282,7 @@ base::RunLoop().RunUntilIdle(); received_page_info = interceptor->GetTextAutosizerPageInfo(); EXPECT_EQ(new_bounds.width(), received_page_info.main_frame_width); -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) // Dynamically create a new, cross-process frame to test sending the cached // TextAutosizerPageInfo. @@ -1482,7 +1482,7 @@ // TODO(bokan): Pretty soon most/all platforms will use overlay scrollbars. This // test should find a better way to check for scrollability. crbug.com/662196. // Flaky on Linux. crbug.com/790929. -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #define MAYBE_FrameOwnerPropertiesPropagationScrolling \ DISABLED_FrameOwnerPropertiesPropagationScrolling #else @@ -1491,7 +1491,7 @@ #endif IN_PROC_BROWSER_TEST_P(SitePerProcessBrowserTest, MAYBE_FrameOwnerPropertiesPropagationScrolling) { -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) ui::test::ScopedPreferredScrollerStyle scroller_style_override(false); #endif GURL main_url(embedded_test_server()->GetURL( @@ -2054,7 +2054,7 @@ params.anchor = gfx::PointF(bounds.CenterPoint()); // In SyntheticPinchGestureParams, |scale_factor| is really a delta. params.scale_factor = kPageScaleDelta; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) auto synthetic_pinch_gesture = std::make_unique<SyntheticTouchpadPinchGesture>(params); #else @@ -2339,7 +2339,7 @@ params.anchor = gfx::PointF(bounds.CenterPoint().x(), 70.f); // In SyntheticPinchGestureParams, |scale_factor| is really a delta. params.scale_factor = kPageScaleDelta; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) auto synthetic_pinch_gesture = std::make_unique<SyntheticTouchpadPinchGesture>(params); #else
diff --git a/content/browser/site_per_process_mixed_content_browsertest.cc b/content/browser/site_per_process_mixed_content_browsertest.cc index 7267a32..dd17e76 100644 --- a/content/browser/site_per_process_mixed_content_browsertest.cc +++ b/content/browser/site_per_process_mixed_content_browsertest.cc
@@ -147,7 +147,7 @@ // iframe can be loaded from a site other than localhost (the // EmbeddedTestServer serves a certificate that is valid for localhost). // This test crashes on Windows under Dr. Memory, see https://crbug.com/600942. -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #define MAYBE_PassiveMixedContentInIframe DISABLED_PassiveMixedContentInIframe #else #define MAYBE_PassiveMixedContentInIframe PassiveMixedContentInIframe
diff --git a/content/browser/site_per_process_sad_frame_browsertest.cc b/content/browser/site_per_process_sad_frame_browsertest.cc index 50743b1..60a4873 100644 --- a/content/browser/site_per_process_sad_frame_browsertest.cc +++ b/content/browser/site_per_process_sad_frame_browsertest.cc
@@ -61,7 +61,7 @@ // This test is flaky on Win7 and Android. // TODO(crbug.com/1179074): Deflake it and enable this test back. -#if defined(OS_WIN) || defined(OS_ANDROID) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) #define MAYBE_ChildFrameCrashMetrics_KilledWhileHiddenThenShown \ DISABLED_ChildFrameCrashMetrics_KilledWhileHiddenThenShown #else
diff --git a/content/browser/site_per_process_scroll_browsertest.cc b/content/browser/site_per_process_scroll_browsertest.cc index b29f0d9..ac7102f 100644 --- a/content/browser/site_per_process_scroll_browsertest.cc +++ b/content/browser/site_per_process_scroll_browsertest.cc
@@ -112,7 +112,7 @@ // TODO(bokan): Mac doesn't support touch events and for an unknown reason, // Android doesn't like mouse wheel here. https://crbug.com/897520. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) source = content::mojom::GestureSourceType::kTouchInput; #else source = content::mojom::GestureSourceType::kTouchpadInput; @@ -356,7 +356,7 @@ // resultant page scale factor is the same for OOPIF and non-OOPIF cases. This // also verifies that in response to the scroll command, the root-layer scrolls // correctly and the <input> is visible in visual viewport. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // crbug.com/793616 #define MAYBE_ScrollFocusedEditableElementIntoView \ DISABLED_ScrollFocusedEditableElementIntoView @@ -369,7 +369,7 @@ GURL url_a(embedded_test_server()->GetURL("a.com", kIframeOutOfViewHTML)); GURL url_b(embedded_test_server()->GetURL("b.com", kIframeOutOfViewHTML)); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // The reason for Android specific code is that // AutoZoomFocusedNodeToLegibleScale is in blink's WebSettings and difficult // to access from here. It so happens that the setting is on for Android. @@ -387,7 +387,7 @@ WaitForOnLoad(root); EXPECT_TRUE(NavigateToURLFromRenderer(root->child_at(0), url_a)); WaitForOnLoad(root->child_at(0)); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) float scale_before_scroll_nonoopif = GetVisualViewportScale(root); #endif AddFocusedInputField(root->child_at(0)); @@ -402,7 +402,7 @@ ->GetFrameWidgetInputHandler() ->ScrollFocusedEditableNodeIntoRect(gfx::Rect()); WaitForElementVisible(root, kIframeSelector); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) float scale_after_scroll_nonoopif = GetVisualViewportScale(root); // Increased scale means zoom triggered correctly. EXPECT_GT(scale_after_scroll_nonoopif - scale_before_scroll_nonoopif, @@ -417,7 +417,7 @@ ->GetPrimaryFrameTree() .root(); WaitForOnLoad(root); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) float scale_before_scroll_oopif = GetVisualViewportScale(root); // Sanity-check: ASSERT_NEAR(scale_before_scroll_oopif, scale_before_scroll_nonoopif, @@ -435,7 +435,7 @@ ->GetFrameWidgetInputHandler() ->ScrollFocusedEditableNodeIntoRect(gfx::Rect()); WaitForElementVisible(root, kIframeSelector); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) float scale_after_scroll_oopif = GetVisualViewportScale(root); EXPECT_GT(scale_after_scroll_oopif - scale_before_scroll_oopif, kEpsilon); EXPECT_GT(scale_after_scroll_oopif, kLowerBoundOnScaleAfterScroll); @@ -457,7 +457,7 @@ // Failing on Android, see crbug.com/1246843 // Flaky on Mac, see crbug.com/1156657 -#if defined(OS_ANDROID) || defined(OS_MAC) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_MAC) #define MAYBE_ScrollClippedFocusedEditableElementIntoView \ DISABLED_ScrollClippedFocusedEditableElementIntoView #else @@ -531,7 +531,7 @@ // Make sure we still zoom in on the input box on platforms that zoom into the // focused editable. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) EXPECT_GT(scale_after, scale_before); #else EXPECT_FLOAT_EQ(scale_after, scale_before); @@ -648,7 +648,7 @@ // Android: crbug.com/825629 // NDEBUG: crbug.com/1063045 -#if defined(OS_ANDROID) || defined(NDEBUG) +#if BUILDFLAG(IS_ANDROID) || defined(NDEBUG) #define MAYBE_ScrollBubblingFromNestedOOPIFTest \ DISABLED_ScrollBubblingFromNestedOOPIFTest #else
diff --git a/content/browser/site_per_process_unload_browsertest.cc b/content/browser/site_per_process_unload_browsertest.cc index 53ac3a6cd..7f8c65c2 100644 --- a/content/browser/site_per_process_unload_browsertest.cc +++ b/content/browser/site_per_process_unload_browsertest.cc
@@ -315,7 +315,7 @@ // Disable the BackForwardCache to ensure the old process is going to be // released. DisableBackForwardCacheForTesting(web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); GURL cross_site_url(embedded_test_server()->GetURL("b.com", "/title1.html")); EXPECT_TRUE(NavigateToURLFromRenderer(shell(), cross_site_url)); @@ -395,7 +395,7 @@ // | // C3 // TODO(crbug.com/1012185): Flaky timeouts on Linux and Mac. -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) #define MAYBE_UnloadHandlerSubframes DISABLED_UnloadHandlerSubframes #else #define MAYBE_UnloadHandlerSubframes UnloadHandlerSubframes @@ -1324,7 +1324,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back-forward cache to ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); GURL A1_url(embedded_test_server()->GetURL( "a.com", "/cross_site_iframe_factory.html?a(b)")); GURL A3_url(embedded_test_server()->GetURL("a.com", "/title1.html")); @@ -1339,7 +1339,7 @@ delete_B1.WaitUntilDeleted(); } -#if defined(OS_LINUX) && defined(THREAD_SANITIZER) +#if BUILDFLAG(IS_LINUX) && defined(THREAD_SANITIZER) // See crbug.com/1275848. #define MAYBE_NestedSubframeWithUnloadHandler \ DISABLED_NestedSubframeWithUnloadHandler
diff --git a/content/browser/sms/sms_provider.cc b/content/browser/sms/sms_provider.cc index 44d4f0e..5a2514d 100644 --- a/content/browser/sms/sms_provider.cc +++ b/content/browser/sms/sms_provider.cc
@@ -11,7 +11,7 @@ #include "content/public/common/content_switches.h" #include "url/gurl.h" #include "url/origin.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "content/browser/sms/sms_provider_gms.h" #endif @@ -22,7 +22,7 @@ // static std::unique_ptr<SmsProvider> SmsProvider::Create() { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) return std::make_unique<SmsProviderGms>(); #else return nullptr;
diff --git a/content/browser/sms/webotp_service_unittest.cc b/content/browser/sms/webotp_service_unittest.cc index 3f274154..5264bc0 100644 --- a/content/browser/sms/webotp_service_unittest.cc +++ b/content/browser/sms/webotp_service_unittest.cc
@@ -912,7 +912,7 @@ TEST_F(WebOTPServiceTest, RecordUnhandledRequestOnNavigation) { web_contents()->GetController().GetBackForwardCache().DisableForTesting( - content::BackForwardCache::TEST_ASSUMES_NO_CACHING); + content::BackForwardCache::TEST_REQUIRES_NO_CACHING); NavigateAndCommit(GURL(kTestUrl)); NiceMock<MockSmsWebContentsDelegate> delegate; WebContentsImpl* web_contents_impl =
diff --git a/content/browser/snapshot_browsertest.cc b/content/browser/snapshot_browsertest.cc index 5dd9bc2..bf8c723 100644 --- a/content/browser/snapshot_browsertest.cc +++ b/content/browser/snapshot_browsertest.cc
@@ -211,7 +211,7 @@ // Even the single-window test doesn't work on Android yet. It's expected // that the multi-window tests would never work on that platform. -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(SnapshotBrowserTest, SingleWindowTest) { SetupTestServer(); @@ -251,8 +251,9 @@ // Linux Chromium OS ASAN LSAN Tests (1) // Linux TSAN Tests // See crbug.com/771119 -#if (defined(OS_WIN) && !defined(NDEBUG)) || (BUILDFLAG(IS_CHROMEOS_ASH)) || \ - ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(THREAD_SANITIZER)) +#if (BUILDFLAG(IS_WIN) && !defined(NDEBUG)) || (BUILDFLAG(IS_CHROMEOS_ASH)) || \ + ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ + defined(THREAD_SANITIZER)) #define MAYBE_SyncMultiWindowTest DISABLED_SyncMultiWindowTest #define MAYBE_AsyncMultiWindowTest DISABLED_AsyncMultiWindowTest #else @@ -397,6 +398,6 @@ } } -#endif // !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) } // namespace content
diff --git a/content/browser/startup_helper.cc b/content/browser/startup_helper.cc index 982546b..c57cdb93 100644 --- a/content/browser/startup_helper.cc +++ b/content/browser/startup_helper.cc
@@ -47,7 +47,7 @@ } namespace { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Mobile config, for iOS see ios/web/app/web_main_loop.cc. constexpr int kThreadPoolDefaultMin = 6; constexpr int kThreadPoolMax = 8; @@ -78,7 +78,7 @@ base::RecommendedMaxNumberOfThreadsInThreadGroup( min, kThreadPoolMax, kThreadPoolCoresMultiplier, kThreadPoolOffset)}; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) thread_pool_init_params.common_thread_pool_environment = base:: ThreadPoolInstance::InitParams::CommonThreadPoolEnvironment::COM_MTA; #endif
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc index 22c448ad..6df863b 100644 --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc
@@ -123,11 +123,11 @@ #include "third_party/blink/public/mojom/devtools/inspector_issue.mojom-shared.h" #include "third_party/blink/public/mojom/quota/quota_types.mojom.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "content/public/browser/android/java_interfaces.h" #include "net/android/http_auth_negotiate_android.h" #include "services/service_manager/public/cpp/interface_provider.h" -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(ENABLE_PLUGINS) #include "content/browser/plugin_private_storage_helper.h" @@ -173,7 +173,7 @@ /*io_task_runner=*/nullptr); } -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) void BindStorageServiceFilesystemImpl( const base::FilePath& directory_path, mojo::PendingReceiver<storage::mojom::Directory> receiver) { @@ -187,7 +187,7 @@ mojo::Remote<storage::mojom::StorageService>& remote = GetStorageServiceRemoteStorage(); if (!remote) { -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) const base::FilePath sandboxed_data_dir = GetContentClient() ->browser() @@ -220,7 +220,7 @@ directory.InitWithNewPipeAndPassReceiver())); remote->SetDataDirectory(sandboxed_data_dir, std::move(directory)); } else -#endif // !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) { GetIOThreadTaskRunner({})->PostTask( FROM_HERE, base::BindOnce(&RunInProcessStorageService, @@ -722,7 +722,7 @@ base::WeakPtrFactory<SSLErrorDelegate> weak_factory_{this}; }; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void FinishGenerateNegotiateAuthToken( std::unique_ptr<net::android::HttpAuthNegotiateAndroid> auth_negotiate, std::unique_ptr<std::string> auth_token, @@ -966,6 +966,7 @@ network::mojom::CookieManager* cookie_manager, InterestGroupManager* interest_group_manager, AttributionManagerImpl* attribution_manager, + AggregationServiceImpl* aggregation_service, bool perform_storage_cleanup, const base::Time begin, const base::Time end); @@ -994,7 +995,8 @@ kShaderCache = 6, kPluginPrivate = 7, kConversions = 8, - kMaxValue = kConversions, + kAggregationService = 9, + kMaxValue = kAggregationService, }; base::OnceClosure CreateTaskCompletionClosure(TracingDataType data_type); @@ -2034,7 +2036,7 @@ load_flags, cookie_partition_key, std::move(callback)); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void StoragePartitionImpl::OnGenerateHttpNegotiateAuthToken( const std::string& server_auth_token, bool can_delegate, @@ -2144,7 +2146,7 @@ quota_manager_.get(), special_storage_policy_.get(), filesystem_context_.get(), GetCookieManagerForBrowserProcess(), interest_group_manager_.get(), attribution_manager_.get(), - perform_storage_cleanup, begin, end); + aggregation_service_.get(), perform_storage_cleanup, begin, end); } void StoragePartitionImpl::DeletionHelperDone(base::OnceClosure callback) { @@ -2345,6 +2347,7 @@ network::mojom::CookieManager* cookie_manager, InterestGroupManager* interest_group_manager, AttributionManagerImpl* attribution_manager, + AggregationServiceImpl* aggregation_service, bool perform_storage_cleanup, const base::Time begin, const base::Time end) { @@ -2451,10 +2454,24 @@ storage_policy_ref); if (attribution_manager && (remove_mask_ & REMOVE_DATA_MASK_CONVERSIONS)) { attribution_manager->ClearData( - begin, end, std::move(filter), + begin, end, filter, CreateTaskCompletionClosure(TracingDataType::kConversions)); } + if (aggregation_service && + (remove_mask_ & REMOVE_DATA_MASK_AGGREGATION_SERVICE)) { + // Currently the aggregation service only stores public keys and we don't + // have information on the page/context that uses the public key origin, + // therefore we don't check origins and instead just delete all rows in the + // given time range. + // TODO(crbug.com/1284971): Consider fine-grained deletion of public keys. + // TODO(crbug.com/1286173): Consider adding aggregation service origins to + // `CookiesTreeModel`. + aggregation_service->ClearData( + begin, end, + CreateTaskCompletionClosure(TracingDataType::kAggregationService)); + } + #if BUILDFLAG(ENABLE_PLUGINS) if (remove_mask_ & REMOVE_DATA_MASK_PLUGIN_PRIVATE_DATA) { filesystem_context->default_file_task_runner()->PostTask( @@ -2698,6 +2715,12 @@ std::move(shared_storage_worklet_host_manager); } +void StoragePartitionImpl::OverrideAggregationServiceForTesting( + std::unique_ptr<AggregationServiceImpl> aggregation_service) { + DCHECK(initialized_); + aggregation_service_ = std::move(aggregation_service); +} + void StoragePartitionImpl::GetQuotaSettings( storage::OptionalQuotaSettingsCallback callback) { if (g_test_quota_settings) { @@ -2891,10 +2914,10 @@ if (local_trust_token_fulfiller_) return; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) GetGlobalJavaInterfaces()->GetInterface( local_trust_token_fulfiller_.BindNewPipeAndPassReceiver()); -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) if (local_trust_token_fulfiller_) { local_trust_token_fulfiller_.set_disconnect_handler(base::BindOnce(
diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h index 4356c6e3..d05dedb 100644 --- a/content/browser/storage_partition_impl.h +++ b/content/browser/storage_partition_impl.h
@@ -127,6 +127,8 @@ void OverrideSharedStorageWorkletHostManagerForTesting( std::unique_ptr<SharedStorageWorkletHostManager> shared_storage_worklet_host_manager); + void OverrideAggregationServiceForTesting( + std::unique_ptr<AggregationServiceImpl> aggregation_service); // Returns the StoragePartitionConfig that represents this StoragePartition. const StoragePartitionConfig& GetConfig(); @@ -265,7 +267,7 @@ void OnCanSendDomainReliabilityUpload( const GURL& origin, OnCanSendDomainReliabilityUploadCallback callback) override; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void OnGenerateHttpNegotiateAuthToken( const std::string& server_auth_token, bool can_delegate,
diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc index 2c06486..d3c0772 100644 --- a/content/browser/storage_partition_impl_map.cc +++ b/content/browser/storage_partition_impl_map.cc
@@ -105,7 +105,7 @@ const int kPartitionNameHashBytes = 6; // Needed for selecting all files in ObliterateOneDirectory() below. -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) const int kAllFileTypes = base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES | base::FileEnumerator::SHOW_SYM_LINKS;
diff --git a/content/browser/storage_partition_impl_unittest.cc b/content/browser/storage_partition_impl_unittest.cc index 8f596bb..eac7f4d 100644 --- a/content/browser/storage_partition_impl_unittest.cc +++ b/content/browser/storage_partition_impl_unittest.cc
@@ -6,15 +6,18 @@ #include <stdint.h> #include <map> +#include <memory> #include <set> #include <string> #include <utility> #include <vector> #include "base/bind.h" +#include "base/callback.h" #include "base/callback_helpers.h" #include "base/containers/contains.h" #include "base/cxx17_backports.h" +#include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/location.h" #include "base/memory/raw_ptr.h" @@ -26,11 +29,14 @@ #include "base/test/scoped_feature_list.h" #include "base/threading/thread.h" #include "base/threading/thread_task_runner_handle.h" +#include "base/time/time.h" #include "build/build_config.h" #include "components/services/storage/dom_storage/async_dom_storage_database.h" #include "components/services/storage/dom_storage/dom_storage_database.h" #include "components/services/storage/dom_storage/local_storage_database.pb.h" #include "components/services/storage/public/cpp/constants.h" +#include "content/browser/aggregation_service/aggregation_service_impl.h" +#include "content/browser/aggregation_service/aggregation_service_test_utils.h" #include "content/browser/attribution_reporting/attribution_manager_impl.h" #include "content/browser/attribution_reporting/attribution_test_utils.h" #include "content/browser/attribution_reporting/storable_trigger.h" @@ -72,6 +78,8 @@ #include "third_party/blink/public/mojom/interest_group/interest_group_types.mojom.h" #include "third_party/blink/public/mojom/quota/quota_types.mojom-shared.h" #include "third_party/leveldatabase/env_chromium.h" +#include "url/gurl.h" +#include "url/origin.h" #if BUILDFLAG(ENABLE_PLUGINS) #include "storage/browser/file_system/async_file_util.h" @@ -82,10 +90,10 @@ #include "url/origin.h" #endif // BUILDFLAG(ENABLE_PLUGINS) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "content/public/browser/android/java_interfaces.h" #include "services/service_manager/public/cpp/interface_provider.h" -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) using net::CanonicalCookie; using CookieDeletionFilter = network::mojom::CookieDeletionFilter; @@ -724,6 +732,21 @@ observation_{this}; }; +class MockAggregationService : public AggregationServiceImpl { + public: + explicit MockAggregationService(StoragePartitionImpl* partition) + : AggregationServiceImpl(/*run_in_memory=*/true, + /*user_data_directory=*/base::FilePath(), + partition) {} + + MOCK_METHOD(void, + ClearData, + (base::Time delete_begin, + base::Time delete_end, + base::OnceClosure done), + (override)); +}; + bool IsWebSafeSchemeForTest(const std::string& scheme) { return scheme == url::kHttpScheme; } @@ -885,8 +908,10 @@ // Configures the Conversion API to run in memory to speed up its // initialization and avoid timeouts. See https://crbug.com/1080764. AttributionManagerImpl::RunInMemoryForTesting(); - feature_list_.InitWithFeatures({blink::features::kInterestGroupStorage}, - {}); + feature_list_.InitWithFeatures( + {blink::features::kInterestGroupStorage, + features::kPrivacySandboxAggregationService}, + {}); } StoragePartitionImplTest(const StoragePartitionImplTest&) = delete; @@ -2139,7 +2164,7 @@ } // namespace -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) TEST_F(StoragePartitionImplTest, BindsTrustTokenFulfiller) { auto expected_answer = network::mojom::FulfillTrustTokenIssuanceAnswer::New(); expected_answer->status = @@ -2207,9 +2232,9 @@ EXPECT_EQ(num_binds_attempted, 1); } } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) TEST_F(StoragePartitionImplTest, HandlesDisconnectedTrustTokenFulfiller) { // Construct a mock fulfiller that doesn't reply to issuance requests it // receives... @@ -2247,10 +2272,10 @@ EXPECT_EQ(received_answer->status, network::mojom::FulfillTrustTokenIssuanceAnswer::Status::kNotFound); } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) TEST_F(StoragePartitionImplTest, HandlesMissingTrustTokenFulfiller) { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // On Android, binding can be explicitly rejected by the Android-side // implementation code: to ensure we can handle the rejection, manually force // the bind to fail. @@ -2269,7 +2294,7 @@ base::BindRepeating([](mojo::ScopedMessagePipeHandle handle) { mojo::Close(std::move(handle)); })); -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( browser_context()->GetDefaultStoragePartition()); @@ -2293,4 +2318,64 @@ network::mojom::FulfillTrustTokenIssuanceAnswer::Status::kNotFound); } +TEST_F(StoragePartitionImplTest, RemoveAggregationServiceData) { + StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( + browser_context()->GetDefaultStoragePartition()); + + auto aggregation_service = + std::make_unique<MockAggregationService>(partition); + auto* aggregation_service_ptr = aggregation_service.get(); + partition->OverrideAggregationServiceForTesting( + std::move(aggregation_service)); + + const uint32_t kTestClearMask = + StoragePartition::REMOVE_DATA_MASK_AGGREGATION_SERVICE; + const uint32_t kTestQuotaClearMask = + StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL; + const auto kTestOrigin = GURL("https://example.com"); + const auto kBeginTime = base::Time() + base::Hours(1); + const auto kEndTime = base::Time() + base::Hours(2); + const auto invoke_callback = + [](base::Time delete_begin, base::Time delete_end, + base::OnceClosure done) { std::move(done).Run(); }; + + // Verify that each of the StoragePartition interfaces for clearing origin + // based data calls aggregation service appropriately. + + EXPECT_CALL(*aggregation_service_ptr, + ClearData(base::Time(), base::Time::Max(), testing::_)) + .WillOnce(testing::Invoke(invoke_callback)); + base::RunLoop run_loop; + partition->ClearDataForOrigin(kTestClearMask, kTestQuotaClearMask, + kTestOrigin, run_loop.QuitClosure()); + run_loop.Run(); + testing::Mock::VerifyAndClearExpectations(aggregation_service_ptr); + + EXPECT_CALL(*aggregation_service_ptr, + ClearData(kBeginTime, kEndTime, testing::_)) + .WillOnce(testing::Invoke(invoke_callback)); + partition->ClearData(kTestClearMask, kTestQuotaClearMask, kTestOrigin, + kBeginTime, kEndTime, base::DoNothing()); + testing::Mock::VerifyAndClearExpectations(aggregation_service_ptr); + + EXPECT_CALL(*aggregation_service_ptr, + ClearData(kBeginTime, kEndTime, testing::_)) + .WillOnce(testing::Invoke(invoke_callback)); + partition->ClearData( + kTestClearMask, kTestQuotaClearMask, + base::BindLambdaForTesting([&](const url::Origin& origin, + storage::SpecialStoragePolicy* policy) { + return origin == url::Origin::Create(kTestOrigin); + }), + /*cookie_deletion_filter=*/nullptr, /*perform_storage_cleanup=*/false, + kBeginTime, kEndTime, base::DoNothing()); + testing::Mock::VerifyAndClearExpectations(aggregation_service_ptr); + + EXPECT_CALL(*aggregation_service_ptr, + ClearData(kBeginTime, kEndTime, testing::_)) + .WillOnce(testing::Invoke(invoke_callback)); + partition->ClearData(kTestClearMask, kTestQuotaClearMask, GURL(), kBeginTime, + kEndTime, base::DoNothing()); +} + } // namespace content
diff --git a/content/browser/storage_service_restart_browsertest.cc b/content/browser/storage_service_restart_browsertest.cc index 9c811d4..4a2820a 100644 --- a/content/browser/storage_service_restart_browsertest.cc +++ b/content/browser/storage_service_restart_browsertest.cc
@@ -129,8 +129,8 @@ } // Flaky on Linux, Windows, and Mac. See crbug.com/1066138. -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) || \ - defined(OS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \ + BUILDFLAG(IS_MAC) #define MAYBE_LocalStorageRecovery DISABLED_LocalStorageRecovery #else #define MAYBE_LocalStorageRecovery LocalStorageRecovery
diff --git a/content/browser/text_fragment_browsertest.cc b/content/browser/text_fragment_browsertest.cc index 576f4d1..8cdd0664 100644 --- a/content/browser/text_fragment_browsertest.cc +++ b/content/browser/text_fragment_browsertest.cc
@@ -282,7 +282,7 @@ // be recreated with did_scroll == false. Disable back/forward cache to ensure // that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting( - main_contents, BackForwardCacheImpl::TEST_ASSUMES_NO_CACHING); + main_contents, BackForwardCacheImpl::TEST_REQUIRES_NO_CACHING); { // The RenderFrameSubmissionObserver destructor expects the RenderFrameHost @@ -820,7 +820,7 @@ // so that the document policy to force-load-at-top will run. This will not // happen if the document is back-forward cached, so we need to disable it. DisableBackForwardCacheForTesting(main_contents, - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // Scroll down the page a bit EXPECT_TRUE(ExecJs(main_contents, "window.scrollTo(0, 1000)"));
diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc index d596feb..80eb2af 100644 --- a/content/browser/utility_process_host.cc +++ b/content/browser/utility_process_host.cc
@@ -16,6 +16,7 @@ #include "base/i18n/base_i18n_switches.h" #include "base/strings/utf_string_conversions.h" #include "base/task/sequenced_task_runner.h" +#include "build/build_config.h" #include "components/network_session_configurator/common/network_switches.h" #include "content/browser/browser_child_process_host_impl.h" #include "content/browser/gpu/gpu_data_manager_impl.h" @@ -42,15 +43,15 @@ #include "ui/base/ui_base_switches.h" #include "ui/gl/gl_switches.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "services/network/public/mojom/network_service.mojom.h" #endif -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "components/os_crypt/os_crypt_switches.h" #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "media/capture/capture_switches.h" #endif @@ -68,7 +69,7 @@ UtilityProcessHost::UtilityProcessHost(std::unique_ptr<Client> client) : sandbox_type_(sandbox::mojom::Sandbox::kUtility), -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) child_flags_(ChildProcessHost::CHILD_ALLOW_SELF), #else child_flags_(ChildProcessHost::CHILD_NORMAL), @@ -99,7 +100,7 @@ return process_->GetData(); } -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) void UtilityProcessHost::SetEnv(const base::EnvironmentMap& env) { env_ = env; } @@ -171,7 +172,7 @@ bool has_cmd_prefix = browser_command_line.HasSwitch(switches::kUtilityCmdPrefix); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // readlink("/prof/self/exe") sometimes fails on Android at startup. // As a workaround skip calling it here, since the executable name is // not needed on Android anyway. See crbug.com/500854. @@ -182,10 +183,10 @@ process_->EnableWarmUpConnection(); } #else -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) if (sandbox_type_ == sandbox::mojom::Sandbox::kServiceWithJit) DCHECK_EQ(child_flags_, ChildProcessHost::CHILD_RENDERER); -#endif // defined(OS_MAC) +#endif // BUILDFLAG(IS_MAC) int child_flags = child_flags_; // When running under gdb, forking /proc/self/exe ends up forking the gdb @@ -214,9 +215,9 @@ std::string locale = GetContentClient()->browser()->GetApplicationLocale(); cmd_line->AppendSwitchASCII(switches::kLang, locale); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) cmd_line->AppendArg(switches::kPrefetchArgumentOther); -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) sandbox::policy::SetCommandLineFlagsForSandboxType(cmd_line.get(), sandbox_type_); @@ -231,10 +232,10 @@ network::switches::kLogNetLog, network::switches::kNetLogCaptureMode, sandbox::policy::switches::kNoSandbox, -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) switches::kDisableDevShmUsage, #endif -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) sandbox::policy::switches::kEnableSandboxLogging, os_crypt::switches::kUseMockKeychain, #endif @@ -261,7 +262,7 @@ switches::kUseGL, switches::kV, switches::kVModule, -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) switches::kEnableReachedCodeProfiler, switches::kReachedCodeSamplingIntervalUs, #endif @@ -273,15 +274,15 @@ switches::kFailAudioStreamCreation, switches::kMuteAudio, switches::kUseFileForFakeAudioCapture, -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_FREEBSD) || \ - defined(OS_SOLARIS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FREEBSD) || \ + BUILDFLAG(IS_SOLARIS) switches::kAlsaInputDevice, switches::kAlsaOutputDevice, #endif #if defined(USE_CRAS) switches::kUseCras, #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) switches::kDisableHighResTimer, switches::kEnableExclusiveAudio, switches::kForceWaveAudio, @@ -293,7 +294,7 @@ #endif network::switches::kUseFirstPartySet, network::switches::kIpAddressSpaceOverrides, -#if defined(OS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) switches::kSchedulerBoostUrgent, #endif }; @@ -313,7 +314,7 @@ for (const auto& extra_switch : extra_switches_) cmd_line->AppendSwitch(extra_switch); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) if (base::FeatureList::IsEnabled( media::kMediaFoundationD3D11VideoCapture)) { // MediaFoundationD3D11VideoCapture requires Gpu memory buffers, @@ -362,7 +363,7 @@ // Take ownership of |client_| so the destructor doesn't notify it of // termination. auto client = std::move(client_); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // OnProcessCrashed() is always called on Android even in the case of normal // process termination. |clean_exit| gives us a reliable indication of whether // this was really a crash or just normal termination.
diff --git a/content/browser/utility_process_host.h b/content/browser/utility_process_host.h index 576d8b5..b5784b7 100644 --- a/content/browser/utility_process_host.h +++ b/content/browser/utility_process_host.h
@@ -86,7 +86,7 @@ // Returns information about the utility child process. const ChildProcessData& GetData(); -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) void SetEnv(const base::EnvironmentMap& env); #endif
diff --git a/content/browser/utility_process_host_browsertest.cc b/content/browser/utility_process_host_browsertest.cc index 6ecfcd3..6f47e7e 100644 --- a/content/browser/utility_process_host_browsertest.cc +++ b/content/browser/utility_process_host_browsertest.cc
@@ -24,15 +24,15 @@ #include "content/public/test/test_service.mojom.h" #include "mojo/public/cpp/bindings/remote.h" -#if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #include <sys/wait.h> #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <windows.h> #include "sandbox/policy/mojom/sandbox.mojom.h" #include "sandbox/win/src/sandbox_types.h" -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) namespace content { @@ -59,7 +59,7 @@ host->SetName(u"TestProcess"); host->SetMetricsName(kTestProcessName); if (fail_launch) { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // The Windows sandbox does not like the child process being a different // process, so launch unsandboxed for the purpose of this test. host->SetSandboxType(sandbox::mojom::Sandbox::kNoSandbox); @@ -70,7 +70,7 @@ switches::kBrowserSubprocessPath, base::FilePath(FILE_PATH_LITERAL("non_existent_path"))); } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) if (elevated) host->SetSandboxType( sandbox::mojom::Sandbox::kNoSandboxAndElevatedPrivileges); @@ -131,7 +131,7 @@ const ChildProcessData& data, const ChildProcessTerminationInfo& info) override { DCHECK_CURRENTLY_ON(BrowserThread::UI); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Android does not send crash notifications but sends kills. See comment in // browser_child_process_observer.h. BrowserChildProcessCrashed(data, info); @@ -144,9 +144,9 @@ const ChildProcessData& data, const ChildProcessTerminationInfo& info) override { DCHECK_CURRENTLY_ON(BrowserThread::UI); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) EXPECT_EQ(EXCEPTION_BREAKPOINT, static_cast<DWORD>(info.exit_code)); -#elif defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) EXPECT_TRUE(WIFSIGNALED(info.exit_code)); EXPECT_EQ(SIGTRAP, WTERMSIG(info.exit_code)); #endif @@ -162,7 +162,7 @@ const ChildProcessTerminationInfo& info) override { DCHECK_CURRENTLY_ON(BrowserThread::UI); EXPECT_EQ(info.status, base::TERMINATION_STATUS_LAUNCH_FAILED); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // On Windows, the sandbox code handles all non-elevated process launches. EXPECT_EQ(sandbox::SBOX_ERROR_CANNOT_LAUNCH_UNSANDBOXED_PROCESS, info.exit_code); @@ -193,13 +193,13 @@ // TERMINATION_STATUS_ABNORMAL_TERMINATION of the forked process. However, // posix_spawn() is used on macOS. // See also ServiceProcessLauncherTest.FailToLaunchProcess. -#if !defined(OS_POSIX) || defined(OS_MAC) +#if !BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_MAC) IN_PROC_BROWSER_TEST_F(UtilityProcessHostBrowserTest, FailToLaunchProcess) { RunUtilityProcess(/*elevated=*/false, /*crash=*/false, /*fail_launch=*/true); } -#endif // !defined(OS_POSIX) || defined(OS_MAC) +#endif // !BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_MAC) -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) IN_PROC_BROWSER_TEST_F(UtilityProcessHostBrowserTest, LaunchElevatedProcess) { RunUtilityProcess(/*elevated=*/true, /*crash=*/false, /*fail_launch=*/false); } @@ -209,6 +209,6 @@ DISABLED_LaunchElevatedProcessAndCrash) { RunUtilityProcess(/*elevated=*/true, /*crash=*/true, /*fail_launch=*/false); } -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) } // namespace content
diff --git a/content/browser/utility_process_host_receiver_bindings.cc b/content/browser/utility_process_host_receiver_bindings.cc index e710646..475cf80 100644 --- a/content/browser/utility_process_host_receiver_bindings.cc +++ b/content/browser/utility_process_host_receiver_bindings.cc
@@ -10,7 +10,7 @@ #include "content/public/browser/content_browser_client.h" #include "content/public/common/content_client.h" -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #include "components/services/font/public/mojom/font_service.mojom.h" // nogncheck #include "content/browser/font_service.h" // nogncheck #endif @@ -19,7 +19,7 @@ void UtilityProcessHost::BindHostReceiver( mojo::GenericPendingReceiver receiver) { -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) if (auto font_receiver = receiver.As<font_service::mojom::FontService>()) { ConnectToFontService(std::move(font_receiver)); return;
diff --git a/content/browser/utility_process_sandbox_browsertest.cc b/content/browser/utility_process_sandbox_browsertest.cc index 35ca5a4c..59166a6 100644 --- a/content/browser/utility_process_sandbox_browsertest.cc +++ b/content/browser/utility_process_sandbox_browsertest.cc
@@ -49,7 +49,7 @@ // These sandbox types can't be spawned in a utility process. if (t == Sandbox::kRenderer || t == Sandbox::kGpu) continue; -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) if (t == Sandbox::kZygoteIntermediateSandbox) continue; #endif
diff --git a/content/browser/utility_sandbox_delegate.cc b/content/browser/utility_sandbox_delegate.cc index eb2de49c..7c0e15ae 100644 --- a/content/browser/utility_sandbox_delegate.cc +++ b/content/browser/utility_sandbox_delegate.cc
@@ -30,7 +30,7 @@ const base::EnvironmentMap& env, const base::CommandLine& cmd_line) : -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) env_(env), #endif sandbox_type_(sandbox_type), @@ -38,7 +38,7 @@ #if DCHECK_IS_ON() bool supported_sandbox_type = sandbox_type_ == sandbox::mojom::Sandbox::kNoSandbox || -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) sandbox_type_ == sandbox::mojom::Sandbox::kNoSandboxAndElevatedPrivileges || sandbox_type_ == sandbox::mojom::Sandbox::kXrCompositing || @@ -47,7 +47,7 @@ sandbox_type_ == sandbox::mojom::Sandbox::kMediaFoundationCdm || sandbox_type_ == sandbox::mojom::Sandbox::kWindowsSystemProxyResolver || #endif -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) sandbox_type_ == sandbox::mojom::Sandbox::kMirroring || #endif sandbox_type_ == sandbox::mojom::Sandbox::kUtility || @@ -62,7 +62,7 @@ #if BUILDFLAG(ENABLE_PLUGINS) sandbox_type_ == sandbox::mojom::Sandbox::kPpapi || #endif -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) sandbox_type_ == sandbox::mojom::Sandbox::kVideoCapture || #endif #if BUILDFLAG(IS_CHROMEOS_ASH) @@ -87,11 +87,11 @@ return sandbox_type_; } -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) base::EnvironmentMap UtilitySandboxedProcessLauncherDelegate::GetEnvironment() { return env_; } -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) #if BUILDFLAG(USE_ZYGOTE_HANDLE) ZygoteHandle UtilitySandboxedProcessLauncherDelegate::GetZygote() {
diff --git a/content/browser/utility_sandbox_delegate.h b/content/browser/utility_sandbox_delegate.h index ceddb4f..ee6ec3a9 100644 --- a/content/browser/utility_sandbox_delegate.h +++ b/content/browser/utility_sandbox_delegate.h
@@ -16,9 +16,9 @@ #include "content/common/zygote/zygote_handle_impl_linux.h" #endif // BUILDFLAG(USE_ZYGOTE_HANDLE) -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "sandbox/win/src/sandbox_policy.h" -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) namespace content { class UtilitySandboxedProcessLauncherDelegate @@ -31,27 +31,27 @@ sandbox::mojom::Sandbox GetSandboxType() override; -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) bool GetAppContainerId(std::string* appcontainer_id) override; bool DisableDefaultPolicy() override; bool ShouldLaunchElevated() override; bool PreSpawnTarget(sandbox::TargetPolicy* policy) override; bool ShouldUnsandboxedRunInJob() override; bool CetCompatible() override; -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) #if BUILDFLAG(USE_ZYGOTE_HANDLE) ZygoteHandle GetZygote() override; #endif // BUILDFLAG(USE_ZYGOTE_HANDLE) -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) base::EnvironmentMap GetEnvironment() override; -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) private: -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) base::EnvironmentMap env_; -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) sandbox::mojom::Sandbox sandbox_type_; base::CommandLine cmd_line_; };
diff --git a/content/browser/v8_snapshot_files.cc b/content/browser/v8_snapshot_files.cc index 0ee3961..cb0af39 100644 --- a/content/browser/v8_snapshot_files.cc +++ b/content/browser/v8_snapshot_files.cc
@@ -10,7 +10,7 @@ namespace content { std::map<std::string, base::FilePath> GetV8SnapshotFilesToPreload() { -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #if defined(USE_V8_CONTEXT_SNAPSHOT) return {{kV8ContextSnapshotDataDescriptor, base::FilePath(FILE_PATH_LITERAL(V8_CONTEXT_SNAPSHOT_FILENAME))}}; @@ -18,7 +18,7 @@ return {{kV8SnapshotDataDescriptor, base::FilePath(FILE_PATH_LITERAL("snapshot_blob.bin"))}}; #endif -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) #if !defined(USE_V8_CONTEXT_SNAPSHOT) return {{kV8Snapshot64DataDescriptor, base::FilePath(FILE_PATH_LITERAL("assets/snapshot_blob_64.bin"))},
diff --git a/content/browser/video_capture_service.cc b/content/browser/video_capture_service.cc index 55d8684..62a762e 100644 --- a/content/browser/video_capture_service.cc +++ b/content/browser/video_capture_service.cc
@@ -22,7 +22,7 @@ #include "services/video_capture/public/uma/video_capture_service_event.h" #include "services/video_capture/video_capture_service_impl.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #define CREATE_IN_PROCESS_TASK_RUNNER base::ThreadPool::CreateCOMSTATaskRunner #else #define CREATE_IN_PROCESS_TASK_RUNNER \ @@ -110,7 +110,7 @@ std::move(receiver), ServiceProcessHost::Options() .WithDisplayName("Video Capture") -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) // On Mac, the service requires a CFRunLoop which is provided by a // UI message loop. See https://crbug.com/834581. .WithExtraCommandLineSwitches({switches::kMessageLoopTypeUi}) @@ -123,7 +123,7 @@ #endif .Pass()); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // On Android, we do not use automatic service shutdown, because when // shutting down the service, we lose caching of the supported formats, // and re-querying these can take several seconds on certain Android @@ -139,7 +139,7 @@ remote->reset(); }, &remote)); -#endif // !defined(OS_ANDROID) +#endif // !BUILDFLAG(IS_ANDROID) // Make sure the Remote is also reset in case of e.g. service crash so we // can restart it as needed.
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc index 04dde6d..3fd27543 100644 --- a/content/browser/web_contents/web_contents_impl_unittest.cc +++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -582,7 +582,7 @@ // Similar coverage when BFCache is on can be found in // BackForwardCacheBrowserTest.NavigateBackForwardRepeatedly. contents()->GetController().GetBackForwardCache().DisableForTesting( - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); TestRenderFrameHost* orig_rfh = main_test_rfh(); int orig_rvh_delete_count = 0; @@ -1170,7 +1170,7 @@ // back navigations can be stopped at ReadyToCommit timing. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const bool will_change_site_instance = IsProactivelySwapBrowsingInstanceOnSameSiteNavigationEnabled(); // Start with a web ui page, which gets a new RVH with WebUI bindings. @@ -1301,7 +1301,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const bool will_change_site_instance = IsProactivelySwapBrowsingInstanceOnSameSiteNavigationEnabled(); // This test assumes no interaction with the back/forward cache. Indeed, it @@ -1309,7 +1309,7 @@ // ReadyToCommit and Commit of the first back/forward cache one. Both steps // are combined with it, nothing can happen in between. contents()->GetController().GetBackForwardCache().DisableForTesting( - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); // Start with a web ui page, which gets a new RFH with WebUI bindings. GURL url1(std::string(kChromeUIScheme) + "://" +
diff --git a/content/browser/web_contents/web_contents_observer_browsertest.cc b/content/browser/web_contents/web_contents_observer_browsertest.cc index 54cc67e..3922bb0 100644 --- a/content/browser/web_contents/web_contents_observer_browsertest.cc +++ b/content/browser/web_contents/web_contents_observer_browsertest.cc
@@ -477,7 +477,7 @@ } // TODO(https://crbug.com/1288573): Flaky on Mac. -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #define MAYBE_CookieCallbacks_Subframe DISABLED_CookieCallbacks_Subframe #else #define MAYBE_CookieCallbacks_Subframe CookieCallbacks_Subframe
diff --git a/content/browser/web_package/signed_exchange_subresource_prefetch_browsertest.cc b/content/browser/web_package/signed_exchange_subresource_prefetch_browsertest.cc index 045e53a..03e4dff5 100644 --- a/content/browser/web_package/signed_exchange_subresource_prefetch_browsertest.cc +++ b/content/browser/web_package/signed_exchange_subresource_prefetch_browsertest.cc
@@ -705,7 +705,7 @@ } // Flaky on Linux TSan, http://crbug.com/1050879 -#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(THREAD_SANITIZER) +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(THREAD_SANITIZER) #define MAYBE_PrefetchMainResourceSXG_SignatureExpire \ DISABLED_PrefetchMainResourceSXG_SignatureExpire #else
diff --git a/content/browser/web_package/web_bundle_browsertest_base.cc b/content/browser/web_package/web_bundle_browsertest_base.cc index 7df52012..ec31fa0a 100644 --- a/content/browser/web_package/web_bundle_browsertest_base.cc +++ b/content/browser/web_package/web_bundle_browsertest_base.cc
@@ -18,9 +18,9 @@ #include "net/base/filename_util.h" #include "net/test/embedded_test_server/http_response.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/content_uri_utils.h" -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) namespace content { namespace web_bundle_browsertest_utils { @@ -33,7 +33,7 @@ .AppendASCII(file); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void CopyFileAndGetContentUri(const base::FilePath& file, GURL* content_uri, base::FilePath* new_file_path) { @@ -54,7 +54,7 @@ *new_file_path = temp_file; *content_uri = GURL(base::GetContentUriFromFilePath(temp_file).value()); } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) std::string ExecuteAndGetString(const ToRenderFrameHost& adapter, const std::string& script) { @@ -1074,7 +1074,7 @@ // back navigation will recreate the page. Disable back/forward cache to // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(web_contents, - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); NavigateAndWaitForTitle( web_contents, web_bundle_url, get_url_for_bundle.Run(url_origin.Resolve("/top-page/")), "Ready"); @@ -1264,7 +1264,7 @@ // back navigation will recreate the page. Disable back/forward cache to // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(web_contents, - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); NavigateAndWaitForTitle( web_contents, web_bundle_url, get_url_for_bundle.Run(url_origin.Resolve("/top-page/")), "Ready");
diff --git a/content/browser/web_package/web_bundle_browsertest_base.h b/content/browser/web_package/web_bundle_browsertest_base.h index eee93141..05bd329 100644 --- a/content/browser/web_package/web_bundle_browsertest_base.h +++ b/content/browser/web_package/web_bundle_browsertest_base.h
@@ -48,11 +48,11 @@ base::FilePath GetTestDataPath(base::StringPiece file); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) void CopyFileAndGetContentUri(const base::FilePath& file, GURL* content_uri, base::FilePath* new_file_path); -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) std::string ExecuteAndGetString(const ToRenderFrameHost& adapter, const std::string& script); @@ -430,14 +430,14 @@ enum class TestFilePathMode { kNormalFilePath, -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) kContentURI, -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) }; // Adding web_bundle_browsertest_utils:: extra to the prefix so the files using // these directives outside of the namespace don't fail. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define TEST_FILE_PATH_MODE_PARAMS \ testing::Values( \ web_bundle_browsertest_utils::TestFilePathMode::kNormalFilePath, \ @@ -446,7 +446,7 @@ #define TEST_FILE_PATH_MODE_PARAMS \ testing::Values( \ web_bundle_browsertest_utils::TestFilePathMode::kNormalFilePath) -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) } // namespace web_bundle_browsertest_utils } // namespace content
diff --git a/content/browser/web_package/web_bundle_element_browsertest.cc b/content/browser/web_package/web_bundle_element_browsertest.cc index df9493d..8e2e316 100644 --- a/content/browser/web_package/web_bundle_element_browsertest.cc +++ b/content/browser/web_package/web_bundle_element_browsertest.cc
@@ -350,12 +350,12 @@ base::Lock lock_; }; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) // TODO(https://crbug.com/1263334): Flakes on macOS. #define MAYBE_ChangeLinkElementHref DISABLED_ChangeLinkElementHref #else #define MAYBE_ChangeLinkElementHref ChangeLinkElementHref -#endif // defined(OS_MAC) +#endif // BUILDFLAG(IS_MAC) IN_PROC_BROWSER_TEST_P(WebBundleElementBrowserTest, MAYBE_ChangeLinkElementHref) { // This test is only for the <link> element. @@ -407,12 +407,12 @@ EXPECT_EQ("\"webbundle loaded after change\"", message); } -#if defined(OS_MAC) || defined(OS_WIN) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) // TODO(https://crbug.com/1263334): Flakes on macOS and Windows. #define MAYBE_RemoveLinkElement DISABLED_RemoveLinkElement #else #define MAYBE_RemoveLinkElement RemoveLinkElement -#endif // defined(OS_MAC) +#endif IN_PROC_BROWSER_TEST_P(WebBundleElementBrowserTest, MAYBE_RemoveLinkElement) { // This test is only for the <link> element. if (GetElementType() == ElementType::Script)
diff --git a/content/browser/web_package/web_bundle_file_browsertest.cc b/content/browser/web_package/web_bundle_file_browsertest.cc index 0d395ac..2a584e5 100644 --- a/content/browser/web_package/web_bundle_file_browsertest.cc +++ b/content/browser/web_package/web_bundle_file_browsertest.cc
@@ -4,6 +4,7 @@ #include "base/files/file_util.h" #include "base/test/scoped_feature_list.h" +#include "build/build_config.h" #include "content/browser/web_package/web_bundle_browsertest_base.h" #include "content/browser/web_package/web_bundle_utils.h" @@ -32,12 +33,12 @@ web_bundle_browsertest_utils::TestFilePathMode::kNormalFilePath) { content_uri = net::FilePathToFileURL(file_path); } else { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) DCHECK_EQ(web_bundle_browsertest_utils::TestFilePathMode::kContentURI, GetParam()); web_bundle_browsertest_utils::CopyFileAndGetContentUri( file_path, &content_uri, nullptr /* new_file_path */); -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) } return content_uri; } @@ -189,7 +190,7 @@ } // TODO(https://crbug.com/1225178): flaky -#if defined(OS_LINUX) +#if BUILDFLAG(IS_LINUX) #define MAYBE_InvalidWebBundleFile DISABLED_InvalidWebBundleFile #else #define MAYBE_InvalidWebBundleFile InvalidWebBundleFile @@ -209,7 +210,7 @@ } // TODO(https://crbug.com/1225178): flaky -#if defined(OS_LINUX) +#if BUILDFLAG(IS_LINUX) #define MAYBE_ResponseParseErrorInMainResource \ DISABLED_ResponseParseErrorInMainResource #else @@ -306,8 +307,8 @@ } // TODO(https://crbug.com/1225178): flaky -#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_ANDROID) || \ - defined(OS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || \ + BUILDFLAG(IS_MAC) #define MAYBE_ParseMetadataCrash DISABLED_ParseMetadataCrash #else #define MAYBE_ParseMetadataCrash ParseMetadataCrash @@ -330,7 +331,7 @@ } // TODO(https://crbug.com/1225178): flaky -#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) #define MAYBE_ParseResponseCrash DISABLED_ParseResponseCrash #else #define MAYBE_ParseResponseCrash ParseResponseCrash @@ -464,7 +465,7 @@ } // TODO(https://crbug.com/1225178): flaky -#if defined(OS_LINUX) +#if BUILDFLAG(IS_LINUX) #define MAYBE_NoPrimaryURLFound DISABLED_NoPrimaryURLFound #else #define MAYBE_NoPrimaryURLFound NoPrimaryURLFound
diff --git a/content/browser/web_package/web_bundle_network_browsertest.cc b/content/browser/web_package/web_bundle_network_browsertest.cc index cc4d7d5..e2997f6 100644 --- a/content/browser/web_package/web_bundle_network_browsertest.cc +++ b/content/browser/web_package/web_bundle_network_browsertest.cc
@@ -400,7 +400,7 @@ } // https://crbug.com/1219373 fails with BFCache field trial testing config. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_IframeNavigation DISABLED_IframeNavigation #else #define MAYBE_IframeNavigation IframeNavigation @@ -427,7 +427,7 @@ } // https://crbug.com/1219373 fails with BFCache field trial testing config. -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_IframeSameDocumentNavigation DISABLED_IframeSameDocumentNavigation #else #define MAYBE_IframeSameDocumentNavigation IframeSameDocumentNavigation @@ -513,7 +513,7 @@ // back navigation will recreate the page. Disable back/forward cache to // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const std::string wbn_path = "/web_bundle/test.wbn"; const std::string primary_url_path = "/web_bundle/test.html"; RegisterRequestHandler(wbn_path); @@ -547,7 +547,7 @@ // back navigation will recreate the page. Disable back/forward cache to // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const std::string wbn_path = "/web_bundle/test.wbn"; const std::string primary_url_path = "/web_bundle/test.html"; RegisterRequestHandler(wbn_path); @@ -582,7 +582,7 @@ // back navigation will recreate the page. Disable back/forward cache to // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const std::string wbn_path = "/web_bundle/test.wbn"; const std::string primary_url_path = "/web_bundle/test.html"; RegisterRequestHandler(wbn_path); @@ -615,7 +615,7 @@ // The test assumes the previous page gets deleted after navigation. Disable // back/forward cache to ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const std::string wbn_path = "/web_bundle/test.wbn"; const std::string primary_url_path = "/web_bundle/test.html"; RegisterRequestHandler(wbn_path); @@ -643,7 +643,7 @@ // back navigation will recreate the page. Disable back/forward cache to // ensure that it doesn't get preserved in the cache. DisableBackForwardCacheForTesting(shell()->web_contents(), - BackForwardCache::TEST_ASSUMES_NO_CACHING); + BackForwardCache::TEST_REQUIRES_NO_CACHING); const std::string wbn_path = "/web_bundle/test.wbn"; const std::string primary_url_path = "/web_bundle/test.html"; const std::string alt_primary_url_path = "/web_bundle/alt.html";
diff --git a/content/browser/web_package/web_bundle_source.cc b/content/browser/web_package/web_bundle_source.cc index 10a5257..bb25bd7 100644 --- a/content/browser/web_package/web_bundle_source.cc +++ b/content/browser/web_package/web_bundle_source.cc
@@ -12,7 +12,7 @@ #include "net/base/url_util.h" #include "url/gurl.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "base/android/content_uri_utils.h" #endif @@ -21,7 +21,7 @@ // static std::unique_ptr<WebBundleSource> WebBundleSource::MaybeCreateFromTrustedFileUrl( const GURL& url) { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) if (url.SchemeIs(url::kContentScheme)) { const base::FilePath file_path = base::FilePath(url.spec()); return base::WrapUnique( @@ -45,7 +45,7 @@ return base::WrapUnique(new WebBundleSource(Type::kFile, file_path, url)); } } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) if (url.SchemeIs(url::kContentScheme)) { return base::WrapUnique( new WebBundleSource(Type::kFile, base::FilePath(url.spec()), url)); @@ -71,7 +71,7 @@ std::unique_ptr<base::File> WebBundleSource::OpenFile() const { DCHECK(!file_path_.empty()); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) if (file_path_.IsContentUri()) { return std::make_unique<base::File>( base::OpenContentUriForRead(file_path_));
diff --git a/content/browser/web_package/web_bundle_trustable_file_browsertest.cc b/content/browser/web_package/web_bundle_trustable_file_browsertest.cc index e367630..0943cd1 100644 --- a/content/browser/web_package/web_bundle_trustable_file_browsertest.cc +++ b/content/browser/web_package/web_bundle_trustable_file_browsertest.cc
@@ -4,6 +4,7 @@ #include "base/files/file_util.h" #include "base/memory/raw_ptr.h" +#include "build/build_config.h" #include "content/browser/web_package/web_bundle_browsertest_base.h" #include "content/browser/web_package/web_bundle_utils.h" #include "content/public/common/content_client.h" @@ -130,12 +131,12 @@ test_data_url_ = net::FilePathToFileURL(file_path); return; } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) DCHECK_EQ(web_bundle_browsertest_utils::TestFilePathMode::kContentURI, GetParam()); web_bundle_browsertest_utils::CopyFileAndGetContentUri( file_path, &test_data_url_, &test_data_file_path_); -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) } GURL test_data_url_; @@ -192,7 +193,7 @@ &web_bundle_browsertest_utils::RunSameDocumentNavigationTest); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_IframeNavigation DISABLED_IframeNavigation #else #define MAYBE_IframeNavigation IframeNavigation @@ -219,7 +220,7 @@ RunIframeParentInitiatedOutOfBundleNavigationTest); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #define MAYBE_IframeSameDocumentNavigation DISABLED_IframeSameDocumentNavigation #else #define MAYBE_IframeSameDocumentNavigation IframeSameDocumentNavigation @@ -290,7 +291,7 @@ } // TODO(https://crbug.com/1225178): flaky -#if defined(OS_LINUX) +#if BUILDFLAG(IS_LINUX) #define MAYBE_NoPrimaryURLFound DISABLED_NoPrimaryURLFound #else #define MAYBE_NoPrimaryURLFound NoPrimaryURLFound @@ -346,7 +347,7 @@ }; // TODO(https://crbug.com/1227439): flaky -#if defined(OS_LINUX) +#if BUILDFLAG(IS_LINUX) #define MAYBE_NotFound DISABLED_NotFound #else #define MAYBE_NotFound NotFound
diff --git a/content/browser/web_package/web_bundle_utils.cc b/content/browser/web_package/web_bundle_utils.cc index e1f7608..25f3022 100644 --- a/content/browser/web_package/web_bundle_utils.cc +++ b/content/browser/web_package/web_bundle_utils.cc
@@ -17,9 +17,9 @@ #include "third_party/blink/public/mojom/devtools/console_message.mojom.h" #include "url/gurl.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "url/url_constants.h" -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) namespace content { namespace web_bundle_utils { @@ -62,10 +62,10 @@ bool IsSupportedFileScheme(const GURL& url) { if (url.SchemeIsFile()) return true; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) if (url.SchemeIs(url::kContentScheme)) return true; -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) return false; }
diff --git a/content/browser/worker_network_isolation_key_browsertest.cc b/content/browser/worker_network_isolation_key_browsertest.cc index a49f616f..04bcf508 100644 --- a/content/browser/worker_network_isolation_key_browsertest.cc +++ b/content/browser/worker_network_isolation_key_browsertest.cc
@@ -23,7 +23,7 @@ namespace { bool SupportsSharedWorker() { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // SharedWorkers are not enabled on Android. https://crbug.com/154571 return false; #else
diff --git a/content/browser/zoom_browsertest.cc b/content/browser/zoom_browsertest.cc index 30d886c..511a2f7 100644 --- a/content/browser/zoom_browsertest.cc +++ b/content/browser/zoom_browsertest.cc
@@ -431,7 +431,7 @@ } // Flaky on mac, https://crbug.com/1055282 -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #define MAYBE_SiblingFramesZoom DISABLED_SiblingFramesZoom #else #define MAYBE_SiblingFramesZoom SiblingFramesZoom
diff --git a/content/browser/zygote_host/zygote_host_impl_linux.cc b/content/browser/zygote_host/zygote_host_impl_linux.cc index a6328930..43446957 100644 --- a/content/browser/zygote_host/zygote_host_impl_linux.cc +++ b/content/browser/zygote_host/zygote_host_impl_linux.cc
@@ -216,7 +216,7 @@ return pid; } -#if !defined(OS_OPENBSD) +#if !BUILDFLAG(IS_OPENBSD) void ZygoteHostImpl::AdjustRendererOOMScore(base::ProcessHandle pid, int score) { // 1) You can't change the oom_score_adj of a non-dumpable process
diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc index c5d6d369..051f559 100644 --- a/content/ppapi_plugin/ppapi_plugin_main.cc +++ b/content/ppapi_plugin/ppapi_plugin_main.cc
@@ -71,9 +71,11 @@ #if BUILDFLAG(IS_WIN) // https://crbug.com/1139752 Premature unload of shell32 caused process to - // crash during process shutdown. - HMODULE shell32_pin = ::LoadLibrary(L"shell32.dll"); - UNREFERENCED_PARAMETER(shell32_pin); + // crash during process shutdown. Fixed in Windows 11. + if (base::win::GetVersion() < base::win::Version::WIN11) { + HMODULE shell32_pin = ::LoadLibrary(L"shell32.dll"); + UNREFERENCED_PARAMETER(shell32_pin); + } g_target_services = parameters.sandbox_info->target_services; #endif
diff --git a/content/public/browser/back_forward_cache.h b/content/public/browser/back_forward_cache.h index bfb018f5..a0d0222c 100644 --- a/content/public/browser/back_forward_cache.h +++ b/content/public/browser/back_forward_cache.h
@@ -24,9 +24,6 @@ // Not all documents can or will be cached. You should not assume a document // will be cached. // -// WARNING: This code is still experimental and might completely go away. -// Please get in touch with bfcache-dev@chromium.org if you intend to use it. -// // All methods of this class should be called from the UI thread. class CONTENT_EXPORT BackForwardCache { public: @@ -106,10 +103,14 @@ // into two tests, one using a cacheable page, and one using an uncacheable // page. // - // Once BackForwardCache is enabled everywhere, any tests still disabled for - // this reason should change their expectations to permanently match the - // BackForwardCache enabled behavior. - TEST_ASSUMES_NO_CACHING, + // Even though BackForwardCache is already enabled by default, it is not + // guaranteed to preserve and cache the previous document on every + // navigation, and even if it does, it is still possible for a cached + // document to get discarded without it ever getting restored, so not every + // history navigation will restore a document from the back/forward cache. + // Thus, testing cases where a document does not get preserved and cached + // on navigation or not restored on history navigation is completely valid. + TEST_REQUIRES_NO_CACHING, // Unload events never fire for documents that are put into the // BackForwardCache. This is by design, as there is never an appropriate
diff --git a/content/public/browser/browsing_data_remover.h b/content/public/browser/browsing_data_remover.h index 1fbb75c..cb9b7a8d 100644 --- a/content/public/browser/browsing_data_remover.h +++ b/content/public/browser/browsing_data_remover.h
@@ -111,8 +111,13 @@ // (https://github.com/WICG/conversion-measurement-api) persistent storage. DATA_TYPE_CONVERSIONS = 1 << 17, + // Aggregation Service + // (https://github.com/WICG/conversion-measurement-api/blob/main/AGGREGATE.md#data-processing-through-the-aggregation-service) + // persistent storage. + DATA_TYPE_AGGREGATION_SERVICE = 1 << 18, + // Embedders can add more datatypes beyond this point. - DATA_TYPE_CONTENT_END = DATA_TYPE_CONVERSIONS, + DATA_TYPE_CONTENT_END = DATA_TYPE_AGGREGATION_SERVICE, }; enum OriginType : uint64_t {
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc index 92da6ae..2579cf2 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc
@@ -464,9 +464,10 @@ } bool ContentBrowserClient::IsInterestGroupAPIAllowed( - content::BrowserContext* browser_context, + content::RenderFrameHost* render_frame_host, + InterestGroupApiOperation operation, const url::Origin& top_frame_origin, - const GURL& api_url) { + const url::Origin& api_origin) { return false; }
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 0fdf74e..7d3fafd5 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h
@@ -793,13 +793,17 @@ // "1812:e, 00001800-0000-1000-8000-00805f9b34fb:w, ignored:1, alsoignored." virtual std::string GetWebBluetoothBlocklist(); - // Returns whether the interest group API is allowed anywhere in - // |browser_context|. Returns false if the interest group API is not allowed - // by default on any origin. + // The possible operations performable by parties related to the Interest + // Group API. + enum class InterestGroupApiOperation { kJoin, kLeave, kUpdate, kSell, kBuy }; + + // Returns whether |api_origin| on |top_frame_origin| can perform + // |operation| within the interest group API. virtual bool IsInterestGroupAPIAllowed( - content::BrowserContext* browser_context, + content::RenderFrameHost* render_frame_host, + InterestGroupApiOperation operation, const url::Origin& top_frame_origin, - const GURL& api_url); + const url::Origin& api_origin); enum class ConversionMeasurementOperation { kImpression,
diff --git a/content/public/browser/storage_partition.h b/content/public/browser/storage_partition.h index 2388801..4abf8c89 100644 --- a/content/public/browser/storage_partition.h +++ b/content/public/browser/storage_partition.h
@@ -177,6 +177,7 @@ // Public explainer here: // https://github.com/WICG/turtledove/blob/main/FLEDGE.md REMOVE_DATA_MASK_INTEREST_GROUPS = 1 << 12, + REMOVE_DATA_MASK_AGGREGATION_SERVICE = 1 << 13, REMOVE_DATA_MASK_ALL = 0xFFFFFFFF, // Corresponds to storage::kStorageTypeTemporary.
diff --git a/content/public/common/url_utils.cc b/content/public/common/url_utils.cc index 70b0807..f5d4af9 100644 --- a/content/public/common/url_utils.cc +++ b/content/public/common/url_utils.cc
@@ -52,7 +52,7 @@ if (blink::IsRendererDebugURL(url)) return false; - // For you information, even though a "data:" url doesn't generate actual + // For your information, even though a "data:" url doesn't generate actual // network requests, it is handled by the network stack and so must return // true. The reason is that a few "data:" urls can't be handled locally. For // instance:
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h index 28e22ce..a92e09d 100644 --- a/content/public/renderer/render_frame_observer.h +++ b/content/public/renderer/render_frame_observer.h
@@ -218,9 +218,7 @@ virtual void DidObserveLayoutNg(uint32_t all_block_count, uint32_t ng_block_count, uint32_t all_call_count, - uint32_t ng_call_count, - uint32_t flexbox_ng_block_count, - uint32_t grid_ng_block_count) {} + uint32_t ng_call_count) {} // Reports lazy loaded behavior when the frame or image is fully deferred or // if the frame or image is loaded after being deferred by lazy load.
diff --git a/content/public/test/dump_accessibility_test_helper.cc b/content/public/test/dump_accessibility_test_helper.cc index 2276d45f..98dd298 100644 --- a/content/public/test/dump_accessibility_test_helper.cc +++ b/content/public/test/dump_accessibility_test_helper.cc
@@ -275,10 +275,10 @@ const std::vector<std::string>& expected_lines) { // Output the test path to help anyone who encounters a failure and needs // to know where to look. - LOG(INFO) << "Testing: " - << test_file_path.NormalizePathSeparatorsTo('/').LossyDisplayName(); - LOG(INFO) << "Expected output: " - << expected_file.NormalizePathSeparatorsTo('/').LossyDisplayName(); + VLOG(1) << "Testing: " + << test_file_path.NormalizePathSeparatorsTo('/').LossyDisplayName(); + VLOG(1) << "Expected output: " + << expected_file.NormalizePathSeparatorsTo('/').LossyDisplayName(); // Perform a diff (or write the initial baseline). std::vector<int> diff_lines = DiffLines(expected_lines, actual_lines); @@ -309,9 +309,9 @@ // the end of the file when parsing the actual output from remote logs. diff += kMarkEndOfFile; diff += "\n"; - LOG(ERROR) << "Diff:\n" << diff; + VLOG(1) << "Diff:\n" << diff; } else { - LOG(INFO) << "Test output matches expectations."; + VLOG(1) << "Test output matches expectations."; } if (base::CommandLine::ForCurrentProcess()->HasSwitch(
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 1fd6d17..5b0d4184 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -4444,13 +4444,10 @@ void RenderFrameImpl::DidObserveLayoutNg(uint32_t all_block_count, uint32_t ng_block_count, uint32_t all_call_count, - uint32_t ng_call_count, - uint32_t flexbox_ng_block_count, - uint32_t grid_ng_block_count) { + uint32_t ng_call_count) { for (auto& observer : observers_) observer.DidObserveLayoutNg(all_block_count, ng_block_count, all_call_count, - ng_call_count, flexbox_ng_block_count, - grid_ng_block_count); + ng_call_count); } void RenderFrameImpl::DidObserveLazyLoadBehavior(
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h index 57caa4c..ed5cb44 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h
@@ -590,9 +590,7 @@ void DidObserveLayoutNg(uint32_t all_block_count, uint32_t ng_block_count, uint32_t all_call_count, - uint32_t ng_call_count, - uint32_t flexbox_ng_block_count, - uint32_t grid_ng_block_count) override; + uint32_t ng_call_count) override; void DidObserveLazyLoadBehavior( blink::WebLocalFrameClient::LazyLoadBehavior lazy_load_behavior) override; void DidCreateScriptContext(v8::Local<v8::Context> context,
diff --git a/content/test/data/gpu/filter_effects.html b/content/test/data/gpu/filter_effects.html index e761d7a..5f733ab2 100644 --- a/content/test/data/gpu/filter_effects.html +++ b/content/test/data/gpu/filter_effects.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_browser_plugin.html b/content/test/data/gpu/pixel_browser_plugin.html index 615f07e..c7874aa6 100644 --- a/content/test/data/gpu/pixel_browser_plugin.html +++ b/content/test/data/gpu/pixel_browser_plugin.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Browser Plugin Compositing Test: Projected Blue Box over Black Background</title>
diff --git a/content/test/data/gpu/pixel_canvas2d.html b/content/test/data/gpu/pixel_canvas2d.html index adffbf2..73924a9 100644 --- a/content/test/data/gpu/pixel_canvas2d.html +++ b/content/test/data/gpu/pixel_canvas2d.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Canvas 2D Test: Red Box over Black Background</title>
diff --git a/content/test/data/gpu/pixel_canvas2d_accelerated.html b/content/test/data/gpu/pixel_canvas2d_accelerated.html index 3214951..3d21886 100644 --- a/content/test/data/gpu/pixel_canvas2d_accelerated.html +++ b/content/test/data/gpu/pixel_canvas2d_accelerated.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Accelerated Canvas 2D Test: Red Box over Black Background</title>
diff --git a/content/test/data/gpu/pixel_canvas2d_tab_switch.html b/content/test/data/gpu/pixel_canvas2d_tab_switch.html index 646621ce..415bd37f 100644 --- a/content/test/data/gpu/pixel_canvas2d_tab_switch.html +++ b/content/test/data/gpu/pixel_canvas2d_tab_switch.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_canvas2d_webgl.html b/content/test/data/gpu/pixel_canvas2d_webgl.html index 38cc252..ac3be8e 100644 --- a/content/test/data/gpu/pixel_canvas2d_webgl.html +++ b/content/test/data/gpu/pixel_canvas2d_webgl.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Accelerated Retina Canvas 2D and WebGL Test: Red Box and Green Triangle over Black Background</title>
diff --git a/content/test/data/gpu/pixel_canvas_low_latency_2d.html b/content/test/data/gpu/pixel_canvas_low_latency_2d.html index 7ac907c..03a3843 100644 --- a/content/test/data/gpu/pixel_canvas_low_latency_2d.html +++ b/content/test/data/gpu/pixel_canvas_low_latency_2d.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Low Latency Canvas 2D Test: Green and blue box, over large red box, over black</title>
diff --git a/content/test/data/gpu/pixel_canvas_low_latency_2d_draw_image.html b/content/test/data/gpu/pixel_canvas_low_latency_2d_draw_image.html index 2126ceb..8b235b2 100644 --- a/content/test/data/gpu/pixel_canvas_low_latency_2d_draw_image.html +++ b/content/test/data/gpu/pixel_canvas_low_latency_2d_draw_image.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Low Latency 2D Canvas drawImage Test</title>
diff --git a/content/test/data/gpu/pixel_canvas_low_latency_2d_image_data.html b/content/test/data/gpu/pixel_canvas_low_latency_2d_image_data.html index 34eae12..3cad1ff 100644 --- a/content/test/data/gpu/pixel_canvas_low_latency_2d_image_data.html +++ b/content/test/data/gpu/pixel_canvas_low_latency_2d_image_data.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Low Latency 2D Canvas get/putImageData Test</title>
diff --git a/content/test/data/gpu/pixel_canvas_low_latency_webgl.html b/content/test/data/gpu/pixel_canvas_low_latency_webgl.html index a512de1..c8eb5e8 100644 --- a/content/test/data/gpu/pixel_canvas_low_latency_webgl.html +++ b/content/test/data/gpu/pixel_canvas_low_latency_webgl.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Low Latency WebGL Canvas Test: Should render a green box with an upward pointing white arrow</title>
diff --git a/content/test/data/gpu/pixel_canvas_low_latency_webgl_alpha_false.html b/content/test/data/gpu/pixel_canvas_low_latency_webgl_alpha_false.html index 0bfab4d1..154faeb 100644 --- a/content/test/data/gpu/pixel_canvas_low_latency_webgl_alpha_false.html +++ b/content/test/data/gpu/pixel_canvas_low_latency_webgl_alpha_false.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Low Latency Alpha False WebGL Canvas Test: Should render an opaque green box</title>
diff --git a/content/test/data/gpu/pixel_canvas_low_latency_webgl_draw_image.html b/content/test/data/gpu/pixel_canvas_low_latency_webgl_draw_image.html index f74cf0e..f9ee7eb 100644 --- a/content/test/data/gpu/pixel_canvas_low_latency_webgl_draw_image.html +++ b/content/test/data/gpu/pixel_canvas_low_latency_webgl_draw_image.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Low Latency WebGL Canvas drawImage Test</title>
diff --git a/content/test/data/gpu/pixel_canvas_low_latency_webgl_occluded.html b/content/test/data/gpu/pixel_canvas_low_latency_webgl_occluded.html index 20d457e..9f355d4 100644 --- a/content/test/data/gpu/pixel_canvas_low_latency_webgl_occluded.html +++ b/content/test/data/gpu/pixel_canvas_low_latency_webgl_occluded.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Low Latency WebGL Canvas Test: Should render diagonal green and blue boxes over red background</title>
diff --git a/content/test/data/gpu/pixel_css3d.html b/content/test/data/gpu/pixel_css3d.html index b8fdb782..79f70a8 100644 --- a/content/test/data/gpu/pixel_css3d.html +++ b/content/test/data/gpu/pixel_css3d.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>CSS 3D Test: Projected Blue Box over Black Background</title>
diff --git a/content/test/data/gpu/pixel_precision_rounded_corner.html b/content/test/data/gpu/pixel_precision_rounded_corner.html index 9fee047c..2995af3 100644 --- a/content/test/data/gpu/pixel_precision_rounded_corner.html +++ b/content/test/data/gpu/pixel_precision_rounded_corner.html
@@ -1,12 +1,5 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_video_backdrop_filter.html b/content/test/data/gpu/pixel_video_backdrop_filter.html index d284b861..7e2ab47 100644 --- a/content/test/data/gpu/pixel_video_backdrop_filter.html +++ b/content/test/data/gpu/pixel_video_backdrop_filter.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_video_mp4.html b/content/test/data/gpu/pixel_video_mp4.html index 574158f..6cd02d8 100644 --- a/content/test/data/gpu/pixel_video_mp4.html +++ b/content/test/data/gpu/pixel_video_mp4.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_video_mp4_four_colors_aspect_4x3.html b/content/test/data/gpu/pixel_video_mp4_four_colors_aspect_4x3.html index 4cba526bb..602aa58 100644 --- a/content/test/data/gpu/pixel_video_mp4_four_colors_aspect_4x3.html +++ b/content/test/data/gpu/pixel_video_mp4_four_colors_aspect_4x3.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_video_mp4_four_colors_rot_180.html b/content/test/data/gpu/pixel_video_mp4_four_colors_rot_180.html index eadd247..bc9208d 100644 --- a/content/test/data/gpu/pixel_video_mp4_four_colors_rot_180.html +++ b/content/test/data/gpu/pixel_video_mp4_four_colors_rot_180.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_video_mp4_four_colors_rot_270.html b/content/test/data/gpu/pixel_video_mp4_four_colors_rot_270.html index 830a5f5..3356fb7 100644 --- a/content/test/data/gpu/pixel_video_mp4_four_colors_rot_270.html +++ b/content/test/data/gpu/pixel_video_mp4_four_colors_rot_270.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_video_mp4_four_colors_rot_90.html b/content/test/data/gpu/pixel_video_mp4_four_colors_rot_90.html index c44cade..6cf865c 100644 --- a/content/test/data/gpu/pixel_video_mp4_four_colors_rot_90.html +++ b/content/test/data/gpu/pixel_video_mp4_four_colors_rot_90.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_video_mp4_fullsize.html b/content/test/data/gpu/pixel_video_mp4_fullsize.html index d052a811..75be257 100644 --- a/content/test/data/gpu/pixel_video_mp4_fullsize.html +++ b/content/test/data/gpu/pixel_video_mp4_fullsize.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>MP4 Video test</title>
diff --git a/content/test/data/gpu/pixel_video_mp4_rounded_corner.html b/content/test/data/gpu/pixel_video_mp4_rounded_corner.html index 07d2a7c0..c0fd27e 100644 --- a/content/test/data/gpu/pixel_video_mp4_rounded_corner.html +++ b/content/test/data/gpu/pixel_video_mp4_rounded_corner.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_video_nonroot.html b/content/test/data/gpu/pixel_video_nonroot.html index c935f3f4..96a16e7 100644 --- a/content/test/data/gpu/pixel_video_nonroot.html +++ b/content/test/data/gpu/pixel_video_nonroot.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Nonroot Video test</title>
diff --git a/content/test/data/gpu/pixel_video_underlay.html b/content/test/data/gpu/pixel_video_underlay.html index ef9424f9..6ac6aa4 100644 --- a/content/test/data/gpu/pixel_video_underlay.html +++ b/content/test/data/gpu/pixel_video_underlay.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Underlay Video test</title>
diff --git a/content/test/data/gpu/pixel_video_underlay_fullsize.html b/content/test/data/gpu/pixel_video_underlay_fullsize.html index aec6a577..8e43094 100644 --- a/content/test/data/gpu/pixel_video_underlay_fullsize.html +++ b/content/test/data/gpu/pixel_video_underlay_fullsize.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>Underlay Video test</title>
diff --git a/content/test/data/gpu/pixel_video_vp9.html b/content/test/data/gpu/pixel_video_vp9.html index 922ddc9..226c37c 100644 --- a/content/test/data/gpu/pixel_video_vp9.html +++ b/content/test/data/gpu/pixel_video_vp9.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_video_vp9_fullsize.html b/content/test/data/gpu/pixel_video_vp9_fullsize.html index 7b4ecde..20e26b3 100644 --- a/content/test/data/gpu/pixel_video_vp9_fullsize.html +++ b/content/test/data/gpu/pixel_video_vp9_fullsize.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>VP9 Video test</title>
diff --git a/content/test/data/gpu/pixel_video_vp9_i420a.html b/content/test/data/gpu/pixel_video_vp9_i420a.html index ff7bfd6..f5e191e 100644 --- a/content/test/data/gpu/pixel_video_vp9_i420a.html +++ b/content/test/data/gpu/pixel_video_vp9_i420a.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_webgl_aa_alpha.html b/content/test/data/gpu/pixel_webgl_aa_alpha.html index 097ef1d..af4e725 100644 --- a/content/test/data/gpu/pixel_webgl_aa_alpha.html +++ b/content/test/data/gpu/pixel_webgl_aa_alpha.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>WebGL Test: Green Triangle over Black Background</title>
diff --git a/content/test/data/gpu/pixel_webgl_aa_noalpha.html b/content/test/data/gpu/pixel_webgl_aa_noalpha.html index 4ea464f..407b522 100644 --- a/content/test/data/gpu/pixel_webgl_aa_noalpha.html +++ b/content/test/data/gpu/pixel_webgl_aa_noalpha.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>WebGL Test: Green Triangle over Black Background</title>
diff --git a/content/test/data/gpu/pixel_webgl_copy_image.html b/content/test/data/gpu/pixel_webgl_copy_image.html index c85ab03..f2a53b6 100644 --- a/content/test/data/gpu/pixel_webgl_copy_image.html +++ b/content/test/data/gpu/pixel_webgl_copy_image.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_webgl_noaa_alpha.html b/content/test/data/gpu/pixel_webgl_noaa_alpha.html index 38ca74a5..02e8f5e 100644 --- a/content/test/data/gpu/pixel_webgl_noaa_alpha.html +++ b/content/test/data/gpu/pixel_webgl_noaa_alpha.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>WebGL Test: Green Triangle over Black Background</title>
diff --git a/content/test/data/gpu/pixel_webgl_noaa_noalpha.html b/content/test/data/gpu/pixel_webgl_noaa_noalpha.html index ebcbd6f..060c55f 100644 --- a/content/test/data/gpu/pixel_webgl_noaa_noalpha.html +++ b/content/test/data/gpu/pixel_webgl_noaa_noalpha.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>WebGL Test: Green Triangle over Black Background</title>
diff --git a/content/test/data/gpu/pixel_webgl_noalpha_implicit_clear.html b/content/test/data/gpu/pixel_webgl_noalpha_implicit_clear.html index 20508de..fc1b437 100644 --- a/content/test/data/gpu/pixel_webgl_noalpha_implicit_clear.html +++ b/content/test/data/gpu/pixel_webgl_noalpha_implicit_clear.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <!-- This is a regression test for crbug.com/666259 .
diff --git a/content/test/data/gpu/pixel_webgl_read_pixels_tab_switch.html b/content/test/data/gpu/pixel_webgl_read_pixels_tab_switch.html index 6ee05fb..488e5c3 100644 --- a/content/test/data/gpu/pixel_webgl_read_pixels_tab_switch.html +++ b/content/test/data/gpu/pixel_webgl_read_pixels_tab_switch.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/test/data/gpu/pixel_webgl_webcodecs_breakoutbox_displays_frame.html b/content/test/data/gpu/pixel_webgl_webcodecs_breakoutbox_displays_frame.html index 5925f0f..218d9d1 100644 --- a/content/test/data/gpu/pixel_webgl_webcodecs_breakoutbox_displays_frame.html +++ b/content/test/data/gpu/pixel_webgl_webcodecs_breakoutbox_displays_frame.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <title>WebGL + WebCodecs + Breakout Box can display frame</title>
diff --git a/content/test/data/gpu/wait_for_compositing.html b/content/test/data/gpu/wait_for_compositing.html index fe6d66fb..c29db55 100644 --- a/content/test/data/gpu/wait_for_compositing.html +++ b/content/test/data/gpu/wait_for_compositing.html
@@ -1,11 +1,4 @@ <!DOCTYPE HTML> - -<!-- READ BEFORE UPDATING: -If this test is updated make sure to increment the "revision" value of the -associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure -that the baseline images are regenerated on the next run. ---> - <html> <head> <meta name="viewport" content="initial-scale=1">
diff --git a/content/utility/utility_main.cc b/content/utility/utility_main.cc index 6b1fe99..3fa411b 100644 --- a/content/utility/utility_main.cc +++ b/content/utility/utility_main.cc
@@ -62,6 +62,7 @@ #if BUILDFLAG(IS_WIN) #include "base/rand_util.h" +#include "base/win/windows_version.h" #include "sandbox/win/src/sandbox.h" sandbox::TargetServices* g_utility_target_services = nullptr; @@ -222,9 +223,12 @@ DVLOG(1) << "Sandbox type: " << static_cast<int>(sandbox_type); // https://crbug.com/1076771 https://crbug.com/1075487 Premature unload of - // shell32 caused process to crash during process shutdown. - HMODULE shell32_pin = ::LoadLibrary(L"shell32.dll"); - UNREFERENCED_PARAMETER(shell32_pin); + // shell32 caused process to crash during process shutdown. See also a + // separate fix for https://crbug.com/1139752. Fixed in Windows 11. + if (base::win::GetVersion() < base::win::Version::WIN11) { + HMODULE shell32_pin = ::LoadLibrary(L"shell32.dll"); + UNREFERENCED_PARAMETER(shell32_pin); + } if (!sandbox::policy::IsUnsandboxedSandboxType(sandbox_type) && sandbox_type != sandbox::mojom::Sandbox::kCdm &&
diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc index 7c60377..f565d06 100644 --- a/content/web_test/browser/web_test_content_browser_client.cc +++ b/content/web_test/browser/web_test_content_browser_client.cc
@@ -598,9 +598,10 @@ } bool WebTestContentBrowserClient::IsInterestGroupAPIAllowed( - content::BrowserContext* browser_context, + content::RenderFrameHost* render_frame_host, + InterestGroupApiOperation operation, const url::Origin& top_frame_origin, - const GURL& api_url) { + const url::Origin& api_origin) { return true; }
diff --git a/content/web_test/browser/web_test_content_browser_client.h b/content/web_test/browser/web_test_content_browser_client.h index 2e59ab83..953433b 100644 --- a/content/web_test/browser/web_test_content_browser_client.h +++ b/content/web_test/browser/web_test_content_browser_client.h
@@ -105,9 +105,10 @@ ChildSpawnFlags flags) override; #endif std::string GetAcceptLangs(BrowserContext* context) override; - bool IsInterestGroupAPIAllowed(content::BrowserContext* browser_context, + bool IsInterestGroupAPIAllowed(content::RenderFrameHost* render_frame_host, + InterestGroupApiOperation operation, const url::Origin& top_frame_origin, - const GURL& api_url) override; + const url::Origin& api_origin) override; void GetHyphenationDictionary( base::OnceCallback<void(const base::FilePath&)>) override;
diff --git a/device/gamepad/gamepad_monitor.cc b/device/gamepad/gamepad_monitor.cc index ce8ba1e..28082924 100644 --- a/device/gamepad/gamepad_monitor.cc +++ b/device/gamepad/gamepad_monitor.cc
@@ -53,6 +53,8 @@ GamepadService* service = GamepadService::GetInstance(); if (!service->ConsumerBecameActive(this)) { mojo::ReportBadMessage("GamepadMonitor::GamepadStartPolling failed"); + std::move(callback).Run(base::ReadOnlySharedMemoryRegion()); + return; } std::move(callback).Run(service->DuplicateSharedMemoryRegion()); }
diff --git a/docs/clangd.md b/docs/clangd.md index b4955d0..1f488af 100644 --- a/docs/clangd.md +++ b/docs/clangd.md
@@ -84,6 +84,11 @@ 5. Use clangd in your favourite editor, see detailed [instructions]( https://clangd.llvm.org/installation.html#editor-plugins). + * Optional: You may want to add `-header-insertion=never` to the clangd flags, + so that your editor doesn't automatically add incorrect #include lines. The + feature doesn't correctly handle some common Chromium headers like + `base/strings/string_piece_forward.h` and `base/callback_forward.h` + ## Background Indexing clangd builds an incremental index of your project (all files listed in the
diff --git a/google_apis/gcm/tools/mcs_probe.cc b/google_apis/gcm/tools/mcs_probe.cc index 31e13a3..082ff17 100644 --- a/google_apis/gcm/tools/mcs_probe.cc +++ b/google_apis/gcm/tools/mcs_probe.cc
@@ -10,6 +10,7 @@ #include <cstddef> #include <cstdio> #include <memory> +#include <set> #include <string> #include <utility> #include <vector> @@ -351,9 +352,10 @@ builder.set_net_log(net_log_); builder.set_host_resolver( net::HostResolver::CreateStandaloneResolver(net_log_)); - builder.SetHttpAuthHandlerFactory(net::HttpAuthHandlerRegistryFactory::Create( - &http_auth_preferences_, - std::vector<std::string>{net::kBasicAuthScheme})); + http_auth_preferences_.set_allowed_schemes( + std::set<std::string>{net::kBasicAuthScheme}); + builder.SetHttpAuthHandlerFactory( + net::HttpAuthHandlerRegistryFactory::Create(&http_auth_preferences_)); builder.set_proxy_resolution_service( net::ConfiguredProxyResolutionService::CreateDirect());
diff --git a/gpu/command_buffer/service/shared_image_backing_factory_raw_draw.cc b/gpu/command_buffer/service/shared_image_backing_factory_raw_draw.cc index b393747d..82ba4b4 100644 --- a/gpu/command_buffer/service/shared_image_backing_factory_raw_draw.cc +++ b/gpu/command_buffer/service/shared_image_backing_factory_raw_draw.cc
@@ -6,10 +6,15 @@ #include "base/logging.h" #include "base/thread_annotations.h" +#include "base/threading/thread_checker.h" #include "cc/paint/paint_op_buffer.h" +#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" +#include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image_backing.h" #include "gpu/command_buffer/service/shared_image_representation.h" +#include "gpu/command_buffer/service/skia_utils.h" +#include "third_party/skia/include/core/SkPromiseImageTexture.h" namespace gpu { @@ -38,20 +43,22 @@ true /* is_thread_safe */) {} ~RawDrawBacking() override { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); AutoLock auto_lock(this); DCHECK_EQ(read_count_, 0); DCHECK(!is_write_); ResetPaintOpBuffer(); + DestroyBackendTexture(); } // SharedImageBacking implementation. bool ProduceLegacyMailbox(MailboxManager* mailbox_manager) override { - NOTREACHED() << "Not supported."; + NOTIMPLEMENTED(); return false; } void Update(std::unique_ptr<gfx::GpuFence> in_fence) override { - NOTREACHED() << "Not supported."; + NOTIMPLEMENTED(); } void OnMemoryDump(const std::string& dump_name, @@ -63,18 +70,24 @@ std::unique_ptr<SharedImageRepresentationRaster> ProduceRaster( SharedImageManager* manager, MemoryTypeTracker* tracker) override; + std::unique_ptr<SharedImageRepresentationSkia> ProduceSkia( + SharedImageManager* manager, + MemoryTypeTracker* tracker, + scoped_refptr<SharedContextState> context_state) override; private: class RepresentationRaster; + class RepresentationSkia; void ResetPaintOpBuffer() { if (!paint_op_buffer_) { DCHECK(!clear_color_); DCHECK(!paint_op_release_callback_); + DCHECK(!backend_texture_.isValid()); + DCHECK(!promise_texture_); return; } - final_msaa_count_ = 0; clear_color_.reset(); paint_op_buffer_->Reset(); @@ -82,13 +95,155 @@ std::move(paint_op_release_callback_).Run(); } + void DestroyBackendTexture() { + if (backend_texture_.isValid()) { + DCHECK(context_state_); + DeleteGrBackendTexture(context_state_.get(), &backend_texture_); + backend_texture_ = {}; + promise_texture_.reset(); + } + } + + cc::PaintOpBuffer* BeginRasterWriteAccess( + int final_msaa_count, + const SkSurfaceProps& surface_props, + const absl::optional<SkColor>& clear_color) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + AutoLock auto_lock(this); + if (read_count_) { + LOG(ERROR) << "The backing is being read."; + return nullptr; + } + + if (is_write_) { + LOG(ERROR) << "The backing is being written."; + return nullptr; + } + + is_write_ = true; + + ResetPaintOpBuffer(); + // Should we keep the backing? + DestroyBackendTexture(); + + if (!paint_op_buffer_) + paint_op_buffer_ = sk_make_sp<cc::PaintOpBuffer>(); + + final_msaa_count_ = final_msaa_count; + surface_props_ = surface_props; + clear_color_ = clear_color; + + return paint_op_buffer_.get(); + } + + void EndRasterWriteAccess(base::OnceClosure callback) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + AutoLock auto_lock(this); + DCHECK_EQ(read_count_, 0); + DCHECK(is_write_); + + is_write_ = false; + + if (callback) { + DCHECK(!paint_op_release_callback_); + paint_op_release_callback_ = std::move(callback); + } + } + + cc::PaintOpBuffer* BeginRasterReadAccess( + absl::optional<SkColor>& clear_color) { + // paint ops will be read on compositor thread, so do not check thread with + // DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + AutoLock auto_lock(this); + if (is_write_) { + LOG(ERROR) << "The backing is being written."; + return nullptr; + } + + // If |backend_texture_| is valid, |paint_op_buffer_| should be played back + // to the |backend_texture_| already, and |paint_op_buffer_| could be + // released already. So we return nullptr here, and then SkiaRenderer will + // fallback to using |backend_texture_|. + if (backend_texture_.isValid()) + return nullptr; + + read_count_++; + + if (!paint_op_buffer_) { + paint_op_buffer_ = sk_make_sp<cc::PaintOpBuffer>(); + } + + clear_color = clear_color_; + return paint_op_buffer_.get(); + } + + sk_sp<SkPromiseImageTexture> BeginSkiaReadAccess() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + AutoLock auto_lock(this); + if (backend_texture_.isValid()) { + DCHECK(promise_texture_); + read_count_++; + return promise_texture_; + } + + auto mipmap = usage() & SHARED_IMAGE_USAGE_MIPMAP ? GrMipMapped::kYes + : GrMipMapped::kNo; + auto sk_color = viz::ResourceFormatToClosestSkColorType( + /*gpu_compositing=*/true, format()); + backend_texture_ = context_state_->gr_context()->createBackendTexture( + size().width(), size().height(), sk_color, mipmap, GrRenderable::kYes, + GrProtected::kNo); + if (!backend_texture_.isValid()) { + DLOG(ERROR) << "createBackendTexture() failed with SkColorType:" + << sk_color; + return nullptr; + } + promise_texture_ = SkPromiseImageTexture::Make(backend_texture_); + + auto surface = SkSurface::MakeFromBackendTexture( + context_state_->gr_context(), backend_texture_, surface_origin(), + final_msaa_count_, sk_color, color_space().ToSkColorSpace(), + &surface_props_); + + if (clear_color_) + surface->getCanvas()->clear(*clear_color_); + + if (paint_op_buffer_) { + cc::PlaybackParams playback_params(nullptr, SkM44()); + paint_op_buffer_->Playback(surface->getCanvas(), playback_params); + } + + read_count_++; + return promise_texture_; + } + + void EndReadAccess() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + AutoLock auto_lock(this); + DCHECK_GE(read_count_, 0); + DCHECK(!is_write_); + read_count_--; + + // If the |backend_texture_| is valid, the |paint_op_buffer_| should have + // been played back to the |backend_texture_| already, so we can release + // the |paint_op_buffer_| now. + if (read_count_ == 0 && backend_texture_.isValid()) + ResetPaintOpBuffer(); + } + int32_t final_msaa_count_ = 0; + SkSurfaceProps surface_props_{}; absl::optional<SkColor> clear_color_; sk_sp<cc::PaintOpBuffer> paint_op_buffer_; base::OnceClosure paint_op_release_callback_; + scoped_refptr<SharedContextState> context_state_; + GrBackendTexture backend_texture_; + sk_sp<SkPromiseImageTexture> promise_texture_; bool is_write_ GUARDED_BY(lock_) = false; int read_count_ GUARDED_BY(lock_) = 0; + + THREAD_CHECKER(thread_checker_); }; class RawDrawBacking::RepresentationRaster @@ -100,71 +255,60 @@ : SharedImageRepresentationRaster(manager, backing, tracker) {} ~RepresentationRaster() override = default; - cc::PaintOpBuffer* BeginReadAccess( - absl::optional<SkColor>& clear_color) override { - AutoLock auto_lock(raw_draw_backing()); - if (raw_draw_backing()->is_write_) { - LOG(ERROR) << "The backing is being written."; - return nullptr; - } - - raw_draw_backing()->read_count_++; - - if (!raw_draw_backing()->paint_op_buffer_) { - raw_draw_backing()->paint_op_buffer_ = sk_make_sp<cc::PaintOpBuffer>(); - } - - clear_color = raw_draw_backing()->clear_color_; - return raw_draw_backing()->paint_op_buffer_.get(); - } - - void EndReadAccess() override { - AutoLock auto_lock(raw_draw_backing()); - DCHECK_GE(raw_draw_backing()->read_count_, 0); - DCHECK(!raw_draw_backing()->is_write_); - raw_draw_backing()->read_count_--; - } - cc::PaintOpBuffer* BeginWriteAccess( int final_msaa_count, const SkSurfaceProps& surface_props, const absl::optional<SkColor>& clear_color) override { - AutoLock auto_lock(raw_draw_backing()); - if (raw_draw_backing()->read_count_) { - LOG(ERROR) << "The backing is being read."; - return nullptr; - } - - if (raw_draw_backing()->is_write_) { - LOG(ERROR) << "The backing is being written."; - return nullptr; - } - - raw_draw_backing()->is_write_ = true; - - raw_draw_backing()->ResetPaintOpBuffer(); - if (!raw_draw_backing()->paint_op_buffer_) { - raw_draw_backing()->paint_op_buffer_ = sk_make_sp<cc::PaintOpBuffer>(); - } - raw_draw_backing()->final_msaa_count_ = final_msaa_count; - raw_draw_backing()->clear_color_ = clear_color; - - return raw_draw_backing()->paint_op_buffer_.get(); + return raw_draw_backing()->BeginRasterWriteAccess( + final_msaa_count, surface_props, clear_color); } void EndWriteAccess(base::OnceClosure callback) override { - AutoLock auto_lock(raw_draw_backing()); - DCHECK_EQ(raw_draw_backing()->read_count_, 0); - DCHECK(raw_draw_backing()->is_write_); - - raw_draw_backing()->is_write_ = false; - - if (callback) { - DCHECK(!raw_draw_backing()->paint_op_release_callback_); - raw_draw_backing()->paint_op_release_callback_ = std::move(callback); - } + raw_draw_backing()->EndRasterWriteAccess(std::move(callback)); } + cc::PaintOpBuffer* BeginReadAccess( + absl::optional<SkColor>& clear_color) override { + return raw_draw_backing()->BeginRasterReadAccess(clear_color); + } + + void EndReadAccess() override { raw_draw_backing()->EndReadAccess(); } + + private: + RawDrawBacking* raw_draw_backing() { + return static_cast<RawDrawBacking*>(backing()); + } +}; + +class RawDrawBacking::RepresentationSkia + : public SharedImageRepresentationSkia { + public: + RepresentationSkia(SharedImageManager* manager, + SharedImageBacking* backing, + MemoryTypeTracker* tracker) + : SharedImageRepresentationSkia(manager, backing, tracker) {} + + bool SupportsMultipleConcurrentReadAccess() override { return true; } + + sk_sp<SkPromiseImageTexture> BeginWriteAccess( + std::vector<GrBackendSemaphore>* begin_semaphores, + std::vector<GrBackendSemaphore>* end_semaphores, + std::unique_ptr<GrBackendSurfaceMutableState>* end_state) override { + NOTIMPLEMENTED(); + return nullptr; + } + + void EndWriteAccess(sk_sp<SkSurface> surface) override { NOTIMPLEMENTED(); } + + sk_sp<SkPromiseImageTexture> BeginReadAccess( + std::vector<GrBackendSemaphore>* begin_semaphores, + std::vector<GrBackendSemaphore>* end_semaphores, + std::unique_ptr<GrBackendSurfaceMutableState>* end_state) override { + return raw_draw_backing()->BeginSkiaReadAccess(); + } + + void EndReadAccess() override { raw_draw_backing()->EndReadAccess(); } + private: RawDrawBacking* raw_draw_backing() { return static_cast<RawDrawBacking*>(backing()); @@ -177,6 +321,16 @@ return std::make_unique<RepresentationRaster>(manager, this, tracker); } +std::unique_ptr<SharedImageRepresentationSkia> RawDrawBacking::ProduceSkia( + SharedImageManager* manager, + MemoryTypeTracker* tracker, + scoped_refptr<SharedContextState> context_state) { + if (!context_state_) + context_state_ = context_state; + DCHECK(context_state_ == context_state); + return std::make_unique<RepresentationSkia>(manager, this, tracker); +} + } // namespace SharedImageBackingFactoryRawDraw::SharedImageBackingFactoryRawDraw() = default;
diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc index 1aefae5b..966fb4b8b 100644 --- a/gpu/ipc/service/gpu_init.cc +++ b/gpu/ipc/service/gpu_init.cc
@@ -426,20 +426,6 @@ } #endif - // On MacOS, the default texture target for native GpuMemoryBuffers is - // GL_TEXTURE_RECTANGLE_ARB. This is due to CGL's requirements for creating - // a GL surface. However, when ANGLE is used on top of SwiftShader or Metal, - // it's necessary to use GL_TEXTURE_2D instead. - // TODO(crbug.com/1056312): The proper behavior is to check the config - // parameter set by the EGL_ANGLE_iosurface_client_buffer extension -#if BUILDFLAG(IS_MAC) - if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE && - (gl::GetANGLEImplementation() == gl::ANGLEImplementation::kSwiftShader || - gl::GetANGLEImplementation() == gl::ANGLEImplementation::kMetal)) { - SetMacOSSpecificTextureTarget(GL_TEXTURE_2D); - } -#endif // BUILDFLAG(IS_MAC) - bool gl_disabled = gl::GetGLImplementation() == gl::kGLImplementationDisabled; // Compute passthrough decoder status before ComputeGpuFeatureInfo below. @@ -518,6 +504,21 @@ } } + // On MacOS, the default texture target for native GpuMemoryBuffers is + // GL_TEXTURE_RECTANGLE_ARB. This is due to CGL's requirements for creating + // a GL surface. However, when ANGLE is used on top of SwiftShader or Metal, + // it's necessary to use GL_TEXTURE_2D instead. + // TODO(crbug.com/1056312): The proper behavior is to check the config + // parameter set by the EGL_ANGLE_iosurface_client_buffer extension +#if defined(OS_MAC) + if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE && + (gl::GetANGLEImplementation() == gl::ANGLEImplementation::kSwiftShader || + gl::GetANGLEImplementation() == gl::ANGLEImplementation::kMetal)) { + SetMacOSSpecificTextureTarget(GL_TEXTURE_2D); + gpu_info_.macos_specific_texture_target = GL_TEXTURE_2D; + } +#endif // defined(OS_MAC) + if (gpu_feature_info_.status_values[GPU_FEATURE_TYPE_VULKAN] != kGpuFeatureStatusEnabled || !InitializeVulkan()) { @@ -749,26 +750,6 @@ } #endif // !BUILDFLAG(IS_CHROMECAST) - // On MacOS, the default texture target for native GpuMemoryBuffers is - // GL_TEXTURE_RECTANGLE_ARB. This is due to CGL's requirements for creating - // a GL surface. However, when ANGLE is used on top of SwiftShader or Metal, - // it's necessary to use GL_TEXTURE_2D instead. - // TODO(crbug.com/1056312): The proper behavior is to check the config - // parameter set by the EGL_ANGLE_iosurface_client_buffer extension -#if BUILDFLAG(IS_MAC) - if (command_line->HasSwitch(switches::kUseGL)) { - std::string use_gl = command_line->GetSwitchValueASCII(switches::kUseGL); - std::string use_angle = - command_line->GetSwitchValueASCII(switches::kUseANGLE); - if (use_gl == gl::kGLImplementationANGLEName && - (use_angle == gl::kANGLEImplementationSwiftShaderName || - use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName || - use_angle == gl::kANGLEImplementationMetalName)) { - SetMacOSSpecificTextureTarget(GL_TEXTURE_2D); - } - } -#endif // BUILDFLAG(IS_MAC) - gl_use_swiftshader_ = EnableSwiftShaderIfNeeded( command_line, gpu_feature_info_, gpu_preferences_.disable_software_rasterizer, needs_more_info); @@ -796,6 +777,21 @@ } } + // On MacOS, the default texture target for native GpuMemoryBuffers is + // GL_TEXTURE_RECTANGLE_ARB. This is due to CGL's requirements for creating + // a GL surface. However, when ANGLE is used on top of SwiftShader or Metal, + // it's necessary to use GL_TEXTURE_2D instead. + // TODO(crbug.com/1056312): The proper behavior is to check the config + // parameter set by the EGL_ANGLE_iosurface_client_buffer extension +#if defined(OS_MAC) + if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE && + (gl::GetANGLEImplementation() == gl::ANGLEImplementation::kSwiftShader || + gl::GetANGLEImplementation() == gl::ANGLEImplementation::kMetal)) { + SetMacOSSpecificTextureTarget(GL_TEXTURE_2D); + gpu_info_.macos_specific_texture_target = GL_TEXTURE_2D; + } +#endif // defined(OS_MAC) + if (!gl_disabled) { if (!gpu_feature_info_.disabled_extensions.empty()) { gl::init::SetDisabledExtensionsPlatform(
diff --git a/gpu/ipc/service/gpu_watchdog_thread_unittest.cc b/gpu/ipc/service/gpu_watchdog_thread_unittest.cc index e12e09d6..078d027 100644 --- a/gpu/ipc/service/gpu_watchdog_thread_unittest.cc +++ b/gpu/ipc/service/gpu_watchdog_thread_unittest.cc
@@ -14,22 +14,44 @@ #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" +#if BUILDFLAG(IS_WIN) +#include "base/win/windows_version.h" +#endif + +#if BUILDFLAG(IS_MAC) +#include "base/mac/mac_util.h" +#endif + namespace gpu { namespace { -constexpr auto kGpuWatchdogTimeoutForTesting = base::Milliseconds(1000); +// |kExtraGPUJobTimeForTesting| is the extra time the gpu main/test thread +// spends after GpuWatchdogTimeout. Theoretically, any extra time such as 1 ms +// should be enough to trigger the watchdog kill. However, it can cause test +// flakiness when the time is too short. -// This is the extra time the gpu main/test thread spends after -// GpuWatchdogTimeout. Theoretically, any extra time such as 1 ms should be -// enough to trigger the watchdog kill. However, more time is added to fix the -// flakiness in CQ. -base::TimeDelta ExtraGPUJobTimeMSForTesting(int milliseconds) { - return base::Milliseconds(milliseconds); -} +constexpr auto kGpuWatchdogTimeoutForTesting = base::Milliseconds(500); +constexpr auto kExtraGPUJobTimeForTesting = base::Milliseconds(2000); -// This task will run for duration_ms milliseconds. -void SimpleTask(base::TimeDelta duration) { - base::PlatformThread::Sleep(duration); +// For slow machines like Win 7 and Mac 10.xx. +constexpr auto kGpuWatchdogTimeoutForTestingSlow = base::Milliseconds(1000); +constexpr auto kExtraGPUJobTimeForTestingSlow = base::Milliseconds(4000); + +// On Windows, the gpu watchdog check if the main thread has used the full +// thread time. We want to detect the case in which the main thread is swapped +// out by the OS scheduler. The task on windows is simiulated by reading +// TimeTicks instead of Sleep(). +void SimpleTask(base::TimeDelta duration, base::TimeDelta extra_time) { +#if BUILDFLAG(IS_WIN) + auto start_timetick = base::TimeTicks::Now(); + do { + } while ((base::TimeTicks::Now() - start_timetick) < duration); + + base::PlatformThread::Sleep(extra_time); + +#else + base::PlatformThread::Sleep(duration + extra_time); +#endif } } // namespace @@ -40,9 +62,12 @@ void LongTaskWithReportProgress(base::TimeDelta duration, base::TimeDelta report_delta); +#if BUILDFLAG(IS_ANDROID) void LongTaskFromBackgroundToForeground( base::TimeDelta duration, + base::TimeDelta extra_time, base::TimeDelta time_to_switch_to_foreground); +#endif // Implements testing::Test void SetUp() override; @@ -52,6 +77,9 @@ base::test::SingleThreadTaskEnvironment task_environment_; base::RunLoop run_loop; std::unique_ptr<gpu::GpuWatchdogThread> watchdog_thread_; + base::TimeDelta timeout_ = kGpuWatchdogTimeoutForTesting; + base::TimeDelta extra_gpu_job_time_ = kExtraGPUJobTimeForTesting; + base::TimeDelta full_thread_time_on_windows_ = base::TimeDelta(); }; class GpuWatchdogPowerTest : public GpuWatchdogTest { @@ -59,6 +87,7 @@ GpuWatchdogPowerTest() {} void LongTaskOnResume(base::TimeDelta duration, + base::TimeDelta extra_time, base::TimeDelta time_to_power_resume); // Implements testing::Test @@ -74,10 +103,30 @@ ASSERT_TRUE(base::ThreadTaskRunnerHandle::IsSet()); ASSERT_TRUE(base::CurrentThread::IsSet()); - // Set watchdog timeout to 1000 milliseconds +#if BUILDFLAG(IS_WIN) + // Win7 + if (base::win::GetVersion() < base::win::Version::WIN10) { + timeout_ = kGpuWatchdogTimeoutForTestingSlow; + extra_gpu_job_time_ = kExtraGPUJobTimeForTestingSlow; + } + + full_thread_time_on_windows_ = timeout_ * kMaxCountOfMoreGpuThreadTimeAllowed; +#elif BUILDFLAG(IS_MAC) + int os_version = base::mac::internal::MacOSVersion(); + // For Mac version <= 11.00 + if (os_version <= 1100) { + timeout_ = kGpuWatchdogTimeoutForTestingSlow; + extra_gpu_job_time_ = kExtraGPUJobTimeForTestingSlow; + } +#else + // Use a longer timeout for now. Will try to reduce it later. + timeout_ = kGpuWatchdogTimeoutForTestingSlow; + extra_gpu_job_time_ = kExtraGPUJobTimeForTestingSlow; +#endif + watchdog_thread_ = gpu::GpuWatchdogThread::Create( /*start_backgrounded=*/false, - /*timeout=*/kGpuWatchdogTimeoutForTesting, + /*timeout=*/timeout_, /*init_factor=*/kInitFactor, /*restart_factor=*/kRestartFactor, /*test_mode=*/true, /*thread_name=*/"GpuWatchdog"); @@ -103,77 +152,91 @@ base::TimeTicks end; do { - base::PlatformThread::Sleep(report_delta); + SimpleTask(report_delta, /*extra_time=*/base::TimeDelta()); watchdog_thread_->ReportProgress(); end = base::TimeTicks::Now(); } while (end - start <= duration); } +#if BUILDFLAG(IS_ANDROID) void GpuWatchdogTest::LongTaskFromBackgroundToForeground( base::TimeDelta duration, + base::TimeDelta extra_time, base::TimeDelta time_to_switch_to_foreground) { // Chrome is running in the background first. watchdog_thread_->OnBackgrounded(); - base::PlatformThread::Sleep(time_to_switch_to_foreground); + SimpleTask(time_to_switch_to_foreground, /*extra_time=*/base::TimeDelta()); // Now switch Chrome to the foreground after the specified time watchdog_thread_->OnForegrounded(); - base::PlatformThread::Sleep(duration); + SimpleTask(duration, extra_time); } +#endif void GpuWatchdogPowerTest::LongTaskOnResume( base::TimeDelta duration, + base::TimeDelta extra_time, base::TimeDelta time_to_power_resume) { // Stay in power suspension mode first. power_monitor_source_.GenerateSuspendEvent(); - base::PlatformThread::Sleep(time_to_power_resume); + SimpleTask(time_to_power_resume, /*extra_time=*/base::TimeDelta()); // Now wake up on power resume. power_monitor_source_.GenerateResumeEvent(); // Continue the GPU task for the remaining time. - base::PlatformThread::Sleep(duration); + SimpleTask(duration, extra_time); } -// GPU Hang In Initialization -TEST_F(GpuWatchdogTest, GpuInitializationHang) { - // GPU init takes longer than timeout. -#if BUILDFLAG(IS_WIN) - SimpleTask(kGpuWatchdogTimeoutForTesting * kInitFactor + - kGpuWatchdogTimeoutForTesting * - kMaxCountOfMoreGpuThreadTimeAllowed + - ExtraGPUJobTimeMSForTesting(3000)); -#else - SimpleTask(kGpuWatchdogTimeoutForTesting * kInitFactor + - ExtraGPUJobTimeMSForTesting(3000)); -#endif +// Normal GPU Initialization. +TEST_F(GpuWatchdogTest, GpuInitializationComplete) { + // Assume GPU initialization takes quarter of WatchdogTimeout time. + auto normal_task_time = timeout_ / 4; - // Gpu hangs. OnInitComplete() is not called + SimpleTask(normal_task_time, /*extra_time=*/base::TimeDelta()); + watchdog_thread_->OnInitComplete(); bool result = watchdog_thread_->IsGpuHangDetectedForTesting(); - EXPECT_TRUE(result); + EXPECT_FALSE(result); } -// Normal GPU Initialization and Running Task +// GPU Hang In Initialization. +TEST_F(GpuWatchdogTest, GpuInitializationHang) { + auto allowed_time = + timeout_ * (kInitFactor + 1) + full_thread_time_on_windows_; + + // GPU init takes longer than timeout. + SimpleTask(allowed_time, /*extra_time=*/extra_gpu_job_time_); + + // Gpu hangs. OnInitComplete() is not called + bool result = watchdog_thread_->IsGpuHangDetectedForTesting(); + EXPECT_TRUE(result); + // retry on failure. +} + +// Normal GPU Initialization and Running Task. TEST_F(GpuWatchdogTest, GpuInitializationAndRunningTasks) { - // Assume GPU initialization takes 300 milliseconds. - SimpleTask(base::Milliseconds(300)); + // Assume GPU initialization takes quarter of WatchdogTimeout time. + auto normal_task_time = timeout_ / 4; + SimpleTask(normal_task_time, /*extra_time=*/base::TimeDelta()); watchdog_thread_->OnInitComplete(); // Start running GPU tasks. Watchdog function WillProcessTask(), // DidProcessTask() and ReportProgress() are tested. task_environment_.GetMainThreadTaskRunner()->PostTask( - FROM_HERE, base::BindOnce(&SimpleTask, base::Milliseconds(500))); + FROM_HERE, base::BindOnce(&SimpleTask, normal_task_time, + /*extra_time=*/base::TimeDelta())); task_environment_.GetMainThreadTaskRunner()->PostTask( - FROM_HERE, base::BindOnce(&SimpleTask, base::Milliseconds(500))); + FROM_HERE, base::BindOnce(&SimpleTask, normal_task_time, + /*extra_time=*/base::TimeDelta())); - // This long task takes 3000 milliseconds to finish, longer than timeout. - // But it reports progress every 500 milliseconds + // This long task takes 6X timeout to finish, longer than timeout. But it + // reports progress every quarter of watchdog |timeout_|, so this is an + // expected normal behavior. + auto normal_long_task_time = timeout_ * 6; task_environment_.GetMainThreadTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce(&GpuWatchdogTest::LongTaskWithReportProgress, - base::Unretained(this), - kGpuWatchdogTimeoutForTesting + base::Milliseconds(2000), - base::Milliseconds(500))); + FROM_HERE, base::BindOnce(&GpuWatchdogTest::LongTaskWithReportProgress, + base::Unretained(this), normal_long_task_time, + /*report_progress_time*/ timeout_ / 4)); task_environment_.GetMainThreadTaskRunner()->PostTask(FROM_HERE, run_loop.QuitClosure()); @@ -184,25 +247,17 @@ EXPECT_FALSE(result); } -// GPU Hang when running a task +// GPU Hang when running a task. TEST_F(GpuWatchdogTest, GpuRunningATaskHang) { // Report gpu init complete watchdog_thread_->OnInitComplete(); // Start running a GPU task. -#if BUILDFLAG(IS_WIN) + auto allowed_time = timeout_ * 2 + full_thread_time_on_windows_; + task_environment_.GetMainThreadTaskRunner()->PostTask( FROM_HERE, - base::BindOnce(&SimpleTask, kGpuWatchdogTimeoutForTesting * 2 + - kGpuWatchdogTimeoutForTesting * - kMaxCountOfMoreGpuThreadTimeAllowed + - ExtraGPUJobTimeMSForTesting(4000))); -#else - task_environment_.GetMainThreadTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce(&SimpleTask, kGpuWatchdogTimeoutForTesting * 2 + - ExtraGPUJobTimeMSForTesting(4000))); -#endif + base::BindOnce(&SimpleTask, allowed_time, extra_gpu_job_time_)); task_environment_.GetMainThreadTaskRunner()->PostTask(FROM_HERE, run_loop.QuitClosure()); @@ -213,22 +268,24 @@ EXPECT_TRUE(result); } +#if BUILDFLAG(IS_ANDROID) TEST_F(GpuWatchdogTest, ChromeInBackground) { // Chrome starts in the background. watchdog_thread_->OnBackgrounded(); - // Gpu init (3000 ms) takes longer than timeout (2000 ms). - SimpleTask(kGpuWatchdogTimeoutForTesting * kInitFactor + - ExtraGPUJobTimeMSForTesting(1000)); + // Gpu init takes longer than 6x watchdog |timeout_|. This is normal since + // Chrome is running in the background. + auto normal_long_task_time = timeout_ * 6; + SimpleTask(normal_long_task_time, /*extra_time=*/base::TimeDelta()); // Report GPU init complete. watchdog_thread_->OnInitComplete(); - // Run a task that takes longer (3000 milliseconds) than timeout. + // Run a task that takes 6x watchdog |timeout_| longer.This is normal since + // Chrome is running in the background. task_environment_.GetMainThreadTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce(&SimpleTask, kGpuWatchdogTimeoutForTesting * 2 + - ExtraGPUJobTimeMSForTesting(1000))); + FROM_HERE, base::BindOnce(&SimpleTask, normal_long_task_time, + /*extra_time=*/base::TimeDelta())); task_environment_.GetMainThreadTaskRunner()->PostTask(FROM_HERE, run_loop.QuitClosure()); run_loop.Run(); @@ -242,29 +299,16 @@ // Report GPU init complete. watchdog_thread_->OnInitComplete(); - // A task stays in the background for 200 milliseconds, and then - // switches to the foreground and runs for 6000 milliseconds. This is longer - // than the first-time foreground watchdog timeout (2000 ms). -#if BUILDFLAG(IS_WIN) + // A task stays in the background for watchdog |timeout_| then switches to the + // foreground and runs longer than the first-time foreground watchdog timeout + // allowed. + auto allowed_time = timeout_ * (kRestartFactor + 1); task_environment_.GetMainThreadTaskRunner()->PostTask( FROM_HERE, base::BindOnce(&GpuWatchdogTest::LongTaskFromBackgroundToForeground, - base::Unretained(this), - /*duration*/ kGpuWatchdogTimeoutForTesting * 2 + - kGpuWatchdogTimeoutForTesting * - kMaxCountOfMoreGpuThreadTimeAllowed + - ExtraGPUJobTimeMSForTesting(4000), - /*time_to_switch_to_foreground*/ - base::Milliseconds(200))); -#else - task_environment_.GetMainThreadTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce(&GpuWatchdogTest::LongTaskFromBackgroundToForeground, - base::Unretained(this), - /*duration*/ kGpuWatchdogTimeoutForTesting * 2 + - ExtraGPUJobTimeMSForTesting(4000), - /*time_to_switch_to_foreground*/ base::Milliseconds(200))); -#endif + base::Unretained(this), /*duration*/ allowed_time, + /*extra_time=*/extra_gpu_job_time_, + /*time_to_switch_to_foreground*/ timeout_ / 4)); task_environment_.GetMainThreadTaskRunner()->PostTask(FROM_HERE, run_loop.QuitClosure()); @@ -275,15 +319,18 @@ bool result = watchdog_thread_->IsGpuHangDetectedForTesting(); EXPECT_TRUE(result); } +#endif TEST_F(GpuWatchdogTest, GpuInitializationPause) { - // Running for 100 ms in the beginning of GPU init. - SimpleTask(base::Milliseconds(100)); + // Running for watchdog |timeout_|/4 in the beginning of GPU init. + SimpleTask(timeout_ / 4, + /*extra_time=*/base::TimeDelta()); watchdog_thread_->PauseWatchdog(); - // The Gpu init continues for another (init timeout + 1000) ms after the pause - SimpleTask(kGpuWatchdogTimeoutForTesting * kInitFactor + - ExtraGPUJobTimeMSForTesting(1000)); + // The Gpu init continues for another 6x watchdog |timeout_| after the pause. + // This is normal since watchdog is paused. + auto normal_long_task_time = timeout_ * 6; + SimpleTask(normal_long_task_time, /*extra_time=*/base::TimeDelta()); // No GPU hang is detected when the watchdog is paused. bool result = watchdog_thread_->IsGpuHangDetectedForTesting(); @@ -291,16 +338,12 @@ // Continue the watchdog now. watchdog_thread_->ResumeWatchdog(); - // The Gpu init continues for (init timeout + 4000) ms. -#if BUILDFLAG(IS_WIN) - SimpleTask(kGpuWatchdogTimeoutForTesting * kInitFactor + - kGpuWatchdogTimeoutForTesting * - kMaxCountOfMoreGpuThreadTimeAllowed + - ExtraGPUJobTimeMSForTesting(4000)); -#else - SimpleTask(kGpuWatchdogTimeoutForTesting * kInitFactor + - ExtraGPUJobTimeMSForTesting(4000)); -#endif + + // The Gpu init continues for longer than allowed init time. + auto allowed_time = + timeout_ * (kInitFactor + 1) + full_thread_time_on_windows_; + + SimpleTask(allowed_time, /*extra_time=*/extra_gpu_job_time_); // A GPU hang should be detected. result = watchdog_thread_->IsGpuHangDetectedForTesting(); @@ -313,11 +356,11 @@ // Enter power suspension mode. power_monitor_source_.GenerateSuspendEvent(); - // Run a task that takes longer (5000 milliseconds) than timeout. + // Run a task that takes 6x watchdog |timeout_|. + auto normal_long_task_time = timeout_ * 6; task_environment_.GetMainThreadTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce(&SimpleTask, kGpuWatchdogTimeoutForTesting * 2 + - ExtraGPUJobTimeMSForTesting(3000))); + FROM_HERE, base::BindOnce(&SimpleTask, normal_long_task_time, + /*extra_time=*/base::TimeDelta())); task_environment_.GetMainThreadTaskRunner()->PostTask(FROM_HERE, run_loop.QuitClosure()); run_loop.Run(); @@ -331,30 +374,18 @@ TEST_F(GpuWatchdogPowerTest, GpuOnResumeHang) { // watchdog_thread_->OnInitComplete() is called in SetUp - // This task stays in the suspension mode for 200 milliseconds, and it - // wakes up on power resume and then runs for 6000 milliseconds. This is - // longer than the watchdog resume timeout (2000 ms). -#if BUILDFLAG(IS_WIN) + // This task stays in the suspension mode for watchdog |timeout_|/4, and it + // wakes up on power resume and then runs a job that is longer than the + // watchdog resume restart timeout. + auto allowed_time = + timeout_ * (kRestartFactor + 1) + full_thread_time_on_windows_; + task_environment_.GetMainThreadTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce( - &GpuWatchdogPowerTest::LongTaskOnResume, base::Unretained(this), - /*duration*/ kGpuWatchdogTimeoutForTesting * kRestartFactor + - kGpuWatchdogTimeoutForTesting * - kMaxCountOfMoreGpuThreadTimeAllowed + - ExtraGPUJobTimeMSForTesting(4000), - /*time_to_power_resume*/ - base::Milliseconds(200))); -#else - task_environment_.GetMainThreadTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce( - &GpuWatchdogPowerTest::LongTaskOnResume, base::Unretained(this), - /*duration*/ kGpuWatchdogTimeoutForTesting * kRestartFactor + - ExtraGPUJobTimeMSForTesting(4000), - /*time_to_power_resume*/ - base::Milliseconds(200))); -#endif + FROM_HERE, base::BindOnce(&GpuWatchdogPowerTest::LongTaskOnResume, + base::Unretained(this), + /*duration*/ allowed_time, + /*extra_time=*/extra_gpu_job_time_, + /*time_to_power_resume*/ timeout_ / 4)); task_environment_.GetMainThreadTaskRunner()->PostTask(FROM_HERE, run_loop.QuitClosure());
diff --git a/headless/lib/headless_content_main_delegate.cc b/headless/lib/headless_content_main_delegate.cc index 8b22116..dda176f 100644 --- a/headless/lib/headless_content_main_delegate.cc +++ b/headless/lib/headless_content_main_delegate.cc
@@ -310,8 +310,13 @@ void HeadlessContentMainDelegate::InitCrashReporter( const base::CommandLine& command_line) { - if (!options()->enable_crash_reporter) + if (!options()->enable_crash_reporter +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + && !command_line.HasSwitch(crash_reporter::switches::kCrashpadHandlerPid) +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + ) { return; + } #if BUILDFLAG(IS_FUCHSIA) // TODO(crbug.com/1226159): Implement this when crash reporting is available @@ -319,18 +324,18 @@ NOTIMPLEMENTED(); #else crash_reporter::SetCrashReporterClient(g_headless_crash_client.Pointer()); - g_headless_crash_client.Pointer()->set_crash_dumps_dir( - options()->crash_dumps_dir); - crash_reporter::InitializeCrashKeys(); - crash_keys::SetSwitchesFromCommandLine(command_line, nullptr); -#if !BUILDFLAG(IS_WIN) const std::string process_type = command_line.GetSwitchValueASCII(::switches::kProcessType); - if (process_type != switches::kZygoteProcess) + if (process_type != switches::kZygoteProcess) { + g_headless_crash_client.Pointer()->set_crash_dumps_dir( + options()->crash_dumps_dir); +#if !BUILDFLAG(IS_WIN) crash_reporter::InitializeCrashpad(process_type.empty(), process_type); #endif // !BUILDFLAG(IS_WIN) + crash_keys::SetSwitchesFromCommandLine(command_line, nullptr); + } #endif // BUILDFLAG(IS_FUCHSIA) // Mark any bug reports from headless mode as such. @@ -417,6 +422,7 @@ const std::string process_type = command_line.GetSwitchValueASCII(::switches::kProcessType); crash_reporter::InitializeCrashpad(false, process_type); + crash_keys::SetSwitchesFromCommandLine(command_line, nullptr); } } #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
diff --git a/infra/config/generated/builders/ci/android-marshmallow-arm64-rel/properties.textpb b/infra/config/generated/builders/ci/android-marshmallow-arm64-rel/properties.textpb index 1ae27d9..8252801 100644 --- a/infra/config/generated/builders/ci/android-marshmallow-arm64-rel/properties.textpb +++ b/infra/config/generated/builders/ci/android-marshmallow-arm64-rel/properties.textpb
@@ -1,10 +1,8 @@ { - "$build/goma": { - "enable_ats": true, + "$build/reclient": { + "instance": "rbe-chromium-trusted", "jobs": 500, - "rpc_extra_params": "?prod", - "server_host": "goma.chromium.org", - "use_luci_auth": true + "metrics_project": "chromium-reclient-metrics" }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [],
diff --git a/infra/config/subprojects/chromium/ci/chromium.android.star b/infra/config/subprojects/chromium/ci/chromium.android.star index 5acf1d5d..b0aae3aa 100644 --- a/infra/config/subprojects/chromium/ci/chromium.android.star +++ b/infra/config/subprojects/chromium/ci/chromium.android.star
@@ -448,7 +448,9 @@ ), cq_mirrors_console_view = "mirrors", execution_timeout = 4 * time.hour, - goma_jobs = goma.jobs.MANY_JOBS_FOR_CI, + goma_backend = None, + reclient_instance = rbe_instance.DEFAULT, + reclient_jobs = rbe_jobs.HIGH_JOBS_FOR_CI, tree_closing = True, )
diff --git a/ios/components/io_thread/ios_io_thread.mm b/ios/components/io_thread/ios_io_thread.mm index fbf8009..5cfacb9 100644 --- a/ios/components/io_thread/ios_io_thread.mm +++ b/ios/components/io_thread/ios_io_thread.mm
@@ -313,9 +313,11 @@ base::SPLIT_WANT_NONEMPTY); globals_->http_auth_preferences = std::make_unique<net::HttpAuthPreferences>(); + globals_->http_auth_preferences->set_allowed_schemes(std::set<std::string>( + supported_schemes.begin(), supported_schemes.end())); globals_->http_auth_handler_factory = net::HttpAuthHandlerRegistryFactory::Create( - globals_->http_auth_preferences.get(), supported_schemes); + globals_->http_auth_preferences.get()); } void IOSIOThread::ClearHostCache() {
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 index 0e022bf..c0009a5 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -8410b3c11e9aadaf98b1c2e621362d77bfeb0f25 \ No newline at end of file +3737550f7a032401009d2eec05f364e35f55bd2e \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 index befe5a0..519e946 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -24c20df5c36374c0935030b9e0da17953d60e822 \ No newline at end of file +97db2f6c335be85d9c18a75561bba93cec908f53 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 index ac3dbff..029e597 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -97ccfd87f3ee5195ef5fe2d4d9021197483767d9 \ No newline at end of file +7fcffe7264db69b2b97b8c93838b90fcf094b65d \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 index b3e54b36..62431a3 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -f6d1af4d3b976c6f577f12c3fcc91a541e091b40 \ No newline at end of file +7f89e262fa364f9c7842dbb3edddc47554aa0d3b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 index 9a54435e..5bf7586 100644 --- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -f1ca50cc49450c321dc7640f52836bb328fc672a \ No newline at end of file +4e8399993c670c5b33dc8622d785329c4a06b01e \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 index a608c170..ad4f0b2 100644 --- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -3250c10fa3d6fb3d5491e29d8892ac6a7cbf46b8 \ No newline at end of file +a540d40034597192a7ba0974cca599b04a8cf7b5 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 index db5d84f..a85eed3e 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -76f2020ed5896d4376405645606c1608eb40b56e \ No newline at end of file +bb15fc33c8fac2f388d66a68f225b3ae5ed8f15a \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 index dae20aa..317f3f9 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -75a457dd3e0ac0df63873cbc5e387eba9f134c01 \ No newline at end of file +dd8ec6922dff8a41e3500a78799cd85ddedba5bd \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 index da9017a..801ff44 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -2055f5e8a3503363fe2d64ae346c40740f4a60d5 \ No newline at end of file +c0b89da84e58798023ecef1a28a5b4bf0f47fbf4 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 index 08232e7..a5e3315 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -e7b4eca3283837843e6d8ad928b15d94b4f48173 \ No newline at end of file +db2fd815e81cccc616639cf8a6155b9c0c0183a4 \ No newline at end of file
diff --git a/media/video/h264_parser.cc b/media/video/h264_parser.cc index 588ae5d..9df1ec8 100644 --- a/media/video/h264_parser.cc +++ b/media/video/h264_parser.cc
@@ -612,19 +612,8 @@ nalu->size = nalu_size_with_start_code - start_code_size; DVLOG(4) << "NALU found: size=" << nalu_size_with_start_code; - // Initialize bit reader at the start of the found NALU. Limit the NALU size - // in the bitstream reader to unencrypted data. - size_t clear_nalu_size = nalu->size; - const uint8_t* nalu_end = nalu->data + nalu->size; - for (size_t i = 0; i < encrypted_ranges_.size(); ++i) { - if (nalu_end <= encrypted_ranges_.start(i)) - break; - if (nalu_end <= encrypted_ranges_.end(i)) { - clear_nalu_size = encrypted_ranges_.start(i) - nalu->data; - break; - } - } - if (!br_.Initialize(nalu->data, clear_nalu_size)) { + // Initialize bit reader at the start of found NALU. + if (!br_.Initialize(nalu->data, nalu->size)) { stream_ = nullptr; bytes_left_ = 0; return kEOStream; @@ -1211,7 +1200,15 @@ READ_BOOL_OR_RETURN(&pps->constrained_intra_pred_flag); READ_BOOL_OR_RETURN(&pps->redundant_pic_cnt_present_flag); - if (br_.HasMoreRBSPData()) { + bool pps_remainder_unencrypted = true; + if (encrypted_ranges_.size()) { + Ranges<const uint8_t*> pps_range; + pps_range.Add(previous_nalu_range_.end(0) - br_.NumBitsLeft() / 8, + previous_nalu_range_.end(0)); + pps_remainder_unencrypted = + (encrypted_ranges_.IntersectionWith(pps_range).size() == 0); + } + if (pps_remainder_unencrypted && br_.HasMoreRBSPData()) { READ_BOOL_OR_RETURN(&pps->transform_8x8_mode_flag); READ_BOOL_OR_RETURN(&pps->pic_scaling_matrix_present_flag);
diff --git a/net/http/bidirectional_stream.cc b/net/http/bidirectional_stream.cc index 5be018d0a..b009fa6 100644 --- a/net/http/bidirectional_stream.cc +++ b/net/http/bidirectional_stream.cc
@@ -113,11 +113,7 @@ return; } - SSLConfig ssl_config; - ssl_config.alpn_protos = session->GetAlpnProtos(); - ssl_config.application_settings = session->GetApplicationSettings(); - - StartRequest(ssl_config); + StartRequest(SSLConfig()); } BidirectionalStream::~BidirectionalStream() {
diff --git a/net/http/http_auth_handler_factory.cc b/net/http/http_auth_handler_factory.cc index 548a255..4b4c23f 100644 --- a/net/http/http_auth_handler_factory.cc +++ b/net/http/http_auth_handler_factory.cc
@@ -84,24 +84,17 @@ digest_nonce_count, net_log, host_resolver, handler); } -namespace { - -const char* const kDefaultAuthSchemes[] = {kBasicAuthScheme, kDigestAuthScheme, -#if BUILDFLAG(USE_KERBEROS) && !BUILDFLAG(IS_ANDROID) - kNegotiateAuthScheme, -#endif - kNtlmAuthScheme}; - -} // namespace - -HttpAuthHandlerRegistryFactory::HttpAuthHandlerRegistryFactory() = default; +HttpAuthHandlerRegistryFactory::HttpAuthHandlerRegistryFactory( + const HttpAuthPreferences* http_auth_preferences) { + set_http_auth_preferences(http_auth_preferences); +} HttpAuthHandlerRegistryFactory::~HttpAuthHandlerRegistryFactory() = default; void HttpAuthHandlerRegistryFactory::SetHttpAuthPreferences( const std::string& scheme, const HttpAuthPreferences* prefs) { - HttpAuthHandlerFactory* factory = GetSchemeFactory(scheme); + HttpAuthHandlerFactory* factory = GetRegisteredSchemeFactory(scheme); if (factory) factory->set_http_auth_preferences(prefs); } @@ -121,11 +114,11 @@ HttpAuthHandlerFactory* HttpAuthHandlerRegistryFactory::GetSchemeFactory( const std::string& scheme) const { std::string lower_scheme = base::ToLowerASCII(scheme); - auto it = factory_map_.find(lower_scheme); - if (it == factory_map_.end()) { - return nullptr; // |scheme| is not registered. + const auto& allowed_schemes = GetAllowedAuthSchemes(); + if (allowed_schemes.find(lower_scheme) == allowed_schemes.end()) { + return nullptr; } - return it->second.get(); + return GetRegisteredSchemeFactory(scheme); } // static @@ -141,9 +134,7 @@ HttpAuthMechanismFactory negotiate_auth_system_factory #endif ) { - std::vector<std::string> auth_types(std::begin(kDefaultAuthSchemes), - std::end(kDefaultAuthSchemes)); - return HttpAuthHandlerRegistryFactory::Create(prefs, auth_types + return HttpAuthHandlerRegistryFactory::Create(prefs #if BUILDFLAG(USE_EXTERNAL_GSSAPI) , gssapi_library_name @@ -158,8 +149,7 @@ // static std::unique_ptr<HttpAuthHandlerRegistryFactory> HttpAuthHandlerRegistryFactory::Create( - const HttpAuthPreferences* prefs, - const std::vector<std::string>& auth_schemes + const HttpAuthPreferences* prefs #if BUILDFLAG(USE_EXTERNAL_GSSAPI) , const std::string& gssapi_library_name @@ -169,45 +159,35 @@ HttpAuthMechanismFactory negotiate_auth_system_factory #endif ) { - std::set<std::string> auth_schemes_set(auth_schemes.begin(), - auth_schemes.end()); - std::unique_ptr<HttpAuthHandlerRegistryFactory> registry_factory( - new HttpAuthHandlerRegistryFactory()); - if (base::Contains(auth_schemes_set, kBasicAuthScheme)) { - registry_factory->RegisterSchemeFactory( - kBasicAuthScheme, new HttpAuthHandlerBasic::Factory()); - } + new HttpAuthHandlerRegistryFactory(prefs)); - if (base::Contains(auth_schemes_set, kDigestAuthScheme)) { - registry_factory->RegisterSchemeFactory( - kDigestAuthScheme, new HttpAuthHandlerDigest::Factory()); - } + registry_factory->RegisterSchemeFactory(kBasicAuthScheme, + new HttpAuthHandlerBasic::Factory()); - if (base::Contains(auth_schemes_set, kNtlmAuthScheme)) { - HttpAuthHandlerNTLM::Factory* ntlm_factory = - new HttpAuthHandlerNTLM::Factory(); + registry_factory->RegisterSchemeFactory(kDigestAuthScheme, + new HttpAuthHandlerDigest::Factory()); + + HttpAuthHandlerNTLM::Factory* ntlm_factory = + new HttpAuthHandlerNTLM::Factory(); #if BUILDFLAG(IS_WIN) - ntlm_factory->set_sspi_library( - std::make_unique<SSPILibraryDefault>(NTLMSP_NAME)); + ntlm_factory->set_sspi_library( + std::make_unique<SSPILibraryDefault>(NTLMSP_NAME)); #endif // BUILDFLAG(IS_WIN) - registry_factory->RegisterSchemeFactory(kNtlmAuthScheme, ntlm_factory); - } + registry_factory->RegisterSchemeFactory(kNtlmAuthScheme, ntlm_factory); #if BUILDFLAG(USE_KERBEROS) - if (base::Contains(auth_schemes_set, kNegotiateAuthScheme)) { - HttpAuthHandlerNegotiate::Factory* negotiate_factory = - new HttpAuthHandlerNegotiate::Factory(negotiate_auth_system_factory); + HttpAuthHandlerNegotiate::Factory* negotiate_factory = + new HttpAuthHandlerNegotiate::Factory(negotiate_auth_system_factory); #if BUILDFLAG(IS_WIN) - negotiate_factory->set_library( - std::make_unique<SSPILibraryDefault>(NEGOSSP_NAME)); + negotiate_factory->set_library( + std::make_unique<SSPILibraryDefault>(NEGOSSP_NAME)); #elif BUILDFLAG(USE_EXTERNAL_GSSAPI) - negotiate_factory->set_library( - std::make_unique<GSSAPISharedLibrary>(gssapi_library_name)); + negotiate_factory->set_library( + std::make_unique<GSSAPISharedLibrary>(gssapi_library_name)); #endif - registry_factory->RegisterSchemeFactory(kNegotiateAuthScheme, - negotiate_factory); - } + registry_factory->RegisterSchemeFactory(kNegotiateAuthScheme, + negotiate_factory); #endif // BUILDFLAG(USE_KERBEROS) if (prefs) { @@ -238,13 +218,12 @@ handler->reset(); net_error = ERR_INVALID_RESPONSE; } else { - auto it = factory_map_.find(scheme); - if (it == factory_map_.end()) { + auto* factory = GetSchemeFactory(scheme); + if (!factory) { handler->reset(); net_error = ERR_UNSUPPORTED_AUTH_SCHEME; } else { - DCHECK(it->second); - net_error = it->second->CreateAuthHandler( + net_error = factory->CreateAuthHandler( challenge, target, ssl_info, network_isolation_key, scheme_host_port, reason, digest_nonce_count, net_log, host_resolver, handler); } @@ -263,4 +242,24 @@ return net_error; } +const std::set<std::string>& +HttpAuthHandlerRegistryFactory::GetAllowedAuthSchemes() const { + if (http_auth_preferences() && + http_auth_preferences()->allowed_schemes().has_value()) { + return *http_auth_preferences()->allowed_schemes(); + } + return default_auth_schemes_; +} + +HttpAuthHandlerFactory* +HttpAuthHandlerRegistryFactory::GetRegisteredSchemeFactory( + const std::string& scheme) const { + std::string lower_scheme = base::ToLowerASCII(scheme); + auto it = factory_map_.find(lower_scheme); + if (it == factory_map_.end()) { + return nullptr; // |scheme| is not registered. + } + return it->second.get(); +} + } // namespace net
diff --git a/net/http/http_auth_handler_factory.h b/net/http/http_auth_handler_factory.h index 972fdc44..4c089081b 100644 --- a/net/http/http_auth_handler_factory.h +++ b/net/http/http_auth_handler_factory.h
@@ -7,6 +7,7 @@ #include <map> #include <memory> +#include <set> #include <string> #include <vector> @@ -15,6 +16,7 @@ #include "net/base/net_export.h" #include "net/http/http_auth.h" #include "net/http/http_auth_mechanism.h" +#include "net/http/http_auth_scheme.h" #include "net/http/url_security_manager.h" #include "net/net_buildflags.h" @@ -59,7 +61,7 @@ } // Retrieves the associated URL security manager. - const HttpAuthPreferences* http_auth_preferences() { + const HttpAuthPreferences* http_auth_preferences() const { return http_auth_preferences_; } @@ -168,7 +170,8 @@ class NET_EXPORT HttpAuthHandlerRegistryFactory : public HttpAuthHandlerFactory { public: - HttpAuthHandlerRegistryFactory(); + explicit HttpAuthHandlerRegistryFactory( + const HttpAuthPreferences* http_auth_preferences); HttpAuthHandlerRegistryFactory(const HttpAuthHandlerRegistryFactory&) = delete; @@ -205,14 +208,10 @@ // That object tracks preference, and hence policy, updates relevant to HTTP // authentication, and provides the current values of the preferences. // - // |auth_schemes| is a list of authentication schemes to support. Unknown - // schemes are ignored. - // // |negotiate_auth_system_factory| is used to override the default auth system // used by the Negotiate authentication handler. static std::unique_ptr<HttpAuthHandlerRegistryFactory> Create( - const HttpAuthPreferences* prefs, - const std::vector<std::string>& auth_schemes + const HttpAuthPreferences* prefs #if BUILDFLAG(USE_EXTERNAL_GSSAPI) , const std::string& gssapi_library_name = "" @@ -242,11 +241,26 @@ const NetLogWithSource& net_log, HostResolver* host_resolver, std::unique_ptr<HttpAuthHandler>* handler) override; + const std::set<std::string>& GetAllowedAuthSchemes() const; private: + // Retrieve the factory for the specified |scheme|. If no factory exists + // for the |scheme|, nullptr is returned. The returned factory must not be + // deleted by the caller, and it is guaranteed to be valid until either + // a new factory is registered for the same scheme, or until this + // registry factory is destroyed. + HttpAuthHandlerFactory* GetRegisteredSchemeFactory( + const std::string& scheme) const; + using FactoryMap = std::map<std::string, std::unique_ptr<HttpAuthHandlerFactory>>; - + std::set<std::string> default_auth_schemes_ { + kBasicAuthScheme, kDigestAuthScheme, +#if BUILDFLAG(USE_KERBEROS) && !BUILDFLAG(IS_ANDROID) + kNegotiateAuthScheme, +#endif + kNtlmAuthScheme + }; FactoryMap factory_map_; };
diff --git a/net/http/http_auth_handler_factory_unittest.cc b/net/http/http_auth_handler_factory_unittest.cc index ade6a508..ad6c0d38 100644 --- a/net/http/http_auth_handler_factory_unittest.cc +++ b/net/http/http_auth_handler_factory_unittest.cc
@@ -61,7 +61,8 @@ TEST(HttpAuthHandlerFactoryTest, RegistryFactory) { SSLInfo null_ssl_info; - HttpAuthHandlerRegistryFactory registry_factory; + HttpAuthHandlerRegistryFactory registry_factory( + /*http_auth_preferences=*/nullptr); url::SchemeHostPort scheme_host_port(GURL("https://www.google.com")); const int kBasicReturnCode = -1; MockHttpAuthHandlerFactory* mock_factory_basic =
diff --git a/net/http/http_auth_preferences.h b/net/http/http_auth_preferences.h index 2a34cab..555c4f3 100644 --- a/net/http/http_auth_preferences.h +++ b/net/http/http_auth_preferences.h
@@ -8,12 +8,12 @@ #include <memory> #include <set> #include <string> -#include <vector> #include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "net/base/net_export.h" #include "net/http/http_auth.h" +#include "third_party/abseil-cpp/absl/types/optional.h" namespace url { class SchemeHostPort; @@ -91,6 +91,15 @@ } #endif + const absl::optional<std::set<std::string>>& allowed_schemes() const { + return allowed_schemes_; + } + + void set_allowed_schemes( + const absl::optional<std::set<std::string>>& allowed_schemes) { + allowed_schemes_ = allowed_schemes; + } + void SetServerAllowlist(const std::string& server_allowlist); void SetDelegateAllowlist(const std::string& delegate_allowlist); @@ -124,6 +133,7 @@ bool allow_gssapi_library_load_ = true; #endif + absl::optional<std::set<std::string>> allowed_schemes_; std::unique_ptr<URLSecurityManager> security_manager_; };
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index 5596469..a22f163 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc
@@ -374,15 +374,6 @@ quic_stream_factory_.set_server_push_delegate(push_delegate_.get()); } -void HttpNetworkSession::GetSSLConfig(SSLConfig* server_config, - SSLConfig* proxy_config) const { - server_config->alpn_protos = GetAlpnProtos(); - server_config->application_settings = GetApplicationSettings(); - server_config->ignore_certificate_errors = params_.ignore_certificate_errors; - *proxy_config = *server_config; - server_config->early_data_enabled = params_.enable_early_data; -} - bool HttpNetworkSession::IsQuicEnabled() const { return params_.enable_quic; }
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index 27295e0..b0f82e9 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h
@@ -280,9 +280,6 @@ return application_settings_; } - // Populates |server_config| and |proxy_config| based on this session. - void GetSSLConfig(SSLConfig* server_config, SSLConfig* proxy_config) const; - // Evaluates if QUIC is enabled for new streams. bool IsQuicEnabled() const;
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 26a2605a..6989ba8b 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc
@@ -188,8 +188,6 @@ start_timeticks_ = base::TimeTicks::Now(); #endif // BUILDFLAG(ENABLE_REPORTING) - session_->GetSSLConfig(&server_ssl_config_, &proxy_ssl_config_); - if (request_->load_flags & LOAD_DISABLE_CERT_NETWORK_FETCHES) { server_ssl_config_.disable_cert_verification_network_fetches = true; proxy_ssl_config_.disable_cert_verification_network_fetches = true;
diff --git a/net/http/http_proxy_client_socket_fuzzer.cc b/net/http/http_proxy_client_socket_fuzzer.cc index cc78fcf..b3bd02b 100644 --- a/net/http/http_proxy_client_socket_fuzzer.cc +++ b/net/http/http_proxy_client_socket_fuzzer.cc
@@ -23,6 +23,7 @@ #include "net/http/http_auth_handler_basic.h" #include "net/http/http_auth_handler_digest.h" #include "net/http/http_auth_handler_factory.h" +#include "net/http/http_auth_preferences.h" #include "net/http/http_auth_scheme.h" #include "net/log/net_log.h" #include "net/log/test_net_log.h" @@ -50,11 +51,11 @@ // make system calls, which doesn't seem like a great idea. net::HttpAuthCache auth_cache( false /* key_server_entries_by_network_isolation_key */); - net::HttpAuthHandlerRegistryFactory auth_handler_factory; - auth_handler_factory.RegisterSchemeFactory( - net::kBasicAuthScheme, new net::HttpAuthHandlerBasic::Factory()); - auth_handler_factory.RegisterSchemeFactory( - net::kDigestAuthScheme, new net::HttpAuthHandlerDigest::Factory()); + net::HttpAuthPreferences http_auth_preferences; + http_auth_preferences.set_allowed_schemes( + std::set<std::string>{net::kBasicAuthScheme, net::kDigestAuthScheme}); + net::HttpAuthHandlerRegistryFactory auth_handler_factory( + &http_auth_preferences); scoped_refptr<net::HttpAuthController> auth_controller( base::MakeRefCounted<net::HttpAuthController>(
diff --git a/net/http/http_stream_factory.cc b/net/http/http_stream_factory.cc index 221f07f..cd4437eb 100644 --- a/net/http/http_stream_factory.cc +++ b/net/http/http_stream_factory.cc
@@ -164,17 +164,13 @@ const HttpRequestInfo& request_info) { DCHECK(request_info.url.is_valid()); - SSLConfig server_ssl_config; - SSLConfig proxy_ssl_config; - session_->GetSSLConfig(&server_ssl_config, &proxy_ssl_config); - auto job_controller = std::make_unique<JobController>( this, nullptr, session_, job_factory_.get(), request_info, - /* is_preconnect = */ true, - /* is_websocket = */ false, - /* enable_ip_based_pooling = */ true, - /* enable_alternative_services = */ true, server_ssl_config, - proxy_ssl_config); + /*is_preconnect=*/true, + /*is_websocket=*/false, + /*enable_ip_based_pooling=*/true, + /*enable_alternative_services=*/true, /*server_ssl_config=*/SSLConfig(), + /*proxy_ssl_config=*/SSLConfig()); JobController* job_controller_raw_ptr = job_controller.get(); job_controller_set_.insert(std::move(job_controller)); job_controller_raw_ptr->Preconnect(num_streams);
diff --git a/net/http/http_stream_factory_job.cc b/net/http/http_stream_factory_job.cc index e944434e..a831772 100644 --- a/net/http/http_stream_factory_job.cc +++ b/net/http/http_stream_factory_job.cc
@@ -319,14 +319,6 @@ return using_spdy_; } -const SSLConfig& HttpStreamFactory::Job::server_ssl_config() const { - return server_ssl_config_; -} - -const SSLConfig& HttpStreamFactory::Job::proxy_ssl_config() const { - return proxy_ssl_config_; -} - const ProxyInfo& HttpStreamFactory::Job::proxy_info() const { return proxy_info_; } @@ -726,6 +718,18 @@ server_ssl_config_.renego_allowed_for_protos.push_back(kProtoHTTP11); } + server_ssl_config_.alpn_protos = session_->GetAlpnProtos(); + proxy_ssl_config_.alpn_protos = session_->GetAlpnProtos(); + server_ssl_config_.application_settings = session_->GetApplicationSettings(); + proxy_ssl_config_.application_settings = session_->GetApplicationSettings(); + server_ssl_config_.ignore_certificate_errors = + session_->params().ignore_certificate_errors; + proxy_ssl_config_.ignore_certificate_errors = + session_->params().ignore_certificate_errors; + + // TODO(https://crbug.com/964642): Also enable 0-RTT for TLS proxies. + server_ssl_config_.early_data_enabled = session_->params().enable_early_data; + if (using_quic_) return DoInitConnectionImplQuic();
diff --git a/net/http/http_stream_factory_job.h b/net/http/http_stream_factory_job.h index 1f19c21..6ce0c30 100644 --- a/net/http/http_stream_factory_job.h +++ b/net/http/http_stream_factory_job.h
@@ -206,8 +206,6 @@ } bool is_waiting() const { return next_state_ == STATE_WAIT_COMPLETE; } - const SSLConfig& server_ssl_config() const; - const SSLConfig& proxy_ssl_config() const; const ProxyInfo& proxy_info() const; ResolveErrorInfo resolve_error_info() const;
diff --git a/net/socket/transport_connect_job.cc b/net/socket/transport_connect_job.cc index a9c07f8..ec10da2 100644 --- a/net/socket/transport_connect_job.cc +++ b/net/socket/transport_connect_job.cc
@@ -154,6 +154,7 @@ return LOAD_STATE_RESOLVING_HOST; case STATE_TRANSPORT_CONNECT: case STATE_TRANSPORT_CONNECT_COMPLETE: + case STATE_FALLBACK_CONNECT_COMPLETE: return LOAD_STATE_CONNECTING; case STATE_NONE: return LOAD_STATE_IDLE; @@ -171,15 +172,11 @@ ConnectionAttempts TransportConnectJob::GetConnectionAttempts() const { // If hostname resolution failed, record an empty endpoint and the result. // Also record any attempts made on either of the sockets. - ConnectionAttempts attempts; + ConnectionAttempts attempts = connection_attempts_; if (resolve_result_ != OK) { DCHECK(!request_->GetAddressResults()); attempts.push_back(ConnectionAttempt(IPEndPoint(), resolve_result_)); } - attempts.insert(attempts.begin(), connection_attempts_.begin(), - connection_attempts_.end()); - attempts.insert(attempts.begin(), fallback_connection_attempts_.begin(), - fallback_connection_attempts_.end()); return attempts; } @@ -275,7 +272,10 @@ rv = DoTransportConnect(); break; case STATE_TRANSPORT_CONNECT_COMPLETE: - rv = DoTransportConnectComplete(rv); + rv = DoTransportConnectComplete(/*is_fallback=*/false, rv); + break; + case STATE_FALLBACK_CONNECT_COMPLETE: + rv = DoTransportConnectComplete(/*is_fallback=*/true, rv); break; default: NOTREACHED(); @@ -372,53 +372,64 @@ if (rv == ERR_IO_PENDING && try_ipv6_connect_with_ipv4_fallback) { fallback_timer_.Start(FROM_HERE, base::Milliseconds(kIPv6FallbackTimerInMs), this, - &TransportConnectJob::DoIPv6FallbackTransportConnect); + &TransportConnectJob::OnIPv6FallbackTimerComplete); } return rv; } -int TransportConnectJob::DoTransportConnectComplete(int result) { - if (result == OK) { - // Success will be returned via the main socket, so also include connection - // attempts made on the fallback socket up to this point. (Unfortunately, - // the only simple way to return information in the success case is through - // the successfully-connected socket.) - if (fallback_transport_socket_) { - ConnectionAttempts fallback_attempts; - fallback_transport_socket_->GetConnectionAttempts(&fallback_attempts); - transport_socket_->AddConnectionAttempts(fallback_attempts); - } +int TransportConnectJob::DoTransportConnectComplete(bool is_fallback, + int result) { + // Either the main socket or the fallback one completed. + std::unique_ptr<StreamSocket>& completed_socket = + is_fallback ? fallback_transport_socket_ : transport_socket_; + std::unique_ptr<StreamSocket>& other_socket = + is_fallback ? transport_socket_ : fallback_transport_socket_; + DCHECK(completed_socket); + if (other_socket) { + // Save the connection attempts from the other socket. (Unfortunately, the + // only simple way to return information in the success case is through the + // successfully-connected socket.) + ConnectionAttempts attempts; + other_socket->GetConnectionAttempts(&attempts); + completed_socket->AddConnectionAttempts(attempts); + } + if (is_fallback) { + connect_timing_.connect_start = fallback_connect_start_time_; + } - bool is_ipv4 = request_->GetAddressResults().value().front().GetFamily() == - ADDRESS_FAMILY_IPV4; + // Cancel any completion events from the callback timer and other socket. + fallback_timer_.Stop(); + other_socket.reset(); + + if (result == OK) { + DCHECK(request_); + const AddressList& addresses = request_->GetAddressResults().value(); + bool is_ipv4 = addresses.front().GetFamily() == ADDRESS_FAMILY_IPV4; RaceResult race_result = RACE_UNKNOWN; - if (is_ipv4) + if (is_fallback) { + race_result = RACE_IPV4_WINS; + } else if (is_ipv4) { race_result = RACE_IPV4_SOLO; - else if (AddressListOnlyContainsIPv6(request_->GetAddressResults().value())) + } else if (AddressListOnlyContainsIPv6(addresses)) { race_result = RACE_IPV6_SOLO; - else + } else { race_result = RACE_IPV6_WINS; + } HistogramDuration(connect_timing_, race_result); - DCHECK(request_); - SetSocket(std::move(transport_socket_), + SetSocket(std::move(completed_socket), base::OptionalFromPtr(request_->GetDnsAliasResults())); } else { // Failure will be returned via |GetAdditionalErrorState|, so save - // connection attempts from both sockets for use there. - CopyConnectionAttemptsFromSockets(); - - transport_socket_.reset(); + // connection attempts from the socket for use there. + completed_socket->GetConnectionAttempts(&connection_attempts_); + completed_socket.reset(); } - fallback_timer_.Stop(); - fallback_transport_socket_.reset(); - fallback_addresses_.reset(); - return result; } -void TransportConnectJob::DoIPv6FallbackTransportConnect() { +void TransportConnectJob::OnIPv6FallbackTimerComplete() { // The timer should only fire while we're waiting for the main connect to // succeed. if (next_state_ != STATE_TRANSPORT_CONNECT_COMPLETE) { @@ -427,75 +438,39 @@ } DCHECK(!fallback_transport_socket_.get()); - DCHECK(!fallback_addresses_.get()); - fallback_addresses_ = - std::make_unique<AddressList>(request_->GetAddressResults().value()); - MakeAddressListStartWithIPv4(fallback_addresses_.get()); + AddressList fallback_addresses = request_->GetAddressResults().value(); + MakeAddressListStartWithIPv4(&fallback_addresses); // Create a |SocketPerformanceWatcher|, and pass the ownership. std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher; if (socket_performance_watcher_factory()) { socket_performance_watcher = socket_performance_watcher_factory()->CreateSocketPerformanceWatcher( - SocketPerformanceWatcherFactory::PROTOCOL_TCP, - *fallback_addresses_); + SocketPerformanceWatcherFactory::PROTOCOL_TCP, fallback_addresses); } fallback_transport_socket_ = client_socket_factory()->CreateTransportClientSocket( - *fallback_addresses_, std::move(socket_performance_watcher), + fallback_addresses, std::move(socket_performance_watcher), network_quality_estimator(), net_log().net_log(), net_log().source()); fallback_connect_start_time_ = base::TimeTicks::Now(); int rv = fallback_transport_socket_->Connect(base::BindOnce( - &TransportConnectJob::DoIPv6FallbackTransportConnectComplete, - base::Unretained(this))); + base::BindOnce(&TransportConnectJob::OnIPv6FallbackConnectComplete, + base::Unretained(this)))); if (rv != ERR_IO_PENDING) - DoIPv6FallbackTransportConnectComplete(rv); + OnIPv6FallbackConnectComplete(rv); } -void TransportConnectJob::DoIPv6FallbackTransportConnectComplete(int result) { +void TransportConnectJob::OnIPv6FallbackConnectComplete(int result) { // This should only happen when we're waiting for the main connect to succeed. if (next_state_ != STATE_TRANSPORT_CONNECT_COMPLETE) { NOTREACHED(); return; } - DCHECK_NE(ERR_IO_PENDING, result); - DCHECK(fallback_transport_socket_.get()); - DCHECK(fallback_addresses_.get()); - - if (result == OK) { - DCHECK(!fallback_connect_start_time_.is_null()); - - // Success will be returned via the fallback socket, so also include - // connection attempts made on the main socket up to this point. - // (Unfortunately, the only simple way to return information in the success - // case is through the successfully-connected socket.) - if (transport_socket_) { - ConnectionAttempts attempts; - transport_socket_->GetConnectionAttempts(&attempts); - fallback_transport_socket_->AddConnectionAttempts(attempts); - } - - connect_timing_.connect_start = fallback_connect_start_time_; - HistogramDuration(connect_timing_, RACE_IPV4_WINS); - DCHECK(request_); - SetSocket(std::move(fallback_transport_socket_), - base::OptionalFromPtr(request_->GetDnsAliasResults())); - next_state_ = STATE_NONE; - } else { - // Failure will be returned via |GetAdditionalErrorState|, so save - // connection attempts from both sockets for use there. - CopyConnectionAttemptsFromSockets(); - - fallback_transport_socket_.reset(); - fallback_addresses_.reset(); - } - - transport_socket_.reset(); - - NotifyDelegateOfCompletion(result); // Deletes |this| + next_state_ = STATE_FALLBACK_CONNECT_COMPLETE; + OnIOComplete(result); } int TransportConnectJob::ConnectInternal() { @@ -511,13 +486,4 @@ } } -void TransportConnectJob::CopyConnectionAttemptsFromSockets() { - if (transport_socket_) - transport_socket_->GetConnectionAttempts(&connection_attempts_); - if (fallback_transport_socket_) { - fallback_transport_socket_->GetConnectionAttempts( - &fallback_connection_attempts_); - } -} - } // namespace net
diff --git a/net/socket/transport_connect_job.h b/net/socket/transport_connect_job.h index 05e558b..7453298 100644 --- a/net/socket/transport_connect_job.h +++ b/net/socket/transport_connect_job.h
@@ -159,6 +159,7 @@ STATE_RESOLVE_HOST_COMPLETE, STATE_TRANSPORT_CONNECT, STATE_TRANSPORT_CONNECT_COMPLETE, + STATE_FALLBACK_CONNECT_COMPLETE, STATE_NONE, }; @@ -168,11 +169,11 @@ int DoResolveHost(); int DoResolveHostComplete(int result); int DoTransportConnect(); - int DoTransportConnectComplete(int result); + int DoTransportConnectComplete(bool is_fallback, int result); // Not part of the state machine. - void DoIPv6FallbackTransportConnect(); - void DoIPv6FallbackTransportConnectComplete(int result); + void OnIPv6FallbackTimerComplete(); + void OnIPv6FallbackConnectComplete(int rv); // Begins the host resolution and the TCP connect. Returns OK on success // and ERR_IO_PENDING if it cannot immediately service the request. @@ -183,8 +184,6 @@ // resolver request. void ChangePriorityInternal(RequestPriority priority) override; - void CopyConnectionAttemptsFromSockets(); - scoped_refptr<TransportSocketParams> params_; std::unique_ptr<HostResolver::ResolveHostRequest> request_; @@ -193,7 +192,6 @@ std::unique_ptr<StreamSocket> transport_socket_; std::unique_ptr<StreamSocket> fallback_transport_socket_; - std::unique_ptr<AddressList> fallback_addresses_; base::TimeTicks fallback_connect_start_time_; base::OneShotTimer fallback_timer_; @@ -206,7 +204,6 @@ // attempts are copied from the other socket, if one exists, into it before // it is returned.) ConnectionAttempts connection_attempts_; - ConnectionAttempts fallback_connection_attempts_; base::WeakPtrFactory<TransportConnectJob> weak_ptr_factory_{this}; };
diff --git a/net/test/embedded_test_server/embedded_test_server.h b/net/test/embedded_test_server/embedded_test_server.h index d335667..450a3780 100644 --- a/net/test/embedded_test_server/embedded_test_server.h +++ b/net/test/embedded_test_server/embedded_test_server.h
@@ -430,7 +430,7 @@ const SSLServerConfig& ssl_config); void SetSSLConfig(const ServerCertificateConfig& cert_config); - // TODO(mattm): make this WARN_UNUSED_RESULT + // TODO(mattm): make this [[nodiscard]] bool ResetSSLConfig(ServerCertificate cert, const SSLServerConfig& ssl_config);
diff --git a/printing/backend/print_backend_win.cc b/printing/backend/print_backend_win.cc index be16894c..86f74f4 100644 --- a/printing/backend/print_backend_win.cc +++ b/printing/backend/print_backend_win.cc
@@ -209,28 +209,28 @@ DCHECK(printer_list); DWORD bytes_needed = 0; DWORD count_returned = 0; + constexpr DWORD kFlags = PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS; const DWORD kLevel = 4; - EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, nullptr, kLevel, - nullptr, 0, &bytes_needed, &count_returned); - if (bytes_needed == 0) { - // No bytes needed could mean the operation failed or that there are simply - // no printer drivers installed. Rely upon system error code to - // distinguish between these. - logging::SystemErrorCode code = logging::GetLastSystemErrorCode(); - if (code == ERROR_SUCCESS) { - VLOG(1) << "Found no printers"; - return mojom::ResultCode::kSuccess; - } + EnumPrinters(kFlags, nullptr, kLevel, nullptr, 0, &bytes_needed, + &count_returned); + logging::SystemErrorCode code = logging::GetLastSystemErrorCode(); + if (code == ERROR_SUCCESS) { + // If EnumPrinters() succeeded, that means there are no printer drivers + // installed because 0 bytes was sufficient. + DCHECK_EQ(bytes_needed, 0u); + VLOG(1) << "Found no printers"; + return mojom::ResultCode::kSuccess; + } + if (code != ERROR_INSUFFICIENT_BUFFER) { LOG(ERROR) << "Error enumerating printers: " << logging::SystemErrorCodeToString(code); return GetResultCodeFromSystemErrorCode(code); } auto printer_info_buffer = std::make_unique<BYTE[]>(bytes_needed); - if (!EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, nullptr, - kLevel, printer_info_buffer.get(), bytes_needed, - &bytes_needed, &count_returned)) { + if (!EnumPrinters(kFlags, nullptr, kLevel, printer_info_buffer.get(), + bytes_needed, &bytes_needed, &count_returned)) { NOTREACHED(); return GetResultCodeFromSystemErrorCode(logging::GetLastSystemErrorCode()); }
diff --git a/services/network/network_context.cc b/services/network/network_context.cc index e120892..abcf825 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc
@@ -62,11 +62,13 @@ #include "net/http/http_auth.h" #include "net/http/http_auth_handler_factory.h" #include "net/http/http_auth_preferences.h" +#include "net/http/http_auth_scheme.h" #include "net/http/http_cache.h" #include "net/http/http_network_session.h" #include "net/http/http_request_headers.h" #include "net/http/http_server_properties.h" #include "net/http/http_transaction_factory.h" +#include "net/net_buildflags.h" #include "net/proxy_resolution/configured_proxy_resolution_service.h" #include "net/proxy_resolution/proxy_config.h" #include "net/traffic_annotation/network_traffic_annotation.h" @@ -2086,6 +2088,13 @@ http_auth_merged_preferences_.set_allow_gssapi_library_load( http_auth_dynamic_network_service_params->allow_gssapi_library_load); #endif + if (http_auth_dynamic_network_service_params->allowed_schemes.has_value()) { + http_auth_merged_preferences_.set_allowed_schemes(std::set<std::string>( + http_auth_dynamic_network_service_params->allowed_schemes->begin(), + http_auth_dynamic_network_service_params->allowed_schemes->end())); + } else { + http_auth_merged_preferences_.set_allowed_schemes(absl::nullopt); + } } URLRequestContextOwner NetworkContext::MakeURLRequestContext(
diff --git a/services/network/network_service.cc b/services/network/network_service.cc index 7554fcfb..3180e11 100644 --- a/services/network/network_service.cc +++ b/services/network/network_service.cc
@@ -784,10 +784,9 @@ } return net::HttpAuthHandlerRegistryFactory::Create( - network_context->GetHttpAuthPreferences(), - http_auth_static_network_service_params_->supported_schemes + network_context->GetHttpAuthPreferences() #if BUILDFLAG(USE_EXTERNAL_GSSAPI) - , + , http_auth_static_network_service_params_->gssapi_library_name #endif #if BUILDFLAG(IS_ANDROID) && BUILDFLAG(USE_KERBEROS)
diff --git a/services/network/network_service_unittest.cc b/services/network/network_service_unittest.cc index 20b3a1e..0687906f 100644 --- a/services/network/network_service_unittest.cc +++ b/services/network/network_service_unittest.cc
@@ -205,31 +205,7 @@ #endif // BUILDFLAG(IS_ANDROID) } -TEST_F(NetworkServiceTest, AuthSchemesDigestAndNtlmOnly) { - mojom::HttpAuthStaticParamsPtr auth_params = - mojom::HttpAuthStaticParams::New(); - auth_params->supported_schemes.push_back("digest"); - auth_params->supported_schemes.push_back("ntlm"); - service()->SetUpHttpAuth(std::move(auth_params)); - - mojo::Remote<mojom::NetworkContext> network_context_remote; - NetworkContext network_context( - service(), network_context_remote.BindNewPipeAndPassReceiver(), - CreateContextParams()); - net::HttpAuthHandlerRegistryFactory* auth_handler_factory = - reinterpret_cast<net::HttpAuthHandlerRegistryFactory*>( - network_context.url_request_context()->http_auth_handler_factory()); - ASSERT_TRUE(auth_handler_factory); - - EXPECT_FALSE(auth_handler_factory->GetSchemeFactory(net::kBasicAuthScheme)); - EXPECT_TRUE(auth_handler_factory->GetSchemeFactory(net::kDigestAuthScheme)); - EXPECT_TRUE(auth_handler_factory->GetSchemeFactory(net::kNtlmAuthScheme)); - EXPECT_FALSE( - auth_handler_factory->GetSchemeFactory(net::kNegotiateAuthScheme)); -} - -TEST_F(NetworkServiceTest, AuthSchemesNone) { - // An empty list means to support no schemes. +TEST_F(NetworkServiceTest, AuthSchemesDynamicallyChanging) { service()->SetUpHttpAuth(mojom::HttpAuthStaticParams::New()); mojo::Remote<mojom::NetworkContext> network_context_remote; @@ -241,6 +217,78 @@ network_context.url_request_context()->http_auth_handler_factory()); ASSERT_TRUE(auth_handler_factory); + EXPECT_TRUE(auth_handler_factory->GetSchemeFactory(net::kBasicAuthScheme)); + EXPECT_TRUE(auth_handler_factory->GetSchemeFactory(net::kDigestAuthScheme)); + EXPECT_TRUE(auth_handler_factory->GetSchemeFactory(net::kNtlmAuthScheme)); +#if BUILDFLAG(USE_KERBEROS) && !defined(OS_ANDROID) + EXPECT_TRUE( + auth_handler_factory->GetSchemeFactory(net::kNegotiateAuthScheme)); +#else + EXPECT_FALSE( + auth_handler_factory->GetSchemeFactory(net::kNegotiateAuthScheme)); +#endif + { + mojom::HttpAuthDynamicParamsPtr auth_params = + mojom::HttpAuthDynamicParams::New(); + auth_params->allowed_schemes = std::vector<std::string>{}; + service()->ConfigureHttpAuthPrefs(std::move(auth_params)); + + EXPECT_FALSE(auth_handler_factory->GetSchemeFactory(net::kBasicAuthScheme)); + EXPECT_FALSE( + auth_handler_factory->GetSchemeFactory(net::kDigestAuthScheme)); + EXPECT_FALSE(auth_handler_factory->GetSchemeFactory(net::kNtlmAuthScheme)); + EXPECT_FALSE( + auth_handler_factory->GetSchemeFactory(net::kNegotiateAuthScheme)); + } + { + mojom::HttpAuthDynamicParamsPtr auth_params = + mojom::HttpAuthDynamicParams::New(); + auth_params->allowed_schemes = + std::vector<std::string>{net::kDigestAuthScheme, net::kNtlmAuthScheme}; + service()->ConfigureHttpAuthPrefs(std::move(auth_params)); + + EXPECT_FALSE(auth_handler_factory->GetSchemeFactory(net::kBasicAuthScheme)); + EXPECT_TRUE(auth_handler_factory->GetSchemeFactory(net::kDigestAuthScheme)); + EXPECT_TRUE(auth_handler_factory->GetSchemeFactory(net::kNtlmAuthScheme)); + EXPECT_FALSE( + auth_handler_factory->GetSchemeFactory(net::kNegotiateAuthScheme)); + } + { + mojom::HttpAuthDynamicParamsPtr auth_params = + mojom::HttpAuthDynamicParams::New(); + service()->ConfigureHttpAuthPrefs(std::move(auth_params)); + + EXPECT_TRUE(auth_handler_factory->GetSchemeFactory(net::kBasicAuthScheme)); + EXPECT_TRUE(auth_handler_factory->GetSchemeFactory(net::kDigestAuthScheme)); + EXPECT_TRUE(auth_handler_factory->GetSchemeFactory(net::kNtlmAuthScheme)); +#if BUILDFLAG(USE_KERBEROS) && !defined(OS_ANDROID) + EXPECT_TRUE( + auth_handler_factory->GetSchemeFactory(net::kNegotiateAuthScheme)); +#else + EXPECT_FALSE( + auth_handler_factory->GetSchemeFactory(net::kNegotiateAuthScheme)); +#endif + } +} + +TEST_F(NetworkServiceTest, AuthSchemesNone) { + service()->SetUpHttpAuth(mojom::HttpAuthStaticParams::New()); + + mojo::Remote<mojom::NetworkContext> network_context_remote; + NetworkContext network_context( + service(), network_context_remote.BindNewPipeAndPassReceiver(), + CreateContextParams()); + net::HttpAuthHandlerRegistryFactory* auth_handler_factory = + reinterpret_cast<net::HttpAuthHandlerRegistryFactory*>( + network_context.url_request_context()->http_auth_handler_factory()); + ASSERT_TRUE(auth_handler_factory); + + // An empty list means to support no schemes. + mojom::HttpAuthDynamicParamsPtr auth_params = + mojom::HttpAuthDynamicParams::New(); + auth_params->allowed_schemes = std::vector<std::string>{}; + service()->ConfigureHttpAuthPrefs(std::move(auth_params)); + EXPECT_FALSE(auth_handler_factory->GetSchemeFactory(net::kBasicAuthScheme)); EXPECT_FALSE(auth_handler_factory->GetSchemeFactory(net::kDigestAuthScheme)); EXPECT_FALSE(auth_handler_factory->GetSchemeFactory(net::kNtlmAuthScheme)); @@ -249,11 +297,16 @@ #if BUILDFLAG(USE_EXTERNAL_GSSAPI) TEST_F(NetworkServiceTest, AuthGssapiLibraryName) { const std::string kGssapiLibraryName = "Jim"; - mojom::HttpAuthStaticParamsPtr auth_params = + mojom::HttpAuthStaticParamsPtr static_auth_params = mojom::HttpAuthStaticParams::New(); - auth_params->supported_schemes.push_back("negotiate"); - auth_params->gssapi_library_name = kGssapiLibraryName; - service()->SetUpHttpAuth(std::move(auth_params)); + static_auth_params->gssapi_library_name = kGssapiLibraryName; + service()->SetUpHttpAuth(std::move(static_auth_params)); + + mojom::HttpAuthDynamicParamsPtr dynamic_auth_params = + mojom::HttpAuthDynamicParams::New(); + dynamic_auth_params->allowed_schemes = + std::vector<std::string>{net::kNegotiateAuthScheme}; + service()->ConfigureHttpAuthPrefs(std::move(dynamic_auth_params)); mojo::Remote<mojom::NetworkContext> network_context_remote; NetworkContext network_context(
diff --git a/services/network/public/mojom/network_service.mojom b/services/network/public/mojom/network_service.mojom index b59c2f5..3380047 100644 --- a/services/network/public/mojom/network_service.mojom +++ b/services/network/public/mojom/network_service.mojom
@@ -43,10 +43,10 @@ // Values for configuring HTTP authentication that can only be set once. struct HttpAuthStaticParams { - // List of supported auth schemes. Unrecognized schemes are ignored. + // List of allowed auth schemes. Unrecognized schemes are ignored. // The default value of this field (an empty list) does not match default // behavior of NetworkService when no HttpAuthStaticParams is specified. - array<string> supported_schemes; + array<string> allowed_schemes; // File name the GSSAPI library to load. Only supported on platforms where an // external GSSAPI library is necessary for Kerberos/SPNEGO support. See the @@ -57,6 +57,9 @@ // Values for configurating HTTP authentication that can be changed as needed. struct HttpAuthDynamicParams { + // List of allowed auth schemes. Unrecognized schemes are ignored. + array<string>? allowed_schemes; + // Comma / semi-colon delimited allowlist of server origins which the network // service may send the default credentials for NTLM or Negotiate // authentication.
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 5af4c26..bad21e72e 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -1637,6 +1637,21 @@ ] } ], + "BlinkCompositorUseDisplayThreadPriority": [ + { + "platforms": [ + "mac" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "BlinkCompositorUseDisplayThreadPriority" + ] + } + ] + } + ], "BrowserJankinessProfiling": [ { "platforms": [ @@ -5510,6 +5525,7 @@ "UIMaxAutocompleteMatches": "8" }, "enable_features": [ + "OmniboxAggregateShortcuts", "OmniboxDocumentProviderAso", "OmniboxEntitySuggestionsReduceLatency", "OmniboxKeywordSearchButton", @@ -7784,6 +7800,27 @@ ] } ], + "ThreadingOptimizationsOnIO": [ + { + "platforms": [ + "android", + "android_weblayer", + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled_20220119", + "enable_features": [ + "ThreadingOptimizationsOnIO" + ] + } + ] + } + ], "ToolbarMicIphAndroid": [ { "platforms": [
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h index 81d0f6aa..507efab 100644 --- a/third_party/blink/public/web/web_local_frame_client.h +++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -572,9 +572,7 @@ virtual void DidObserveLayoutNg(uint32_t all_block_count, uint32_t ng_block_count, uint32_t all_call_count, - uint32_t ng_call_count, - uint32_t flexbox_ng_block_count, - uint32_t grid_ng_block_count) {} + uint32_t ng_call_count) {} enum class LazyLoadBehavior { kDeferredImage, // An image is being deferred by the lazy load feature.
diff --git a/third_party/blink/renderer/bindings/scripts/bind_gen/callback_function.py b/third_party/blink/renderer/bindings/scripts/bind_gen/callback_function.py index b36fced5..0fb42e1 100644 --- a/third_party/blink/renderer/bindings/scripts/bind_gen/callback_function.py +++ b/third_party/blink/renderer/bindings/scripts/bind_gen/callback_function.py
@@ -186,7 +186,7 @@ func_decl = CxxFuncDeclNode(name=function_name, arg_decls=arg_decls, return_type=maybe_return_type, - warn_unused_result=True) + nodiscard=True) if cg_context.callback_function: if is_construct_call: comment = T("""\
diff --git a/third_party/blink/renderer/bindings/scripts/bind_gen/code_node_cxx.py b/third_party/blink/renderer/bindings/scripts/bind_gen/code_node_cxx.py index 93f246cb..dcd3a51 100644 --- a/third_party/blink/renderer/bindings/scripts/bind_gen/code_node_cxx.py +++ b/third_party/blink/renderer/bindings/scripts/bind_gen/code_node_cxx.py
@@ -261,7 +261,7 @@ override=False, default=False, delete=False, - warn_unused_result=False): + nodiscard=False): """ Args: name: Function name. @@ -275,7 +275,7 @@ override: True makes this an overriding function. default: True makes this have the default implementation. delete: True makes this function be deleted. - warn_unused_result: True adds WARN_UNUSED_RESULT annotation. + nodiscard: True adds [[nodiscard]] attribute. """ assert isinstance(name, str) assert isinstance(static, bool) @@ -286,16 +286,16 @@ assert isinstance(default, bool) assert isinstance(delete, bool) assert not (default and delete) - assert isinstance(warn_unused_result, bool) + assert isinstance(nodiscard, bool) template_format = ("{template}" + "{nodiscard_result}" "{static}{explicit}{constexpr}" "{return_type} " "{name}({arg_decls})" "{const}" "{override}" "{default_or_delete}" - "{warn_unused_result}" ";") if template_params is None: @@ -313,8 +313,7 @@ default_or_delete = " = delete" else: default_or_delete = "" - warn_unused_result = (" WARN_UNUSED_RESULT" - if warn_unused_result else "") + nodiscard_result = ("[[nodiscard]] " if nodiscard else "") CompositeNode.__init__(self, template_format, @@ -330,7 +329,7 @@ const=const, override=override, default_or_delete=default_or_delete, - warn_unused_result=warn_unused_result) + nodiscard_result=nodiscard_result) class CxxFuncDefNode(CompositeNode):
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index 6cbde2e..7c483da 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc
@@ -2518,11 +2518,9 @@ frame->Client()->DidObserveLayoutNg( layout_blocks_counter_, layout_blocks_counter_ng_, - layout_calls_counter_, layout_calls_counter_ng_, - layout_flexbox_counter_ng_, layout_grid_counter_ng_); + layout_calls_counter_, layout_calls_counter_ng_); layout_blocks_counter_ = layout_blocks_counter_ng_ = layout_calls_counter_ = - layout_calls_counter_ng_ = layout_flexbox_counter_ng_ = - layout_grid_counter_ng_ = 0; + layout_calls_counter_ng_ = 0; } Markers().InvalidateRectsForAllTextMatchMarkers();
diff --git a/third_party/blink/renderer/core/dom/document.h b/third_party/blink/renderer/core/dom/document.h index 40d36e2..061a262 100644 --- a/third_party/blink/renderer/core/dom/document.h +++ b/third_party/blink/renderer/core/dom/document.h
@@ -644,8 +644,6 @@ void IncLayoutCallsCounterNG() { ++layout_calls_counter_ng_; } void IncLayoutBlockCounter() { ++layout_blocks_counter_; } void IncLayoutBlockCounterNG() { ++layout_blocks_counter_ng_; } - void IncLayoutFlexboxCounterNG() { ++layout_flexbox_counter_ng_; } - void IncLayoutGridCounterNG() { ++layout_grid_counter_ng_; } scoped_refptr<const ComputedStyle> StyleForPage(uint32_t page_index); @@ -2283,12 +2281,6 @@ // The number of LayoutNGMixin<LayoutBlock> instances uint32_t layout_blocks_counter_ng_ = 0; - // The number of LayoutNGFlexibleBox instances - uint32_t layout_flexbox_counter_ng_ = 0; - - // The number of LayoutNGGrid instances - uint32_t layout_grid_counter_ng_ = 0; - bool deferred_compositor_commit_is_allowed_ = false; // True when the document was created (in DomImplementation) for specific MIME
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index 57d940aea..1022e3b 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -670,8 +670,15 @@ !GetDocument().IsActive() || GetDocument().InStyleRecalc() || !GetDocument().NeedsLayoutTreeUpdateForNodeIncludingDisplayLocked(*this)); // Elements in canvas fallback content are not rendered, but they are allowed - // to be focusable as long as their canvas is displayed and visible. + // to be focusable as long as they aren't expressly inert and their canvas is + // displayed and visible. if (IsInCanvasSubtree()) { + // TODO(obrufau): the element can be inert when GetComputedStyle() is null. + // Should maybe use EnsureComputedStyle(), but it's not const. + if (const ComputedStyle* style = GetComputedStyle()) { + if (style->IsInert()) + return false; + } const HTMLCanvasElement* canvas = Traversal<HTMLCanvasElement>::FirstAncestorOrSelf(*this); DCHECK(canvas); @@ -683,8 +690,11 @@ // FIXME: Even if we are not visible, we might have a child that is visible. // Hyatt wants to fix that some day with a "has visible content" flag or the // like. - return GetLayoutObject() && - GetLayoutObject()->Style()->Visibility() == EVisibility::kVisible; + if (LayoutObject* layout_object = GetLayoutObject()) { + const ComputedStyle& style = layout_object->StyleRef(); + return !style.IsInert() && style.Visibility() == EVisibility::kVisible; + } + return false; } Node* Element::Clone(Document& factory, CloneChildrenFlag flag) const { @@ -2900,7 +2910,8 @@ } else { LayoutObject* layout_object = GetLayoutObject(); if (!layout_object || !layout_object->SelfNeedsLayout() || - !layout_object->IsEligibleForSizeContainment()) { + !layout_object->IsEligibleForSizeContainment() || + layout_object->ForceLegacyLayout()) { return false; } } @@ -4647,7 +4658,7 @@ } bool Element::IsKeyboardFocusable() const { - return isConnected() && !IsInert() && IsFocusableStyleAfterUpdate() && + return isConnected() && IsFocusableStyleAfterUpdate() && ((SupportsFocus() && GetIntegralAttribute(html_names::kTabindexAttr, 0) >= 0) || (RuntimeEnabledFeatures::KeyboardFocusableScrollersEnabled() && @@ -4655,8 +4666,7 @@ } bool Element::IsMouseFocusable() const { - return isConnected() && !IsInert() && IsFocusableStyleAfterUpdate() && - SupportsFocus(); + return isConnected() && IsFocusableStyleAfterUpdate() && SupportsFocus(); } bool Element::IsAutofocusable() const {
diff --git a/third_party/blink/renderer/core/dom/node.cc b/third_party/blink/renderer/core/dom/node.cc index 07b1e53..c86dc537 100644 --- a/third_party/blink/renderer/core/dom/node.cc +++ b/third_party/blink/renderer/core/dom/node.cc
@@ -1389,13 +1389,6 @@ return true; } -// TODO(crbug.com/692360): Remove this method. -bool Node::IsInert() const { - if (const ComputedStyle* style = GetComputedStyle()) - return style->IsInert(); - return false; -} - LinkHighlightCandidate Node::IsLinkHighlightCandidate() const { if (const LayoutObject* layout_object = GetLayoutObject()) { const ECursor cursor = layout_object->StyleRef().Cursor();
diff --git a/third_party/blink/renderer/core/dom/node.h b/third_party/blink/renderer/core/dom/node.h index f515bbb..74f60c2 100644 --- a/third_party/blink/renderer/core/dom/node.h +++ b/third_party/blink/renderer/core/dom/node.h
@@ -589,13 +589,6 @@ // This is called only when the node is focused. virtual bool ShouldHaveFocusAppearance() const; - // Whether the node is inert: - // https://html.spec.whatwg.org/C/#inert - // https://github.com/WICG/inert/blob/master/README.md - // This can't be in Element because text nodes must be recognized as - // inert to prevent text selection. - bool IsInert() const; - // Returns how |this| participates to the nodes with hand cursor set. LinkHighlightCandidate IsLinkHighlightCandidate() const;
diff --git a/third_party/blink/renderer/core/editing/local_caret_rect_test.cc b/third_party/blink/renderer/core/editing/local_caret_rect_test.cc index 73276ad..991e499 100644 --- a/third_party/blink/renderer/core/editing/local_caret_rect_test.cc +++ b/third_party/blink/renderer/core/editing/local_caret_rect_test.cc
@@ -919,8 +919,7 @@ InsertStyleElement("pre{ font: 10px/10px Ahem; width: 300px }"); const Position& caret = SetCaretTextToBody("<pre dir='ltr'>foo\n|<bdo dir='ltr'>abc</bdo></pre>"); - PhysicalRect position_rect, visible_position_rect; - std::tie(position_rect, visible_position_rect) = GetPhysicalRects(caret); + auto [position_rect, visible_position_rect] = GetPhysicalRects(caret); EXPECT_EQ(PhysicalRect(0, 10, 1, 10), position_rect); EXPECT_EQ(PhysicalRect(0, 10, 1, 10), visible_position_rect); } @@ -930,8 +929,7 @@ InsertStyleElement("pre{ font: 10px/10px Ahem; width: 300px }"); const Position& caret = SetCaretTextToBody("<pre dir='ltr'>foo\n|<bdo dir='rtl'>abc</bdo></pre>"); - PhysicalRect position_rect, visible_position_rect; - std::tie(position_rect, visible_position_rect) = GetPhysicalRects(caret); + auto [position_rect, visible_position_rect] = GetPhysicalRects(caret); EXPECT_EQ(PhysicalRect(0, 10, 1, 10), position_rect); EXPECT_EQ(PhysicalRect(0, 10, 1, 10), visible_position_rect); } @@ -941,8 +939,7 @@ InsertStyleElement("pre{ font: 10px/10px Ahem; width: 300px }"); const Position& caret = SetCaretTextToBody("<pre dir='rtl'>foo\n|<bdo dir='ltr'>abc</bdo></pre>"); - PhysicalRect position_rect, visible_position_rect; - std::tie(position_rect, visible_position_rect) = GetPhysicalRects(caret); + auto [position_rect, visible_position_rect] = GetPhysicalRects(caret); EXPECT_EQ(PhysicalRect(299, 10, 1, 10), position_rect); EXPECT_EQ(PhysicalRect(299, 10, 1, 10), visible_position_rect); } @@ -952,8 +949,7 @@ InsertStyleElement("pre{ font: 10px/10px Ahem; width: 300px }"); const Position& caret = SetCaretTextToBody("<pre dir='rtl'>foo\n|<bdo dir='rtl'>abc</bdo></pre>"); - PhysicalRect position_rect, visible_position_rect; - std::tie(position_rect, visible_position_rect) = GetPhysicalRects(caret); + auto [position_rect, visible_position_rect] = GetPhysicalRects(caret); EXPECT_EQ(PhysicalRect(299, 10, 1, 10), position_rect); EXPECT_EQ(PhysicalRect(299, 10, 1, 10), visible_position_rect); } @@ -963,8 +959,7 @@ LoadAhem(); InsertStyleElement("body { font: 10px/10px Ahem; width: 300px }"); const Position& caret = SetCaretTextToBody("<div>foo\n|</div>"); - PhysicalRect position_rect, visible_position_rect; - std::tie(position_rect, visible_position_rect) = GetPhysicalRects(caret); + auto [position_rect, visible_position_rect] = GetPhysicalRects(caret); EXPECT_EQ(PhysicalRect(30, 0, 1, 10), position_rect); EXPECT_EQ(PhysicalRect(30, 0, 1, 10), visible_position_rect); }
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h index 9373677d..aa2c98b5 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client.h +++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -216,9 +216,7 @@ virtual void DidObserveLayoutNg(uint32_t all_block_count, uint32_t ng_block_count, uint32_t all_call_count, - uint32_t ng_call_count, - uint32_t flexbox_ng_block_count, - uint32_t grid_ng_block_count) {} + uint32_t ng_call_count) {} // Reports lazy loaded behavior when the frame or image is fully deferred or // if the frame or image is loaded after being deferred. Called every time the
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc index 6a3f0eac1..ba2d1be 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
@@ -740,13 +740,10 @@ void LocalFrameClientImpl::DidObserveLayoutNg(uint32_t all_block_count, uint32_t ng_block_count, uint32_t all_call_count, - uint32_t ng_call_count, - uint32_t flexbox_ng_block_count, - uint32_t grid_ng_block_count) { + uint32_t ng_call_count) { if (WebLocalFrameClient* client = web_frame_->Client()) { client->DidObserveLayoutNg(all_block_count, ng_block_count, all_call_count, - ng_call_count, flexbox_ng_block_count, - grid_ng_block_count); + ng_call_count); } }
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h index 7bcdcfb8..2d9517c 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
@@ -149,9 +149,7 @@ void DidObserveLayoutNg(uint32_t all_block_count, uint32_t ng_block_count, uint32_t all_call_count, - uint32_t ng_call_count, - uint32_t flexbox_ng_block_count, - uint32_t grid_ng_block_count) override; + uint32_t ng_call_count) override; void DidObserveLazyLoadBehavior( WebLocalFrameClient::LazyLoadBehavior lazy_load_behavior) override; void PreloadSubresourceOptimizationsForOrigins(
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc index 4b3d2914..dd163e2 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -2190,9 +2190,7 @@ HTMLPortalElement* portal, mojo::PendingAssociatedReceiver<mojom::blink::Portal> portal_receiver, mojo::PendingAssociatedRemote<mojom::blink::PortalClient> portal_client) { - WebRemoteFrame* portal_frame; - PortalToken portal_token; - std::tie(portal_frame, portal_token) = client_->CreatePortal( + auto [portal_frame, portal_token] = client_->CreatePortal( std::move(portal_receiver), std::move(portal_client), portal); return {To<WebRemoteFrameImpl>(portal_frame)->GetFrame(), portal_token}; }
diff --git a/third_party/blink/renderer/core/html/fenced_frame/document_fenced_frames.cc b/third_party/blink/renderer/core/html/fenced_frame/document_fenced_frames.cc index 0664755ba..dc9b411ed 100644 --- a/third_party/blink/renderer/core/html/fenced_frame/document_fenced_frames.cc +++ b/third_party/blink/renderer/core/html/fenced_frame/document_fenced_frames.cc
@@ -4,8 +4,11 @@ #include "third_party/blink/renderer/core/html/fenced_frame/document_fenced_frames.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/renderer/core/dom/document.h" +#include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.h" +#include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/platform/wtf/wtf_size_t.h" namespace blink { @@ -30,6 +33,14 @@ void DocumentFencedFrames::RegisterFencedFrame( HTMLFencedFrameElement* fenced_frame) { fenced_frames_.push_back(fenced_frame); + + if (features::IsFencedFramesMPArchBased()) { + LocalFrame* frame = GetSupplementable()->GetFrame(); + if (!frame) + return; + if (Page* page = frame->GetPage()) + page->IncrementSubframeCount(); + } } void DocumentFencedFrames::DeregisterFencedFrame( @@ -38,6 +49,15 @@ if (index != WTF::kNotFound) { fenced_frames_.EraseAt(index); } + + if (features::IsFencedFramesMPArchBased()) { + LocalFrame* frame = GetSupplementable()->GetFrame(); + if (!frame) + return; + if (Page* page = frame->GetPage()) { + page->DecrementSubframeCount(); + } + } } void DocumentFencedFrames::Trace(Visitor* visitor) const {
diff --git a/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.cc b/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.cc index c977d173..dfc67723 100644 --- a/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.cc +++ b/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.cc
@@ -9,6 +9,7 @@ #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/shadow_root.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" +#include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/geometry/dom_rect_read_only.h" #include "third_party/blink/renderer/core/html/fenced_frame/document_fenced_frames.h" #include "third_party/blink/renderer/core/html/fenced_frame/fenced_frame_mparch_delegate.h" @@ -17,6 +18,7 @@ #include "third_party/blink/renderer/core/html/html_style_element.h" #include "third_party/blink/renderer/core/html_names.h" #include "third_party/blink/renderer/core/layout/layout_iframe.h" +#include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/core/resize_observer/resize_observer_entry.h" #include "third_party/blink/renderer/platform/instrumentation/use_counter.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h" @@ -40,7 +42,6 @@ frame_delegate_(FencedFrameDelegate::Create(this)) { DCHECK(RuntimeEnabledFeatures::FencedFramesEnabled(GetExecutionContext())); UseCounter::Count(document, WebFeature::kHTMLFencedFrameElement); - DocumentFencedFrames::From(document).RegisterFencedFrame(this); if (!features::IsFencedFramesMPArchBased()) StartResizeObserver(); } @@ -98,7 +99,14 @@ if (!SubframeLoadingDisabler::CanLoadFrame(*this)) return; + // The frame limit only needs to be checked on initial creation before + // attempting to insert it into the DOM. This behavior matches how iframes + // handles frame limits. + if (!IsCurrentlyWithinFrameLimit()) + return; + frame_delegate_->DidGetInserted(); + DocumentFencedFrames::From(GetDocument()).RegisterFencedFrame(this); Navigate(); }
diff --git a/third_party/blink/renderer/core/html/html_area_element.cc b/third_party/blink/renderer/core/html/html_area_element.cc index f0ef22de..7702be4 100644 --- a/third_party/blink/renderer/core/html/html_area_element.cc +++ b/third_party/blink/renderer/core/html/html_area_element.cc
@@ -193,12 +193,14 @@ } bool HTMLAreaElement::IsFocusableStyle() const { - HTMLImageElement* image = ImageElement(); - if (!image || !image->GetLayoutObject() || - image->GetLayoutObject()->Style()->Visibility() != EVisibility::kVisible) - return false; - - return SupportsFocus() && Element::tabIndex() >= 0; + if (HTMLImageElement* image = ImageElement()) { + if (LayoutObject* layout_object = image->GetLayoutObject()) { + const ComputedStyle& style = layout_object->StyleRef(); + return !style.IsInert() && style.Visibility() == EVisibility::kVisible && + SupportsFocus() && Element::tabIndex() >= 0; + } + } + return false; } void HTMLAreaElement::SetFocused(bool should_be_focused,
diff --git a/third_party/blink/renderer/core/html/html_frame_owner_element.cc b/third_party/blink/renderer/core/html/html_frame_owner_element.cc index 07e51b5..4fb0a2f 100644 --- a/third_party/blink/renderer/core/html/html_frame_owner_element.cc +++ b/third_party/blink/renderer/core/html/html_frame_owner_element.cc
@@ -599,6 +599,16 @@ return false; } +bool HTMLFrameOwnerElement::IsCurrentlyWithinFrameLimit() const { + LocalFrame* frame = GetDocument().GetFrame(); + if (!frame) + return false; + Page* page = frame->GetPage(); + if (!page) + return false; + return page->SubframeCount() < Page::MaxNumberOfFrames(); +} + bool HTMLFrameOwnerElement::LoadOrRedirectSubframe( const KURL& url, const AtomicString& frame_name,
diff --git a/third_party/blink/renderer/core/html/html_frame_owner_element.h b/third_party/blink/renderer/core/html/html_frame_owner_element.h index add86a5..7d14b83 100644 --- a/third_party/blink/renderer/core/html/html_frame_owner_element.h +++ b/third_party/blink/renderer/core/html/html_frame_owner_element.h
@@ -181,6 +181,9 @@ protected: bool is_swapping_frames() const { return is_swapping_frames_; } + // Checks that the number of frames on the page are within the current limit. + bool IsCurrentlyWithinFrameLimit() const; + private: // Intentionally private to prevent redundant checks when the type is // already HTMLFrameOwnerElement.
diff --git a/third_party/blink/renderer/core/html/portal/html_portal_element.cc b/third_party/blink/renderer/core/html/portal/html_portal_element.cc index 281f19a..5542b4e 100644 --- a/third_party/blink/renderer/core/html/portal/html_portal_element.cc +++ b/third_party/blink/renderer/core/html/portal/html_portal_element.cc
@@ -105,16 +105,6 @@ portal_ = nullptr; } -bool HTMLPortalElement::IsCurrentlyWithinFrameLimit() const { - auto* frame = GetDocument().GetFrame(); - if (!frame) - return false; - auto* page = frame->GetPage(); - if (!page) - return false; - return page->SubframeCount() < Page::MaxNumberOfFrames(); -} - String HTMLPortalElement::PreActivateChecksCommon() { if (!portal_) return "The HTMLPortalElement is not associated with a portal context.";
diff --git a/third_party/blink/renderer/core/html/portal/html_portal_element.h b/third_party/blink/renderer/core/html/portal/html_portal_element.h index 06b280e..e5cca8f1 100644 --- a/third_party/blink/renderer/core/html/portal/html_portal_element.h +++ b/third_party/blink/renderer/core/html/portal/html_portal_element.h
@@ -98,10 +98,6 @@ // the console). bool CheckWithinFrameLimitOrWarn() const; - // Checks that the number of frames and portals on the page are within the - // limit. - bool IsCurrentlyWithinFrameLimit() const; - enum class GuestContentsEligibility { // Can have a guest contents. kEligible,
diff --git a/third_party/blink/renderer/core/layout/layout_outside_list_marker.cc b/third_party/blink/renderer/core/layout/layout_outside_list_marker.cc index 3aa2726..05b40ed 100644 --- a/third_party/blink/renderer/core/layout/layout_outside_list_marker.cc +++ b/third_party/blink/renderer/core/layout/layout_outside_list_marker.cc
@@ -37,9 +37,7 @@ void LayoutOutsideListMarker::UpdateMargins() { NOT_DESTROYED(); - LayoutUnit margin_start; - LayoutUnit margin_end; - std::tie(margin_start, margin_end) = ListMarker::InlineMarginsForOutside( + auto [margin_start, margin_end] = ListMarker::InlineMarginsForOutside( GetDocument(), StyleRef(), list_marker_.ListItem(*this)->StyleRef(), PreferredLogicalWidths().min_size); SetMarginStart(margin_start);
diff --git a/third_party/blink/renderer/core/layout/layout_replaced.cc b/third_party/blink/renderer/core/layout/layout_replaced.cc index cd90d3c..c2847bed9 100644 --- a/third_party/blink/renderer/core/layout/layout_replaced.cc +++ b/third_party/blink/renderer/core/layout/layout_replaced.cc
@@ -1018,9 +1018,7 @@ const PhysicalOffset& point) const { NOT_DESTROYED(); - LayoutUnit top; - LayoutUnit bottom; - std::tie(top, bottom) = SelectionTopAndBottom(*this); + auto [top, bottom] = SelectionTopAndBottom(*this); LayoutPoint flipped_point_in_container = LocationContainer()->FlipForWritingMode(point + PhysicalLocation());
diff --git a/third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.cc b/third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.cc index 3e2bd3c..e8c788d 100644 --- a/third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.cc +++ b/third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.cc
@@ -16,10 +16,7 @@ namespace blink { LayoutNGFlexibleBox::LayoutNGFlexibleBox(Element* element) - : LayoutNGMixin<LayoutBlock>(element) { - if (element) - GetDocument().IncLayoutFlexboxCounterNG(); -} + : LayoutNGMixin<LayoutBlock>(element) {} bool LayoutNGFlexibleBox::HasTopOverflow() const { if (IsHorizontalWritingMode())
diff --git a/third_party/blink/renderer/core/layout/ng/grid/layout_ng_grid.cc b/third_party/blink/renderer/core/layout/ng/grid/layout_ng_grid.cc index ba750aa..99940e42 100644 --- a/third_party/blink/renderer/core/layout/ng/grid/layout_ng_grid.cc +++ b/third_party/blink/renderer/core/layout/ng/grid/layout_ng_grid.cc
@@ -8,10 +8,7 @@ namespace blink { LayoutNGGrid::LayoutNGGrid(Element* element) - : LayoutNGMixin<LayoutBlock>(element) { - if (element) - GetDocument().IncLayoutGridCounterNG(); -} + : LayoutNGMixin<LayoutBlock>(element) {} void LayoutNGGrid::UpdateBlockLayout(bool relayout_children) { if (IsOutOfFlowPositioned()) {
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm_test.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm_test.cc index 9e98b22..9ff050db 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm_test.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm_test.cc
@@ -359,9 +359,7 @@ </div> )HTML"); // ** Run LayoutNG algorithm ** - NGConstraintSpace space; - scoped_refptr<const NGPhysicalBoxFragment> html_fragment; - std::tie(html_fragment, space) = RunBlockLayoutAlgorithmForElement( + auto [html_fragment, space] = RunBlockLayoutAlgorithmForElement( GetDocument().getElementsByTagName("html")->item(0)); auto* body_fragment = To<NGPhysicalBoxFragment>(html_fragment->Children()[0].get());
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_ruby_utils.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_ruby_utils.cc index f68a1ea..44f212c2 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_ruby_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_ruby_utils.cc
@@ -78,8 +78,7 @@ const LayoutUnit line_height = IsHorizontalWritingMode(writing_mode) ? rect.size.height : rect.size.width; - LayoutUnit over, under; - std::tie(over, under) = AdjustTextOverUnderOffsetsForEmHeight( + auto [over, under] = AdjustTextOverUnderOffsetsForEmHeight( LayoutUnit(), line_height, style, *shape_view); const LayoutUnit over_diff = over; const LayoutUnit under_diff = line_height - under;
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc index 48db647..a9d005d 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc
@@ -426,9 +426,7 @@ )HTML"); // ** Run LayoutNG algorithm ** - NGConstraintSpace space; - scoped_refptr<const NGPhysicalBoxFragment> fragment; - std::tie(fragment, space) = RunBlockLayoutAlgorithmForElement( + auto [fragment, space] = RunBlockLayoutAlgorithmForElement( GetDocument().getElementsByTagName("html")->item(0)); ASSERT_EQ(fragment->Children().size(), 1UL); PhysicalOffset body_offset = fragment->Children()[0].Offset(); @@ -508,9 +506,7 @@ )HTML"); // ** Run LayoutNG algorithm ** - NGConstraintSpace space; - scoped_refptr<const NGPhysicalBoxFragment> fragment; - std::tie(fragment, space) = RunBlockLayoutAlgorithmForElement( + auto [fragment, space] = RunBlockLayoutAlgorithmForElement( GetDocument().getElementsByTagName("html")->item(0)); auto* body_fragment = @@ -1210,9 +1206,7 @@ )HTML"); // ** Run LayoutNG algorithm ** - NGConstraintSpace space; - scoped_refptr<const NGPhysicalBoxFragment> fragment; - std::tie(fragment, space) = RunBlockLayoutAlgorithmForElement( + auto [fragment, space] = RunBlockLayoutAlgorithmForElement( GetDocument().getElementsByTagName("html")->item(0)); const auto* body_fragment = @@ -1315,9 +1309,7 @@ )HTML"); // ** Run LayoutNG algorithm ** - NGConstraintSpace space; - scoped_refptr<const NGPhysicalBoxFragment> fragment; - std::tie(fragment, space) = RunBlockLayoutAlgorithmForElement( + auto [fragment, space] = RunBlockLayoutAlgorithmForElement( GetDocument().getElementsByTagName("html")->item(0)); // ** Verify LayoutNG fragments and the list of positioned floats **
diff --git a/third_party/blink/renderer/core/layout/ng/svg/layout_ng_svg_text_test.cc b/third_party/blink/renderer/core/layout/ng/svg/layout_ng_svg_text_test.cc index e73977f..422d1dc 100644 --- a/third_party/blink/renderer/core/layout/ng/svg/layout_ng_svg_text_test.cc +++ b/third_party/blink/renderer/core/layout/ng/svg/layout_ng_svg_text_test.cc
@@ -15,9 +15,7 @@ void DidObserveLayoutNg(uint32_t all_block_count, uint32_t ng_block_count, uint32_t all_call_count, - uint32_t ng_call_count, - uint32_t flexbox_ng_block_count, - uint32_t grid_ng_block_count) override { + uint32_t ng_call_count) override { all_call_count_ += all_call_count; }
diff --git a/third_party/blink/renderer/core/layout/ng/svg/ng_svg_text_query.cc b/third_party/blink/renderer/core/layout/ng/svg/ng_svg_text_query.cc index 1b1c072..85eb3a5 100644 --- a/third_party/blink/renderer/core/layout/ng/svg/ng_svg_text_query.cc +++ b/third_party/blink/renderer/core/layout/ng/svg/ng_svg_text_query.cc
@@ -84,9 +84,7 @@ std::tuple<const NGFragmentItem*, StringView, unsigned, unsigned> FindFragmentItemForAddressableCodeUnitIndex(const LayoutObject& query_root, unsigned index) { - Vector<const NGFragmentItem*> item_list; - const NGFragmentItems* items; - std::tie(item_list, items) = FragmentItemsInLogicalOrder(query_root); + auto [item_list, items] = FragmentItemsInLogicalOrder(query_root); unsigned character_index = 0; for (const auto* item : item_list) { @@ -134,10 +132,7 @@ std::tuple<const NGFragmentItem*, gfx::RectF> ScaledCharacterRectInContainer( const LayoutObject& query_root, unsigned code_unit_index) { - const NGFragmentItem* item; - unsigned start_ifc_offset, end_ifc_offset; - StringView item_text; - std::tie(item, item_text, start_ifc_offset, end_ifc_offset) = + auto [item, item_text, start_ifc_offset, end_ifc_offset] = FindFragmentItemForAddressableCodeUnitIndex(query_root, code_unit_index); DCHECK(item); DCHECK_EQ(item->Type(), NGFragmentItem::kSvgText); @@ -153,9 +148,7 @@ gfx::PointF StartOrEndPosition(const LayoutObject& query_root, unsigned index, QueryPosition pos) { - const NGFragmentItem* item; - gfx::RectF char_rect; - std::tie(item, char_rect) = ScaledCharacterRectInContainer(query_root, index); + auto [item, char_rect] = ScaledCharacterRectInContainer(query_root, index); DCHECK_EQ(item->Type(), NGFragmentItem::kSvgText); if (item->IsHiddenForPaint()) return gfx::PointF(); @@ -184,9 +177,7 @@ } // namespace unsigned NGSvgTextQuery::NumberOfCharacters() const { - Vector<const NGFragmentItem*> item_list; - const NGFragmentItems* items; - std::tie(item_list, items) = FragmentItemsInLogicalOrder(query_root_); + auto [item_list, items] = FragmentItemsInLogicalOrder(query_root_); unsigned addressable_code_unit_count = 0; for (const auto* item : item_list) @@ -198,9 +189,7 @@ unsigned length) const { if (length <= 0) return 0.0f; - Vector<const NGFragmentItem*> item_list; - const NGFragmentItems* items; - std::tie(item_list, items) = FragmentItemsInLogicalOrder(query_root_); + auto [item_list, items] = FragmentItemsInLogicalOrder(query_root_); float total_length = 0.0f; // Starting addressable code unit index for the current NGFragmentItem. @@ -234,10 +223,7 @@ } gfx::RectF NGSvgTextQuery::ExtentOfCharacter(unsigned index) const { - const NGFragmentItem* item; - gfx::RectF char_rect; - std::tie(item, char_rect) = - ScaledCharacterRectInContainer(query_root_, index); + auto [item, char_rect] = ScaledCharacterRectInContainer(query_root_, index); DCHECK_EQ(item->Type(), NGFragmentItem::kSvgText); if (item->IsHiddenForPaint()) return gfx::RectF(); @@ -248,10 +234,7 @@ } float NGSvgTextQuery::RotationOfCharacter(unsigned index) const { - const NGFragmentItem* item; - unsigned start_ifc_offset, end_ifc_offset; - StringView item_text; - std::tie(item, item_text, start_ifc_offset, end_ifc_offset) = + auto [item, item_text, start_ifc_offset, end_ifc_offset] = FindFragmentItemForAddressableCodeUnitIndex(query_root_, index); DCHECK(item); DCHECK_EQ(item->Type(), NGFragmentItem::kSvgText); @@ -282,9 +265,7 @@ // The specification says we should do hit-testing in logical order. // However, this does it in visual order in order to match to the legacy SVG // <text> behavior. - Vector<const NGFragmentItem*> item_list; - const NGFragmentItems* items; - std::tie(item_list, items) = FragmentItemsInVisualOrder(query_root_); + auto [item_list, items] = FragmentItemsInVisualOrder(query_root_); const NGFragmentItem* hit_item = nullptr; for (const auto* item : item_list) {
diff --git a/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc b/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc index 4b1c65b..48f1cfb 100644 --- a/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc +++ b/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc
@@ -55,9 +55,7 @@ } } // Check if we can use the script streamer. - ScriptStreamer* streamer; - ScriptStreamer::NotStreamingReason not_streamed_reason; - std::tie(streamer, not_streamed_reason) = ScriptStreamer::TakeFrom( + auto [streamer, not_streamed_reason] = ScriptStreamer::TakeFrom( script_resource, mojom::blink::ScriptType::kModule); ScriptStreamer::RecordStreamingHistogram(ScriptSchedulingType::kAsync,
diff --git a/third_party/blink/renderer/core/page/page.cc b/third_party/blink/renderer/core/page/page.cc index 0383b904..321818f 100644 --- a/third_party/blink/renderer/core/page/page.cc +++ b/third_party/blink/renderer/core/page/page.cc
@@ -53,6 +53,7 @@ #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/frame/viewport_data.h" #include "third_party/blink/renderer/core/frame/visual_viewport.h" +#include "third_party/blink/renderer/core/html/fenced_frame/document_fenced_frames.h" #include "third_party/blink/renderer/core/html/media/html_media_element.h" #include "third_party/blink/renderer/core/html/portal/document_portals.h" #include "third_party/blink/renderer/core/inspector/console_message.h" @@ -619,9 +620,22 @@ DocumentPortals::From(*local_frame->GetDocument()).GetPortals().size()); } - for (; frame; frame = frame->Tree().TraverseNext()) + for (; frame; frame = frame->Tree().TraverseNext()) { ++actual_frame_count; + // Check the ``DocumentFencedFrames`` on every local frame beneath + // the ``frame`` to get an accurate count (i.e. if an iframe embeds + // a fenced frame and creates a new ``DocumentFencedFrames`` object). + if (features::IsFencedFramesMPArchBased()) { + if (auto* local_frame = DynamicTo<LocalFrame>(frame)) { + actual_frame_count += static_cast<int>( + DocumentFencedFrames::From(*local_frame->GetDocument()) + .GetFencedFrames() + .size()); + } + } + } + DCHECK_EQ(expected_frame_count, actual_frame_count); } #endif
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_types_util.h b/third_party/blink/renderer/core/trustedtypes/trusted_types_util.h index b208f2b..251c84c 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_types_util.h +++ b/third_party/blink/renderer/core/trustedtypes/trusted_types_util.h
@@ -43,7 +43,7 @@ // Perform Trusted Type checks, for a dynamically or statically determined // type. // Returns the effective value (which may have been modified by the "default" -// policy. We use WARN_UNUSED_RESULT to prevent erroneous usage. +// policy. [[nodiscard]] String TrustedTypesCheckFor(SpecificTrustedType, String, const ExecutionContext*,
diff --git a/third_party/blink/renderer/modules/mediasource/media_source.cc b/third_party/blink/renderer/modules/mediasource/media_source.cc index d310d65a..7ccfa87 100644 --- a/third_party/blink/renderer/modules/mediasource/media_source.cc +++ b/third_party/blink/renderer/modules/mediasource/media_source.cc
@@ -682,9 +682,7 @@ // method directly. bool MediaSource::RunUnlessElementGoneOrClosingUs( MediaSourceAttachmentSupplement::RunExclusivelyCB cb) { - scoped_refptr<MediaSourceAttachmentSupplement> attachment; - MediaSourceTracer* tracer; - std::tie(attachment, tracer) = AttachmentAndTracer(); + auto [attachment, tracer] = AttachmentAndTracer(); DCHECK(IsMainThread() || !tracer); // Cross-thread attachments do not use a tracer. @@ -1060,9 +1058,7 @@ // 6. Update the media controller duration to new duration and run the // HTMLMediaElement duration change algorithm. - scoped_refptr<MediaSourceAttachmentSupplement> attachment; - MediaSourceTracer* tracer; - std::tie(attachment, tracer) = AttachmentAndTracer(); + auto [attachment, tracer] = AttachmentAndTracer(); attachment->NotifyDurationChanged(tracer, new_duration); } @@ -1300,9 +1296,7 @@ // to just mark end of stream, and move the duration reduction logic to here // so we can just run DurationChangeAlgorithm(...) here. double new_duration = GetDuration_Locked(pass_key); - scoped_refptr<MediaSourceAttachmentSupplement> attachment; - MediaSourceTracer* tracer; - std::tie(attachment, tracer) = AttachmentAndTracer(); + auto [attachment, tracer] = AttachmentAndTracer(); attachment->NotifyDurationChanged(tracer, new_duration); } else { // Even though error didn't change duration, the transition to kEnded
diff --git a/third_party/blink/renderer/modules/mediasource/source_buffer.cc b/third_party/blink/renderer/modules/mediasource/source_buffer.cc index 929f812..151473f 100644 --- a/third_party/blink/renderer/modules/mediasource/source_buffer.cc +++ b/third_party/blink/renderer/modules/mediasource/source_buffer.cc
@@ -219,9 +219,7 @@ DCHECK(web_source_buffer_); DCHECK(source_); - scoped_refptr<MediaSourceAttachmentSupplement> attachment; - MediaSourceTracer* tracer; - std::tie(attachment, tracer) = source_->AttachmentAndTracer(); + auto [attachment, tracer] = source_->AttachmentAndTracer(); DCHECK(attachment); if (GetExecutionContext()->IsWindow()) { @@ -1231,9 +1229,7 @@ DCHECK(HTMLMediaElement::MediaTracksEnabledInternally()); DCHECK(source_); - scoped_refptr<MediaSourceAttachmentSupplement> attachment; - MediaSourceTracer* tracer; - std::tie(attachment, tracer) = source_->AttachmentAndTracer(); + auto [attachment, tracer] = source_->AttachmentAndTracer(); DCHECK(attachment); // One path leading to here is from |source_|'s ContextDestroyed(), so we @@ -1345,9 +1341,7 @@ double SourceBuffer::GetMediaTime() { DCHECK(source_); - scoped_refptr<MediaSourceAttachmentSupplement> attachment; - MediaSourceTracer* tracer; - std::tie(attachment, tracer) = source_->AttachmentAndTracer(); + auto [attachment, tracer] = source_->AttachmentAndTracer(); DCHECK(attachment); return attachment->GetRecentMediaTime(tracer).InSecondsF(); } @@ -1521,9 +1515,7 @@ DCHECK(source_); source_->AssertAttachmentsMutexHeldIfCrossThreadForDebugging(); - scoped_refptr<MediaSourceAttachmentSupplement> attachment; - MediaSourceTracer* tracer; - std::tie(attachment, tracer) = source_->AttachmentAndTracer(); + auto [attachment, tracer] = source_->AttachmentAndTracer(); DCHECK(attachment); DCHECK_EQ(!tracer, !IsMainThread()); @@ -1931,9 +1923,7 @@ // 3. If the HTMLMediaElement.error attribute is not null, then throw an // InvalidStateError exception and abort these steps. DCHECK(source_); - scoped_refptr<MediaSourceAttachmentSupplement> attachment; - MediaSourceTracer* tracer; - std::tie(attachment, tracer) = source_->AttachmentAndTracer(); + auto [attachment, tracer] = source_->AttachmentAndTracer(); DCHECK(attachment); DCHECK_EQ(!tracer, !IsMainThread()); if (attachment->GetElementError(tracer)) {
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio.cc b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio.cc index 1b80be4..2337161 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio.cc
@@ -864,8 +864,7 @@ absl::optional<int> requested_buffer_size; if (processing_type_ == ProcessingType::kUnprocessed && latency && !constraint_set.latency.IsUnconstrained()) { - int min_buffer_size, max_buffer_size; - std::tie(min_buffer_size, max_buffer_size) = + auto [min_buffer_size, max_buffer_size] = GetMinMaxBufferSizesForAudioParameters(parameters); requested_buffer_size = media::AudioLatency::GetExactBufferSize( base::Seconds(*latency), parameters.sample_rate(), @@ -1066,8 +1065,7 @@ case ProcessingType::kNoApmProcessed: return DoubleRangeSet::FromValue(allowed_latency); case ProcessingType::kUnprocessed: - double min_latency, max_latency; - std::tie(min_latency, max_latency) = + auto [min_latency, max_latency] = GetMinMaxLatenciesForAudioParameters(device_parameters); return DoubleRangeSet(min_latency, max_latency); } @@ -1212,12 +1210,9 @@ std::string default_device_id) const { DCHECK(!IsEmpty()); Score score(0.0); - double sub_score = 0.0; - std::string device_id; - std::tie(sub_score, device_id) = - device_id_container_.SelectSettingsAndScore(constraint_set.device_id, - default_device_id); + auto [sub_score, device_id] = device_id_container_.SelectSettingsAndScore( + constraint_set.device_id, default_device_id); score += sub_score; std::tie(sub_score, std::ignore) = @@ -1250,12 +1245,8 @@ if (container.IsEmpty()) continue; - Score container_score(0.0); - AudioProcessingProperties container_properties; - absl::optional<int> requested_buffer_size; - int num_channels; - std::tie(container_score, container_properties, requested_buffer_size, - num_channels) = + auto [container_score, container_properties, requested_buffer_size, + num_channels] = container.SelectSettingsAndScore( constraint_set, should_disable_hardware_noise_suppression, device_parameters_); @@ -1422,9 +1413,7 @@ AudioCaptureSettings best_settings; Score best_score(-1.0); for (const auto& candidate : devices_) { - Score score(0.0); - AudioCaptureSettings settings; - std::tie(score, settings) = candidate.SelectSettingsAndScore( + auto [score, settings] = candidate.SelectSettingsAndScore( constraint_set, is_desktop_source, should_disable_hardware_noise_suppression, default_device_id_); @@ -1618,8 +1607,7 @@ std::tuple<double, double> GetMinMaxLatenciesForAudioParameters( const media::AudioParameters& parameters) { - int min_buffer_size, max_buffer_size; - std::tie(min_buffer_size, max_buffer_size) = + auto [min_buffer_size, max_buffer_size] = GetMinMaxBufferSizesForAudioParameters(parameters); // Doing the microseconds conversion to match what is done in
diff --git a/third_party/blink/renderer/modules/native_io/native_io_file.cc b/third_party/blink/renderer/modules/native_io/native_io_file.cc index 16b8eed..8041bb4 100644 --- a/third_party/blink/renderer/modules/native_io/native_io_file.cc +++ b/third_party/blink/renderer/modules/native_io/native_io_file.cc
@@ -621,9 +621,7 @@ << "File I/O operation queued after file closed"; DCHECK(resolver_task_runner); - int64_t length; - base::File::Error get_length_error; - std::tie(length, get_length_error) = file_state->GetLength(); + auto [length, get_length_error] = file_state->GetLength(); PostCrossThreadTask( *resolver_task_runner, FROM_HERE, @@ -680,9 +678,7 @@ DCHECK(resolver_task_runner); DCHECK_GE(expected_length, 0); - int64_t actual_length; - base::File::Error set_length_error; - std::tie(actual_length, set_length_error) = + auto [actual_length, set_length_error] = file_state->SetLength(expected_length); PostCrossThreadTask( @@ -814,9 +810,7 @@ DCHECK_LE(static_cast<size_t>(read_size), result_buffer_data->DataLength()); #endif // DCHECK_IS_ON() - int read_bytes; - base::File::Error read_error; - std::tie(read_bytes, read_error) = + auto [read_bytes, read_error] = file_state->Read(result_buffer_data.get(), file_offset, read_size); PostCrossThreadTask( @@ -879,10 +873,7 @@ DCHECK_LE(static_cast<size_t>(write_size), result_buffer_data->DataLength()); #endif // DCHECK_IS_ON() - int written_bytes; - int64_t actual_file_length_on_failure = 0; - base::File::Error write_error; - std::tie(actual_file_length_on_failure, written_bytes, write_error) = + auto [actual_file_length_on_failure, written_bytes, write_error] = file_state->Write(result_buffer_data.get(), file_offset, write_size); PostCrossThreadTask(
diff --git a/third_party/blink/renderer/modules/webaudio/audio_param.cc b/third_party/blink/renderer/modules/webaudio/audio_param.cc index c226481..bd8da8a4 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_param.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_param.cc
@@ -169,9 +169,7 @@ // Update value for timeline. float v = IntrinsicValue(); if (GetDeferredTaskHandler().IsAudioThread()) { - bool has_value; - float timeline_value; - std::tie(has_value, timeline_value) = timeline_.ValueForContextTime( + auto [has_value, timeline_value] = timeline_.ValueForContextTime( DestinationHandler(), v, MinValue(), MaxValue(), GetDeferredTaskHandler().RenderQuantumFrames()); @@ -200,9 +198,7 @@ bool AudioParamHandler::Smooth() { // If values have been explicitly scheduled on the timeline, then use the // exact value. Smoothing effectively is performed by the timeline. - bool use_timeline_value = false; - float value; - std::tie(use_timeline_value, value) = timeline_.ValueForContextTime( + auto [use_timeline_value, value] = timeline_.ValueForContextTime( DestinationHandler(), IntrinsicValue(), MinValue(), MaxValue(), GetDeferredTaskHandler().RenderQuantumFrames()); @@ -308,10 +304,8 @@ CalculateTimelineValues(values, number_of_values); } else { // Calculate control-rate (k-rate) intrinsic value. - bool has_value; float value = IntrinsicValue(); - float timeline_value; - std::tie(has_value, timeline_value) = timeline_.ValueForContextTime( + auto [has_value, timeline_value] = timeline_.ValueForContextTime( DestinationHandler(), value, MinValue(), MaxValue(), GetDeferredTaskHandler().RenderQuantumFrames());
diff --git a/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc b/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc index 81e3643..7d6f8cae 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc
@@ -970,14 +970,11 @@ } // Maintain a running time (frame) and index for writing the values buffer. - size_t current_frame = start_frame; - unsigned write_index = 0; - // If first event is after startFrame then fill initial part of values buffer // with defaultValue until we reach the first event time. - std::tie(current_frame, write_index) = + auto [current_frame, write_index] = HandleFirstEvent(values, default_value, number_of_values, start_frame, - end_frame, sample_rate, current_frame, write_index); + end_frame, sample_rate, start_frame, 0); float value = default_value; @@ -1000,23 +997,19 @@ } // If there's no next event, set nextEventType to LastType to indicate that. - ParamEvent::Type next_event_type = + ProcessSetTargetFollowedByRamp( + i, event, next_event ? static_cast<ParamEvent::Type>(next_event->GetType()) - : ParamEvent::kLastType; - - ProcessSetTargetFollowedByRamp(i, event, next_event_type, current_frame, - sample_rate, control_rate, value); + : ParamEvent::kLastType, + current_frame, sample_rate, control_rate, value); float value1 = event->Value(); double time1 = event->Time(); - float value2 = next_event ? next_event->Value() : value1; - double time2 = - next_event ? next_event->Time() : end_frame / sample_rate + 1; - // Check to see if an event was cancelled. - std::tie(value2, time2, next_event_type) = - HandleCancelValues(event, next_event, value2, time2); + auto [value2, time2, next_event_type] = HandleCancelValues( + event, next_event, next_event ? next_event->Value() : value1, + next_event ? next_event->Time() : end_frame / sample_rate + 1); DCHECK(!std::isnan(value1)); DCHECK(!std::isnan(value2));
diff --git a/third_party/blink/renderer/modules/webcodecs/fuzzer_seed_corpus/video_encoder/encode_av1.textproto b/third_party/blink/renderer/modules/webcodecs/fuzzer_seed_corpus/video_encoder/encode_av1.textproto new file mode 100644 index 0000000..0043bf0 --- /dev/null +++ b/third_party/blink/renderer/modules/webcodecs/fuzzer_seed_corpus/video_encoder/encode_av1.textproto
@@ -0,0 +1,76 @@ +# Simulates reasonable usage of VideoEncoder +# configure(av1) +# encode(red frame) +# encode(green frame, key) +# configure(av1, different bitrate) +# encode(blue frame) +# flush() +# close() + +invocations: [ + { + configure { + codec: 'av01.0.04M.08', + acceleration: DENY, + bitrate: 1500000, + framerate: 25, + width: 200, + height: 50 + } + }, + { + encode { + frame { + timestamp: 0, + duration: 33333, + bitmap_width: 200, + + # RED FRAME + rgb_bitmap: "\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377\353\000\000\377", + } + } + }, + { + encode { + frame { + timestamp: 33333, + duration: 33333, + bitmap_width: 200, + + # GREEN FRAME + rgb_bitmap: "\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377\000\276\000\377", + }, + options { + key_frame: true, + } + } + }, + { + configure { + codec: 'av01.0.05M.12', + acceleration: DENY, + framerate: 25, + bitrate: 1000000, + width: 200, + height: 50 + } + }, + { + encode { + frame { + timestamp: 66666, + duration: 33333, + bitmap_width: 200, + + # BLUE FRAME + rgb_bitmap: "\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377\000\310\310\377", + } + } + }, + { + flush {} + }, + { + close {} + } +] \ No newline at end of file
diff --git a/third_party/blink/renderer/platform/fonts/simple_font_data.cc b/third_party/blink/renderer/platform/fonts/simple_font_data.cc index f4f53d7..6af1dae 100644 --- a/third_party/blink/renderer/platform/fonts/simple_font_data.cc +++ b/third_party/blink/renderer/platform/fonts/simple_font_data.cc
@@ -314,8 +314,7 @@ void SimpleFontData::ComputeNormalizedTypoAscentAndDescent() const { // Compute em height metrics from OS/2 sTypoAscender and sTypoDescender. SkTypeface* typeface = platform_data_.Typeface(); - int16_t typo_ascender, typo_descender; - std::tie(typo_ascender, typo_descender) = TypoAscenderAndDescender(typeface); + auto [typo_ascender, typo_descender] = TypoAscenderAndDescender(typeface); if (typo_ascender > 0 && TrySetNormalizedTypoAscentAndDescent(typo_ascender, typo_descender)) { return;
diff --git a/third_party/blink/renderer/platform/graphics/graphics_context.cc b/third_party/blink/renderer/platform/graphics/graphics_context.cc index 3799694..52e4103 100644 --- a/third_party/blink/renderer/platform/graphics/graphics_context.cc +++ b/third_party/blink/renderer/platform/graphics/graphics_context.cc
@@ -528,9 +528,7 @@ auto stroke_style = GetStrokeStyle(); DCHECK_NE(stroke_style, kWavyStroke); if (ShouldUseStrokeForTextLine(stroke_style)) { - gfx::Point start; - gfx::Point end; - std::tie(start, end) = GetPointsForTextLine(pt, width, StrokeThickness()); + auto [start, end] = GetPointsForTextLine(pt, width, StrokeThickness()); DrawLine(start, end, auto_dark_mode, true, paint_flags); } else { if (paint_flags) { @@ -1228,9 +1226,7 @@ Path path; DCHECK_NE(stroke_style, kWavyStroke); if (ShouldUseStrokeForTextLine(stroke_style)) { - gfx::Point start; - gfx::Point end; - std::tie(start, end) = GetPointsForTextLine(pt, width, stroke_thickness); + auto [start, end] = GetPointsForTextLine(pt, width, stroke_thickness); path.MoveTo(gfx::PointF(start)); path.AddLineTo(gfx::PointF(end)); } else {
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc index e188b43..b9674a4d 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc +++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc
@@ -1464,9 +1464,7 @@ const FetchParameters& fetch_params, const Resource& existing_resource, bool is_static_data) const { - RevalidationPolicy policy; - const char* reason; - std::tie(policy, reason) = DetermineRevalidationPolicyInternal( + auto [policy, reason] = DetermineRevalidationPolicyInternal( type, fetch_params, existing_resource, is_static_data); DCHECK(reason);
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_loader.cc b/third_party/blink/renderer/platform/loader/fetch/resource_loader.cc index 7cbc9362..842ca10d 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_loader.cc +++ b/third_party/blink/renderer/platform/loader/fetch/resource_loader.cc
@@ -1357,14 +1357,11 @@ WebBlobInfo downloaded_blob; if (CanHandleDataURLRequestLocally(request)) { - ResourceResponse response; - scoped_refptr<SharedBuffer> data; - int result; - // It doesn't have to verify mime type again since it's allowed to handle + // We don't have to verify mime type again since it's allowed to handle // the data url with invalid mime type in some cases. // CanHandleDataURLRequestLocally() has already checked if the data url can // be handled here. - std::tie(result, response, data) = + auto [result, response, data] = network_utils::ParseDataURL(resource_->Url(), request.HttpMethod()); if (result != net::OK) { error_out = WebURLError(result, resource_->Url()); @@ -1587,14 +1584,11 @@ } // Extract a ResourceResponse from the data url. - ResourceResponse response; - scoped_refptr<SharedBuffer> data; - int result; - // We doesn't have to verify mime type again since it's allowed to handle the + // We don't have to verify mime type again since it's allowed to handle the // data url with invalid mime type in some cases. // CanHandleDataURLRequestLocally() has already checked if the data url can be // handled here. - std::tie(result, response, data) = network_utils::ParseDataURL( + auto [result, response, data] = network_utils::ParseDataURL( resource_->Url(), resource_->GetResourceRequest().HttpMethod()); if (result != net::OK) { HandleError(ResourceError(result, resource_->Url(), absl::nullopt));
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_loader_test.cc b/third_party/blink/renderer/platform/loader/fetch/resource_loader_test.cc index 09fd868f..1ba0731 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_loader_test.cc +++ b/third_party/blink/renderer/platform/loader/fetch/resource_loader_test.cc
@@ -258,9 +258,7 @@ // Read through the bytes consumer passed back from the ResourceLoader. auto* test_reader = MakeGarbageCollected<BytesConsumerTestReader>( raw_resource_client->body()); - Vector<char> body; - BytesConsumer::Result result; - std::tie(result, body) = test_reader->Run(task_runner); + auto [result, body] = test_reader->Run(task_runner); EXPECT_EQ(result, BytesConsumer::Result::kDone); EXPECT_EQ(resource->GetStatus(), ResourceStatus::kCached); EXPECT_EQ(std::string(body.data(), body.size()), "Hello World!");
diff --git a/third_party/blink/renderer/platform/loader/fetch/shared_buffer_bytes_consumer_test.cc b/third_party/blink/renderer/platform/loader/fetch/shared_buffer_bytes_consumer_test.cc index 2cec6cd..4fd028c 100644 --- a/third_party/blink/renderer/platform/loader/fetch/shared_buffer_bytes_consumer_test.cc +++ b/third_party/blink/renderer/platform/loader/fetch/shared_buffer_bytes_consumer_test.cc
@@ -33,9 +33,7 @@ auto task_runner = base::MakeRefCounted<scheduler::FakeTaskRunner>(); auto* test_reader = MakeGarbageCollected<BytesConsumerTestReader>(bytes_consumer); - Vector<char> data_from_consumer; - BytesConsumer::Result result; - std::tie(result, data_from_consumer) = test_reader->Run(task_runner.get()); + auto [result, data_from_consumer] = test_reader->Run(task_runner.get()); EXPECT_EQ(BytesConsumer::Result::kDone, result); EXPECT_EQ(PublicState::kClosed, bytes_consumer->GetPublicState()); EXPECT_EQ(flatten_expected_data,
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/frame_task_queue_controller_unittest.cc b/third_party/blink/renderer/platform/scheduler/main_thread/frame_task_queue_controller_unittest.cc index cfc6d2b..3a31764 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/frame_task_queue_controller_unittest.cc +++ b/third_party/blink/renderer/platform/scheduler/main_thread/frame_task_queue_controller_unittest.cc
@@ -5,7 +5,6 @@ #include "third_party/blink/renderer/platform/scheduler/main_thread/frame_task_queue_controller.h" #include <memory> -#include <tuple> #include <utility> #include "base/bind.h" @@ -192,9 +191,7 @@ frame_task_queue_controller_->GetAllTaskQueuesAndVoters().size()); for (const auto& task_queue_and_voter : frame_task_queue_controller_->GetAllTaskQueuesAndVoters()) { - MainThreadTaskQueue* task_queue_ptr; - TaskQueue::QueueEnabledVoter* voter; - std::tie(task_queue_ptr, voter) = task_queue_and_voter; + auto [task_queue_ptr, voter] = task_queue_and_voter; EXPECT_NE(task_queue_ptr, nullptr); EXPECT_TRUE(all_task_queues.find(task_queue_ptr) != all_task_queues.end());
diff --git a/third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h b/third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h index 2e16900..f72ecf6 100644 --- a/third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h +++ b/third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h
@@ -6,7 +6,6 @@ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_SCHEDULER_PUBLIC_POST_CANCELLABLE_TASK_H_ #include "base/callback.h" -#include "base/compiler_specific.h" #include "base/location.h" #include "base/memory/scoped_refptr.h" #include "base/task/sequenced_task_runner.h" @@ -50,21 +49,21 @@ friend PLATFORM_EXPORT TaskHandle PostCancellableTask(base::SequencedTaskRunner&, const base::Location&, - base::OnceClosure) WARN_UNUSED_RESULT; + base::OnceClosure); friend PLATFORM_EXPORT TaskHandle PostDelayedCancellableTask(base::SequencedTaskRunner&, const base::Location&, base::OnceClosure, - base::TimeDelta delay) WARN_UNUSED_RESULT; + base::TimeDelta delay); friend PLATFORM_EXPORT TaskHandle PostNonNestableCancellableTask(base::SequencedTaskRunner&, const base::Location&, - base::OnceClosure) WARN_UNUSED_RESULT; - friend PLATFORM_EXPORT TaskHandle PostNonNestableDelayedCancellableTask( - base::SequencedTaskRunner&, - const base::Location&, - base::OnceClosure, - base::TimeDelta delay) WARN_UNUSED_RESULT; + base::OnceClosure); + friend PLATFORM_EXPORT TaskHandle + PostNonNestableDelayedCancellableTask(base::SequencedTaskRunner&, + const base::Location&, + base::OnceClosure, + base::TimeDelta delay); explicit TaskHandle(scoped_refptr<Runner>); scoped_refptr<Runner> runner_; @@ -72,24 +71,24 @@ // For same-thread cancellable task posting. Returns a TaskHandle object for // cancellation. -PLATFORM_EXPORT TaskHandle PostCancellableTask(base::SequencedTaskRunner&, - const base::Location&, - base::OnceClosure) - WARN_UNUSED_RESULT; -PLATFORM_EXPORT TaskHandle +[[nodiscard]] PLATFORM_EXPORT TaskHandle +PostCancellableTask(base::SequencedTaskRunner&, + const base::Location&, + base::OnceClosure); +[[nodiscard]] PLATFORM_EXPORT TaskHandle PostDelayedCancellableTask(base::SequencedTaskRunner&, const base::Location&, base::OnceClosure, - base::TimeDelta delay) WARN_UNUSED_RESULT; -PLATFORM_EXPORT TaskHandle + base::TimeDelta delay); +[[nodiscard]] PLATFORM_EXPORT TaskHandle PostNonNestableCancellableTask(base::SequencedTaskRunner&, const base::Location&, - base::OnceClosure) WARN_UNUSED_RESULT; -PLATFORM_EXPORT TaskHandle + base::OnceClosure); +[[nodiscard]] PLATFORM_EXPORT TaskHandle PostNonNestableDelayedCancellableTask(base::SequencedTaskRunner&, const base::Location&, base::OnceClosure, - base::TimeDelta delay) WARN_UNUSED_RESULT; + base::TimeDelta delay); } // namespace blink
diff --git a/third_party/blink/web_tests/NeverFixTests b/third_party/blink/web_tests/NeverFixTests index af44097e..cb4446e 100644 --- a/third_party/blink/web_tests/NeverFixTests +++ b/third_party/blink/web_tests/NeverFixTests
@@ -1835,6 +1835,7 @@ external/wpt/serial/serialPort_loopback-manual.https.html [ Skip ] external/wpt/serial/serialPort_loopback_BreakError-manual.https.html [ Skip ] external/wpt/serial/serialPort_loopback_BufferOverrunError-manual.https.html [ Skip ] +external/wpt/serial/serialPort_loopback_flowControl-manual.https.html [ Skip ] external/wpt/serial/serialPort_disconnect-manual.https.html [ Skip ] external/wpt/serial/serialPort_readable-manual.https.html [ Skip ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index d7f24c21..3902374d 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -227,9 +227,8 @@ # These tests require fenced-frames # Keep this in sync with VirtualTestSuites. crbug.com/1123606 wpt_internal/fenced_frame/* [ Skip ] -crbug.com/1123606 fenced_frame/* [ Skip ] +crbug.com/1123606 http/tests/fenced_frame/* [ Skip ] crbug.com/1123606 virtual/fenced-frame-shadow-dom/* [ Pass ] -crbug.com/1123606 virtual/fenced-frame-mparch/* [ Pass ] # These tests require the experimental prerender feature. # See https://crbug.com/1126305.
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 341bc92..dc30bac 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -1029,7 +1029,7 @@ { "prefix": "fenced-frame-mparch", "bases": [ - "fenced_frame", + "http/tests/fenced_frame", "wpt_internal/fenced_frame", "http/tests/inspector-protocol/fenced-frame" ], @@ -1038,7 +1038,7 @@ { "prefix": "fenced-frame-shadow-dom", "bases": [ - "fenced_frame", + "http/tests/fenced_frame", "wpt_internal/fenced_frame" ], "args": ["--enable-features=FencedFrames:implementation_type/shadow_dom,Prerender2,PartitionedCookies"]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/container-type-change-chrome-legacy-crash.html b/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/container-type-change-chrome-legacy-crash.html new file mode 100644 index 0000000..609142a --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/container-type-change-chrome-legacy-crash.html
@@ -0,0 +1,16 @@ +<!doctype html> +<title>CSS Container Queries Test: Changing container-type in Chrome legacy layout</title> +<link rel="help" href="https://drafts.csswg.org/css-contain-3/#size-container"> +<link rel="help" href="https://crbug.com/1286773"> +<p>Pass if there is no crash.</p> +<span style="column-count: 1"><table></table></span> +<video id="video"></video> +<input id="input"></input> +<script> + document.body.offsetTop; + video.style.containerType = "inline-size"; + document.body.offsetLeft; + video.style.columnCount = "1"; + input.setAttribute("type", "button"); + document.body.offsetTop; +</script>
diff --git a/third_party/blink/web_tests/external/wpt/serial/serialPort_loopback_flowControl-manual.https.html b/third_party/blink/web_tests/external/wpt/serial/serialPort_loopback_flowControl-manual.https.html new file mode 100644 index 0000000..930dab7 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/serial/serialPort_loopback_flowControl-manual.https.html
@@ -0,0 +1,59 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="resources/common.js"></script> + <script src="resources/manual.js"></script> + </head> + <body> + <p> + These tests require a connected serial device configured to act as a + "loopback" device, with the TX and RX pins and RTS and CTS pins wired + together. + </p> + <script> + manual_serial_test(async (t, port) => { + await port.open({ + baudRate: 115200, + bufferSize: 255, + flowControl: 'none' + }); + t.add_cleanup(async () => { + await port.close(); + }); + + await port.setSignals({ requestToSend: true }); + let signals = await port.getSignals(); + assert_true(signals.clearToSend); + + await port.setSignals({ requestToSend: false }); + signals = await port.getSignals(); + assert_false(signals.clearToSend); + }, 'Manual RTS control works with no flow control enabled'); + + manual_serial_test(async (t, port) => { + await port.open({ + baudRate: 115200, + bufferSize: 255, + flowControl: 'hardware' + }); + + const writer = port.writable.getWriter(); + t.add_cleanup(async () => { + writer.releaseLock(); + await port.close(); + }); + + assert_true((await port.getSignals()).clearToSend); + + const buffer = new Uint8Array(1); + while ((await port.getSignals()).clearToSend) { + await writer.write(buffer); + } + }, 'Hardware flow control automatically sets RTS pin'); + </script> + </body> +</html>
diff --git a/third_party/blink/web_tests/fenced_frame/basic-expected.html b/third_party/blink/web_tests/http/tests/fenced_frame/basic-expected.html similarity index 100% rename from third_party/blink/web_tests/fenced_frame/basic-expected.html rename to third_party/blink/web_tests/http/tests/fenced_frame/basic-expected.html
diff --git a/third_party/blink/web_tests/fenced_frame/basic.html b/third_party/blink/web_tests/http/tests/fenced_frame/basic.html similarity index 87% rename from third_party/blink/web_tests/fenced_frame/basic.html rename to third_party/blink/web_tests/http/tests/fenced_frame/basic.html index 6cbac2df..870f606b 100644 --- a/third_party/blink/web_tests/fenced_frame/basic.html +++ b/third_party/blink/web_tests/http/tests/fenced_frame/basic.html
@@ -10,6 +10,6 @@ </script> <fencedframe style="width: 100%; height: 300px; border: 0" - src="resources/fenced_frame.html"></fencedframe> + src="resources/fenced_frame.php"></fencedframe> </body> </html>
diff --git a/third_party/blink/web_tests/fenced_frame/resources/fenced_frame.html b/third_party/blink/web_tests/http/tests/fenced_frame/resources/fenced_frame.php similarity index 66% rename from third_party/blink/web_tests/fenced_frame/resources/fenced_frame.html rename to third_party/blink/web_tests/http/tests/fenced_frame/resources/fenced_frame.php index 6aa1501..0060a6f 100644 --- a/third_party/blink/web_tests/fenced_frame/resources/fenced_frame.html +++ b/third_party/blink/web_tests/http/tests/fenced_frame/resources/fenced_frame.php
@@ -1,3 +1,7 @@ +<?php +header('Content-Type: text/html'); +header('Supports-Loading-Mode: fenced-frame'); +?> <body style="margin: 0px"> <div style="background: red; width: 20px; height: 20px"></div> <script>
diff --git a/third_party/blink/web_tests/fenced_frame/resources/visibility-changed-inner.html b/third_party/blink/web_tests/http/tests/fenced_frame/resources/visibility-changed-inner.php similarity index 84% rename from third_party/blink/web_tests/fenced_frame/resources/visibility-changed-inner.html rename to third_party/blink/web_tests/http/tests/fenced_frame/resources/visibility-changed-inner.php index c37c3e6a..3d10d37 100644 --- a/third_party/blink/web_tests/fenced_frame/resources/visibility-changed-inner.html +++ b/third_party/blink/web_tests/http/tests/fenced_frame/resources/visibility-changed-inner.php
@@ -1,3 +1,7 @@ +<?php +header('Content-Type: text/html'); +header('Supports-Loading-Mode: fenced-frame'); +?> <body style="margin: 0px"> <div id="placeholder" style="background: red; width: 20px; height: 20px"></div> <script>
diff --git a/third_party/blink/web_tests/fenced_frame/visibility-changed-expected.html b/third_party/blink/web_tests/http/tests/fenced_frame/visibility-changed-expected.html similarity index 100% rename from third_party/blink/web_tests/fenced_frame/visibility-changed-expected.html rename to third_party/blink/web_tests/http/tests/fenced_frame/visibility-changed-expected.html
diff --git a/third_party/blink/web_tests/fenced_frame/visibility-changed.html b/third_party/blink/web_tests/http/tests/fenced_frame/visibility-changed.html similarity index 81% rename from third_party/blink/web_tests/fenced_frame/visibility-changed.html rename to third_party/blink/web_tests/http/tests/fenced_frame/visibility-changed.html index 4fbcaa5..6aeae87 100644 --- a/third_party/blink/web_tests/fenced_frame/visibility-changed.html +++ b/third_party/blink/web_tests/http/tests/fenced_frame/visibility-changed.html
@@ -10,6 +10,6 @@ </script> <fencedframe style="width: 100%; height: 300px; border: 0" - src="resources/visibility-changed-inner.html"></fencedframe> + src="resources/visibility-changed-inner.php"></fencedframe> </body> </html>
diff --git a/third_party/blink/web_tests/virtual/fenced-frame-mparch/fenced_frame/basic-expected.html b/third_party/blink/web_tests/virtual/fenced-frame-mparch/http/tests/fenced_frame/basic-expected.html similarity index 100% rename from third_party/blink/web_tests/virtual/fenced-frame-mparch/fenced_frame/basic-expected.html rename to third_party/blink/web_tests/virtual/fenced-frame-mparch/http/tests/fenced_frame/basic-expected.html
diff --git a/third_party/blink/web_tests/virtual/fenced-frame-mparch/fenced_frame/visibility-changed-expected.html b/third_party/blink/web_tests/virtual/fenced-frame-mparch/http/tests/fenced_frame/visibility-changed-expected.html similarity index 100% rename from third_party/blink/web_tests/virtual/fenced-frame-mparch/fenced_frame/visibility-changed-expected.html rename to third_party/blink/web_tests/virtual/fenced-frame-mparch/http/tests/fenced_frame/visibility-changed-expected.html
diff --git a/third_party/blink/web_tests/virtual/fenced-frame-shadow-dom/fenced_frame/basic-expected.html b/third_party/blink/web_tests/virtual/fenced-frame-shadow-dom/http/tests/fenced_frame/basic-expected.html similarity index 100% rename from third_party/blink/web_tests/virtual/fenced-frame-shadow-dom/fenced_frame/basic-expected.html rename to third_party/blink/web_tests/virtual/fenced-frame-shadow-dom/http/tests/fenced_frame/basic-expected.html
diff --git a/third_party/blink/web_tests/virtual/fenced-frame-shadow-dom/fenced_frame/visibility-changed-expected.html b/third_party/blink/web_tests/virtual/fenced-frame-shadow-dom/http/tests/fenced_frame/visibility-changed-expected.html similarity index 100% rename from third_party/blink/web_tests/virtual/fenced-frame-shadow-dom/fenced_frame/visibility-changed-expected.html rename to third_party/blink/web_tests/virtual/fenced-frame-shadow-dom/http/tests/fenced_frame/visibility-changed-expected.html
diff --git a/third_party/blink/web_tests/wpt_internal/fenced_frame/maxframes.html b/third_party/blink/web_tests/wpt_internal/fenced_frame/maxframes.html new file mode 100644 index 0000000..d174560 --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/fenced_frame/maxframes.html
@@ -0,0 +1,35 @@ +<!DOCTYPE html> +<title>Test Maximum Subframes</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/utils.js"></script> + +<body> +<script> +promise_test(async (t) => { + const maxframes_key = KEYS['maxframes_response']; + + internals.setMaxNumberOfFramesToTen(true); + + for (let i = 0; i < 9; ++i) { + attachFencedFrame('resources/dummy.html'); + } + const tenth_frame = attachFencedFrame('resources/dummy.html'); + + // This frame is past the limit and should not be loaded + // If it does load, a DCHECK will catch it and cause the browser to crash, + // failing the test. + attachFencedFrame('resources/dummy.html'); + + tenth_frame.remove(); + + // Now that the last frame is removed, a new fenced frame can be + // created since the page is now under the subframe limit. + attachFencedFrame('resources/maxframes-inner.html'); + const response = await nextValueFromServer(maxframes_key); + assert_equals(response, "page loaded", "The inner frame should be loaded."); +}, 'Max Subframes Test'); + +</script> +</body> +</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/wpt_internal/fenced_frame/resources/maxframes-inner.html b/third_party/blink/web_tests/wpt_internal/fenced_frame/resources/maxframes-inner.html new file mode 100644 index 0000000..1c14cfd --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/fenced_frame/resources/maxframes-inner.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<script src="utils.js"></script> +<title>Fenced frame content to report whether it loaded</title> + +<body> +<script> +function init() { + // This file is meant to be navigated to from a <fencedframe> element. + // It reports back to the page hosting the <fencedframe> letting it + // know that the frame loaded successfully. + const window_data_key = KEYS["maxframes_response"]; + writeValueToServer(window_data_key, "page loaded"); +} + +init(); +</script> +</body> +</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/wpt_internal/fenced_frame/resources/maxframes-inner.html.headers b/third_party/blink/web_tests/wpt_internal/fenced_frame/resources/maxframes-inner.html.headers new file mode 100644 index 0000000..6247f6d --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/fenced_frame/resources/maxframes-inner.html.headers
@@ -0,0 +1 @@ +Supports-Loading-Mode: fenced-frame \ No newline at end of file
diff --git a/third_party/blink/web_tests/wpt_internal/fenced_frame/resources/utils.js b/third_party/blink/web_tests/wpt_internal/fenced_frame/resources/utils.js index 37a446e..a5124d394 100644 --- a/third_party/blink/web_tests/wpt_internal/fenced_frame/resources/utils.js +++ b/third_party/blink/web_tests/wpt_internal/fenced_frame/resources/utils.js
@@ -110,8 +110,15 @@ "cookie_value" : "00000000-0000-0000-0000-00000000004C", + "csp-fenced-frame-src-blocked" : "00000000-0000-0000-0000-00000000004D", + "csp-fenced-frame-src-allowed" : "00000000-0000-0000-0000-00000000004E", + "csp-frame-src-blocked" : "00000000-0000-0000-0000-00000000004F", + "csp-frame-src-allowed" : "00000000-0000-0000-0000-000000000050", + "frame_navigation" : "00000000-0000-0000-0000-000000000051", "frame_navigation ACK" : "00000000-0000-0000-0000-000000000052", + + "maxframes_response" : "00000000-0000-0000-0000-000000000053", // Add keys above this list, incrementing the key UUID in hexadecimal }
diff --git a/third_party/crashpad/README.chromium b/third_party/crashpad/README.chromium index b775101..7770539 100644 --- a/third_party/crashpad/README.chromium +++ b/third_party/crashpad/README.chromium
@@ -2,7 +2,7 @@ Short Name: crashpad URL: https://crashpad.chromium.org/ Version: unknown -Revision: b714b223ad7fdd75bd9278c9a7d005df3954d119 +Revision: 50ed179e9a66937857acf7bc5eba356500f8b122 License: Apache 2.0 License File: crashpad/LICENSE Security Critical: yes
diff --git a/third_party/crashpad/crashpad/DEPS b/third_party/crashpad/crashpad/DEPS index 8f9617f4..27e9520 100644 --- a/third_party/crashpad/crashpad/DEPS +++ b/third_party/crashpad/crashpad/DEPS
@@ -39,7 +39,7 @@ 'e1e7b0ad8ee99a875b272c8e33e308472e897660', 'crashpad/third_party/mini_chromium/mini_chromium': Var('chromium_git') + '/chromium/mini_chromium@' + - 'c2bc7a2a195eb8940215d0b81767f022aa5ecfdd', + '6e2f204b4ae135c40a6c4b3c3a01f48a86c5e886', 'crashpad/third_party/libfuzzer/src': Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git@' + 'fda403cf93ecb8792cb1d061564d89a6553ca020',
diff --git a/third_party/crashpad/crashpad/client/annotation.h b/third_party/crashpad/crashpad/client/annotation.h index 7a7d7164a..d783aad 100644 --- a/third_party/crashpad/crashpad/client/annotation.h +++ b/third_party/crashpad/crashpad/client/annotation.h
@@ -29,7 +29,7 @@ #include "build/build_config.h" namespace crashpad { -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) namespace internal { class InProcessIntermediateDumpHandler; } // namespace internal @@ -107,7 +107,7 @@ // variables defined in a constexpr function, which is valid. Avoid them // and the also-problematic DCHECK until all the infrastructure is updated: // https://crbug.com/crashpad/201. -#if !defined(OS_WIN) || (defined(_MSC_VER) && _MSC_VER >= 1910) +#if !BUILDFLAG(IS_WIN) || (defined(_MSC_VER) && _MSC_VER >= 1910) const UnderlyingType start = static_cast<UnderlyingType>(Type::kUserDefinedStart); const UnderlyingType user_type = start + value; @@ -174,7 +174,7 @@ protected: friend class AnnotationList; -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) friend class internal::InProcessIntermediateDumpHandler; #endif
diff --git a/third_party/crashpad/crashpad/client/annotation_list.h b/third_party/crashpad/crashpad/client/annotation_list.h index 0238953..1c2141fe 100644 --- a/third_party/crashpad/crashpad/client/annotation_list.h +++ b/third_party/crashpad/crashpad/client/annotation_list.h
@@ -19,7 +19,7 @@ #include "client/annotation.h" namespace crashpad { -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) namespace internal { class InProcessIntermediateDumpHandler; } // namespace internal @@ -87,7 +87,7 @@ Iterator end(); protected: -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) friend class internal::InProcessIntermediateDumpHandler; #endif
diff --git a/third_party/crashpad/crashpad/client/crash_report_database.cc b/third_party/crashpad/crashpad/client/crash_report_database.cc index 5c8156e..7a3732b 100644 --- a/third_party/crashpad/crashpad/client/crash_report_database.cc +++ b/third_party/crashpad/crashpad/client/crash_report_database.cc
@@ -68,7 +68,7 @@ return false; } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) const std::wstring uuid_string = uuid_.ToWString(); #else const std::string uuid_string = uuid_.ToString(); @@ -103,7 +103,7 @@ report_attachments_dir, FilePermissions::kOwnerOnly, true)) { return nullptr; } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) const std::wstring name_string = base::UTF8ToWide(name); #else const std::string name_string = name; @@ -137,7 +137,7 @@ continue; } attachment_readers_.emplace_back(std::move(file_reader)); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) const std::string name_string = base::WideToUTF8(filename.value()); #else const std::string name_string = filename.value(); @@ -177,7 +177,7 @@ } base::FilePath CrashReportDatabase::AttachmentsPath(const UUID& uuid) { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) const std::wstring uuid_string = uuid.ToWString(); #else const std::string uuid_string = uuid.ToString();
diff --git a/third_party/crashpad/crashpad/client/crash_report_database_generic.cc b/third_party/crashpad/crashpad/client/crash_report_database_generic.cc index 754f578..9d48b68b 100644 --- a/third_party/crashpad/crashpad/client/crash_report_database_generic.cc +++ b/third_party/crashpad/crashpad/client/crash_report_database_generic.cc
@@ -600,7 +600,7 @@ DCHECK_NE(state, kUninitialized); DCHECK_NE(state, kSearchable); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) const std::wstring uuid_string = uuid.ToWString(); #else const std::string uuid_string = uuid.ToString();
diff --git a/third_party/crashpad/crashpad/client/crash_report_database_test.cc b/third_party/crashpad/crashpad/client/crash_report_database_test.cc index 357702b0..d75ab35 100644 --- a/third_party/crashpad/crashpad/client/crash_report_database_test.cc +++ b/third_party/crashpad/crashpad/client/crash_report_database_test.cc
@@ -737,7 +737,7 @@ ASSERT_TRUE(LoggingRemoveFile(report.file_path)); -#if !defined(OS_APPLE) && !defined(OS_WIN) +#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) // CrashReportDatabaseMac stores metadata in xattrs and does not have .meta // files. // CrashReportDatabaseWin stores metadata in a global metadata file and not @@ -749,7 +749,7 @@ ASSERT_EQ(db()->LookUpCrashReport(uuid, &report), CrashReportDatabase::kReportNotFound); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) const std::wstring uuid_string = uuid.ToWString(); #else const std::string uuid_string = uuid.ToString(); @@ -763,7 +763,7 @@ EXPECT_TRUE(FileExists(file_path1)); EXPECT_TRUE(FileExists(file_path1)); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // On Windows, reports removed from metadata are counted, even if the file // is not on the disk. EXPECT_EQ(db()->CleanDatabase(0), 1); @@ -778,7 +778,7 @@ // This test uses knowledge of the database format to break it, so it only // applies to the unfified database implementation. -#if !defined(OS_APPLE) && !defined(OS_WIN) +#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) TEST_F(CrashReportDatabaseTest, CleanBrokenDatabase) { // Remove report files if metadata goes missing. CrashReportDatabase::Report report; @@ -843,7 +843,7 @@ EXPECT_FALSE(PathExists(report.file_path)); EXPECT_FALSE(PathExists(metadata3)); } -#endif // !OS_APPLE && !OS_WIN +#endif // !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) TEST_F(CrashReportDatabaseTest, TotalSize_MainReportOnly) { std::unique_ptr<CrashReportDatabase::NewReport> new_report;
diff --git a/third_party/crashpad/crashpad/client/crashpad_client.h b/third_party/crashpad/crashpad/client/crashpad_client.h index 468c836..a5e54a5 100644 --- a/third_party/crashpad/crashpad/client/crashpad_client.h +++ b/third_party/crashpad/crashpad/client/crashpad_client.h
@@ -28,12 +28,12 @@ #include "util/file/file_io.h" #include "util/misc/capture_context.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include "base/mac/scoped_mach_port.h" -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> #include "util/win/scoped_handle.h" -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include <signal.h> #include <ucontext.h> #endif @@ -125,7 +125,8 @@ bool asynchronous_start, const std::vector<base::FilePath>& attachments = {}); -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || DOXYGEN +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ + DOXYGEN //! \brief Retrieve the socket and process ID for the handler. //! //! `StartHandler()` must have successfully been called before calling this @@ -170,9 +171,10 @@ //! //! \return `true` on success. Otherwise `false` with a message logged. static bool InitializeSignalStackForThread(); -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS || DOXYGEN +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) || DOXYGEN -#if defined(OS_ANDROID) || DOXYGEN +#if BUILDFLAG(IS_ANDROID) || DOXYGEN //! \brief Installs a signal handler to execute `/system/bin/app_process` and //! load a Java class in response to a crash. //! @@ -339,9 +341,10 @@ const std::map<std::string, std::string>& annotations, const std::vector<std::string>& arguments, int socket); -#endif // OS_ANDROID || DOXYGEN +#endif // BUILDFLAG(IS_ANDROID) || DOXYGEN -#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_CHROMEOS) || DOXYGEN +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) || \ + DOXYGEN //! \brief Installs a signal handler to launch a handler process in reponse to //! a crash. //! @@ -454,9 +457,10 @@ //! //! \param[in] unhandled_signals The set of unhandled signals void SetUnhandledSignals(const std::set<int>& unhandled_signals); -#endif // OS_LINUX || OS_ANDROID || OS_CHROMEOS || DOXYGEN +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || + // BUILDFLAG(IS_CHROMEOS) || DOXYGEN -#if defined(OS_IOS) || DOXYGEN +#if BUILDFLAG(IS_IOS) || DOXYGEN //! \brief Configures the process to direct its crashes to the iOS in-process //! Crashpad handler. //! @@ -556,7 +560,7 @@ const base::FilePath path); #endif -#if defined(OS_APPLE) || DOXYGEN +#if BUILDFLAG(IS_APPLE) || DOXYGEN //! \brief Sets the process’ crash handler to a Mach service registered with //! the bootstrap server. //! @@ -606,7 +610,7 @@ base::mac::ScopedMachSendRight GetHandlerMachPort() const; #endif -#if defined(OS_WIN) || DOXYGEN +#if BUILDFLAG(IS_WIN) || DOXYGEN //! \brief Sets the IPC pipe of a presumably-running Crashpad handler process //! which was started with StartHandler() or by other compatible means //! and does an IPC message exchange to register this process with the @@ -706,7 +710,7 @@ }; #endif -#if defined(OS_APPLE) || DOXYGEN +#if BUILDFLAG(IS_APPLE) || DOXYGEN //! \brief Configures the process to direct its crashes to the default handler //! for the operating system. //! @@ -740,14 +744,14 @@ #endif private: -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) base::mac::ScopedMachSendRight exception_port_; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) std::wstring ipc_pipe_; ScopedKernelHANDLE handler_start_thread_; -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) std::set<int> unhandled_signals_; -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) }; } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/client/crashpad_client_linux.cc b/third_party/crashpad/crashpad/client/crashpad_client_linux.cc index eccf204..4c9a307 100644 --- a/third_party/crashpad/crashpad/client/crashpad_client_linux.cc +++ b/third_party/crashpad/crashpad/client/crashpad_client_linux.cc
@@ -28,6 +28,7 @@ #include "base/logging.h" #include "base/strings/stringprintf.h" +#include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "client/client_argv_handling.h" #include "third_party/lss/lss.h" @@ -56,7 +57,7 @@ return base::StringPrintf("--%s=%p", name.c_str(), addr); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) std::vector<std::string> BuildAppProcessArgs( const std::string& class_name, @@ -124,7 +125,7 @@ return argv; } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) // A base class for Crashpad signal handler implementations. class SignalHandler { @@ -415,7 +416,7 @@ std::move(client_sock), handler_pid, &unhandled_signals_); } -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) // static bool CrashpadClient::GetHandlerSocket(int* sock, pid_t* pid) { auto signal_handler = RequestCrashDumpHandler::Get(); @@ -519,9 +520,10 @@ } return true; } -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool CrashpadClient::StartJavaHandlerAtCrash( const std::string& class_name,
diff --git a/third_party/crashpad/crashpad/client/crashpad_client_linux_test.cc b/third_party/crashpad/crashpad/client/crashpad_client_linux_test.cc index 1ab974e..08c78b0 100644 --- a/third_party/crashpad/crashpad/client/crashpad_client_linux_test.cc +++ b/third_party/crashpad/crashpad/client/crashpad_client_linux_test.cc
@@ -23,6 +23,7 @@ #include "base/check_op.h" #include "base/notreached.h" +#include "build/build_config.h" #include "client/annotation.h" #include "client/annotation_list.h" #include "client/crash_report_database.h" @@ -50,7 +51,7 @@ #include "util/posix/signals.h" #include "util/thread/thread.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include <android/set_abort_message.h> #include "dlfcn_internal.h" @@ -140,7 +141,7 @@ constexpr char kTestAttachmentName[] = "test_attachment"; constexpr char kTestAttachmentContent[] = "attachment_content"; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) constexpr char kTestAbortMessage[] = "test abort message"; #endif @@ -179,7 +180,7 @@ ProcessSnapshotMinidump minidump_snapshot; ASSERT_TRUE(minidump_snapshot.Initialize(report->Reader())); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // This part of the test requires Q. The API level on Q devices will be 28 // until the API is finalized, so we can't check API level yet. For now, test // for the presence of a libc symbol which was introduced in Q. @@ -363,7 +364,7 @@ return EXIT_FAILURE; } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) if (android_set_abort_message) { android_set_abort_message(kTestAbortMessage); }
diff --git a/third_party/crashpad/crashpad/client/crashpad_info.cc b/third_party/crashpad/crashpad/client/crashpad_info.cc index 929c0df..8f13276 100644 --- a/third_party/crashpad/crashpad/client/crashpad_info.cc +++ b/third_party/crashpad/crashpad/client/crashpad_info.cc
@@ -16,10 +16,11 @@ #include <type_traits> +#include "build/build_config.h" #include "util/misc/address_sanitizer.h" #include "util/misc/from_pointer_cast.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include <mach-o/loader.h> #endif @@ -52,10 +53,10 @@ // because it’s POD, no code should need to run to initialize this under // release-mode optimization. -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) __attribute__(( -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) // Put the structure in a well-known section name where it can be easily // found without having to consult the symbol table. section(SEG_DATA ",crashpad_info"), @@ -77,16 +78,16 @@ // The “used” attribute prevents the structure from being dead-stripped. used)) -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) // Put the struct in a section name CPADinfo where it can be found without the // symbol table. #pragma section("CPADinfo", read, write) __declspec(allocate("CPADinfo")) -#else // !defined(OS_POSIX) && !defined(OS_WIN) +#else // !BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_WIN) #error Port -#endif // !defined(OS_POSIX) && !defined(OS_WIN) +#endif // !BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_WIN) CrashpadInfo g_crashpad_info; @@ -94,8 +95,8 @@ // static CrashpadInfo* CrashpadInfo::GetCrashpadInfo() { -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ - defined(OS_FUCHSIA) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ + BUILDFLAG(IS_FUCHSIA) // This otherwise-unused reference is used so that any module that // references GetCrashpadInfo() will also include the note in the // .note.crashpad.info section. That note in turn contains the address of
diff --git a/third_party/crashpad/crashpad/client/crashpad_info.h b/third_party/crashpad/crashpad/client/crashpad_info.h index cc05398..6c7ce327 100644 --- a/third_party/crashpad/crashpad/client/crashpad_info.h +++ b/third_party/crashpad/crashpad/client/crashpad_info.h
@@ -23,15 +23,15 @@ #include "client/simple_string_dictionary.h" #include "util/misc/tri_state.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <windows.h> -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) namespace crashpad { namespace internal { -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) class InProcessIntermediateDumpHandler; #endif @@ -230,7 +230,7 @@ }; protected: -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) friend class internal::InProcessIntermediateDumpHandler; #endif
diff --git a/third_party/crashpad/crashpad/client/settings.cc b/third_party/crashpad/crashpad/client/settings.cc index 3855b9b..966481d 100644 --- a/third_party/crashpad/crashpad/client/settings.cc +++ b/third_party/crashpad/crashpad/client/settings.cc
@@ -20,12 +20,13 @@ #include "base/logging.h" #include "base/posix/eintr_wrapper.h" +#include "build/build_config.h" #include "util/file/filesystem.h" #include "util/numeric/in_range_cast.h" namespace crashpad { -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) Settings::ScopedLockedFileHandle::ScopedLockedFileHandle() : handle_(kInvalidFileHandle), lockfile_path_() { @@ -68,7 +69,7 @@ } } -#else // OS_FUCHSIA +#else // BUILDFLAG(IS_FUCHSIA) namespace internal { @@ -82,7 +83,7 @@ } // namespace internal -#endif // OS_FUCHSIA +#endif // BUILDFLAG(IS_FUCHSIA) struct Settings::Data { static constexpr uint32_t kSettingsMagic = 'CPds'; @@ -193,7 +194,7 @@ FileLocking locking, const base::FilePath& file_path) { ScopedFileHandle scoped(file); -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) base::FilePath lockfile_path(file_path.value() + ".__lock__"); if (scoped.is_valid()) { ScopedFileHandle lockfile_scoped(
diff --git a/third_party/crashpad/crashpad/client/settings.h b/third_party/crashpad/crashpad/client/settings.h index d17f357..82f893a05 100644 --- a/third_party/crashpad/crashpad/client/settings.h +++ b/third_party/crashpad/crashpad/client/settings.h
@@ -125,7 +125,7 @@ // and closes the file on destruction. Note that on Fuchsia, this handle DOES // NOT offer correct operation, only an attempt to DCHECK if racy behavior is // detected. -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) struct ScopedLockedFileHandle { public: ScopedLockedFileHandle(); @@ -155,10 +155,10 @@ FileHandle handle_; base::FilePath lockfile_path_; }; -#else // OS_FUCHSIA +#else // BUILDFLAG(IS_FUCHSIA) using ScopedLockedFileHandle = base::ScopedGeneric<FileHandle, internal::ScopedLockedFileHandleTraits>; -#endif // OS_FUCHSIA +#endif // BUILDFLAG(IS_FUCHSIA) static ScopedLockedFileHandle MakeScopedLockedFileHandle( FileHandle file, FileLocking locking,
diff --git a/third_party/crashpad/crashpad/client/settings_test.cc b/third_party/crashpad/crashpad/client/settings_test.cc index 5f13cfc..74a2014 100644 --- a/third_party/crashpad/crashpad/client/settings_test.cc +++ b/third_party/crashpad/crashpad/client/settings_test.cc
@@ -154,7 +154,7 @@ EXPECT_TRUE(settings()->SetUploadsEnabled(true)); EXPECT_TRUE(settings()->SetLastUploadAttemptTime(time(nullptr))); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) EXPECT_EQ(_wunlink(settings_path().value().c_str()), 0) << ErrnoMessage("_wunlink"); #else
diff --git a/third_party/crashpad/crashpad/client/simulate_crash.h b/third_party/crashpad/crashpad/client/simulate_crash.h index d01e168..62a2ff9 100644 --- a/third_party/crashpad/crashpad/client/simulate_crash.h +++ b/third_party/crashpad/crashpad/client/simulate_crash.h
@@ -17,13 +17,13 @@ #include "build/build_config.h" -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "client/simulate_crash_mac.h" -#elif defined(OS_IOS) +#elif BUILDFLAG(IS_IOS) #include "client/simulate_crash_ios.h" -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include "client/simulate_crash_win.h" -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include "client/simulate_crash_linux.h" #endif
diff --git a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc index 3872e11..c6913614 100644 --- a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc +++ b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc
@@ -40,9 +40,9 @@ #include "util/net/url.h" #include "util/stdlib/map_insert.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include "handler/mac/file_limit_annotation.h" -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) namespace crashpad { @@ -51,7 +51,7 @@ // The number of seconds to wait between checking for pending reports. const int kRetryWorkIntervalSeconds = 15 * 60; -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) // The number of times to attempt to upload a pending report, repeated on // failure. Attempts will happen once per launch, once per call to // ReportPending(), and, if Options.watch_pending_reports is true, once every @@ -152,9 +152,9 @@ void CrashReportUploadThread::ProcessPendingReport( const CrashReportDatabase::Report& report) { -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) RecordFileLimitAnnotation(); -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) Settings* const settings = database_->GetSettings(); @@ -172,7 +172,7 @@ if (ShouldRateLimitUpload(report)) return; -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) if (ShouldRateLimitRetry(report)) return; #endif @@ -217,7 +217,7 @@ report.uuid, Metrics::CrashSkippedReason::kPrepareForUploadFailed); break; case UploadResult::kRetry: -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) if (upload_report->upload_attempts > kRetryAttempts) { upload_report.reset(); database_->SkipReportUpload(report.uuid, @@ -377,7 +377,7 @@ return false; } -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) bool CrashReportUploadThread::ShouldRateLimitRetry( const CrashReportDatabase::Report& report) { if (retry_uuid_time_map_.find(report.uuid) != retry_uuid_time_map_.end()) {
diff --git a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.h b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.h index 7649ae0..70f1628 100644 --- a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.h +++ b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
@@ -19,6 +19,7 @@ #include <string> #include <unordered_map> +#include "build/build_config.h" #include "client/crash_report_database.h" #include "util/misc/uuid.h" #include "util/stdlib/thread_safe_vector.h" @@ -186,7 +187,7 @@ //! upload attempts to be retried. bool ShouldRateLimitUpload(const CrashReportDatabase::Report& report); -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) //! \brief Rate-limit report retries. //! //! \param[in] report The crash report to process. @@ -206,7 +207,7 @@ const std::string url_; WorkerThread thread_; ThreadSafeVector<UUID> known_pending_report_uuids_; -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) // This is not thread-safe, and only used by the worker thread. std::map<UUID, time_t> retry_uuid_time_map_; #endif
diff --git a/third_party/crashpad/crashpad/handler/crashpad_handler_test_extended_handler.cc b/third_party/crashpad/crashpad/handler/crashpad_handler_test_extended_handler.cc index 4abcacd5..9901aba 100644 --- a/third_party/crashpad/crashpad/handler/crashpad_handler_test_extended_handler.cc +++ b/third_party/crashpad/crashpad/handler/crashpad_handler_test_extended_handler.cc
@@ -19,7 +19,7 @@ #include "minidump/test/minidump_user_extension_stream_util.h" #include "tools/tool_support.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <windows.h> #endif @@ -55,16 +55,16 @@ } // namespace -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) int main(int argc, char* argv[]) { return ExtendedHandlerMain(argc, argv); } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) int wmain(int argc, wchar_t* argv[]) { return crashpad::ToolSupport::Wmain(argc, argv, &ExtendedHandlerMain); } -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX)
diff --git a/third_party/crashpad/crashpad/handler/handler_main.cc b/third_party/crashpad/crashpad/handler/handler_main.cc index 5e8ff1a2..cb78aa168 100644 --- a/third_party/crashpad/crashpad/handler/handler_main.cc +++ b/third_party/crashpad/crashpad/handler/handler_main.cc
@@ -60,13 +60,13 @@ #include "handler/linux/cros_crash_report_exception_handler.h" #endif -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include <unistd.h> #include "handler/linux/crash_report_exception_handler.h" #include "handler/linux/exception_handler_server.h" #include "util/posix/signals.h" -#elif defined(OS_APPLE) +#elif BUILDFLAG(IS_APPLE) #include <libgen.h> #include <signal.h> @@ -78,7 +78,7 @@ #include "util/mach/child_port_handshake.h" #include "util/posix/close_stdio.h" #include "util/posix/signals.h" -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> #include "handler/win/crash_report_exception_handler.h" @@ -86,32 +86,42 @@ #include "util/win/handle.h" #include "util/win/initial_client_data.h" #include "util/win/session_end_watcher.h" -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) namespace crashpad { namespace { -#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ - defined(OS_ANDROID) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ + BUILDFLAG(IS_ANDROID) #define ATTACHMENTS_SUPPORTED 1 -#endif // OS_WIN || OS_LINUX || OS_CHROMEOS || OS_ANDROID +#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || + // BUILDFLAG(IS_ANDROID) void Usage(const base::FilePath& me) { + // clang-format off fprintf(stderr, "Usage: %" PRFilePath " [OPTION]...\n" "Crashpad's exception handler server.\n" "\n" " --annotation=KEY=VALUE set a process annotation in each crash report\n" + // clang-format on #if defined(ATTACHMENTS_SUPPORTED) + // clang-format off " --attachment=FILE_PATH attach specified file to each crash report\n" " at the time of the crash\n" + // clang-format on #endif // ATTACHMENTS_SUPPORTED + // clang-format off " --database=PATH store the crash report database at PATH\n" -#if defined(OS_APPLE) + // clang-format on +#if BUILDFLAG(IS_APPLE) + // clang-format off " --handshake-fd=FD establish communication with the client over FD\n" -#endif // OS_APPLE -#if defined(OS_WIN) + // clang-format on +#endif // BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_WIN) + // clang-format off " --initial-client-data=HANDLE_request_crash_dump,\n" " HANDLE_request_non_crash_dump,\n" " HANDLE_non_crash_dump_completed,\n" @@ -121,13 +131,20 @@ " Address_non_crash_exception_information,\n" " Address_debug_critical_section\n" " use precreated data to register initial client\n" -#endif // OS_WIN -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) + // clang-format on +#endif // BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + // clang-format off " --initial-client-fd=FD a socket connected to a client.\n" -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS -#if defined(OS_APPLE) + // clang-format on +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_APPLE) + // clang-format off " --mach-service=SERVICE register SERVICE with the bootstrap server\n" -#endif // OS_APPLE + // clang-format on +#endif // BUILDFLAG(IS_APPLE) + // clang-format off " --metrics-dir=DIR store metrics files in DIR (only in Chromium)\n" " --monitor-self run a second handler to catch crashes in the first\n" " --monitor-self-annotation=KEY=VALUE\n" @@ -140,18 +157,26 @@ " --no-periodic-tasks don't scan for new reports or prune the database\n" " --no-rate-limit don't rate limit crash uploads\n" " --no-upload-gzip don't use gzip compression when uploading\n" -#if defined(OS_ANDROID) + // clang-format on +#if BUILDFLAG(IS_ANDROID) + // clang-format off " --no-write-minidump-to-database\n" " don't write minidump to database\n" -#endif // OS_ANDROID -#if defined(OS_WIN) + // clang-format on +#endif // BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_WIN) + // clang-format off " --pipe-name=PIPE communicate with the client over PIPE\n" -#endif // OS_WIN -#if defined(OS_APPLE) + // clang-format on +#endif // BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_APPLE) + // clang-format off " --reset-own-crash-exception-port-to-system-default\n" " reset the server's exception handler to default\n" -#endif // OS_APPLE -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) + // clang-format on +#endif // BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) + // clang-format off " --sanitization-information=SANITIZATION_INFORMATION_ADDRESS\n" " the address of a SanitizationInformation struct.\n" " --shared-client-connection the file descriptor provided by\n" @@ -159,10 +184,15 @@ " clients\n" " --trace-parent-with-exception=EXCEPTION_INFORMATION_ADDRESS\n" " request a dump for the handler's parent process\n" -#endif // OS_LINUX || OS_CHROMEOS || OS_ANDROID + // clang-format on +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || + // BUILDFLAG(IS_ANDROID) + // clang-format off " --url=URL send crash reports to this Breakpad server URL,\n" " only if uploads are enabled for the database\n" + // clang-format on #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) + // clang-format off " --use-cros-crash-reporter\n" " pass crash reports to /sbin/crash_reporter\n" " instead of storing them in the database\n" @@ -173,13 +203,18 @@ " pass the --always_allow_feedback flag to\n" " crash_reporter, thus skipping metrics consent\n" " checks\n" + // clang-format on #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) + // clang-format off " --write-minidump-to-log write minidump to log\n" -#endif // OS_ANDROID + // clang-format on +#endif // BUILDFLAG(IS_ANDROID) + // clang-format off " --help display this help and exit\n" " --version output version information and exit\n", me.value().c_str()); + // clang-format on ToolSupport::UsageTail(me); } @@ -190,23 +225,23 @@ base::FilePath database; base::FilePath metrics_dir; std::vector<std::string> monitor_self_arguments; -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) std::string mach_service; int handshake_fd; bool reset_own_crash_exception_port_to_system_default; -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) VMAddress exception_information_address; VMAddress sanitization_information_address; int initial_client_fd; bool shared_client_connection; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool write_minidump_to_log; bool write_minidump_to_database; -#endif // OS_ANDROID -#elif defined(OS_WIN) +#endif // BUILDFLAG(IS_ANDROID) +#elif BUILDFLAG(IS_WIN) std::string pipe_name; InitialClientData initial_client_data; -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) bool identify_client_via_url; bool monitor_self; bool periodic_tasks; @@ -278,8 +313,8 @@ } }; -#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ - defined(OS_ANDROID) +#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ + BUILDFLAG(IS_ANDROID) void HandleCrashSignal(int sig, siginfo_t* siginfo, void* context) { MetricsRecordExit(Metrics::LifetimeMilestone::kCrashed); @@ -339,7 +374,7 @@ Signals::InstallTerminateHandlers(HandleTerminateSignal, 0, nullptr); } -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) struct ResetSIGTERMTraits { static struct sigaction* InvalidValue() { @@ -365,9 +400,9 @@ g_exception_handler_server->Stop(); } -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) LONG(WINAPI* g_original_exception_filter)(EXCEPTION_POINTERS*) = nullptr; @@ -424,7 +459,7 @@ new TerminateHandler(); } -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) void MonitorSelf(const Options& options) { base::FilePath executable_path; @@ -460,7 +495,7 @@ // instance of crashpad_handler to be writing metrics at a time, and it should // be the primary instance. CrashpadClient crashpad_client; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) if (!crashpad_client.StartHandlerAtCrash(executable_path, options.database, base::FilePath(), @@ -513,7 +548,7 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) settings.logging_dest = logging::LOG_TO_FILE; settings.log_file_path = "/var/log/chrome/chrome"; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; #else settings.logging_dest = @@ -540,23 +575,24 @@ // Long options without short equivalents. kOptionLastChar = 255, kOptionAnnotation, -#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ - defined(OS_ANDROID) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ + BUILDFLAG(IS_ANDROID) kOptionAttachment, -#endif // OS_WIN || OS_LINUX +#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) kOptionDatabase, -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) kOptionHandshakeFD, -#endif // OS_APPLE -#if defined(OS_WIN) +#endif // BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_WIN) kOptionInitialClientData, -#endif // OS_WIN -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) kOptionInitialClientFD, -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS -#if defined(OS_APPLE) +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_APPLE) kOptionMachService, -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) kOptionMetrics, kOptionMonitorSelf, kOptionMonitorSelfAnnotation, @@ -565,16 +601,16 @@ kOptionNoPeriodicTasks, kOptionNoRateLimit, kOptionNoUploadGzip, -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) kOptionNoWriteMinidumpToDatabase, -#endif // OS_ANDROID -#if defined(OS_WIN) +#endif // BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_WIN) kOptionPipeName, -#endif // OS_WIN -#if defined(OS_APPLE) +#endif // BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_APPLE) kOptionResetOwnCrashExceptionPortToSystemDefault, -#endif // OS_APPLE -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#endif // BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) kOptionSanitizationInformation, kOptionSharedClientConnection, kOptionTraceParentWithException, @@ -585,9 +621,9 @@ kOptionMinidumpDirForTests, kOptionAlwaysAllowFeedback, #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) kOptionWriteMinidumpToLog, -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) // Standard options. kOptionHelp = -2, @@ -600,21 +636,22 @@ {"attachment", required_argument, nullptr, kOptionAttachment}, #endif // ATTACHMENTS_SUPPORTED {"database", required_argument, nullptr, kOptionDatabase}, -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) {"handshake-fd", required_argument, nullptr, kOptionHandshakeFD}, -#endif // OS_APPLE -#if defined(OS_WIN) +#endif // BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_WIN) {"initial-client-data", required_argument, nullptr, kOptionInitialClientData}, -#endif // OS_APPLE -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) {"initial-client-fd", required_argument, nullptr, kOptionInitialClientFD}, -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS -#if defined(OS_APPLE) +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_APPLE) {"mach-service", required_argument, nullptr, kOptionMachService}, -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) {"metrics-dir", required_argument, nullptr, kOptionMetrics}, {"monitor-self", no_argument, nullptr, kOptionMonitorSelf}, {"monitor-self-annotation", @@ -632,22 +669,22 @@ {"no-periodic-tasks", no_argument, nullptr, kOptionNoPeriodicTasks}, {"no-rate-limit", no_argument, nullptr, kOptionNoRateLimit}, {"no-upload-gzip", no_argument, nullptr, kOptionNoUploadGzip}, -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) {"no-write-minidump-to-database", no_argument, nullptr, kOptionNoWriteMinidumpToDatabase}, -#endif // OS_ANDROID -#if defined(OS_WIN) +#endif // BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_WIN) {"pipe-name", required_argument, nullptr, kOptionPipeName}, -#endif // OS_WIN -#if defined(OS_APPLE) +#endif // BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_APPLE) {"reset-own-crash-exception-port-to-system-default", no_argument, nullptr, kOptionResetOwnCrashExceptionPortToSystemDefault}, -#endif // OS_APPLE -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#endif // BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) {"sanitization-information", required_argument, nullptr, @@ -660,42 +697,40 @@ required_argument, nullptr, kOptionTraceParentWithException}, -#endif // OS_LINUX || OS_CHROMEOS || OS_ANDROID +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || + // BUILDFLAG(IS_ANDROID) {"url", required_argument, nullptr, kOptionURL}, #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) {"use-cros-crash-reporter", - no_argument, - nullptr, - kOptionUseCrosCrashReporter}, + no_argument, + nullptr, + kOptionUseCrosCrashReporter}, {"minidump-dir-for-tests", - required_argument, - nullptr, - kOptionMinidumpDirForTests}, - {"always-allow-feedback", - no_argument, - nullptr, - kOptionAlwaysAllowFeedback}, + required_argument, + nullptr, + kOptionMinidumpDirForTests}, + {"always-allow-feedback", no_argument, nullptr, kOptionAlwaysAllowFeedback}, #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) {"write-minidump-to-log", no_argument, nullptr, kOptionWriteMinidumpToLog}, -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) {"help", no_argument, nullptr, kOptionHelp}, {"version", no_argument, nullptr, kOptionVersion}, {nullptr, 0, nullptr, 0}, }; Options options = {}; -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) options.handshake_fd = -1; #endif options.identify_client_via_url = true; -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) options.initial_client_fd = kInvalidFileHandle; #endif options.periodic_tasks = true; options.rate_limit = true; options.upload_gzip = true; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) options.write_minidump_to_database = true; #endif @@ -720,7 +755,7 @@ ToolSupport::CommandLineArgumentToFilePathStringType(optarg)); break; } -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) case kOptionHandshakeFD: { if (!StringToNumber(optarg, &options.handshake_fd) || options.handshake_fd < 0) { @@ -734,8 +769,8 @@ options.mach_service = optarg; break; } -#endif // OS_APPLE -#if defined(OS_WIN) +#endif // BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_WIN) case kOptionInitialClientData: { if (!options.initial_client_data.InitializeFromString(optarg)) { ToolSupport::UsageHint( @@ -744,8 +779,8 @@ } break; } -#endif // OS_WIN -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) case kOptionInitialClientFD: { if (!base::StringToInt(optarg, &options.initial_client_fd)) { ToolSupport::UsageHint(me, "failed to parse --initial-client-fd"); @@ -753,7 +788,8 @@ } break; } -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) case kOptionMetrics: { options.metrics_dir = base::FilePath( ToolSupport::CommandLineArgumentToFilePathStringType(optarg)); @@ -791,25 +827,25 @@ options.upload_gzip = false; break; } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) case kOptionNoWriteMinidumpToDatabase: { options.write_minidump_to_database = false; break; } -#endif // OS_ANDROID -#if defined(OS_WIN) +#endif // BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_WIN) case kOptionPipeName: { options.pipe_name = optarg; break; } -#endif // OS_WIN -#if defined(OS_APPLE) +#endif // BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_APPLE) case kOptionResetOwnCrashExceptionPortToSystemDefault: { options.reset_own_crash_exception_port_to_system_default = true; break; } -#endif // OS_APPLE -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#endif // BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) case kOptionSanitizationInformation: { if (!StringToNumber(optarg, &options.sanitization_information_address)) { @@ -831,7 +867,8 @@ } break; } -#endif // OS_LINUX || OS_CHROMEOS || OS_ANDROID +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || + // BUILDFLAG(IS_ANDROID) case kOptionURL: { options.url = optarg; break; @@ -851,12 +888,12 @@ break; } #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) case kOptionWriteMinidumpToLog: { options.write_minidump_to_log = true; break; } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) case kOptionHelp: { Usage(me); MetricsRecordExit(Metrics::LifetimeMilestone::kExitedEarly); @@ -876,7 +913,7 @@ argc -= optind; argv += optind; -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) if (options.handshake_fd < 0 && options.mach_service.empty()) { ToolSupport::UsageHint(me, "--handshake-fd or --mach-service is required"); return ExitFailure(); @@ -886,7 +923,7 @@ me, "--handshake-fd and --mach-service are incompatible"); return ExitFailure(); } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) if (!options.initial_client_data.IsValid() && options.pipe_name.empty()) { ToolSupport::UsageHint(me, "--initial-client-data or --pipe-name is required"); @@ -897,7 +934,7 @@ me, "--initial-client-data and --pipe-name are incompatible"); return ExitFailure(); } -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) if (!options.exception_information_address && options.initial_client_fd == kInvalidFileHandle) { ToolSupport::UsageHint( @@ -917,15 +954,15 @@ me, "--shared-client-connection requires --initial-client-fd"); return ExitFailure(); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) if (!options.write_minidump_to_log && !options.write_minidump_to_database) { ToolSupport::UsageHint(me, "--no_write_minidump_to_database is required to use " "with --write_minidump_to_log."); ExitFailure(); } -#endif // OS_ANDROID -#endif // OS_APPLE +#endif // BUILDFLAG(IS_ANDROID) +#endif // BUILDFLAG(IS_APPLE) if (options.database.empty()) { ToolSupport::UsageHint(me, "--database is required"); @@ -937,11 +974,11 @@ return ExitFailure(); } -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) if (options.reset_own_crash_exception_port_to_system_default) { CrashpadClient::UseSystemDefaultHandler(); } -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) if (options.monitor_self) { MonitorSelf(options); @@ -990,7 +1027,7 @@ upload_thread.Get()->Start(); } -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) std::unique_ptr<ExceptionHandlerServer::Delegate> exception_handler; #else std::unique_ptr<CrashReportExceptionHandler> exception_handler; @@ -1030,18 +1067,18 @@ #if defined(ATTACHMENTS_SUPPORTED) &options.attachments, #endif // ATTACHMENTS_SUPPORTED -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) options.write_minidump_to_database, options.write_minidump_to_log, -#endif // OS_ANDROID -#if defined(OS_LINUX) +#endif // BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) true, false, -#endif // OS_LINUX +#endif // BUILDFLAG(IS_LINUX) user_stream_sources); #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) if (options.exception_information_address) { ExceptionHandlerProtocol::ClientInformation info; info.exception_information_address = options.exception_information_address; @@ -1051,7 +1088,8 @@ ? EXIT_SUCCESS : ExitFailure(); } -#endif // OS_LINUX || OS_CHROMEOS || OS_ANDROID +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || + // BUILDFLAG(IS_ANDROID) ScopedStoppable prune_thread; if (options.periodic_tasks) { @@ -1060,7 +1098,7 @@ prune_thread.Get()->Start(); } -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) if (options.mach_service.empty()) { // Don’t do this when being run by launchd. See launchd.plist(5). CloseStdinAndStdout(); @@ -1103,7 +1141,7 @@ } RecordFileLimitAnnotation(); -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) // Shut down as late as possible relative to programs we're watching. if (!SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY)) PLOG(ERROR) << "SetProcessShutdownParameters"; @@ -1113,9 +1151,9 @@ if (!options.pipe_name.empty()) { exception_handler_server.SetPipeName(base::UTF8ToWide(options.pipe_name)); } -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) ExceptionHandlerServer exception_handler_server; -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) base::GlobalHistogramAllocator* histogram_allocator = nullptr; if (!options.metrics_dir.empty()) { @@ -1130,19 +1168,19 @@ Metrics::HandlerLifetimeMilestone(Metrics::LifetimeMilestone::kStarted); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) if (options.initial_client_data.IsValid()) { exception_handler_server.InitializeWithInheritedDataForInitialClient( options.initial_client_data, exception_handler.get()); } -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) if (options.initial_client_fd == kInvalidFileHandle || !exception_handler_server.InitializeWithClient( ScopedFileHandle(options.initial_client_fd), options.shared_client_connection)) { return ExitFailure(); } -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) exception_handler_server.Run(exception_handler.get());
diff --git a/third_party/crashpad/crashpad/handler/handler_main.h b/third_party/crashpad/crashpad/handler/handler_main.h index 2526541..b6cc467c 100644 --- a/third_party/crashpad/crashpad/handler/handler_main.h +++ b/third_party/crashpad/crashpad/handler/handler_main.h
@@ -35,7 +35,7 @@ char* argv[], const UserStreamDataSources* user_stream_sources); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) //! \brief The `main()` entry point for Android libraries. //! //! This symbol is the entry point for crashpad when it is dynamically loaded
diff --git a/third_party/crashpad/crashpad/handler/linux/crash_report_exception_handler.cc b/third_party/crashpad/crashpad/handler/linux/crash_report_exception_handler.cc index 84f9534..88378a9 100644 --- a/third_party/crashpad/crashpad/handler/linux/crash_report_exception_handler.cc +++ b/third_party/crashpad/crashpad/handler/linux/crash_report_exception_handler.cc
@@ -36,7 +36,7 @@ #include "util/stream/log_output_stream.h" #include "util/stream/zlib_output_stream.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include <android/log.h> #endif @@ -52,7 +52,7 @@ ~Logger() override = default; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) int Log(const char* buf) override { return __android_log_buf_write( LOG_ID_CRASH, ANDROID_LOG_FATAL, "crashpad", buf);
diff --git a/third_party/crashpad/crashpad/handler/linux/exception_handler_server_test.cc b/third_party/crashpad/crashpad/handler/linux/exception_handler_server_test.cc index 786bab1..c7fa90d 100644 --- a/third_party/crashpad/crashpad/handler/linux/exception_handler_server_test.cc +++ b/third_party/crashpad/crashpad/handler/linux/exception_handler_server_test.cc
@@ -30,7 +30,7 @@ #include "util/synchronization/semaphore.h" #include "util/thread/thread.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include <android/api-level.h> #endif
diff --git a/third_party/crashpad/crashpad/handler/main.cc b/third_party/crashpad/crashpad/handler/main.cc index 3ae73ec..855a5a7 100644 --- a/third_party/crashpad/crashpad/handler/main.cc +++ b/third_party/crashpad/crashpad/handler/main.cc
@@ -17,17 +17,17 @@ #include "build/build_config.h" #include "tools/tool_support.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <windows.h> #endif -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) int main(int argc, char* argv[]) { return crashpad::HandlerMain(argc, argv, nullptr); } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) namespace { @@ -50,4 +50,4 @@ return crashpad::ToolSupport::Wmain(argc, argv, HandlerMainAdaptor); } -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX)
diff --git a/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc b/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc index d7e53a4..2f2d90b 100644 --- a/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc +++ b/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
@@ -21,6 +21,7 @@ #include "base/compiler_specific.h" #include "base/logging.h" +#include "build/build_config.h" #include "snapshot/cpu_context.h" #include "util/file/file_writer.h" #include "util/stdlib/aligned_allocator.h" @@ -35,7 +36,7 @@ "MinidumpContextAMD64 size"); // These structures can also be checked against definitions in the Windows SDK. -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #if defined(ARCH_CPU_X86_FAMILY) static_assert(sizeof(MinidumpContextX86) == sizeof(WOW64_CONTEXT), "WOW64_CONTEXT size"); @@ -45,7 +46,7 @@ static_assert(sizeof(MinidumpContextAMD64) == sizeof(CONTEXT), "CONTEXT size"); #endif #endif // ARCH_CPU_X86_FAMILY -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) } // namespace
diff --git a/third_party/crashpad/crashpad/minidump/minidump_file_writer_test.cc b/third_party/crashpad/crashpad/minidump/minidump_file_writer_test.cc index efeaeab4c..e4be0b6d 100644 --- a/third_party/crashpad/crashpad/minidump/minidump_file_writer_test.cc +++ b/third_party/crashpad/crashpad/minidump/minidump_file_writer_test.cc
@@ -418,12 +418,13 @@ // but the test should complete without failure. constexpr uint32_t kSnapshotTime = 0xfd469ab8; constexpr timeval kSnapshotTimeval = { -#ifdef OS_WIN - static_cast<long>(kSnapshotTime), +#if BUILDFLAG(IS_WIN) + static_cast<long>(kSnapshotTime), #else - static_cast<time_t>(kSnapshotTime), + static_cast<time_t>(kSnapshotTime), #endif - 0}; + 0 + }; TestProcessSnapshot process_snapshot; process_snapshot.SetSnapshotTime(kSnapshotTimeval);
diff --git a/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc b/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc index 64c3c23..12c65b1 100644 --- a/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc +++ b/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
@@ -31,9 +31,9 @@ #include "util/numeric/in_range_cast.h" #include "util/numeric/safe_assignment.h" -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include <Availability.h> -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) #include <android/api-level.h> #endif @@ -67,7 +67,7 @@ return machine_description; } -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) // Converts the value of the __MAC_OS_X_VERSION_MIN_REQUIRED or // __MAC_OS_X_VERSION_MAX_ALLOWED macro from <Availability.h> to a number // identifying the macOS version that it represents, in the same format used by @@ -93,7 +93,7 @@ return availability; } -#endif // OS_MAC +#endif // BUILDFLAG(IS_MAC) } // namespace @@ -107,17 +107,17 @@ // Caution: the minidump file format only has room for 39 UTF-16 code units // plus a UTF-16 NUL terminator. Don’t let strings get longer than this, or // they will be truncated and a message will be logged. -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) static constexpr char kOS[] = "mac"; -#elif defined(OS_IOS) +#elif BUILDFLAG(IS_IOS) static constexpr char kOS[] = "ios"; -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) static constexpr char kOS[] = "android"; -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) static constexpr char kOS[] = "linux"; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) static constexpr char kOS[] = "win"; -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) static constexpr char kOS[] = "fuchsia"; #else #error define kOS for this operating system @@ -145,12 +145,12 @@ PACKAGE_VERSION, kOS); -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) debug_build_string += base::StringPrintf( ",%d,%d", AvailabilityVersionToMacOSVersionNumber(__MAC_OS_X_VERSION_MIN_REQUIRED), AvailabilityVersionToMacOSVersionNumber(__MAC_OS_X_VERSION_MAX_ALLOWED)); -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) debug_build_string += base::StringPrintf(",%d", __ANDROID_API__); #endif
diff --git a/third_party/crashpad/crashpad/snapshot/crashpad_info_client_options_test.cc b/third_party/crashpad/crashpad/snapshot/crashpad_info_client_options_test.cc index 4476e21..73df677 100644 --- a/third_party/crashpad/crashpad/snapshot/crashpad_info_client_options_test.cc +++ b/third_party/crashpad/crashpad/snapshot/crashpad_info_client_options_test.cc
@@ -24,13 +24,13 @@ #include "test/scoped_module_handle.h" #include "test/test_paths.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include <dlfcn.h> #include "snapshot/mac/process_snapshot_mac.h" -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> #include "snapshot/win/process_snapshot_win.h" -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) #include <lib/zx/process.h> #include "snapshot/fuchsia/process_snapshot_fuchsia.h" #endif @@ -79,19 +79,19 @@ }; CrashpadInfoClientOptions SelfProcessSnapshotAndGetCrashpadOptions() { -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) ProcessSnapshotMac process_snapshot; EXPECT_TRUE(process_snapshot.Initialize(mach_task_self())); -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) ProcessSnapshotWin process_snapshot; EXPECT_TRUE(process_snapshot.Initialize( GetCurrentProcess(), ProcessSuspensionState::kRunning, 0, 0)); -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) ProcessSnapshotFuchsia process_snapshot; EXPECT_TRUE(process_snapshot.Initialize(*zx::process::self())); #else #error Port. -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) CrashpadInfoClientOptions options; process_snapshot.GetCrashpadOptions(&options); @@ -154,19 +154,19 @@ TestPaths::BuildArtifact(FILE_PATH_LITERAL("snapshot"), FILE_PATH_LITERAL("module"), TestPaths::FileType::kLoadableModule); -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) ScopedModuleHandle module( dlopen(module_path.value().c_str(), RTLD_LAZY | RTLD_LOCAL)); ASSERT_TRUE(module.valid()) << "dlopen " << module_path.value() << ": " << dlerror(); -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) ScopedModuleHandle module(LoadLibrary(module_path.value().c_str())); ASSERT_TRUE(module.valid()) << "LoadLibrary " << base::WideToUTF8(module_path.value()) << ": " << ErrorMessage(); #else #error Port. -#endif // OS_APPLE +#endif // BUILDFLAG(IS_POSIX) // Get the function pointer from the module. This wraps GetCrashpadInfo(), but // because it runs in the module, it returns the remote module’s CrashpadInfo @@ -252,19 +252,19 @@ TestPaths::BuildArtifact(FILE_PATH_LITERAL("snapshot"), artifact, TestPaths::FileType::kLoadableModule); -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) ScopedModuleHandle module( dlopen(module_path.value().c_str(), RTLD_LAZY | RTLD_LOCAL)); ASSERT_TRUE(module.valid()) << "dlopen " << module_path.value() << ": " << dlerror(); -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) ScopedModuleHandle module(LoadLibrary(module_path.value().c_str())); ASSERT_TRUE(module.valid()) << "LoadLibrary " << base::WideToUTF8(module_path.value()) << ": " << ErrorMessage(); #else #error Port. -#endif // OS_APPLE +#endif // BUILDFLAG(IS_POSIX) // Get the function pointer from the module. CrashpadInfo* (*TestModule_GetCrashpadInfo)() =
diff --git a/third_party/crashpad/crashpad/snapshot/crashpad_info_client_options_test_module.cc b/third_party/crashpad/crashpad/snapshot/crashpad_info_client_options_test_module.cc index 357d35e..48795e3c 100644 --- a/third_party/crashpad/crashpad/snapshot/crashpad_info_client_options_test_module.cc +++ b/third_party/crashpad/crashpad/snapshot/crashpad_info_client_options_test_module.cc
@@ -15,12 +15,12 @@ #include "build/build_config.h" #include "client/crashpad_info.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #define EXPORT __attribute__((visibility("default"))) -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> #define EXPORT __declspec(dllexport) -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) extern "C" { @@ -40,8 +40,8 @@ } // extern "C" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) { return TRUE; } -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN)
diff --git a/third_party/crashpad/crashpad/snapshot/crashpad_info_size_test_module.cc b/third_party/crashpad/crashpad/snapshot/crashpad_info_size_test_module.cc index 584f83b..0a9186c 100644 --- a/third_party/crashpad/crashpad/snapshot/crashpad_info_size_test_module.cc +++ b/third_party/crashpad/crashpad/snapshot/crashpad_info_size_test_module.cc
@@ -16,11 +16,11 @@ #include "build/build_config.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include <mach-o/loader.h> -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) namespace crashpad { @@ -65,9 +65,9 @@ // to get this test version to be interpreted as a genuine CrashpadInfo // structure. The size is set to the actual size of this structure (that’s kind // of the point of this test). -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) __attribute__(( -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) section(SEG_DATA ",crashpad_info"), #endif #if defined(ADDRESS_SANITIZER) @@ -75,12 +75,12 @@ #endif // defined(ADDRESS_SANITIZER) visibility("hidden"), used)) -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #pragma section("CPADinfo", read, write) __declspec(allocate("CPADinfo")) -#else // !defined(OS_POSIX) && !defined(OS_WIN) +#else // !BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_WIN) #error Port -#endif // !defined(OS_POSIX) && !defined(OS_WIN) +#endif // !BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_WIN) TestCrashpadInfo g_test_crashpad_info = {'CPad', sizeof(TestCrashpadInfo), 1, @@ -105,14 +105,15 @@ extern "C" { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) __attribute__((visibility("default"))) -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) __declspec(dllexport) #else #error Port -#endif // OS_POSIX -crashpad::TestCrashpadInfo* TestModule_GetCrashpadInfo() { +#endif // BUILDFLAG(IS_POSIX) +crashpad::TestCrashpadInfo* +TestModule_GetCrashpadInfo() { // Note that there's no need to do the back-reference here to the note on // POSIX like CrashpadInfo::GetCrashpadInfo() because the note .S file is // directly included into this test binary. @@ -121,8 +122,8 @@ } // extern "C" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) { return TRUE; } -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN)
diff --git a/third_party/crashpad/crashpad/snapshot/crashpad_types/crashpad_info_reader.cc b/third_party/crashpad/crashpad/snapshot/crashpad_types/crashpad_info_reader.cc index cedab59..ad75292 100644 --- a/third_party/crashpad/crashpad/snapshot/crashpad_types/crashpad_info_reader.cc +++ b/third_party/crashpad/crashpad/snapshot/crashpad_types/crashpad_info_reader.cc
@@ -20,11 +20,11 @@ #include "client/crashpad_info.h" #include "util/misc/as_underlying_type.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "util/win/traits.h" -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include "util/linux/traits.h" -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) #include "util/fuchsia/traits.h" #endif
diff --git a/third_party/crashpad/crashpad/snapshot/crashpad_types/crashpad_info_reader_test.cc b/third_party/crashpad/crashpad/snapshot/crashpad_types/crashpad_info_reader_test.cc index 3a1806a..9c6e3c3 100644 --- a/third_party/crashpad/crashpad/snapshot/crashpad_types/crashpad_info_reader_test.cc +++ b/third_party/crashpad/crashpad/snapshot/crashpad_types/crashpad_info_reader_test.cc
@@ -30,7 +30,7 @@ #include "util/misc/from_pointer_cast.h" #include "util/process/process_memory_native.h" -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #include "test/linux/fake_ptrace_connection.h" #endif @@ -109,7 +109,7 @@ VMAddress extra_memory_address, VMAddress simple_annotations_address, VMAddress annotations_list_address) { -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) FakePtraceConnection connection; ASSERT_TRUE(connection.Initialize(process)); ProcessMemoryLinux memory(&connection);
diff --git a/third_party/crashpad/crashpad/snapshot/crashpad_types/image_annotation_reader_test.cc b/third_party/crashpad/crashpad/snapshot/crashpad_types/image_annotation_reader_test.cc index b5289e7..f7f18cbd6 100644 --- a/third_party/crashpad/crashpad/snapshot/crashpad_types/image_annotation_reader_test.cc +++ b/third_party/crashpad/crashpad/snapshot/crashpad_types/image_annotation_reader_test.cc
@@ -32,7 +32,7 @@ #include "util/misc/from_pointer_cast.h" #include "util/process/process_memory_native.h" -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #include "test/linux/fake_ptrace_connection.h" #endif @@ -94,7 +94,7 @@ bool is_64_bit, VMAddress simple_map_address, VMAddress annotation_list_address) { -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) FakePtraceConnection connection; ASSERT_TRUE(connection.Initialize(process)); ProcessMemoryLinux memory(&connection);
diff --git a/third_party/crashpad/crashpad/snapshot/elf/elf_image_reader.cc b/third_party/crashpad/crashpad/snapshot/elf/elf_image_reader.cc index 5ea14c0..0b7d0145f 100644 --- a/third_party/crashpad/crashpad/snapshot/elf/elf_image_reader.cc +++ b/third_party/crashpad/crashpad/snapshot/elf/elf_image_reader.cc
@@ -733,13 +733,13 @@ if (!dynamic_array_->GetValue(tag, log, address)) { return false; } -#if defined(OS_ANDROID) || defined(OS_FUCHSIA) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) // The GNU loader updates the dynamic array according to the load bias. // The Android and Fuchsia loaders only update the debug address. if (tag != DT_DEBUG) { *address += GetLoadBias(); } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) return true; }
diff --git a/third_party/crashpad/crashpad/snapshot/elf/elf_image_reader_test.cc b/third_party/crashpad/crashpad/snapshot/elf/elf_image_reader_test.cc index 2ea55ad..161eab0 100644 --- a/third_party/crashpad/crashpad/snapshot/elf/elf_image_reader_test.cc +++ b/third_party/crashpad/crashpad/snapshot/elf/elf_image_reader_test.cc
@@ -30,12 +30,12 @@ #include "util/misc/from_pointer_cast.h" #include "util/process/process_memory_native.h" -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) #include <lib/zx/process.h> #include "base/fuchsia/fuchsia_logging.h" -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include "test/linux/fake_ptrace_connection.h" #include "util/linux/auxiliary_vector.h" @@ -45,7 +45,7 @@ #error Port. -#endif // OS_FUCHSIA +#endif // BUILDFLAG(IS_FUCHSIA) extern "C" { __attribute__((visibility("default"))) void ElfImageReaderTestExportedSymbol() { @@ -56,8 +56,7 @@ namespace test { namespace { - -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) void LocateExecutable(const ProcessType& process, ProcessMemory* memory, @@ -84,7 +83,7 @@ *elf_address = base; } -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) void LocateExecutable(PtraceConnection* connection, ProcessMemory* memory, @@ -104,7 +103,7 @@ *elf_address = possible_mappings->Next()->range.Base(); } -#endif // OS_FUCHSIA +#endif // BUILDFLAG(IS_FUCHSIA) void ExpectSymbol(ElfImageReader* reader, const std::string& symbol_name, @@ -128,12 +127,12 @@ #endif // ARCH_CPU_64_BITS VMAddress elf_address; -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) FakePtraceConnection connection; ASSERT_TRUE(connection.Initialize(process)); ProcessMemoryLinux memory(&connection); LocateExecutable(&connection, &memory, &elf_address); -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) ProcessMemoryFuchsia memory; ASSERT_TRUE(memory.Initialize(process)); LocateExecutable(process, &memory, &elf_address); @@ -192,7 +191,7 @@ constexpr bool am_64_bit = false; #endif // ARCH_CPU_64_BITS -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) FakePtraceConnection connection; ASSERT_TRUE(connection.Initialize(process)); ProcessMemoryLinux memory(&connection); @@ -301,7 +300,7 @@ test.Run(); } -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) // crashpad_snapshot_test_both_dt_hash_styles is specially built and forced to // include both .hash and .gnu.hash sections. Linux, Android, and Fuchsia have @@ -356,7 +355,7 @@ EXPECT_EQ(from_dt_hash, from_dt_gnu_hash); } -#endif // OS_FUCHSIA +#endif // BUILDFLAG(IS_FUCHSIA) } // namespace } // namespace test
diff --git a/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous.cc b/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous.cc index 42384f7..e0af2b3b 100644 --- a/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous.cc +++ b/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous.cc
@@ -21,7 +21,7 @@ #include "base/logging.h" #include "build/build_config.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include <android/api-level.h> #endif @@ -142,7 +142,7 @@ modules_.push_back(entry); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Android P (API 28) mistakenly places the vdso in the first entry in the // link map. const int android_runtime_api = android_get_device_api_level(); @@ -151,7 +151,7 @@ modules_[0] = executable_; executable_ = executable; } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) return true; }
diff --git a/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc b/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc index 4754528e..9fa6d631 100644 --- a/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc +++ b/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
@@ -41,7 +41,7 @@ #include "util/process/process_memory_linux.h" #include "util/process/process_memory_range.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include <android/api-level.h> #endif @@ -103,7 +103,7 @@ DebugRendezvous debug; ASSERT_TRUE(debug.Initialize(range, debug_address)); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) const int android_runtime_api = android_get_device_api_level(); ASSERT_GE(android_runtime_api, 1); @@ -125,7 +125,7 @@ // glibc's loader does not set the name for the executable. EXPECT_TRUE(debug.Executable()->name.empty()); EXPECT_EQ(debug.Executable()->dynamic_array, exe_dynamic_address); -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) // Android's loader doesn't set the load bias until Android 4.3 (API 18). if (android_runtime_api >= 18) { @@ -162,7 +162,7 @@ ASSERT_GE(possible_mappings->Count(), 1u); std::unique_ptr<ElfImageReader> module_reader; -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) const MemoryMap::Mapping* module_mapping = nullptr; #endif const MemoryMap::Mapping* mapping = nullptr; @@ -174,7 +174,7 @@ parsed_module->GetDynamicArrayAddress(&dynamic_address) && dynamic_address == module.dynamic_array) { module_reader = std::move(parsed_module); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) module_mapping = mapping; #endif break; @@ -182,7 +182,7 @@ } ASSERT_TRUE(module_reader.get()); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) EXPECT_FALSE(module.name.empty()); #else // glibc's loader doesn't always set the name in the link map for the vdso. @@ -206,7 +206,7 @@ module_mapping->device, module_mapping->inode, module.name); -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) // Android's loader stops setting its own load bias after Android 4.4.4 // (API 20) until Android 6.0 (API 23).
diff --git a/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc b/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc index a9098ac..5711f34 100644 --- a/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc +++ b/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
@@ -29,7 +29,7 @@ #include "util/linux/auxiliary_vector.h" #include "util/linux/proc_stat_reader.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include <android/api-level.h> #endif @@ -282,7 +282,7 @@ } void ProcessReaderLinux::InitializeAbortMessage() { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) const MemoryMap::Mapping* mapping = memory_map_.FindMappingWithName("[anon:abort message]"); if (!mapping) { @@ -297,7 +297,7 @@ #endif } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // These structure definitions and the magic numbers below were copied from // bionic/libc/bionic/android_set_abort_message.cpp @@ -346,7 +346,7 @@ } } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) const std::string& ProcessReaderLinux::AbortMessage() { INITIALIZATION_STATE_DCHECK_VALID(initialized_); @@ -486,7 +486,7 @@ continue; } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Beginning at API 21, Bionic provides android_dlopen_ext() which allows // passing a file descriptor with an existing relro segment to the loader. // This means that the mapping attributes of dyn_mapping may be unrelated
diff --git a/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc b/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc index f3791f8..8cc90a0 100644 --- a/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc +++ b/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
@@ -53,7 +53,7 @@ #include "util/misc/memory_sanitizer.h" #include "util/synchronization/semaphore.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include <android/api-level.h> #include <android/set_abort_message.h> #include "dlfcn_internal.h" @@ -492,7 +492,7 @@ } // Android doesn't provide dl_iterate_phdr on ARM until API 21. -#if !defined(OS_ANDROID) || !defined(ARCH_CPU_ARMEL) || __ANDROID_API__ >= 21 +#if !BUILDFLAG(IS_ANDROID) || !defined(ARCH_CPU_ARMEL) || __ANDROID_API__ >= 21 int ExpectFindModule(dl_phdr_info* info, size_t size, void* data) { SCOPED_TRACE( base::StringPrintf("module %s at 0x%" PRIx64 " phdrs 0x%" PRIx64, @@ -502,8 +502,7 @@ auto modules = reinterpret_cast<const std::vector<ProcessReaderLinux::Module>*>(data); - -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Prior to API 27, Bionic includes a null entry for /system/bin/linker. if (!info->dlpi_name) { EXPECT_EQ(info->dlpi_addr, 0u); @@ -532,7 +531,7 @@ EXPECT_TRUE(found); return 0; } -#endif // !OS_ANDROID || !ARCH_CPU_ARMEL || __ANDROID_API__ >= 21 +#endif // !BUILDFLAG(IS_ANDROID) || !ARCH_CPU_ARMEL || __ANDROID_API__ >= 21 void ExpectModulesFromSelf( const std::vector<ProcessReaderLinux::Module>& modules) { @@ -542,14 +541,14 @@ } // Android doesn't provide dl_iterate_phdr on ARM until API 21. -#if !defined(OS_ANDROID) || !defined(ARCH_CPU_ARMEL) || __ANDROID_API__ >= 21 +#if !BUILDFLAG(IS_ANDROID) || !defined(ARCH_CPU_ARMEL) || __ANDROID_API__ >= 21 EXPECT_EQ( dl_iterate_phdr( ExpectFindModule, reinterpret_cast<void*>( const_cast<std::vector<ProcessReaderLinux::Module>*>(&modules))), 0); -#endif // !OS_ANDROID || !ARCH_CPU_ARMEL || __ANDROID_API__ >= 21 +#endif // !BUILDFLAG(IS_ANDROID) || !ARCH_CPU_ARMEL || __ANDROID_API__ >= 21 } #if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) @@ -641,7 +640,7 @@ test.Run(); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) const char kTestAbortMessage[] = "test abort message"; TEST(ProcessReaderLinux, AbortMessage) {
diff --git a/third_party/crashpad/crashpad/snapshot/linux/process_snapshot_linux.cc b/third_party/crashpad/crashpad/snapshot/linux/process_snapshot_linux.cc index a730b29..b4be3de7 100644 --- a/third_party/crashpad/crashpad/snapshot/linux/process_snapshot_linux.cc +++ b/third_party/crashpad/crashpad/snapshot/linux/process_snapshot_linux.cc
@@ -17,6 +17,7 @@ #include <utility> #include "base/logging.h" +#include "build/build_config.h" #include "util/linux/exception_information.h" namespace crashpad { @@ -306,7 +307,7 @@ } void ProcessSnapshotLinux::InitializeAnnotations() { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) const std::string& abort_message = process_reader_.AbortMessage(); if (!abort_message.empty()) { annotations_simple_map_["abort_message"] = abort_message;
diff --git a/third_party/crashpad/crashpad/snapshot/linux/signal_context.h b/third_party/crashpad/crashpad/snapshot/linux/signal_context.h index 1100246..c004f8f6 100644 --- a/third_party/crashpad/crashpad/snapshot/linux/signal_context.h +++ b/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
@@ -119,11 +119,11 @@ struct Sigset< Traits, typename std::enable_if<std::is_base_of<Traits64, Traits>::value>::type> { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) uint64_t val; #else typename Traits::ULong val[16]; -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) }; #if defined(ARCH_CPU_X86_FAMILY)
diff --git a/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc b/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc index a99da3e4..e77bcaf 100644 --- a/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc +++ b/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
@@ -26,13 +26,14 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/stringprintf.h" +#include "build/build_config.h" #include "snapshot/cpu_context.h" #include "snapshot/posix/timezone.h" #include "util/file/file_io.h" #include "util/numeric/in_range_cast.h" #include "util/string/split_string.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include <sys/system_properties.h> #endif @@ -118,7 +119,7 @@ return true; } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool ReadProperty(const char* property, std::string* value) { char value_buffer[PROP_VALUE_MAX]; int length = __system_property_get(property, value_buffer); @@ -129,7 +130,7 @@ *value = value_buffer; return true; } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) } // namespace @@ -158,13 +159,13 @@ process_reader_ = process_reader; snapshot_time_ = snapshot_time; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) std::string build_string; if (ReadProperty("ro.build.fingerprint", &build_string)) { os_version_build_ = build_string; os_version_full_ = build_string; } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) utsname uts; if (uname(&uts) != 0) { @@ -314,11 +315,11 @@ SystemSnapshot::OperatingSystem SystemSnapshotLinux::GetOperatingSystem() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) return kOperatingSystemAndroid; #else return kOperatingSystemLinux; -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) } bool SystemSnapshotLinux::OSServer() const { @@ -344,7 +345,7 @@ std::string SystemSnapshotLinux::MachineDescription() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) std::string description; std::string prop; if (ReadProperty("ro.product.model", &prop)) { @@ -359,7 +360,7 @@ return description; #else return std::string(); -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) } bool SystemSnapshotLinux::NXEnabled() const {
diff --git a/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux_test.cc b/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux_test.cc index f5d26a1..09c2196 100644 --- a/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux_test.cc +++ b/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux_test.cc
@@ -65,11 +65,11 @@ system.CPURevision(); system.NXEnabled(); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) EXPECT_FALSE(system.MachineDescription().empty()); #else system.MachineDescription(); -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) #if defined(ARCH_CPU_X86_FAMILY) system.CPUX86Signature();
diff --git a/third_party/crashpad/crashpad/snapshot/posix/timezone.cc b/third_party/crashpad/crashpad/snapshot/posix/timezone.cc index c413d708..e4b5208 100644 --- a/third_party/crashpad/crashpad/snapshot/posix/timezone.cc +++ b/third_party/crashpad/crashpad/snapshot/posix/timezone.cc
@@ -40,7 +40,7 @@ bool found_transition = false; long probe_gmtoff = local.tm_gmtoff; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Some versions of the timezone database on Android have incorrect // information (e.g. Asia/Kolkata and Pacific/Honolulu). These timezones set // daylight to a non-zero value and return incorrect, >= 0 values for tm_isdst @@ -105,14 +105,14 @@ } else { *daylight_name = tzname[0]; *dst_status = SystemSnapshot::kDoesNotObserveDaylightSavingTime; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // timezone is more reliably set correctly on Android. *standard_offset_seconds = -timezone; *daylight_offset_seconds = -timezone; #else *standard_offset_seconds = local.tm_gmtoff; *daylight_offset_seconds = local.tm_gmtoff; -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) } }
diff --git a/third_party/crashpad/crashpad/snapshot/sanitized/process_snapshot_sanitized_test.cc b/third_party/crashpad/crashpad/snapshot/sanitized/process_snapshot_sanitized_test.cc index 0bdea43..f6ef1ef 100644 --- a/third_party/crashpad/crashpad/snapshot/sanitized/process_snapshot_sanitized_test.cc +++ b/third_party/crashpad/crashpad/snapshot/sanitized/process_snapshot_sanitized_test.cc
@@ -25,7 +25,7 @@ #include "util/misc/address_sanitizer.h" #include "util/numeric/safe_assignment.h" -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include <sys/syscall.h> #include "snapshot/linux/process_snapshot_linux.h"
diff --git a/third_party/crashpad/crashpad/snapshot/sanitized/sanitization_information_test.cc b/third_party/crashpad/crashpad/snapshot/sanitized/sanitization_information_test.cc index 425ec752..933bc92 100644 --- a/third_party/crashpad/crashpad/snapshot/sanitized/sanitization_information_test.cc +++ b/third_party/crashpad/crashpad/snapshot/sanitized/sanitization_information_test.cc
@@ -20,7 +20,7 @@ #include "util/misc/from_pointer_cast.h" #include "util/process/process_memory_linux.h" -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #include "test/linux/fake_ptrace_connection.h" #endif
diff --git a/third_party/crashpad/crashpad/snapshot/x86/cpuid_reader.cc b/third_party/crashpad/crashpad/snapshot/x86/cpuid_reader.cc index 5834058..c1bd837 100644 --- a/third_party/crashpad/crashpad/snapshot/x86/cpuid_reader.cc +++ b/third_party/crashpad/crashpad/snapshot/x86/cpuid_reader.cc
@@ -16,12 +16,13 @@ #include <stddef.h> +#include "build/build_config.h" #include "snapshot/cpu_context.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <immintrin.h> #include <intrin.h> -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) #if defined(ARCH_CPU_X86_FAMILY) @@ -101,7 +102,7 @@ using Fxsave = CPUContextX86_64::Fxsave; #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) __declspec(align(16)) Fxsave fxsave = {}; #else Fxsave fxsave __attribute__((aligned(16))) = {}; @@ -111,7 +112,7 @@ static_assert(offsetof(decltype(fxsave), mxcsr_mask) == 28, "mxcsr_mask offset"); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) _fxsave(&fxsave); #else asm("fxsave %0" : "=m"(fxsave)); @@ -122,13 +123,13 @@ } void CpuidReader::Cpuid(uint32_t cpuinfo[4], uint32_t leaf) const { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) __cpuid(reinterpret_cast<int*>(cpuinfo), leaf); #else asm("cpuid" : "=a"(cpuinfo[0]), "=b"(cpuinfo[1]), "=c"(cpuinfo[2]), "=d"(cpuinfo[3]) : "a"(leaf), "b"(0), "c"(0), "d"(0)); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) } } // namespace internal
diff --git a/third_party/crashpad/crashpad/test/errors.cc b/third_party/crashpad/crashpad/test/errors.cc index 1484506..1f14db2 100644 --- a/third_party/crashpad/crashpad/test/errors.cc +++ b/third_party/crashpad/crashpad/test/errors.cc
@@ -20,9 +20,9 @@ #include "base/strings/stringprintf.h" #include "build/build_config.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #include "base/posix/safe_strerror.h" -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <string.h> #include <windows.h> #endif @@ -31,10 +31,10 @@ namespace test { std::string ErrnoMessage(int err, const std::string& base) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) std::string err_as_string = base::safe_strerror(errno); const char* err_string = err_as_string.c_str(); -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) char err_string[256]; strerror_s(err_string, errno); #endif @@ -49,7 +49,7 @@ return ErrnoMessage(errno, base); } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) std::string ErrorMessage(const std::string& base) { return base::StringPrintf( "%s%s%s",
diff --git a/third_party/crashpad/crashpad/test/errors.h b/third_party/crashpad/crashpad/test/errors.h index 471fbb5..5be04f1b 100644 --- a/third_party/crashpad/crashpad/test/errors.h +++ b/third_party/crashpad/crashpad/test/errors.h
@@ -67,7 +67,7 @@ //! a colon. std::string ErrnoMessage(const std::string& base = std::string()); -#if defined(OS_WIN) || DOXYGEN +#if BUILDFLAG(IS_WIN) || DOXYGEN //! \brief Formats an error message using `GetLastError()`. //! //! The returned string will combine the \a base string, if supplied, with a
diff --git a/third_party/crashpad/crashpad/test/file.cc b/third_party/crashpad/crashpad/test/file.cc index 04b4625..a0ec470d 100644 --- a/third_party/crashpad/crashpad/test/file.cc +++ b/third_party/crashpad/crashpad/test/file.cc
@@ -25,11 +25,11 @@ namespace test { bool FileExists(const base::FilePath& path) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) struct stat st; int rv = lstat(path.value().c_str(), &st); static constexpr char stat_function[] = "lstat"; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) struct _stat st; int rv = _wstat(path.value().c_str(), &st); static constexpr char stat_function[] = "_wstat"; @@ -45,11 +45,11 @@ } FileOffset FileSize(const base::FilePath& path) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) struct stat st; int rv = lstat(path.value().c_str(), &st); static constexpr char stat_function[] = "lstat"; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) struct _stati64 st; int rv = _wstati64(path.value().c_str(), &st); static constexpr char stat_function[] = "_wstati64";
diff --git a/third_party/crashpad/crashpad/test/filesystem.cc b/third_party/crashpad/crashpad/test/filesystem.cc index 39b8648..a434212 100644 --- a/third_party/crashpad/crashpad/test/filesystem.cc +++ b/third_party/crashpad/crashpad/test/filesystem.cc
@@ -22,6 +22,7 @@ #include "base/logging.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "gtest/gtest.h" #include "test/errors.h" #include "test/scoped_temp_dir.h" @@ -29,11 +30,11 @@ #include "util/file/filesystem.h" #include "util/misc/time.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #include <unistd.h> #include "base/posix/eintr_wrapper.h" -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> #endif @@ -42,7 +43,7 @@ namespace { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Detects the flags necessary to create symbolic links and stores them in // |flags| if non-nullptr, and returns true on success. If symbolic links can’t @@ -89,7 +90,7 @@ return true; } -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) } // namespace @@ -101,14 +102,14 @@ } bool PathExists(const base::FilePath& path) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) struct stat st; if (lstat(path.value().c_str(), &st) != 0) { EXPECT_EQ(errno, ENOENT) << ErrnoMessage("lstat ") << path.value(); return false; } return true; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) if (GetFileAttributes(path.value().c_str()) == INVALID_FILE_ATTRIBUTES) { EXPECT_EQ(GetLastError(), static_cast<DWORD>(ERROR_FILE_NOT_FOUND)) << ErrorMessage("GetFileAttributes ") << base::WideToUTF8(path.value()); @@ -120,7 +121,7 @@ bool SetFileModificationTime(const base::FilePath& path, const timespec& mtime) { -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) // utimensat() isn't available on macOS until 10.13, so lutimes() is used // instead. struct stat st; @@ -136,7 +137,7 @@ return false; } return true; -#elif defined(OS_POSIX) +#elif BUILDFLAG(IS_POSIX) timespec times[2]; times[0].tv_sec = 0; times[0].tv_nsec = UTIME_OMIT; @@ -147,7 +148,7 @@ return false; } return true; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) DWORD flags = FILE_FLAG_OPEN_REPARSE_POINT; if (IsDirectory(path, true)) { // required for directory handles @@ -172,22 +173,22 @@ return false; } return true; -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) } -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) bool CanCreateSymbolicLinks() { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) return true; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) return SymbolicLinkFlags(nullptr); -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) } bool CreateSymbolicLink(const base::FilePath& target_path, const base::FilePath& symlink_path) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) int rv = HANDLE_EINTR( symlink(target_path.value().c_str(), symlink_path.value().c_str())); if (rv != 0) { @@ -195,7 +196,7 @@ return false; } return true; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) DWORD symbolic_link_flags = 0; SymbolicLinkFlags(&symbolic_link_flags); if (!::CreateSymbolicLink( @@ -208,10 +209,10 @@ return false; } return true; -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) } -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) } // namespace test } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/test/filesystem.h b/third_party/crashpad/crashpad/test/filesystem.h index 516335bb..6832136 100644 --- a/third_party/crashpad/crashpad/test/filesystem.h +++ b/third_party/crashpad/crashpad/test/filesystem.h
@@ -37,7 +37,7 @@ //! \return `true` on success. Otherwise `false` with a message logged. bool SetFileModificationTime(const base::FilePath& path, const timespec& mtime); -#if !defined(OS_FUCHSIA) || DOXYGEN +#if !BUILDFLAG(IS_FUCHSIA) || DOXYGEN // There are no symbolic links on Fuchsia. Don’t bother declaring or defining // symbolic link-related functions at all, because it’s an error to even pretend // that symbolic links might be available on Fuchsia. @@ -67,7 +67,7 @@ bool CreateSymbolicLink(const base::FilePath& target_path, const base::FilePath& symlink_path); -#endif // !OS_FUCHSIA || DOXYGEN +#endif // !BUILDFLAG(IS_FUCHSIA) || DOXYGEN } // namespace test } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/test/gtest_death.h b/third_party/crashpad/crashpad/test/gtest_death.h index c67d334..8142c3d1 100644 --- a/third_party/crashpad/crashpad/test/gtest_death.h +++ b/third_party/crashpad/crashpad/test/gtest_death.h
@@ -19,13 +19,13 @@ #include "build/build_config.h" #include "gtest/gtest.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include "test/mac/exception_swallower.h" #endif //! \file -#if defined(OS_MAC) || DOXYGEN +#if BUILDFLAG(IS_MAC) || DOXYGEN //! \brief Wraps the Google Test `ASSERT_DEATH_IF_SUPPORTED()` macro to make //! assertions about death caused by crashes. @@ -73,14 +73,14 @@ regex); \ } while (false) -#else // OS_MAC +#else // BUILDFLAG(IS_MAC) #define ASSERT_DEATH_CRASH(statement, regex) \ ASSERT_DEATH_IF_SUPPORTED(statement, regex) #define EXPECT_DEATH_CRASH(statement, regex) \ EXPECT_DEATH_IF_SUPPORTED(statement, regex) -#endif // OS_MAC +#endif // BUILDFLAG(IS_MAC) #if !(!defined(MINI_CHROMIUM_BASE_LOGGING_H_) && \ defined(OFFICIAL_BUILD) && \
diff --git a/third_party/crashpad/crashpad/test/gtest_main.cc b/third_party/crashpad/crashpad/test/gtest_main.cc index c67b8e2..04c539b 100644 --- a/third_party/crashpad/crashpad/test/gtest_main.cc +++ b/third_party/crashpad/crashpad/test/gtest_main.cc
@@ -22,17 +22,17 @@ #include "gmock/gmock.h" #endif // CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "util/linux/initial_signal_dispositions.h" -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) #include "test/ios/google_test_setup.h" #endif -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include "test/win/win_child_process.h" -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) #if defined(CRASHPAD_IS_IN_CHROMIUM) #include "base/bind.h" @@ -42,7 +42,7 @@ namespace { -#if !defined(OS_IOS) +#if !BUILDFLAG(IS_IOS) bool GetChildTestFunctionName(std::string* child_func_name) { constexpr size_t arg_length = sizeof(crashpad::test::internal::kChildTestFunction) - 1; @@ -55,38 +55,38 @@ } return false; } -#endif // !OS_IOS +#endif // !BUILDFLAG(IS_IOS) } // namespace int main(int argc, char* argv[]) { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) crashpad::InitializeSignalDispositions(); -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) crashpad::test::InitializeMainArguments(argc, argv); -#if !defined(OS_IOS) +#if !BUILDFLAG(IS_IOS) std::string child_func_name; if (GetChildTestFunctionName(&child_func_name)) { return crashpad::test::internal::CheckedInvokeMultiprocessChild( child_func_name); } -#endif // !OS_IOS +#endif // !BUILDFLAG(IS_IOS) #if defined(CRASHPAD_IS_IN_CHROMIUM) -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Chromium’s test launcher interferes with WinMultiprocess-based tests. Allow // their child processes to be launched by the standard Google Test-based test // runner. const bool use_chromium_test_launcher = !crashpad::test::WinChildProcess::IsChildProcess(); -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) constexpr bool use_chromium_test_launcher = false; -#else // OS_WIN +#else // BUILDFLAG(IS_WIN) constexpr bool use_chromium_test_launcher = true; -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) if (use_chromium_test_launcher) { // This supports --test-launcher-summary-output, which writes a JSON file @@ -115,7 +115,7 @@ CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK #endif // CRASHPAD_TEST_LAUNCHER_GOOGLEMOCK -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) // iOS needs to run tests within the context of an app, so call a helper that // invokes UIApplicationMain(). The application delegate will call // RUN_ALL_TESTS() and exit before returning control to this function.
diff --git a/third_party/crashpad/crashpad/test/multiprocess.h b/third_party/crashpad/crashpad/test/multiprocess.h index ca48ce8..dd96a0fe1 100644 --- a/third_party/crashpad/crashpad/test/multiprocess.h +++ b/third_party/crashpad/crashpad/test/multiprocess.h
@@ -28,7 +28,7 @@ struct MultiprocessInfo; } // namespace internal -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) using ReturnCodeType = int64_t; #else using ReturnCodeType = int; @@ -55,13 +55,13 @@ //! that call `exit()` or `_exit()`. kTerminationNormal = false, -#if !defined(OS_FUCHSIA) // There are no signals on Fuchsia. +#if !BUILDFLAG(IS_FUCHSIA) // There are no signals on Fuchsia. //! \brief The child terminated by signal. //! //! Signal termination happens as a result of a crash, a call to `abort()`, //! assertion failure (including Google Test assertions), etc. kTerminationSignal, -#endif // !defined(OS_FUCHSIA) +#endif // !BUILDFLAG(IS_FUCHSIA) }; Multiprocess(); @@ -104,11 +104,11 @@ void SetExpectedChildTermination(TerminationReason reason, ReturnCodeType code); -#if !defined(OS_WIN) +#if !BUILDFLAG(IS_WIN) //! \brief Sets termination reason and code appropriately for a child that //! terminates via `__builtin_trap()`. void SetExpectedChildTerminationBuiltinTrap(); -#endif // !OS_WIN +#endif // !BUILDFLAG(IS_WIN) protected: ~Multiprocess(); @@ -131,17 +131,17 @@ //! Subclass implementations may signal failure by raising their own fatal //! Google Test assertions. virtual void PreFork() -#if defined(OS_WIN) || defined(OS_FUCHSIA) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) = 0 -#endif // OS_WIN || OS_FUCHSIA +#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_FUCHSIA) ; -#if !defined(OS_WIN) && !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_FUCHSIA) //! \brief Returns the child process’ process ID. //! //! This method may only be called by the parent process. pid_t ChildPID() const; -#endif // !OS_WIN && !OS_FUCHSIA +#endif // !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_FUCHSIA) //! \brief Returns the read pipe’s file handle. //!
diff --git a/third_party/crashpad/crashpad/test/multiprocess_exec.cc b/third_party/crashpad/crashpad/test/multiprocess_exec.cc index cd9a32c..805090d 100644 --- a/third_party/crashpad/crashpad/test/multiprocess_exec.cc +++ b/third_party/crashpad/crashpad/test/multiprocess_exec.cc
@@ -18,6 +18,7 @@ #include "base/check.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "test/main_arguments.h" #include "test/test_paths.h" #include "util/stdlib/map_insert.h" @@ -59,7 +60,7 @@ GetMainArguments().end()); rest.push_back(internal::kChildTestFunction + function_name); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Instead of using argv[0] on Windows, use the actual binary name. This is // necessary because if originally the test isn't run with ".exe" on the // command line, then argv[0] also won't include ".exe". This argument is used
diff --git a/third_party/crashpad/crashpad/test/multiprocess_exec.h b/third_party/crashpad/crashpad/test/multiprocess_exec.h index a03f8c1..3be9b7a 100644 --- a/third_party/crashpad/crashpad/test/multiprocess_exec.h +++ b/third_party/crashpad/crashpad/test/multiprocess_exec.h
@@ -141,11 +141,11 @@ base::FilePath command_; std::vector<std::string> arguments_; -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) std::vector<const char*> argv_; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) std::wstring command_line_; -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) }; } // namespace test
diff --git a/third_party/crashpad/crashpad/test/multiprocess_exec_posix.cc b/third_party/crashpad/crashpad/test/multiprocess_exec_posix.cc index e14a3b8..fa87f088 100644 --- a/third_party/crashpad/crashpad/test/multiprocess_exec_posix.cc +++ b/third_party/crashpad/crashpad/test/multiprocess_exec_posix.cc
@@ -26,11 +26,11 @@ #include "util/misc/scoped_forbid_return.h" #include "util/posix/close_multiple.h" -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #include <stdio_ext.h> #endif -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include "util/mach/task_for_pid.h" #endif @@ -90,7 +90,7 @@ int rv; -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) __fpurge(stdin); #else rv = fpurge(stdin); @@ -154,7 +154,7 @@ } ProcessType MultiprocessExec::ChildProcess() { -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) return TaskForPID(ChildPID()); #else return ChildPID();
diff --git a/third_party/crashpad/crashpad/test/multiprocess_exec_test.cc b/third_party/crashpad/crashpad/test/multiprocess_exec_test.cc index b8bda54..2cb9db2a 100644 --- a/third_party/crashpad/crashpad/test/multiprocess_exec_test.cc +++ b/third_party/crashpad/crashpad/test/multiprocess_exec_test.cc
@@ -114,7 +114,7 @@ exec.Run(); } -#if !defined(OS_WIN) +#if !BUILDFLAG(IS_WIN) CRASHPAD_CHILD_TEST_MAIN(BuiltinTrapChild) { __builtin_trap(); @@ -143,7 +143,7 @@ test.Run(); } -#endif // !OS_WIN +#endif // !BUILDFLAG(IS_WIN) } // namespace } // namespace test
diff --git a/third_party/crashpad/crashpad/test/multiprocess_exec_test_child.cc b/third_party/crashpad/crashpad/test/multiprocess_exec_test_child.cc index 8c77015..f74b585 100644 --- a/third_party/crashpad/crashpad/test/multiprocess_exec_test_child.cc +++ b/third_party/crashpad/crashpad/test/multiprocess_exec_test_child.cc
@@ -22,19 +22,19 @@ #include "base/logging.h" #include "build/build_config.h" -#if defined(OS_POSIX) -#if !defined(OS_FUCHSIA) +#if BUILDFLAG(IS_POSIX) +#if !BUILDFLAG(IS_FUCHSIA) #include <sys/resource.h> -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) #include <unistd.h> -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> #endif int main(int argc, char* argv[]) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) // getrlimit() is not implemented on Fuchsia. By construction, the child only // receieves specific fds that it's given, but check low values as mild // verification. @@ -45,7 +45,7 @@ LOG(FATAL) << "getrlimit"; } int last_fd = static_cast<int>(rlimit_nofile.rlim_cur); -#endif // OS_FUCHSIA +#endif // BUILDFLAG(IS_FUCHSIA) // Make sure that there’s nothing open at any FD higher than 3. All FDs other // than stdin, stdout, and stderr should have been closed prior to or at @@ -69,7 +69,7 @@ if (rv != 1) { LOG(FATAL) << "write"; } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) // TODO(scottmg): Verify that only the handles we expect to be open, are. // Read a byte from stdin, expecting it to be a specific value. @@ -89,7 +89,7 @@ bytes_written != 1) { LOG(FATAL) << "WriteFile"; } -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) return 0; }
diff --git a/third_party/crashpad/crashpad/test/multiprocess_posix.cc b/third_party/crashpad/crashpad/test/multiprocess_posix.cc index c16aa08f..f1b138f6 100644 --- a/third_party/crashpad/crashpad/test/multiprocess_posix.cc +++ b/third_party/crashpad/crashpad/test/multiprocess_posix.cc
@@ -33,7 +33,7 @@ #include "util/misc/scoped_forbid_return.h" #include "util/posix/signals.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include "test/mac/exception_swallower.h" #endif @@ -73,7 +73,7 @@ ASSERT_NO_FATAL_FAILURE(PreFork()); -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) // If the child is expected to crash, set up an exception swallower to swallow // the exception instead of allowing it to be seen by the system’s crash // reporter. @@ -81,7 +81,7 @@ if (reason_ == kTerminationSignal && Signals::IsCrashSignal(code_)) { exception_swallower.reset(new ExceptionSwallower()); } -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) pid_t pid = fork(); ASSERT_GE(pid, 0) << ErrnoMessage("fork"); @@ -139,15 +139,15 @@ ADD_FAILURE() << message; } } else { -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) if (exception_swallower.get()) { ExceptionSwallower::SwallowExceptions(); } -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) if (reason_ == kTerminationSignal && Signals::IsCrashSignal(code_)) { Signals::InstallDefaultHandler(code_); } -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) RunChild(); }
diff --git a/third_party/crashpad/crashpad/test/process_type.cc b/third_party/crashpad/crashpad/test/process_type.cc index f6eec36..7c6f88f 100644 --- a/third_party/crashpad/crashpad/test/process_type.cc +++ b/third_party/crashpad/crashpad/test/process_type.cc
@@ -14,9 +14,11 @@ #include "test/process_type.h" -#if defined(OS_FUCHSIA) +#include "build/build_config.h" + +#if BUILDFLAG(IS_FUCHSIA) #include <lib/zx/process.h> -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include <unistd.h> #endif @@ -24,13 +26,13 @@ namespace test { ProcessType GetSelfProcess() { -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) return zx::process::self(); -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) return getpid(); -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) return GetCurrentProcess(); -#elif defined(OS_APPLE) +#elif BUILDFLAG(IS_APPLE) return mach_task_self(); #endif }
diff --git a/third_party/crashpad/crashpad/test/process_type.h b/third_party/crashpad/crashpad/test/process_type.h index cacac04f..a1c727cb 100644 --- a/third_party/crashpad/crashpad/test/process_type.h +++ b/third_party/crashpad/crashpad/test/process_type.h
@@ -17,28 +17,28 @@ #include "build/build_config.h" -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) #include <lib/zx/process.h> -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include <sys/types.h> -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> -#elif defined(OS_APPLE) +#elif BUILDFLAG(IS_APPLE) #include <mach/mach.h> #endif namespace crashpad { namespace test { -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) using ProcessType = zx::unowned_process; -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ - DOXYGEN +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ + BUILDFLAG(IS_ANDROID) || DOXYGEN //! \brief Alias for platform-specific type to represent a process. using ProcessType = pid_t; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) using ProcessType = HANDLE; -#elif defined(OS_APPLE) +#elif BUILDFLAG(IS_APPLE) using ProcessType = task_t; #else #error Port.
diff --git a/third_party/crashpad/crashpad/test/scoped_module_handle.cc b/third_party/crashpad/crashpad/test/scoped_module_handle.cc index df246fc..ff8e0bd 100644 --- a/third_party/crashpad/crashpad/test/scoped_module_handle.cc +++ b/third_party/crashpad/crashpad/test/scoped_module_handle.cc
@@ -15,17 +15,18 @@ #include "test/scoped_module_handle.h" #include "base/logging.h" +#include "build/build_config.h" namespace crashpad { namespace test { // static void ScopedModuleHandle::Impl::Close(ModuleHandle handle) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) if (dlclose(handle) != 0) { LOG(ERROR) << "dlclose: " << dlerror(); } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) if (!FreeLibrary(handle)) { PLOG(ERROR) << "FreeLibrary"; }
diff --git a/third_party/crashpad/crashpad/test/scoped_module_handle.h b/third_party/crashpad/crashpad/test/scoped_module_handle.h index 0e96c951..1a8ed1b 100644 --- a/third_party/crashpad/crashpad/test/scoped_module_handle.h +++ b/third_party/crashpad/crashpad/test/scoped_module_handle.h
@@ -17,9 +17,9 @@ #include "build/build_config.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #include <dlfcn.h> -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> #endif @@ -36,13 +36,13 @@ Impl(const Impl&) = delete; Impl& operator=(const Impl&) = delete; -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) using ModuleHandle = void*; static void* LookUpSymbol(ModuleHandle handle, const char* symbol_name) { return dlsym(handle, symbol_name); } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) using ModuleHandle = HMODULE; static void* LookUpSymbol(ModuleHandle handle, const char* symbol_name) {
diff --git a/third_party/crashpad/crashpad/test/scoped_temp_dir_posix.cc b/third_party/crashpad/crashpad/test/scoped_temp_dir_posix.cc index 38aa4fb..848ab56 100644 --- a/third_party/crashpad/crashpad/test/scoped_temp_dir_posix.cc +++ b/third_party/crashpad/crashpad/test/scoped_temp_dir_posix.cc
@@ -42,7 +42,7 @@ if (tmpdir && tmpdir[0] != '\0') { dir.assign(tmpdir); } else { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) dir.assign("/data/local/tmp"); #else dir.assign("/tmp");
diff --git a/third_party/crashpad/crashpad/test/scoped_temp_dir_test.cc b/third_party/crashpad/crashpad/test/scoped_temp_dir_test.cc index 9ad801f..3b5a316 100644 --- a/third_party/crashpad/crashpad/test/scoped_temp_dir_test.cc +++ b/third_party/crashpad/crashpad/test/scoped_temp_dir_test.cc
@@ -23,26 +23,26 @@ #include "test/errors.h" #include "test/file.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #include <unistd.h> -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <direct.h> #include <io.h> -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) namespace crashpad { namespace test { namespace { void CreateFile(const base::FilePath& path) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) int fd = HANDLE_EINTR(creat(path.value().c_str(), 0644)); ASSERT_GE(fd, 0) << ErrnoMessage("creat") << " " << path.value(); // gcc refuses to compile ASSERT_EQ(IGNORE_EINTR(close(fd)), 0). int close_rv = IGNORE_EINTR(close(fd)); ASSERT_EQ(close_rv, 0) << ErrnoMessage("close") << " " << path.value(); -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) int fd = _wcreat(path.value().c_str(), _S_IREAD | _S_IWRITE); ASSERT_GE(fd, 0) << ErrnoMessage("_wcreat") << " " << path.value(); ASSERT_EQ(_close(fd), 0) << ErrnoMessage("_close") << " " << path.value(); @@ -53,10 +53,10 @@ } void CreateDirectory(const base::FilePath& path) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) ASSERT_EQ(mkdir(path.value().c_str(), 0755), 0) << ErrnoMessage("mkdir") << " " << path.value(); -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) ASSERT_EQ(_wmkdir(path.value().c_str()), 0) << ErrnoMessage("_wmkdir") << " " << path.value(); #else
diff --git a/third_party/crashpad/crashpad/test/test_paths.cc b/third_party/crashpad/crashpad/test/test_paths.cc index 475e2b0..c55aa64 100644 --- a/third_party/crashpad/crashpad/test/test_paths.cc +++ b/third_party/crashpad/crashpad/test/test_paths.cc
@@ -31,7 +31,7 @@ candidate.Append(FILE_PATH_LITERAL("test")) .Append(FILE_PATH_LITERAL("test_paths_test_data_root.txt")); -#if !defined(OS_WIN) +#if !BUILDFLAG(IS_WIN) struct stat stat_buf; int rv = stat(marker_path.value().c_str(), &stat_buf); #else @@ -43,16 +43,16 @@ } base::FilePath TestDataRootInternal() { -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) base::FilePath asset_path("/pkg/data"); if (!IsTestDataRoot(asset_path)) { LOG(WARNING) << "test data root seems invalid, continuing anyway"; } return asset_path; -#else // defined(OS_FUCHSIA) -#if !defined(OS_WIN) +#else // BUILDFLAG(IS_FUCHSIA) +#if !BUILDFLAG(IS_WIN) const char* environment_value = getenv("CRASHPAD_TEST_DATA_ROOT"); -#else // defined(OS_WIN) +#else // BUILDFLAG(IS_WIN) const wchar_t* environment_value = _wgetenv(L"CRASHPAD_TEST_DATA_ROOT"); #endif @@ -67,21 +67,21 @@ base::FilePath executable_path; if (Paths::Executable(&executable_path)) { -#if defined(OS_IOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_ANDROID) // On Android and iOS, test data is in a crashpad_test_data directory // adjacent to the main executable. On iOS, this refers to the main // executable file inside the .app bundle, so crashpad_test_data is also // inside the bundle. base::FilePath candidate = executable_path.DirName() .Append("crashpad_test_data"); -#else // OS_IOS || OS_ANDRID +#else // BUILDFLAG(IS_IOS) || BUILDFLAG(IS_ANDRID) // In a standalone build, the test executable is usually at // out/{Debug,Release} relative to the Crashpad root. base::FilePath candidate = base::FilePath(executable_path.DirName() .Append(base::FilePath::kParentDirectory) .Append(base::FilePath::kParentDirectory)); -#endif // OS_IOS || OS_ANDROID +#endif // BUILDFLAG(IS_IOS) || BUILDFLAG(IS_ANDROID) if (IsTestDataRoot(candidate)) { return candidate; } @@ -104,10 +104,10 @@ } return base::FilePath(base::FilePath::kCurrentDirectory); -#endif // defined(OS_FUCHSIA) +#endif // BUILDFLAG(IS_FUCHSIA) } -#if defined(OS_WIN) && defined(ARCH_CPU_64_BITS) +#if BUILDFLAG(IS_WIN) && defined(ARCH_CPU_64_BITS) // Returns the pathname of a directory containing 32-bit test build output. // @@ -122,7 +122,7 @@ return base::FilePath(environment_value); } -#endif // defined(OS_WIN) && defined(ARCH_CPU_64_BITS) +#endif // BUILDFLAG(IS_WIN) && defined(ARCH_CPU_64_BITS) } // namespace @@ -139,10 +139,10 @@ // static base::FilePath TestPaths::ExpectedExecutableBasename( const base::FilePath::StringType& name) { -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) // Apps in Fuchsia packages are always named "app". return base::FilePath("app"); -#else // OS_FUCHSIA +#else // BUILDFLAG(IS_FUCHSIA) #if defined(CRASHPAD_IS_IN_CHROMIUM) base::FilePath::StringType executable_name( FILE_PATH_LITERAL("crashpad_tests")); @@ -150,12 +150,12 @@ base::FilePath::StringType executable_name(name); #endif // CRASHPAD_IS_IN_CHROMIUM -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) executable_name += FILE_PATH_LITERAL(".exe"); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) return base::FilePath(executable_name); -#endif // OS_FUCHSIA +#endif // BUILDFLAG(IS_FUCHSIA) } // static @@ -177,17 +177,17 @@ directory = Executable().DirName(); break; -#if defined(OS_WIN) && defined(ARCH_CPU_64_BITS) +#if BUILDFLAG(IS_WIN) && defined(ARCH_CPU_64_BITS) case Architecture::k32Bit: directory = Output32BitDirectory(); CHECK(!directory.empty()); break; -#endif // OS_WIN && ARCH_CPU_64_BITS +#endif // BUILDFLAG(IS_WIN) && ARCH_CPU_64_BITS } base::FilePath::StringType test_name = FILE_PATH_LITERAL("crashpad_") + module + FILE_PATH_LITERAL("_test"); -#if !defined(CRASHPAD_IS_IN_CHROMIUM) && !defined(OS_FUCHSIA) +#if !defined(CRASHPAD_IS_IN_CHROMIUM) && !BUILDFLAG(IS_FUCHSIA) CHECK(Executable().BaseName().RemoveFinalExtension().value() == test_name); #endif // !CRASHPAD_IS_IN_CHROMIUM @@ -197,21 +197,21 @@ break; case FileType::kExecutable: -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) extension = FILE_PATH_LITERAL(".exe"); -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) directory = base::FilePath(FILE_PATH_LITERAL("/pkg/bin")); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) break; case FileType::kLoadableModule: -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) extension = FILE_PATH_LITERAL(".dll"); -#else // OS_WIN +#else // BUILDFLAG(IS_WIN) extension = FILE_PATH_LITERAL(".so"); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) // TODO(scottmg): .so files are currently deployed into /boot/lib, where // they'll be found (without a path) by the loader. Application packaging // infrastructure is in progress, so this will likely change again in the @@ -232,14 +232,14 @@ extension); } -#if defined(OS_WIN) && defined(ARCH_CPU_64_BITS) +#if BUILDFLAG(IS_WIN) && defined(ARCH_CPU_64_BITS) // static bool TestPaths::Has32BitBuildArtifacts() { return !Output32BitDirectory().empty(); } -#endif // defined(OS_WIN) && defined(ARCH_CPU_64_BITS) +#endif // BUILDFLAG(IS_WIN) && defined(ARCH_CPU_64_BITS) } // namespace test } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/test/test_paths.h b/third_party/crashpad/crashpad/test/test_paths.h index 72bb155..0fc021e1 100644 --- a/third_party/crashpad/crashpad/test/test_paths.h +++ b/third_party/crashpad/crashpad/test/test_paths.h
@@ -49,14 +49,14 @@ //! architecture as the running process. kDefault = 0, -#if (defined(OS_WIN) && defined(ARCH_CPU_64_BITS)) || DOXYGEN +#if (BUILDFLAG(IS_WIN) && defined(ARCH_CPU_64_BITS)) || DOXYGEN //! \brief The 32-bit variant is requested. //! //! On Windows, when running 64-bit code, the 32-bit variant can be //! requested. Before doing so, Has32BitBuildArtifacts() must be called and //! must return `true`. Otherwise, execution will be aborted. k32Bit, -#endif // OS_WIN && ARCH_CPU_64_BITS +#endif // BUILDFLAG(IS_WIN) && ARCH_CPU_64_BITS }; TestPaths() = delete; @@ -128,7 +128,7 @@ FileType file_type, Architecture architecture = Architecture::kDefault); -#if (defined(OS_WIN) && defined(ARCH_CPU_64_BITS)) || DOXYGEN +#if (BUILDFLAG(IS_WIN) && defined(ARCH_CPU_64_BITS)) || DOXYGEN //! \return `true` if 32-bit build artifacts are available. //! //! Tests that require the use of 32-bit build output should call this @@ -142,7 +142,7 @@ //! can be found its own directory, and located by calling BuildArtifact() //! with Architecture::kDefault. static bool Has32BitBuildArtifacts(); -#endif // OS_WIN && ARCH_CPU_64_BITS +#endif // BUILDFLAG(IS_WIN) && ARCH_CPU_64_BITS }; } // namespace test
diff --git a/third_party/crashpad/crashpad/tools/base94_encoder.cc b/third_party/crashpad/crashpad/tools/base94_encoder.cc index 1b184e9..b0f7e0e 100644 --- a/third_party/crashpad/crashpad/tools/base94_encoder.cc +++ b/third_party/crashpad/crashpad/tools/base94_encoder.cc
@@ -24,6 +24,7 @@ namespace { void Usage(const base::FilePath& me) { + // clang-format off fprintf(stderr, "Usage: %" PRFilePath " [options] <input-file> <output-file>\n" "Encode/Decode the given file\n" @@ -34,6 +35,7 @@ " --help display this help and exit\n" " --version output version information and exit\n", me.value().c_str()); + // clang-format on ToolSupport::UsageTail(me); } @@ -117,12 +119,12 @@ } // namespace } // namespace crashpad -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) int main(int argc, char* argv[]) { return crashpad::Base94EncoderMain(argc, argv); } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) int wmain(int argc, wchar_t* argv[]) { return crashpad::ToolSupport::Wmain(argc, argv, crashpad::Base94EncoderMain); } -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX)
diff --git a/third_party/crashpad/crashpad/tools/crashpad_database_util.cc b/third_party/crashpad/crashpad/tools/crashpad_database_util.cc index e9927bd..bbe6f7d 100644 --- a/third_party/crashpad/crashpad/tools/crashpad_database_util.cc +++ b/third_party/crashpad/crashpad/tools/crashpad_database_util.cc
@@ -44,6 +44,7 @@ namespace { void Usage(const base::FilePath& me) { + // clang-format off fprintf(stderr, "Usage: %" PRFilePath " [OPTION]... PID\n" "Operate on Crashpad crash report databases.\n" @@ -66,6 +67,7 @@ " --help display this help and exit\n" " --version output version information and exit\n", me.value().c_str()); + // clang-format on ToolSupport::UsageTail(me); } @@ -619,12 +621,12 @@ } // namespace } // namespace crashpad -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) int main(int argc, char* argv[]) { return crashpad::DatabaseUtilMain(argc, argv); } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) int wmain(int argc, wchar_t* argv[]) { return crashpad::ToolSupport::Wmain(argc, argv, crashpad::DatabaseUtilMain); } -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX)
diff --git a/third_party/crashpad/crashpad/tools/crashpad_http_upload.cc b/third_party/crashpad/crashpad/tools/crashpad_http_upload.cc index 624aaa71..1470b41 100644 --- a/third_party/crashpad/crashpad/tools/crashpad_http_upload.cc +++ b/third_party/crashpad/crashpad/tools/crashpad_http_upload.cc
@@ -22,6 +22,7 @@ #include <vector> #include "base/files/file_path.h" +#include "build/build_config.h" #include "tools/tool_support.h" #include "util/file/file_reader.h" #include "util/file/file_writer.h" @@ -34,6 +35,7 @@ namespace { void Usage(const base::FilePath& me) { + // clang-format off fprintf(stderr, "Usage: %" PRFilePath " [OPTION]...\n" "Send an HTTP POST request.\n" @@ -45,6 +47,7 @@ " --help display this help and exit\n" " --version output version information and exit\n", me.value().c_str()); + // clang-format on ToolSupport::UsageTail(me); } @@ -205,12 +208,12 @@ } // namespace } // namespace crashpad -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) int main(int argc, char* argv[]) { return crashpad::HTTPUploadMain(argc, argv); } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) int wmain(int argc, wchar_t* argv[]) { return crashpad::ToolSupport::Wmain(argc, argv, crashpad::HTTPUploadMain); } -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX)
diff --git a/third_party/crashpad/crashpad/tools/generate_dump.cc b/third_party/crashpad/crashpad/tools/generate_dump.cc index ab027b8..ba561a5 100644 --- a/third_party/crashpad/crashpad/tools/generate_dump.cc +++ b/third_party/crashpad/crashpad/tools/generate_dump.cc
@@ -29,33 +29,34 @@ #include "util/process/process_id.h" #include "util/stdlib/string_number_conversion.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #include <unistd.h> #include "util/posix/drop_privileges.h" #endif -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include <mach/mach.h> #include "base/mac/scoped_mach_port.h" #include "snapshot/mac/process_snapshot_mac.h" #include "util/mach/scoped_task_suspend.h" #include "util/mach/task_for_pid.h" -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include "base/strings/utf_string_conversions.h" #include "snapshot/win/process_snapshot_win.h" #include "util/win/scoped_process_suspend.h" #include "util/win/xp_compat.h" -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include "snapshot/linux/process_snapshot_linux.h" #include "util/linux/direct_ptrace_connection.h" -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) namespace crashpad { namespace { void Usage(const base::FilePath& me) { + // clang-format off fprintf(stderr, "Usage: %" PRFilePath " [OPTION]... PID\n" "Generate a minidump file containing a snapshot of a running process.\n" @@ -65,6 +66,7 @@ " --help display this help and exit\n" " --version output version information and exit\n", me.value().c_str()); + // clang-format on ToolSupport::UsageTail(me); } @@ -137,7 +139,7 @@ return EXIT_FAILURE; } -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) task_t task = TaskForPID(options.pid); if (task == TASK_NULL) { return EXIT_FAILURE; @@ -155,14 +157,14 @@ } LOG(WARNING) << "operating on myself"; } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) ScopedKernelHANDLE process( OpenProcess(kXPProcessAllAccess, false, options.pid)); if (!process.is_valid()) { PLOG(ERROR) << "could not open process " << options.pid; return EXIT_FAILURE; } -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) if (options.dump_path.empty()) { options.dump_path = base::StringPrintf("minidump.%" PRI_PROCESS_ID, @@ -170,24 +172,24 @@ } { -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) std::unique_ptr<ScopedTaskSuspend> suspend; if (options.suspend) { suspend.reset(new ScopedTaskSuspend(task)); } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) std::unique_ptr<ScopedProcessSuspend> suspend; if (options.suspend) { suspend.reset(new ScopedProcessSuspend(process.get())); } -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) ProcessSnapshotMac process_snapshot; if (!process_snapshot.Initialize(task)) { return EXIT_FAILURE; } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) ProcessSnapshotWin process_snapshot; if (!process_snapshot.Initialize(process.get(), options.suspend @@ -197,7 +199,7 @@ 0)) { return EXIT_FAILURE; } -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) // TODO(jperaza): https://crashpad.chromium.org/bug/30. DirectPtraceConnection task; if (!task.Initialize(options.pid)) { @@ -207,7 +209,7 @@ if (!process_snapshot.Initialize(&task)) { return EXIT_FAILURE; } -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) FileWriter file_writer; base::FilePath dump_path( @@ -236,12 +238,12 @@ } // namespace } // namespace crashpad -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) int main(int argc, char* argv[]) { return crashpad::GenerateDumpMain(argc, argv); } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) int wmain(int argc, wchar_t* argv[]) { return crashpad::ToolSupport::Wmain(argc, argv, crashpad::GenerateDumpMain); } -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX)
diff --git a/third_party/crashpad/crashpad/tools/mac/catch_exception_tool.cc b/third_party/crashpad/crashpad/tools/mac/catch_exception_tool.cc index 06fda23..568672d 100644 --- a/third_party/crashpad/crashpad/tools/mac/catch_exception_tool.cc +++ b/third_party/crashpad/crashpad/tools/mac/catch_exception_tool.cc
@@ -181,6 +181,7 @@ }; void Usage(const std::string& me) { + // clang-format off fprintf(stderr, "Usage: %s -m SERVICE [OPTION]...\n" "Catch Mach exceptions and display information about them.\n" @@ -192,6 +193,7 @@ " --help display this help and exit\n" " --version output version information and exit\n", me.c_str()); + // clang-format on ToolSupport::UsageTail(me); }
diff --git a/third_party/crashpad/crashpad/tools/mac/exception_port_tool.cc b/third_party/crashpad/crashpad/tools/mac/exception_port_tool.cc index 2fdc580..60d8414 100644 --- a/third_party/crashpad/crashpad/tools/mac/exception_port_tool.cc +++ b/third_party/crashpad/crashpad/tools/mac/exception_port_tool.cc
@@ -311,6 +311,7 @@ } void Usage(const std::string& me) { + // clang-format off fprintf(stderr, "Usage: %s [OPTION]... [COMMAND [ARG]...]\n" "View and change Mach exception ports, and run COMMAND if supplied.\n" @@ -343,6 +344,7 @@ "The default DESCRIPTION is\n" " target=task,mask=CRASH,behavior=DEFAULT|MACH,flavor=NONE,handler=NULL\n", me.c_str()); + // clang-format on ToolSupport::UsageTail(me); }
diff --git a/third_party/crashpad/crashpad/tools/mac/on_demand_service_tool.mm b/third_party/crashpad/crashpad/tools/mac/on_demand_service_tool.mm index 7b3e104..ffb7920c 100644 --- a/third_party/crashpad/crashpad/tools/mac/on_demand_service_tool.mm +++ b/third_party/crashpad/crashpad/tools/mac/on_demand_service_tool.mm
@@ -34,6 +34,7 @@ namespace { void Usage(const std::string& me) { + // clang-format off fprintf(stderr, "Usage: %s -L -l LABEL [OPTION]... COMMAND [ARG]...\n" " %s -U -l LABEL\n" @@ -48,6 +49,7 @@ " --version output version information and exit\n", me.c_str(), me.c_str()); + // clang-format on ToolSupport::UsageTail(me); }
diff --git a/third_party/crashpad/crashpad/tools/run_with_crashpad.cc b/third_party/crashpad/crashpad/tools/run_with_crashpad.cc index 5ef0edb..487f378 100644 --- a/third_party/crashpad/crashpad/tools/run_with_crashpad.cc +++ b/third_party/crashpad/crashpad/tools/run_with_crashpad.cc
@@ -31,7 +31,7 @@ #include "util/stdlib/map_insert.h" #include "util/string/split_string.h" -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) #include <lib/fdio/spawn.h> #include <zircon/process.h> #include <zircon/syscalls.h> @@ -43,16 +43,23 @@ namespace { void Usage(const std::string& me) { + // clang-format off fprintf(stderr, "Usage: %s [OPTION]... COMMAND [ARG]...\n" "Start a Crashpad handler and have it handle crashes from COMMAND.\n" "\n" -#if defined(OS_FUCHSIA) + // clang-format on +#if BUILDFLAG(IS_FUCHSIA) + // clang-format off "COMMAND is run via fdio_spawn, so must be a qualified path to the subprocess to\n" "be executed.\n" + // clang-format on #else + // clang-format off "COMMAND is run via execvp() so the PATH will be searched.\n" + // clang-format on #endif + // clang-format off "\n" " -h, --handler=HANDLER invoke HANDLER instead of crashpad_handler\n" " --annotation=KEY=VALUE passed to the handler as an --annotation argument\n" @@ -62,6 +69,7 @@ " --help display this help and exit\n" " --version output version information and exit\n", me.c_str()); + // clang-format on ToolSupport::UsageTail(me); } @@ -189,7 +197,7 @@ return kExitFailure; } -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) // Fuchsia doesn't implement execvp(), launch with fdio_spawn here. zx_handle_t child = ZX_HANDLE_INVALID; zx_status_t status = fdio_spawn(
diff --git a/third_party/crashpad/crashpad/tools/tool_support.cc b/third_party/crashpad/crashpad/tools/tool_support.cc index b453f6e..aa6a2d9 100644 --- a/third_party/crashpad/crashpad/tools/tool_support.cc +++ b/third_party/crashpad/crashpad/tools/tool_support.cc
@@ -21,6 +21,7 @@ #include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "package.h" namespace crashpad { @@ -55,7 +56,7 @@ me.value().c_str()); } -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) // static void ToolSupport::Version(const std::string& me) { Version(base::FilePath(me)); @@ -70,9 +71,9 @@ void ToolSupport::UsageHint(const std::string& me, const char* hint) { UsageHint(base::FilePath(me), hint); } -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // static int ToolSupport::Wmain(int argc, wchar_t* argv[], int (*entry)(int, char* [])) { @@ -87,26 +88,26 @@ return entry(argc, argv_as_utf8.get()); } -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) // static base::FilePath::StringType ToolSupport::CommandLineArgumentToFilePathStringType( const base::StringPiece& path) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) return std::string(path.data(), path.size()); -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) return base::UTF8ToWide(path); -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) } // static std::string ToolSupport::FilePathToCommandLineArgument( const base::FilePath& file_path) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) return file_path.value(); -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) return base::WideToUTF8(file_path.value()); -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) } } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/tools/tool_support.h b/third_party/crashpad/crashpad/tools/tool_support.h index fd4955e4..87db24d 100644 --- a/third_party/crashpad/crashpad/tools/tool_support.h +++ b/third_party/crashpad/crashpad/tools/tool_support.h
@@ -48,7 +48,7 @@ //! Optional, may be `nullptr`, in which case no hint will be presented. static void UsageHint(const base::FilePath& me, const char* hint); -#if defined(OS_POSIX) || DOXYGEN +#if BUILDFLAG(IS_POSIX) || DOXYGEN //! \copydoc Version static void Version(const std::string& me); @@ -57,15 +57,15 @@ //! \copydoc UsageHint static void UsageHint(const std::string& me, const char* hint); -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) -#if defined(OS_WIN) || DOXYGEN +#if BUILDFLAG(IS_WIN) || DOXYGEN //! \brief Converts \a argv `wchar_t` UTF-16 to UTF-8, and passes onwards to a //! UTF-8 entry point. //! //! \return The return value of \a entry. static int Wmain(int argc, wchar_t* argv[], int (*entry)(int, char*[])); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) //! \brief Converts a command line argument to the string type suitable for //! base::FilePath.
diff --git a/third_party/crashpad/crashpad/util/file/directory_reader.h b/third_party/crashpad/crashpad/util/file/directory_reader.h index 096d120d..ccde8b7 100644 --- a/third_party/crashpad/crashpad/util/file/directory_reader.h +++ b/third_party/crashpad/crashpad/util/file/directory_reader.h
@@ -18,13 +18,13 @@ #include "base/files/file_path.h" #include "build/build_config.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #include "util/posix/scoped_dir.h" -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> #include "util/win/scoped_handle.h" -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) namespace crashpad { @@ -67,20 +67,20 @@ //! logged. Result NextFile(base::FilePath* filename); -#if defined(OS_POSIX) || DOXYGEN +#if BUILDFLAG(IS_POSIX) || DOXYGEN //! \brief Returns the file descriptor associated with this reader, logging a //! message and returning -1 on error. int DirectoryFD(); #endif private: -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) ScopedDIR dir_; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) WIN32_FIND_DATA find_data_; ScopedSearchHANDLE handle_; bool first_entry_; -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) }; } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/util/file/directory_reader_test.cc b/third_party/crashpad/crashpad/util/file/directory_reader_test.cc index 5d09c6f..e1dcee2 100644 --- a/third_party/crashpad/crashpad/util/file/directory_reader_test.cc +++ b/third_party/crashpad/crashpad/util/file/directory_reader_test.cc
@@ -19,6 +19,7 @@ #include "base/files/file_path.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "gtest/gtest.h" #include "test/filesystem.h" #include "test/scoped_temp_dir.h" @@ -42,7 +43,7 @@ reader.Open(temp_dir.path().Append(FILE_PATH_LITERAL("doesntexist")))); } -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) TEST(DirectoryReader, BadPaths_SymbolicLinks) { if (!CanCreateSymbolicLinks()) { @@ -63,7 +64,7 @@ EXPECT_FALSE(reader.Open(link)); } -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) TEST(DirectoryReader, EmptyDirectory) { ScopedTempDir temp_dir; @@ -103,7 +104,7 @@ ASSERT_TRUE( CreateFile(temp_dir.path().Append(directory).Append(nested_file))); -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) if (symbolic_links) { base::FilePath link(FILE_PATH_LITERAL("link")); @@ -118,7 +119,7 @@ EXPECT_TRUE(expected_files.insert(dangling).second); } -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) std::set<base::FilePath> files; DirectoryReader reader; @@ -138,7 +139,7 @@ TestFilesAndDirectories(false); } -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) TEST(DirectoryReader, FilesAndDirectories_SymbolicLinks) { if (!CanCreateSymbolicLinks()) { @@ -148,7 +149,7 @@ TestFilesAndDirectories(true); } -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) } // namespace } // namespace test
diff --git a/third_party/crashpad/crashpad/util/file/file_io.h b/third_party/crashpad/crashpad/util/file/file_io.h index 526debd..6a6a5865 100644 --- a/third_party/crashpad/crashpad/util/file/file_io.h +++ b/third_party/crashpad/crashpad/util/file/file_io.h
@@ -21,9 +21,9 @@ #include "build/build_config.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #include "base/files/scoped_file.h" -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> #include "util/win/scoped_handle.h" #endif @@ -34,7 +34,7 @@ namespace crashpad { -#if defined(OS_POSIX) || DOXYGEN +#if BUILDFLAG(IS_POSIX) || DOXYGEN //! \brief Platform-specific alias for a low-level file handle. using FileHandle = int; @@ -51,7 +51,7 @@ //! \brief A value that can never be a valid FileHandle. const FileHandle kInvalidFileHandle = -1; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) using FileHandle = HANDLE; using FileOffset = LONGLONG; @@ -132,7 +132,7 @@ namespace internal { -#if defined(OS_POSIX) || DOXYGEN +#if BUILDFLAG(IS_POSIX) || DOXYGEN //! \brief The name of the native read function used by ReadFile(). //! @@ -148,7 +148,7 @@ //! \sa kNativeReadFunctionName constexpr char kNativeWriteFunctionName[] = "write"; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) constexpr char kNativeReadFunctionName[] = "ReadFile"; constexpr char kNativeWriteFunctionName[] = "WriteFile"; @@ -422,7 +422,7 @@ FileWriteMode mode, FilePermissions permissions); -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) //! \brief Opens an in-memory file for input and output. //! //! This function first attempts to open the file with `memfd_create()`. If @@ -444,7 +444,7 @@ //! \sa LoggingOpenFileForWrite //! \sa LoggingOpenFileForReadAndWrite FileHandle LoggingOpenMemoryFileForReadAndWrite(const base::FilePath& name); -#endif // OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) //! \brief Wraps OpenFileForReadAndWrite(), logging an error if the operation //! fails. @@ -461,7 +461,7 @@ // Fuchsia does not currently support any sort of file locking. See // https://crashpad.chromium.org/bug/196 and // https://crashpad.chromium.org/bug/217. -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) //! \brief Locks the given \a file using `flock()` on POSIX or `LockFileEx()` on //! Windows. @@ -500,7 +500,7 @@ //! \return `true` on success, or `false` and a message will be logged. bool LoggingUnlockFile(FileHandle file); -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) //! \brief Wraps `lseek()` or `SetFilePointerEx()`. Logs an error if the //! operation fails.
diff --git a/third_party/crashpad/crashpad/util/file/file_io_posix.cc b/third_party/crashpad/crashpad/util/file/file_io_posix.cc index 119a2fc..5276b36d 100644 --- a/third_party/crashpad/crashpad/util/file/file_io_posix.cc +++ b/third_party/crashpad/crashpad/util/file/file_io_posix.cc
@@ -72,7 +72,7 @@ const base::FilePath& path, FileWriteMode mode, FilePermissions permissions) { -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) // O_NOCTTY is invalid on Fuchsia, and O_CLOEXEC isn't necessary. int flags = 0; #else @@ -120,7 +120,7 @@ FileHandle OpenFileForRead(const base::FilePath& path) { int flags = O_RDONLY; -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) // O_NOCTTY is invalid on Fuchsia, and O_CLOEXEC isn't necessary. flags |= O_NOCTTY | O_CLOEXEC; #endif @@ -153,7 +153,7 @@ return fd; } -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) FileHandle LoggingOpenMemoryFileForReadAndWrite(const base::FilePath& name) { DCHECK(name.value().find('/') == std::string::npos); @@ -208,7 +208,7 @@ return fd; } -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) FileLockingResult LoggingLockFile(FileHandle file, FileLocking locking, @@ -234,7 +234,7 @@ return rv == 0; } -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) FileOffset LoggingSeekFile(FileHandle file, FileOffset offset, int whence) { off_t rv = lseek(file, offset, whence);
diff --git a/third_party/crashpad/crashpad/util/file/file_io_test.cc b/third_party/crashpad/crashpad/util/file/file_io_test.cc index abfef12..f970e35 100644 --- a/third_party/crashpad/crashpad/util/file/file_io_test.cc +++ b/third_party/crashpad/crashpad/util/file/file_io_test.cc
@@ -22,6 +22,7 @@ #include "base/atomicops.h" #include "base/cxx17_backports.h" #include "base/files/file_path.h" +#include "build/build_config.h" #include "gmock/gmock.h" #include "gtest/gtest.h" #include "test/errors.h" @@ -474,7 +475,7 @@ TestOpenFileForWrite(LoggingOpenFileForReadAndWrite); } -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) TEST(FileIO, LoggingOpenMemoryFileForReadAndWrite) { ScopedFileHandle handle( LoggingOpenMemoryFileForReadAndWrite(base::FilePath("memfile"))); @@ -489,7 +490,7 @@ ASSERT_TRUE(LoggingReadFileExactly(handle.get(), buffer, sizeof(buffer))); EXPECT_EQ(memcmp(buffer, kTestData, sizeof(buffer)), 0); } -#endif // OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) enum class ReadOrWrite : bool { kRead, @@ -545,7 +546,7 @@ // Fuchsia does not currently support any sort of file locking. See // https://crashpad.chromium.org/bug/196 and // https://crashpad.chromium.org/bug/217. -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) TEST(FileIO, MultipleSharedLocks) { ScopedTempDir temp_dir; @@ -720,7 +721,7 @@ EXPECT_TRUE(LoggingUnlockFile(handle2.get())); } -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) TEST(FileIO, FileSizeByHandle) { EXPECT_EQ(LoggingFileSizeByHandle(kInvalidFileHandle), -1); @@ -742,9 +743,9 @@ FileHandle FileHandleForFILE(FILE* file) { int fd = fileno(file); -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) return fd; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) return reinterpret_cast<HANDLE>(_get_osfhandle(fd)); #else #error Port
diff --git a/third_party/crashpad/crashpad/util/file/file_writer.cc b/third_party/crashpad/crashpad/util/file/file_writer.cc index 73fe708..b6f50eb 100644 --- a/third_party/crashpad/crashpad/util/file/file_writer.cc +++ b/third_party/crashpad/crashpad/util/file/file_writer.cc
@@ -25,22 +25,22 @@ #include "build/build_config.h" #include "util/misc/implicit_cast.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #include <sys/uio.h> #include <unistd.h> #include "base/posix/eintr_wrapper.h" -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) namespace crashpad { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) // Ensure type compatibility between WritableIoVec and iovec. static_assert(sizeof(WritableIoVec) == sizeof(iovec), "WritableIoVec size"); static_assert(offsetof(WritableIoVec, iov_base) == offsetof(iovec, iov_base), "WritableIoVec base offset"); static_assert(offsetof(WritableIoVec, iov_len) == offsetof(iovec, iov_len), "WritableIoVec len offset"); -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) WeakFileHandleFileWriter::WeakFileHandleFileWriter(FileHandle file_handle) : file_handle_(file_handle) { @@ -62,7 +62,7 @@ return false; } -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) ssize_t size = 0; for (const WritableIoVec& iov : *iovecs) { @@ -79,7 +79,7 @@ iovec* iov = reinterpret_cast<iovec*>(&(*iovecs)[0]); size_t remaining_iovecs = iovecs->size(); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Android does not expose the IOV_MAX macro, but makes its value available // via sysconf(). See Android 7.0.0 bionic/libc/bionic/sysconf.cpp sysconf(). // Bionic defines IOV_MAX at bionic/libc/include/limits.h, but does not ship @@ -127,14 +127,14 @@ DCHECK_EQ(remaining_iovecs, 0u); -#else // !OS_POSIX +#else // !BUILDFLAG(IS_POSIX) for (const WritableIoVec& iov : *iovecs) { if (!Write(iov.iov_base, iov.iov_len)) return false; } -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) #ifndef NDEBUG // The interface says that |iovecs| is not sacred, so scramble it to make sure @@ -171,7 +171,7 @@ return true; } -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) bool FileWriter::OpenMemfd(const base::FilePath& path) { CHECK(!file_.is_valid()); file_.reset(LoggingOpenMemoryFileForReadAndWrite(path));
diff --git a/third_party/crashpad/crashpad/util/file/file_writer.h b/third_party/crashpad/crashpad/util/file/file_writer.h index 4ba7a43..8d82d14 100644 --- a/third_party/crashpad/crashpad/util/file/file_writer.h +++ b/third_party/crashpad/crashpad/util/file/file_writer.h
@@ -20,6 +20,7 @@ #include <vector> #include "base/files/file_path.h" +#include "build/build_config.h" #include "util/file/file_io.h" #include "util/file/file_seeker.h" @@ -136,7 +137,7 @@ FileWriteMode write_mode, FilePermissions permissions); -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) //! \brief Wraps LoggingOpenMemoryFileForWrite(). //! //! \return `true` if the operation succeeded, `false` if it failed, with an
diff --git a/third_party/crashpad/crashpad/util/file/filesystem_posix.cc b/third_party/crashpad/crashpad/util/file/filesystem_posix.cc index c413397..8853b9f 100644 --- a/third_party/crashpad/crashpad/util/file/filesystem_posix.cc +++ b/third_party/crashpad/crashpad/util/file/filesystem_posix.cc
@@ -33,9 +33,9 @@ return false; } -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) *mtime = st.st_mtimespec; -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) // This is needed to compile with traditional NDK headers. mtime->tv_sec = st.st_mtime; mtime->tv_nsec = st.st_mtime_nsec;
diff --git a/third_party/crashpad/crashpad/util/file/filesystem_test.cc b/third_party/crashpad/crashpad/util/file/filesystem_test.cc index 9338cdc..cc683b3 100644 --- a/third_party/crashpad/crashpad/util/file/filesystem_test.cc +++ b/third_party/crashpad/crashpad/util/file/filesystem_test.cc
@@ -31,7 +31,7 @@ constexpr char kTestFileContent[] = "file_content"; bool CurrentTime(timespec* now) { -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) timeval now_tv; int res = gettimeofday(&now_tv, nullptr); if (res != 0) { @@ -40,7 +40,7 @@ } TimevalToTimespec(now_tv, now); return true; -#elif defined(OS_POSIX) +#elif BUILDFLAG(IS_POSIX) int res = clock_gettime(CLOCK_REALTIME, now); if (res != 0) { EXPECT_EQ(res, 0) << ErrnoMessage("clock_gettime"); @@ -90,7 +90,7 @@ temp_dir.path().Append(FILE_PATH_LITERAL("notafile")), &mtime)); } -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) TEST(Filesystem, FileModificationTime_SymbolicLinks) { if (!CanCreateSymbolicLinks()) { @@ -140,7 +140,7 @@ EXPECT_LE(mtime.tv_sec, expected_time_end.tv_sec + 2); } -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) TEST(Filesystem, CreateDirectory) { ScopedTempDir temp_dir; @@ -221,7 +221,7 @@ EXPECT_TRUE(IsRegularFile(file)); } -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) TEST(Filesystem, MoveFileOrDirectory_SymbolicLinks) { if (!CanCreateSymbolicLinks()) { @@ -284,7 +284,7 @@ EXPECT_FALSE(PathExists(link2)); } -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) TEST(Filesystem, IsRegularFile) { EXPECT_FALSE(IsRegularFile(base::FilePath())); @@ -299,7 +299,7 @@ EXPECT_TRUE(IsRegularFile(file)); } -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) TEST(Filesystem, IsRegularFile_SymbolicLinks) { if (!CanCreateSymbolicLinks()) { @@ -323,7 +323,7 @@ EXPECT_FALSE(IsRegularFile(dir_link)); } -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) TEST(Filesystem, IsDirectory) { EXPECT_FALSE(IsDirectory(base::FilePath(), false)); @@ -341,7 +341,7 @@ EXPECT_FALSE(IsDirectory(file, true)); } -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) TEST(Filesystem, IsDirectory_SymbolicLinks) { if (!CanCreateSymbolicLinks()) { @@ -368,7 +368,7 @@ EXPECT_TRUE(IsDirectory(dir_link, true)); } -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) TEST(Filesystem, RemoveFile) { EXPECT_FALSE(LoggingRemoveFile(base::FilePath())); @@ -390,7 +390,7 @@ EXPECT_FALSE(LoggingRemoveFile(file)); } -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) TEST(Filesystem, RemoveFile_SymbolicLinks) { if (!CanCreateSymbolicLinks()) { @@ -417,7 +417,7 @@ EXPECT_TRUE(PathExists(dir)); } -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) TEST(Filesystem, RemoveDirectory) { EXPECT_FALSE(LoggingRemoveDirectory(base::FilePath())); @@ -432,7 +432,7 @@ EXPECT_FALSE(LoggingRemoveDirectory(file)); ASSERT_TRUE(CreateFile(file)); -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) // The current implementation of Fuchsia's rmdir() simply calls unlink(), and // unlink() works on all FS objects. This is incorrect as // http://pubs.opengroup.org/onlinepubs/9699919799/functions/rmdir.html says @@ -447,7 +447,7 @@ EXPECT_TRUE(LoggingRemoveDirectory(dir)); } -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) TEST(Filesystem, RemoveDirectory_SymbolicLinks) { if (!CanCreateSymbolicLinks()) { @@ -472,7 +472,7 @@ EXPECT_TRUE(LoggingRemoveFile(link)); } -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) TEST(Filesystem, GetFileSize) { ScopedTempDir temp_dir; @@ -486,13 +486,13 @@ uint64_t filesize = GetFileSize(filepath); EXPECT_EQ(filesize, sizeof(kTestFileContent)); -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) // Create a link to a file. base::FilePath link(temp_dir.path().Append(FILE_PATH_LITERAL("link"))); ASSERT_TRUE(CreateSymbolicLink(filepath, link)); uint64_t filesize_link = GetFileSize(link); EXPECT_EQ(filesize_link, 0u); -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) } TEST(Filesystem, GetDirectorySize) { @@ -516,7 +516,7 @@ writer2.Write(kTestFileContent, sizeof(kTestFileContent)); writer2.Close(); -#if !defined(OS_FUCHSIA) +#if !BUILDFLAG(IS_FUCHSIA) // Create a link to a file. base::FilePath link(dir.Append(FILE_PATH_LITERAL("link"))); ASSERT_TRUE(CreateSymbolicLink(filepath2, link)); @@ -524,7 +524,7 @@ // Create a link to a dir. base::FilePath linkdir(temp_dir.path().Append(FILE_PATH_LITERAL("link"))); ASSERT_TRUE(CreateSymbolicLink(dir, linkdir)); -#endif // !OS_FUCHSIA +#endif // !BUILDFLAG(IS_FUCHSIA) uint64_t filesize = GetDirectorySize(temp_dir.path()); EXPECT_EQ(filesize, 2 * sizeof(kTestFileContent));
diff --git a/third_party/crashpad/crashpad/util/linux/auxiliary_vector_test.cc b/third_party/crashpad/crashpad/util/linux/auxiliary_vector_test.cc index 75c20d1..a230de6f1 100644 --- a/third_party/crashpad/crashpad/util/linux/auxiliary_vector_test.cc +++ b/third_party/crashpad/crashpad/util/linux/auxiliary_vector_test.cc
@@ -33,7 +33,7 @@ #include "util/numeric/int128.h" #include "util/process/process_memory_linux.h" -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // TODO(jperaza): This symbol isn't defined when building in chromium for // Android. There may be another symbol to use. extern "C" { @@ -72,7 +72,7 @@ ASSERT_TRUE(aux.GetValue(AT_BASE, &interp_base)); EXPECT_TRUE(mappings.FindMapping(interp_base)); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) LinuxVMAddress entry_addr; ASSERT_TRUE(aux.GetValue(AT_ENTRY, &entry_addr)); EXPECT_EQ(entry_addr, FromPointerCast<LinuxVMAddress>(START_SYMBOL));
diff --git a/third_party/crashpad/crashpad/util/linux/exception_handler_client.cc b/third_party/crashpad/crashpad/util/linux/exception_handler_client.cc index 608a199..ed1c9fb 100644 --- a/third_party/crashpad/crashpad/util/linux/exception_handler_client.cc +++ b/third_party/crashpad/crashpad/util/linux/exception_handler_client.cc
@@ -30,7 +30,7 @@ #include "util/misc/from_pointer_cast.h" #include "util/posix/signals.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include <android/api-level.h> #endif
diff --git a/third_party/crashpad/crashpad/util/linux/exception_handler_protocol.cc b/third_party/crashpad/crashpad/util/linux/exception_handler_protocol.cc index 27f180c..a5530f7 100644 --- a/third_party/crashpad/crashpad/util/linux/exception_handler_protocol.cc +++ b/third_party/crashpad/crashpad/util/linux/exception_handler_protocol.cc
@@ -14,15 +14,19 @@ #include "util/linux/exception_handler_protocol.h" +#include "build/build_config.h" + namespace crashpad { ExceptionHandlerProtocol::ClientInformation::ClientInformation() : exception_information_address(0), sanitization_information_address(0) -#if defined(OS_LINUX) || defined(OS_CHROMEOS) - , crash_loop_before_time(0) -#endif // OS_LINUX || OS_CHROMEOS -{} +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + , + crash_loop_before_time(0) +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +{ +} ExceptionHandlerProtocol::ClientToServerMessage::ClientToServerMessage() : version(kVersion),
diff --git a/third_party/crashpad/crashpad/util/linux/exception_handler_protocol.h b/third_party/crashpad/crashpad/util/linux/exception_handler_protocol.h index cbd2441..6a38acd5 100644 --- a/third_party/crashpad/crashpad/util/linux/exception_handler_protocol.h +++ b/third_party/crashpad/crashpad/util/linux/exception_handler_protocol.h
@@ -51,7 +51,7 @@ //! SanitizationInformation struct, or 0 if there is no such struct. VMAddress sanitization_information_address; -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) //! \brief Indicates that the client is likely in a crash loop if a crash //! occurs before this timestamp. This value is only used by ChromeOS's //! `/sbin/crash_reporter`.
diff --git a/third_party/crashpad/crashpad/util/linux/memory_map.cc b/third_party/crashpad/crashpad/util/linux/memory_map.cc index 47eec97..3e845c4c 100644 --- a/third_party/crashpad/crashpad/util/linux/memory_map.cc +++ b/third_party/crashpad/crashpad/util/linux/memory_map.cc
@@ -398,7 +398,7 @@ return std::make_unique<SparseReverseIterator>(); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // The Android Chromium linker uses ashmem to share RELRO segments between // processes. The original RELRO segment has been unmapped and replaced with a // mapping named "/dev/ashmem/RELRO:<libname>" where <libname> is the base @@ -427,17 +427,17 @@ } } } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) for (const auto& candidate : mappings_) { if (candidate.device == mapping.device && candidate.inode == mapping.inode -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // Libraries on Android may be mapped from zipfiles (APKs), in which // case the offset is not 0. && candidate.offset == 0 -#endif // !defined(OS_ANDROID) - ) { +#endif // !BUILDFLAG(IS_ANDROID) + ) { possible_starts.push_back(&candidate); } if (mapping.Equals(candidate)) {
diff --git a/third_party/crashpad/crashpad/util/linux/memory_map_test.cc b/third_party/crashpad/crashpad/util/linux/memory_map_test.cc index 4ccf575..caa40a4 100644 --- a/third_party/crashpad/crashpad/util/linux/memory_map_test.cc +++ b/third_party/crashpad/crashpad/util/linux/memory_map_test.cc
@@ -122,7 +122,7 @@ ASSERT_TRUE(mapping); EXPECT_GE(code_address, mapping->range.Base()); EXPECT_LT(code_address, mapping->range.End()); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // Android Q+ supports execute only memory. EXPECT_TRUE(mapping->readable); #endif @@ -195,7 +195,7 @@ ASSERT_TRUE(mapping); EXPECT_GE(code_address, mapping->range.Base()); EXPECT_LT(code_address, mapping->range.End()); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // Android Q+ supports execute only memory. EXPECT_TRUE(mapping->readable); #endif @@ -454,7 +454,7 @@ EXPECT_EQ(mappings->Next(), mapping2); mappings = map.FindFilePossibleMmapStarts(*mapping3); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) EXPECT_EQ(mappings->Count(), 2u); #else ASSERT_EQ(mappings->Count(), 1u); @@ -502,7 +502,7 @@ ASSERT_NE(mapping1, mapping2); ASSERT_NE(mapping2, mapping3); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) auto mappings = map.FindFilePossibleMmapStarts(*mapping1); EXPECT_EQ(mappings->Count(), 1u); EXPECT_EQ(mappings->Next(), mapping1); @@ -650,7 +650,7 @@ auto mapping = map.FindMapping(file_mapping0.addr_as<VMAddress>()); ASSERT_TRUE(mapping); auto possible_starts = map.FindFilePossibleMmapStarts(*mapping); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) EXPECT_EQ(possible_starts->Count(), 1u); #else EXPECT_EQ(possible_starts->Count(), 0u); @@ -659,7 +659,7 @@ mapping = map.FindMapping(file_mapping1.addr_as<VMAddress>()); ASSERT_TRUE(mapping); possible_starts = map.FindFilePossibleMmapStarts(*mapping); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) EXPECT_EQ(possible_starts->Count(), 2u); #else EXPECT_EQ(possible_starts->Count(), 1u); @@ -668,7 +668,7 @@ mapping = map.FindMapping(file_mapping2.addr_as<VMAddress>()); ASSERT_TRUE(mapping); possible_starts = map.FindFilePossibleMmapStarts(*mapping); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) EXPECT_EQ(possible_starts->Count(), 3u); #else EXPECT_EQ(possible_starts->Count(), 2u); @@ -677,7 +677,7 @@ mapping = map.FindMapping(file_mapping3.addr_as<VMAddress>()); ASSERT_TRUE(mapping); possible_starts = map.FindFilePossibleMmapStarts(*mapping); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) EXPECT_EQ(possible_starts->Count(), 4u); #else EXPECT_EQ(possible_starts->Count(), 3u); @@ -686,7 +686,7 @@ mapping = map.FindMapping(file_mapping4.addr_as<VMAddress>()); ASSERT_TRUE(mapping); possible_starts = map.FindFilePossibleMmapStarts(*mapping); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) EXPECT_EQ(possible_starts->Count(), 5u); #else EXPECT_EQ(possible_starts->Count(), 4u);
diff --git a/third_party/crashpad/crashpad/util/linux/thread_info.h b/third_party/crashpad/crashpad/util/linux/thread_info.h index 5b55c24..d3f3b2c 100644 --- a/third_party/crashpad/crashpad/util/linux/thread_info.h +++ b/third_party/crashpad/crashpad/util/linux/thread_info.h
@@ -24,7 +24,7 @@ #include "util/linux/address_types.h" #include "util/numeric/int128.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include <android/api-level.h> #endif @@ -261,11 +261,12 @@ // __ANDROID_API_N__ is a proxy for determining whether unified headers are in // use. It’s only defined by unified headers. Unified headers call this // structure user_fpxregs_struct regardless of API level. -#if defined(OS_ANDROID) && __ANDROID_API__ <= 19 && !defined(__ANDROID_API_N__) +#if BUILDFLAG(IS_ANDROID) && __ANDROID_API__ <= 19 && \ + !defined(__ANDROID_API_N__) using NativeFpxregs = user_fxsr_struct; #else using NativeFpxregs = user_fpxregs_struct; -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) static_assert(sizeof(f32_t::fxsave) == sizeof(NativeFpxregs), "Size mismatch"); #elif defined(ARCH_CPU_X86_64)
diff --git a/third_party/crashpad/crashpad/util/mach/exc_server_variants.cc b/third_party/crashpad/crashpad/util/mach/exc_server_variants.cc index b9357a78..9d36f3b 100644 --- a/third_party/crashpad/crashpad/util/mach/exc_server_variants.cc +++ b/third_party/crashpad/crashpad/util/mach/exc_server_variants.cc
@@ -686,10 +686,10 @@ exception_behavior_t behavior, bool set_thread_state) { if (exception == EXC_CRASH -#if defined(OS_MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_11 +#if BUILDFLAG(IS_MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_11 && MacOSVersionNumber() >= 10'11'00 #endif - ) { + ) { return KERN_SUCCESS; }
diff --git a/third_party/crashpad/crashpad/util/mach/exc_server_variants_test.cc b/third_party/crashpad/crashpad/util/mach/exc_server_variants_test.cc index d74cbc59..f5be0ea 100644 --- a/third_party/crashpad/crashpad/util/mach/exc_server_variants_test.cc +++ b/third_party/crashpad/crashpad/util/mach/exc_server_variants_test.cc
@@ -31,9 +31,9 @@ #include "util/mach/mach_message.h" #include "util/misc/implicit_cast.h" -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "test/mac/mach_multiprocess.h" -#endif // OS_MAC +#endif // BUILDFLAG(IS_MAC) namespace crashpad { namespace test { @@ -962,7 +962,7 @@ expect_request_ids); } -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) class TestExcServerVariants : public MachMultiprocess, public UniversalMachExcServer::Interface { @@ -1203,10 +1203,10 @@ } } -#endif // OS_MAC +#endif // BUILDFLAG(IS_MAC) TEST(ExcServerVariants, ExcServerSuccessfulReturnValue) { -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) // iOS 9 ≅ OS X 10.11. const kern_return_t prefer_not_set_thread_state = KERN_SUCCESS; #else
diff --git a/third_party/crashpad/crashpad/util/mach/mach_extensions.cc b/third_party/crashpad/crashpad/util/mach/mach_extensions.cc index 7f80693..dcff5c2 100644 --- a/third_party/crashpad/crashpad/util/mach/mach_extensions.cc +++ b/third_party/crashpad/crashpad/util/mach/mach_extensions.cc
@@ -44,12 +44,12 @@ // 10.9.4 xnu-2422.110.17/osfmk/mach/ipc_host.c and // xnu-2422.110.17/osfmk/mach/ipc_tt.c. -#if defined(OS_IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0 +#if BUILDFLAG(IS_IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0 // iOS 7 ≅ OS X 10.9. #error This code was not ported to iOS versions older than 7 #endif -#if defined(OS_MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_9 +#if BUILDFLAG(IS_MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_9 const int macos_version_number = MacOSVersionNumber(); #endif @@ -66,7 +66,7 @@ EXC_MASK_MACH_SYSCALL | EXC_MASK_RPC_ALERT | EXC_MASK_MACHINE; -#if defined(OS_MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8 +#if BUILDFLAG(IS_MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8 if (macos_version_number < 10'08'00) { return kExcMaskAll_10_6; } @@ -76,7 +76,7 @@ // xnu-2050.48.11/osfmk/mach/exception_types.h. constexpr exception_mask_t kExcMaskAll_10_8 = kExcMaskAll_10_6 | EXC_MASK_RESOURCE; -#if defined(OS_MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_9 +#if BUILDFLAG(IS_MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_9 if (macos_version_number < 10'09'00) { return kExcMaskAll_10_8; } @@ -91,12 +91,12 @@ exception_mask_t ExcMaskValid() { const exception_mask_t kExcMaskValid_10_6 = ExcMaskAll() | EXC_MASK_CRASH; -#if defined(OS_IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 +#if BUILDFLAG(IS_IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 // iOS 9 ≅ OS X 10.11. #error This code was not ported to iOS versions older than 9 #endif -#if defined(OS_MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_11 +#if BUILDFLAG(IS_MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_11 if (MacOSVersionNumber() < 10'11'00) { return kExcMaskValid_10_6; }
diff --git a/third_party/crashpad/crashpad/util/mach/mach_extensions_test.cc b/third_party/crashpad/crashpad/util/mach/mach_extensions_test.cc index 4ff53d94..57e03ad1 100644 --- a/third_party/crashpad/crashpad/util/mach/mach_extensions_test.cc +++ b/third_party/crashpad/crashpad/util/mach/mach_extensions_test.cc
@@ -80,11 +80,11 @@ EXPECT_FALSE(exc_mask_all & EXC_MASK_CRASH); EXPECT_FALSE(exc_mask_all & EXC_MASK_CORPSE_NOTIFY); -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) // Assume at least iOS 7 (≅ OS X 10.9). EXPECT_TRUE(exc_mask_all & EXC_MASK_RESOURCE); EXPECT_TRUE(exc_mask_all & EXC_MASK_GUARD); -#else // OS_IOS +#else // BUILDFLAG(IS_IOS) const int macos_version_number = MacOSVersionNumber(); if (macos_version_number >= 10'08'00) { EXPECT_TRUE(exc_mask_all & EXC_MASK_RESOURCE); @@ -97,7 +97,7 @@ } else { EXPECT_FALSE(exc_mask_all & EXC_MASK_GUARD); } -#endif // OS_IOS +#endif // BUILDFLAG(IS_IOS) // Bit 0 should not be set. EXPECT_FALSE(ExcMaskAll() & 1); @@ -112,12 +112,12 @@ EXPECT_TRUE(exc_mask_valid & EXC_MASK_CRASH); -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) // Assume at least iOS 9 (≅ OS X 10.11). EXPECT_TRUE(exc_mask_valid & EXC_MASK_RESOURCE); EXPECT_TRUE(exc_mask_valid & EXC_MASK_GUARD); EXPECT_TRUE(exc_mask_valid & EXC_MASK_CORPSE_NOTIFY); -#else // OS_IOS +#else // BUILDFLAG(IS_IOS) const int macos_version_number = MacOSVersionNumber(); if (macos_version_number >= 10'08'00) { EXPECT_TRUE(exc_mask_valid & EXC_MASK_RESOURCE); @@ -136,7 +136,7 @@ } else { EXPECT_FALSE(exc_mask_valid & EXC_MASK_CORPSE_NOTIFY); } -#endif // OS_IOS +#endif // BUILDFLAG(IS_IOS) // Bit 0 should not be set. EXPECT_FALSE(ExcMaskValid() & 1);
diff --git a/third_party/crashpad/crashpad/util/mach/mach_message.cc b/third_party/crashpad/crashpad/util/mach/mach_message.cc index 00fe116f..ac76a538 100644 --- a/third_party/crashpad/crashpad/util/mach/mach_message.cc +++ b/third_party/crashpad/crashpad/util/mach/mach_message.cc
@@ -20,12 +20,13 @@ #include "base/logging.h" #include "base/mac/mach_logging.h" +#include "build/build_config.h" #include "util/misc/clock.h" #include "util/misc/implicit_cast.h" -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include <bsm/libbsm.h> -#endif // OS_MAC +#endif // BUILDFLAG(IS_MAC) namespace crashpad { @@ -253,7 +254,7 @@ } } -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) pid_t AuditPIDFromMachMessageTrailer(const mach_msg_trailer_t* trailer) { if (trailer->msgh_trailer_type != MACH_MSG_TRAILER_FORMAT_0) { @@ -287,6 +288,6 @@ return audit_pid; } -#endif // OS_MAC +#endif // BUILDFLAG(IS_MAC) } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/util/mach/mach_message.h b/third_party/crashpad/crashpad/util/mach/mach_message.h index c58b6d0..e670a13 100644 --- a/third_party/crashpad/crashpad/util/mach/mach_message.h +++ b/third_party/crashpad/crashpad/util/mach/mach_message.h
@@ -183,7 +183,7 @@ bool MachMessageDestroyReceivedPort(mach_port_t port, mach_msg_type_name_t port_right_type); -#if defined(OS_MAC) || DOXYGEN +#if BUILDFLAG(IS_MAC) || DOXYGEN //! \brief Returns the process ID of a Mach message’s sender from its audit //! trailer. @@ -201,7 +201,7 @@ //! audit information. pid_t AuditPIDFromMachMessageTrailer(const mach_msg_trailer_t* trailer); -#endif // OS_MAC +#endif // BUILDFLAG(IS_MAC) } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/util/mach/mach_message_test.cc b/third_party/crashpad/crashpad/util/mach/mach_message_test.cc index 0c578b9..587061f 100644 --- a/third_party/crashpad/crashpad/util/mach/mach_message_test.cc +++ b/third_party/crashpad/crashpad/util/mach/mach_message_test.cc
@@ -19,6 +19,7 @@ #include <tuple> #include "base/mac/scoped_mach_port.h" +#include "build/build_config.h" #include "gtest/gtest.h" #include "test/mac/mach_errors.h" #include "util/mach/mach_extensions.h" @@ -159,7 +160,7 @@ EXPECT_TRUE(MachMessageDestroyReceivedPort(port, MACH_MSG_TYPE_PORT_SEND)); } -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) TEST(MachMessage, AuditPIDFromMachMessageTrailer) { base::mac::ScopedMachReceiveRight port(NewMachPort(MACH_PORT_RIGHT_RECEIVE)); @@ -201,7 +202,7 @@ EXPECT_EQ(AuditPIDFromMachMessageTrailer(&receive.trailer), getpid()); } -#endif // OS_MAC +#endif // BUILDFLAG(IS_MAC) } // namespace } // namespace test
diff --git a/third_party/crashpad/crashpad/util/misc/address_types.h b/third_party/crashpad/crashpad/util/misc/address_types.h index 14942bd..8902efb6 100644 --- a/third_party/crashpad/crashpad/util/misc/address_types.h +++ b/third_party/crashpad/crashpad/util/misc/address_types.h
@@ -21,13 +21,13 @@ #include "build/build_config.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include <mach/mach_types.h> -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include "util/win/address_types.h" -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include "util/linux/address_types.h" -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) #include <zircon/types.h> #else #error "Unhandled OS type" @@ -45,22 +45,22 @@ //! VMAddress), potentially across bitness. using VMSize = uint64_t; -#elif defined(OS_APPLE) +#elif BUILDFLAG(IS_APPLE) using VMAddress = mach_vm_address_t; using VMSize = mach_vm_size_t; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) using VMAddress = WinVMAddress; using VMSize = WinVMSize; -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) using VMAddress = LinuxVMAddress; using VMSize = LinuxVMSize; -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) using VMAddress = zx_vaddr_t; using VMSize = size_t;
diff --git a/third_party/crashpad/crashpad/util/misc/capture_context.h b/third_party/crashpad/crashpad/util/misc/capture_context.h index d21a24f..37ed4002 100644 --- a/third_party/crashpad/crashpad/util/misc/capture_context.h +++ b/third_party/crashpad/crashpad/util/misc/capture_context.h
@@ -17,30 +17,30 @@ #include "build/build_config.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include <mach/mach.h> -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include <ucontext.h> -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) #include <signal.h> -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) namespace crashpad { -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #if defined(ARCH_CPU_X86_FAMILY) using NativeCPUContext = x86_thread_state; #elif defined(ARCH_CPU_ARM64) using NativeCPUContext = arm_unified_thread_state; #endif -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) using NativeCPUContext = CONTEXT; -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ - defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) using NativeCPUContext = ucontext_t; -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) //! \brief Saves the CPU context. //!
diff --git a/third_party/crashpad/crashpad/util/misc/capture_context_test.cc b/third_party/crashpad/crashpad/util/misc/capture_context_test.cc index cf23c2d..a24ea15 100644 --- a/third_party/crashpad/crashpad/util/misc/capture_context_test.cc +++ b/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
@@ -28,14 +28,14 @@ namespace test { namespace { -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) // Fuchsia uses -fsanitize=safe-stack by default, which splits local variables // and the call stack into separate regions (see // https://clang.llvm.org/docs/SafeStack.html). Because this test would like to // find an approximately valid stack pointer by comparing locals to the // captured one, disable safe-stack for this function. __attribute__((no_sanitize("safe-stack"))) -#endif // defined(OS_FUCHSIA) +#endif // BUILDFLAG(IS_FUCHSIA) #if defined(MEMORY_SANITIZER) // CaptureContext() calls inline assembly and is incompatible with MSan.
diff --git a/third_party/crashpad/crashpad/util/misc/clock_posix.cc b/third_party/crashpad/crashpad/util/misc/clock_posix.cc index a9fe8e585..448f843 100644 --- a/third_party/crashpad/crashpad/util/misc/clock_posix.cc +++ b/third_party/crashpad/crashpad/util/misc/clock_posix.cc
@@ -30,7 +30,7 @@ namespace crashpad { -#if !defined(OS_APPLE) +#if !BUILDFLAG(IS_APPLE) uint64_t ClockMonotonicNanoseconds() { timespec now;
diff --git a/third_party/crashpad/crashpad/util/misc/clock_test.cc b/third_party/crashpad/crashpad/util/misc/clock_test.cc index 443d496..a1b1a4f 100644 --- a/third_party/crashpad/crashpad/util/misc/clock_test.cc +++ b/third_party/crashpad/crashpad/util/misc/clock_test.cc
@@ -21,6 +21,7 @@ #include "base/cxx17_backports.h" #include "base/format_macros.h" #include "base/strings/stringprintf.h" +#include "build/build_config.h" #include "gtest/gtest.h" namespace crashpad { @@ -41,17 +42,17 @@ EXPECT_GE(now, last); } -#if !defined(OS_WIN) // No SleepNanoseconds implemented on Windows. +#if !BUILDFLAG(IS_WIN) // No SleepNanoseconds implemented on Windows. // SleepNanoseconds() should sleep for at least the value of the clock’s // resolution, so the clock’s value should definitely increase after a sleep. // EXPECT_GT can be used instead of EXPECT_GE after the sleep. SleepNanoseconds(1); now = ClockMonotonicNanoseconds(); EXPECT_GT(now, start); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) } -#if !defined(OS_WIN) // No SleepNanoseconds implemented on Windows. +#if !BUILDFLAG(IS_WIN) // No SleepNanoseconds implemented on Windows. void TestSleepNanoseconds(uint64_t nanoseconds) { uint64_t start = ClockMonotonicNanoseconds(); @@ -91,7 +92,7 @@ } } -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) } // namespace } // namespace test
diff --git a/third_party/crashpad/crashpad/util/misc/metrics.cc b/third_party/crashpad/crashpad/util/misc/metrics.cc index 47c9f26..2e8459c7 100644 --- a/third_party/crashpad/crashpad/util/misc/metrics.cc +++ b/third_party/crashpad/crashpad/util/misc/metrics.cc
@@ -19,15 +19,15 @@ #include "base/numerics/safe_conversions.h" #include "build/build_config.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #define METRICS_OS_NAME "Mac" -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #define METRICS_OS_NAME "Win" -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) #define METRICS_OS_NAME "Android" -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #define METRICS_OS_NAME "Linux" -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) #define METRICS_OS_NAME "Fuchsia" #endif @@ -115,7 +115,7 @@ "Crashpad.HandlerCrash.ExceptionCode." METRICS_OS_NAME, exception_code); } -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) // static void Metrics::MissingIntermediateDumpKey( const internal::IntermediateDumpKey& key) {
diff --git a/third_party/crashpad/crashpad/util/misc/metrics.h b/third_party/crashpad/crashpad/util/misc/metrics.h index dcd37a6..c870b3a 100644 --- a/third_party/crashpad/crashpad/util/misc/metrics.h +++ b/third_party/crashpad/crashpad/util/misc/metrics.h
@@ -20,7 +20,7 @@ #include "build/build_config.h" #include "util/file/file_io.h" -#if defined(OS_IOS) +#if BUILDFLAG(IS_IOS) #include "util/ios/ios_intermediate_dump_format.h" #endif @@ -207,7 +207,7 @@ //! This is currently only reported on Windows. static void HandlerCrashed(uint32_t exception_code); -#if defined(OS_IOS) || DOXYGEN +#if BUILDFLAG(IS_IOS) || DOXYGEN //! \brief Records a missing key from an intermediate dump. static void MissingIntermediateDumpKey( const internal::IntermediateDumpKey& key);
diff --git a/third_party/crashpad/crashpad/util/misc/no_cfi_icall.h b/third_party/crashpad/crashpad/util/misc/no_cfi_icall.h index 80e584e..1a5ddc6 100644 --- a/third_party/crashpad/crashpad/util/misc/no_cfi_icall.h +++ b/third_party/crashpad/crashpad/util/misc/no_cfi_icall.h
@@ -20,9 +20,9 @@ #include "build/build_config.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <windows.h> -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) namespace crashpad { @@ -39,7 +39,7 @@ #endif // DISABLE_CFI_ICALL -- Disable Control Flow Integrity indirect call checks. -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Windows also needs __declspec(guard(nocf)). #define DISABLE_CFI_ICALL NO_SANITIZE("cfi-icall") __declspec(guard(nocf)) #else @@ -65,7 +65,7 @@ } }; -#if defined(OS_WIN) && defined(ARCH_CPU_X86) +#if BUILDFLAG(IS_WIN) && defined(ARCH_CPU_X86) template <typename R, typename... Args> struct FunctorTraits<R(__stdcall*)(Args...) noexcept> { template <typename... RunArgs> @@ -74,7 +74,7 @@ return function(std::forward<RunArgs>(args)...); } }; -#endif // OS_WIN && ARCH_CPU_X86 +#endif // BUILDFLAG(IS_WIN) && ARCH_CPU_X86 #if __cplusplus >= 201703L // These specializations match functions which are not explicitly declared @@ -97,7 +97,7 @@ } }; -#if defined(OS_WIN) && defined(ARCH_CPU_X86) +#if BUILDFLAG(IS_WIN) && defined(ARCH_CPU_X86) template <typename R, typename... Args> struct FunctorTraits<R(__stdcall*)(Args...)> { template <typename... RunArgs> @@ -106,7 +106,7 @@ return function(std::forward<RunArgs>(args)...); } }; -#endif // OS_WIN && ARCH_CPU_X86 +#endif // BUILDFLAG(IS_WIN) && ARCH_CPU_X86 #endif // __cplusplus >= 201703L @@ -146,14 +146,14 @@ explicit NoCfiIcall(PointerType function) : function_(reinterpret_cast<Functor>(function)) {} -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) //! \see NoCfiIcall template <typename = std::enable_if_t< !std::is_same<typename std::remove_cv<Functor>::type, FARPROC>::value>> explicit NoCfiIcall(FARPROC function) : function_(reinterpret_cast<Functor>(function)) {} -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) ~NoCfiIcall() = default;
diff --git a/third_party/crashpad/crashpad/util/misc/no_cfi_icall_test.cc b/third_party/crashpad/crashpad/util/misc/no_cfi_icall_test.cc index 5654a2f4..56a2cac 100644 --- a/third_party/crashpad/crashpad/util/misc/no_cfi_icall_test.cc +++ b/third_party/crashpad/crashpad/util/misc/no_cfi_icall_test.cc
@@ -19,7 +19,7 @@ #include "build/build_config.h" #include "gtest/gtest.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <windows.h> #include "util/win/get_function.h" @@ -49,7 +49,7 @@ } TEST(NoCfiIcall, CrossDSOICall) { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) static const NoCfiIcall<decltype(GetCurrentProcessId)*> call( GET_FUNCTION_REQUIRED(L"kernel32.dll", GetCurrentProcessId)); ASSERT_TRUE(call); @@ -62,7 +62,7 @@ } TEST(NoCfiIcall, Args) { -#if !defined(OS_WIN) +#if !BUILDFLAG(IS_WIN) static const NoCfiIcall<decltype(snprintf)*> call( dlsym(RTLD_NEXT, "snprintf")); ASSERT_TRUE(call);
diff --git a/third_party/crashpad/crashpad/util/misc/time.h b/third_party/crashpad/crashpad/util/misc/time.h index dc992bdc..d695f77 100644 --- a/third_party/crashpad/crashpad/util/misc/time.h +++ b/third_party/crashpad/crashpad/util/misc/time.h
@@ -21,7 +21,7 @@ #include "build/build_config.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <windows.h> #endif @@ -45,7 +45,7 @@ //! \brief Convert the timeval \a tv to a timespec \a ts. void TimevalToTimespec(const timeval& tv, timespec* ts); -#if defined(OS_WIN) || DOXYGEN +#if BUILDFLAG(IS_WIN) || DOXYGEN //! \brief Convert a `timespec` to a Windows `FILETIME`, converting from POSIX //! epoch to Windows epoch. @@ -67,15 +67,17 @@ //! UTC. void GetTimeOfDay(timeval* tv); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || DOXYGEN +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ + DOXYGEN //! \brief Get the kernel boot time. Subsequent calls to this function may //! return different results due to the system clock being changed or //! imprecision in measuring the boot time. //! \return `true` on success. Otherwise, `false` with a message logged. bool GetBootTime(timespec* ts); -#endif // OS_LINUX || OS_CHROMEOS || OS_ANDROID || DOXYGEN +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || + // BUILDFLAG(IS_ANDROID) || DOXYGEN } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/util/misc/time_test.cc b/third_party/crashpad/crashpad/util/misc/time_test.cc index 87e28fa..d3ae9566 100644 --- a/third_party/crashpad/crashpad/util/misc/time_test.cc +++ b/third_party/crashpad/crashpad/util/misc/time_test.cc
@@ -16,6 +16,7 @@ #include <limits> +#include "build/build_config.h" #include "gtest/gtest.h" namespace crashpad { @@ -71,7 +72,7 @@ EXPECT_TRUE(TimespecToTimeval(kEndOfTime, &end_of_timeval)); } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) constexpr uint64_t kBirthdateFiletimeIntervals = 130512285140000324; FILETIME filetime_birthdate; filetime_birthdate.dwLowDateTime = 0xffffffff & kBirthdateFiletimeIntervals; @@ -112,10 +113,10 @@ elapsed_timeval = FiletimeToTimevalInterval(elapsed_filetime); EXPECT_EQ(elapsed_timeval.tv_sec, 429); EXPECT_EQ(elapsed_timeval.tv_usec, 496729); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) TEST(Time, GetTimeOfDay) { timeval t; @@ -125,7 +126,7 @@ EXPECT_LT(approx_now - 100, t.tv_sec); } -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) } // namespace } // namespace test
diff --git a/third_party/crashpad/crashpad/util/misc/uuid.cc b/third_party/crashpad/crashpad/util/misc/uuid.cc index 4ed3831..6ad7e672 100644 --- a/third_party/crashpad/crashpad/util/misc/uuid.cc +++ b/third_party/crashpad/crashpad/util/misc/uuid.cc
@@ -29,10 +29,11 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/sys_byteorder.h" +#include "build/build_config.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include <uuid/uuid.h> -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) namespace crashpad { @@ -87,20 +88,20 @@ return true; } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) bool UUID::InitializeFromString(const base::WStringPiece& string) { return InitializeFromString(WideToUTF8(string)); } #endif bool UUID::InitializeWithNew() { -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) uuid_t uuid; uuid_generate(uuid); InitializeFromBytes(uuid); return true; -#elif defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ - defined(OS_ANDROID) || defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ + BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) // Linux, Android, and Fuchsia do not provide a UUID generator in a // widely-available system library. On Linux and Android, uuid_generate() // from libuuid is not available everywhere. @@ -115,10 +116,10 @@ return true; #else #error Port. -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) void UUID::InitializeFromSystemUUID(const ::UUID* system_uuid) { static_assert(sizeof(::UUID) == sizeof(UUID), "unexpected system uuid size"); @@ -126,7 +127,7 @@ "unexpected system uuid layout"); memcpy(this, system_uuid, sizeof(*this)); } -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) std::string UUID::ToString() const { return base::StringPrintf("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", @@ -143,10 +144,10 @@ data_5[5]); } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) std::wstring UUID::ToWString() const { return base::UTF8ToWide(ToString()); } -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/util/misc/uuid.h b/third_party/crashpad/crashpad/util/misc/uuid.h index 7e504a2..574f01d 100644 --- a/third_party/crashpad/crashpad/util/misc/uuid.h +++ b/third_party/crashpad/crashpad/util/misc/uuid.h
@@ -22,7 +22,7 @@ #include "base/strings/string_piece.h" #include "build/build_config.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <rpc.h> #endif @@ -63,9 +63,9 @@ //! been initialized with the data. `false` if the string could not be //! parsed, with the object state untouched. bool InitializeFromString(const base::StringPiece& string); -#if defined(OS_WIN) || DOXYGEN +#if BUILDFLAG(IS_WIN) || DOXYGEN bool InitializeFromString(const base::WStringPiece& string); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) //! \brief Initializes the %UUID using a standard system facility to generate //! the value. @@ -74,22 +74,22 @@ //! with a message logged. bool InitializeWithNew(); -#if defined(OS_WIN) || DOXYGEN +#if BUILDFLAG(IS_WIN) || DOXYGEN //! \brief Initializes the %UUID from a system `UUID` or `GUID` structure. //! //! \param[in] system_uuid A system `UUID` or `GUID` structure. void InitializeFromSystemUUID(const ::UUID* system_uuid); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) //! \brief Formats the %UUID per RFC 4122 §3. //! //! \return A string of the form `"00112233-4455-6677-8899-aabbccddeeff"`. std::string ToString() const; -#if defined(OS_WIN) || DOXYGEN +#if BUILDFLAG(IS_WIN) || DOXYGEN //! \brief The same as ToString, but returned as a wstring. std::wstring ToWString() const; -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) // These fields are laid out according to RFC 4122 §4.1.2. uint32_t data_1;
diff --git a/third_party/crashpad/crashpad/util/misc/uuid_test.cc b/third_party/crashpad/crashpad/util/misc/uuid_test.cc index 28d7ce4..aea126a 100644 --- a/third_party/crashpad/crashpad/util/misc/uuid_test.cc +++ b/third_party/crashpad/crashpad/util/misc/uuid_test.cc
@@ -23,6 +23,7 @@ #include "base/format_macros.h" #include "base/scoped_generic.h" #include "base/strings/stringprintf.h" +#include "build/build_config.h" #include "gtest/gtest.h" namespace crashpad { @@ -231,7 +232,7 @@ uuid.InitializeFromString("5762C15D-50b5-4171-a2e9-7429C9EC6CAB"); EXPECT_EQ(uuid.ToString(), "5762c15d-50b5-4171-a2e9-7429c9ec6cab"); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Test accepting a StringPiece16 via L"" literals on Windows. EXPECT_TRUE( uuid.InitializeFromString(L"F32E5BDC-2681-4C73-A4E6-444FFD44B444")); @@ -240,10 +241,10 @@ EXPECT_TRUE( uuid.InitializeFromString(L"5762C15D-50b5-4171-a2e9-5555C5EC5CAB")); EXPECT_EQ(uuid.ToString(), "5762c15d-50b5-4171-a2e9-5555c5ec5cab"); -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) } -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) TEST(UUID, FromSystem) { ::GUID system_uuid; @@ -268,7 +269,7 @@ EXPECT_EQ(uuid.ToWString(), reinterpret_cast<wchar_t*>(system_string)); } -#endif // OS_WIN +#endif // BUILDFLAG(IS_WIN) } // namespace } // namespace test
diff --git a/third_party/crashpad/crashpad/util/net/http_transport_socket.cc b/third_party/crashpad/crashpad/util/net/http_transport_socket.cc index 4de9280..286c2ab0 100644 --- a/third_party/crashpad/crashpad/util/net/http_transport_socket.cc +++ b/third_party/crashpad/crashpad/util/net/http_transport_socket.cc
@@ -27,6 +27,7 @@ #include "base/scoped_generic.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" +#include "build/build_config.h" #include "util/file/file_io.h" #include "util/net/http_body.h" #include "util/net/url.h" @@ -127,13 +128,13 @@ return false; } } else { -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) if (SSL_CTX_load_verify_locations( ctx_.get(), nullptr, "/etc/ssl/certs") <= 0) { LOG(ERROR) << "SSL_CTX_load_verify_locations"; return false; } -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) if (SSL_CTX_load_verify_locations( ctx_.get(), "/config/ssl/cert.pem", nullptr) <= 0) { LOG(ERROR) << "SSL_CTX_load_verify_locations";
diff --git a/third_party/crashpad/crashpad/util/net/http_transport_test.cc b/third_party/crashpad/crashpad/util/net/http_transport_test.cc index cf53450e..6c13bfa 100644 --- a/third_party/crashpad/crashpad/util/net/http_transport_test.cc +++ b/third_party/crashpad/crashpad/util/net/http_transport_test.cc
@@ -41,7 +41,7 @@ namespace test { namespace { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) std::string ToUTF8IfWin(const std::wstring& x) { return base::WideToUTF8(x); } @@ -70,7 +70,7 @@ scheme_and_host_() { base::FilePath server_path = TestPaths::Executable().DirName().Append( FILE_PATH_LITERAL("http_transport_test_server") -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) FILE_PATH_LITERAL(".exe") #endif ); @@ -361,7 +361,7 @@ } // This should be on for Fuchsia, but DX-382. Debug and re-enabled. -#if defined(CRASHPAD_USE_BORINGSSL) && !defined(OS_FUCHSIA) +#if defined(CRASHPAD_USE_BORINGSSL) && !BUILDFLAG(IS_FUCHSIA) // The test server requires BoringSSL or OpenSSL, so https in tests can only be // enabled where that's readily available. Additionally on Linux, the bots fail // lacking libcrypto.so.1.1, so disabled there for now. On Mac, they could also
diff --git a/third_party/crashpad/crashpad/util/net/http_transport_test_server.cc b/third_party/crashpad/crashpad/util/net/http_transport_test_server.cc index a3bcc6a..4e30cbd 100644 --- a/third_party/crashpad/crashpad/util/net/http_transport_test_server.cc +++ b/third_party/crashpad/crashpad/util/net/http_transport_test_server.cc
@@ -122,13 +122,13 @@ } // namespace } // namespace crashpad -#if defined(OS_POSIX) || defined(OS_FUCHSIA) +#if BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) int main(int argc, char* argv[]) { return crashpad::HttpTransportTestServerMain(argc, argv); } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) int wmain(int argc, wchar_t* argv[]) { return crashpad::ToolSupport::Wmain( argc, argv, crashpad::HttpTransportTestServerMain); } -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX)
diff --git a/third_party/crashpad/crashpad/util/numeric/checked_address_range.cc b/third_party/crashpad/crashpad/util/numeric/checked_address_range.cc index 4ba7ff39..1f5abc2 100644 --- a/third_party/crashpad/crashpad/util/numeric/checked_address_range.cc +++ b/third_party/crashpad/crashpad/util/numeric/checked_address_range.cc
@@ -17,16 +17,17 @@ #include "base/check_op.h" #include "base/format_macros.h" #include "base/strings/stringprintf.h" +#include "build/build_config.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include <mach/mach.h> -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include "util/win/address_types.h" -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include "util/linux/address_types.h" -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) #include <zircon/types.h> -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) namespace crashpad { namespace internal { @@ -126,15 +127,15 @@ } // Explicit instantiations for the cases we use. -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) template class CheckedAddressRangeGeneric<mach_vm_address_t, mach_vm_size_t>; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) template class CheckedAddressRangeGeneric<WinVMAddress, WinVMSize>; -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) template class CheckedAddressRangeGeneric<LinuxVMAddress, LinuxVMSize>; -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) template class CheckedAddressRangeGeneric<zx_vaddr_t, size_t>; -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) } // namespace internal } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/util/posix/close_multiple.cc b/third_party/crashpad/crashpad/util/posix/close_multiple.cc index 8d1543e1..1290d335 100644 --- a/third_party/crashpad/crashpad/util/posix/close_multiple.cc +++ b/third_party/crashpad/crashpad/util/posix/close_multiple.cc
@@ -31,7 +31,7 @@ #include "util/file/directory_reader.h" #include "util/misc/implicit_cast.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include <sys/sysctl.h> #endif @@ -51,7 +51,7 @@ void CloseNowOrOnExec(int fd, bool ebadf_ok) { int rv; -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) // Try to set close-on-exec, to avoid attempting to close a guarded FD with // a close guard set. rv = fcntl(fd, F_SETFD, FD_CLOEXEC); @@ -72,9 +72,9 @@ // This is an advantage over looping over all possible file descriptors, because // no attempt needs to be made to close file descriptors that are not open. bool CloseMultipleNowOrOnExecUsingFDDir(int min_fd, int preserve_fd) { -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) static constexpr char kFDDir[] = "/dev/fd"; -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) static constexpr char kFDDir[] = "/proc/self/fd"; #endif @@ -134,14 +134,15 @@ // bionic/libc/bionic/ndk_cruft.cpp getdtablesize(). int max_fd = implicit_cast<int>(sysconf(_SC_OPEN_MAX)); -#if !defined(OS_ANDROID) +#if !BUILDFLAG(IS_ANDROID) // getdtablesize() was removed effective Android 5.0.0 (API 21). Since it // returns the same thing as the sysconf() above, just skip it. See // https://android.googlesource.com/platform/bionic/+/462abab12b074c62c0999859e65d5a32ebb41951. max_fd = std::max(max_fd, getdtablesize()); #endif -#if !(defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)) || \ +#if !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ + BUILDFLAG(IS_ANDROID)) || \ defined(OPEN_MAX) // Linux does not provide OPEN_MAX. See // https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/include/linux/limits.h?id=77293034696e3e0b6c8b8fc1f96be091104b3d2b. @@ -153,7 +154,7 @@ // while the system is running, but it’s still a better upper bound than the // current RLIMIT_NOFILE value. -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) // See 10.11.6 xnu-3248.60.10/bsd/kern/kern_resource.c maxfilesperproc, // referenced by dosetrlimit(). int oid[] = {CTL_KERN, KERN_MAXFILESPERPROC}; @@ -169,7 +170,7 @@ } else { PLOG(WARNING) << "sysctl"; } -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) // See linux-4.4.27/fs/file.c sysctl_nr_open, referenced by kernel/sys.c // do_prlimit() and kernel/sysctl.c fs_table. Inability to open this file is // not considered an error, because /proc may not be available or usable.
diff --git a/third_party/crashpad/crashpad/util/posix/drop_privileges.cc b/third_party/crashpad/crashpad/util/posix/drop_privileges.cc index 75650d5..82aa1eb 100644 --- a/third_party/crashpad/crashpad/util/posix/drop_privileges.cc +++ b/third_party/crashpad/crashpad/util/posix/drop_privileges.cc
@@ -25,7 +25,7 @@ gid_t gid = getgid(); uid_t uid = getuid(); -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) // Based on the POSIX.1-2008 2013 edition documentation for setreuid() and // setregid(), setreuid() and setregid() alone should be sufficient to drop // privileges. The standard specifies that the saved ID should be set to the @@ -73,7 +73,7 @@ CHECK_EQ(setegid(egid), -1); } } -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) PCHECK(setresgid(gid, gid, gid) == 0) << "setresgid"; PCHECK(setresuid(uid, uid, uid) == 0) << "setresuid";
diff --git a/third_party/crashpad/crashpad/util/posix/process_info.h b/third_party/crashpad/crashpad/util/posix/process_info.h index 7a58788..d3f1c99 100644 --- a/third_party/crashpad/crashpad/util/posix/process_info.h +++ b/third_party/crashpad/crashpad/util/posix/process_info.h
@@ -27,12 +27,12 @@ #include "util/misc/initialization_state.h" #include "util/misc/initialization_state_dcheck.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include <mach/mach.h> #include <sys/sysctl.h> #endif -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include "util/linux/ptrace_connection.h" #endif @@ -47,7 +47,8 @@ ~ProcessInfo(); -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || DOXYGEN +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ + DOXYGEN //! \brief Initializes this object with information about the process whose ID //! is \a pid using a PtraceConnection \a connection. //! @@ -62,9 +63,10 @@ //! //! \return `true` on success, `false` on failure with a message logged. bool InitializeWithPtrace(PtraceConnection* connection); -#endif // OS_LINUX || OS_CHROMEOS || OS_ANDROID || DOXYGEN +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || + // BUILDFLAG(IS_ANDROID) || DOXYGEN -#if defined(OS_APPLE) || DOXYGEN +#if BUILDFLAG(IS_APPLE) || DOXYGEN //! \brief Initializes this object with information about the process whose ID //! is \a pid. //! @@ -169,9 +171,9 @@ bool Arguments(std::vector<std::string>* argv) const; private: -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) kinfo_proc kern_proc_info_; -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) // Some members are marked mutable so that they can be lazily initialized by // const methods. These are always InitializationState-protected so that // multiple successive calls will always produce the same return value and out
diff --git a/third_party/crashpad/crashpad/util/posix/process_info_test.cc b/third_party/crashpad/crashpad/util/posix/process_info_test.cc index 1d9b065..8456b72 100644 --- a/third_party/crashpad/crashpad/util/posix/process_info_test.cc +++ b/third_party/crashpad/crashpad/util/posix/process_info_test.cc
@@ -33,7 +33,7 @@ #include "util/misc/implicit_cast.h" #include "util/string/split_string.h" -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include "util/linux/direct_ptrace_connection.h" #include "test/linux/fake_ptrace_connection.h" #endif @@ -98,7 +98,7 @@ const std::vector<std::string>& expect_argv = GetMainArguments(); -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) // Prior to Linux 4.2, the kernel only allowed reading a single page from // /proc/<pid>/cmdline, causing any further arguments to be truncated. Disable // testing arguments in this case. @@ -124,7 +124,8 @@ argv_size > static_cast<size_t>(getpagesize())) { return; } -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) std::vector<std::string> argv; ASSERT_TRUE(process_info.Arguments(&argv)); @@ -161,18 +162,19 @@ TEST(ProcessInfo, Self) { ProcessInfo process_info; -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) FakePtraceConnection connection; ASSERT_TRUE(connection.Initialize(getpid())); ASSERT_TRUE(process_info.InitializeWithPtrace(&connection)); #else ASSERT_TRUE(process_info.InitializeWithPid(getpid())); -#endif // OS_LINUX || OS_ANDROID || OS_CHROMEOS +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || + // BUILDFLAG(IS_CHROMEOS) TestSelfProcess(process_info); } -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) TEST(ProcessInfo, SelfTask) { ProcessInfo process_info; ASSERT_TRUE(process_info.InitializeWithTask(mach_task_self())); @@ -184,7 +186,7 @@ // PID 1 is expected to be init or the system’s equivalent. This tests reading // information about another process. ProcessInfo process_info; -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) FakePtraceConnection connection; ASSERT_TRUE(connection.Initialize(1)); ASSERT_TRUE(process_info.InitializeWithPtrace(&connection)); @@ -216,7 +218,7 @@ void MultiprocessParent() override { const pid_t pid = ChildPID(); -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) DirectPtraceConnection connection; ASSERT_TRUE(connection.Initialize(pid)); @@ -225,7 +227,8 @@ #else ProcessInfo process_info; ASSERT_TRUE(process_info.InitializeWithPid(pid)); -#endif // OS_LINUX || OS_CHROMEOS || OS_ANDROID +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || + // BUILDFLAG(IS_ANDROID) EXPECT_EQ(process_info.ProcessID(), pid); EXPECT_EQ(process_info.ParentProcessID(), getpid());
diff --git a/third_party/crashpad/crashpad/util/posix/scoped_mmap.cc b/third_party/crashpad/crashpad/util/posix/scoped_mmap.cc index 4438393..1d28581 100644 --- a/third_party/crashpad/crashpad/util/posix/scoped_mmap.cc +++ b/third_party/crashpad/crashpad/util/posix/scoped_mmap.cc
@@ -28,7 +28,7 @@ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. -#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) #include "third_party/lss/lss.h" #endif @@ -36,7 +36,7 @@ // TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is // complete. -#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) void* CallMmap(void* addr, size_t len, int prot,
diff --git a/third_party/crashpad/crashpad/util/posix/signals.cc b/third_party/crashpad/crashpad/util/posix/signals.cc index cd8b87d86..145a433 100644 --- a/third_party/crashpad/crashpad/util/posix/signals.cc +++ b/third_party/crashpad/crashpad/util/posix/signals.cc
@@ -21,8 +21,9 @@ #include "base/check_op.h" #include "base/cxx17_backports.h" #include "base/logging.h" +#include "build/build_config.h" -#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) #include <sys/syscall.h> #endif @@ -50,10 +51,10 @@ #if defined(SIGEMT) SIGEMT, #endif // defined(SIGEMT) -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) SIGXCPU, SIGXFSZ, -#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) }; // These are the non-core-generating but terminating signals. @@ -86,13 +87,13 @@ #if defined(SIGSTKFLT) SIGSTKFLT, #endif // defined(SIGSTKFLT) -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) SIGXCPU, SIGXFSZ, -#endif // defined(OS_APPLE) -#if defined(OS_LINUX) || defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) SIGIO, -#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) }; bool InstallHandlers(const std::vector<int>& signals, @@ -289,7 +290,7 @@ // signals that do not re-raise autonomously), such as signals delivered via // kill() and asynchronous hardware faults such as SEGV_MTEAERR, which would // otherwise be lost when re-raising the signal via raise(). -#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) int retval = syscall(SYS_rt_tgsigqueueinfo, getpid(), syscall(SYS_gettid), @@ -307,7 +308,8 @@ if (errno != EPERM) { _exit(kFailureExitCode); } -#endif // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || + // BUILDFLAG(IS_CHROMEOS) // Explicitly re-raise the signal if it will not re-raise itself. Because // signal handlers normally execute with their signal blocked, this raise()
diff --git a/third_party/crashpad/crashpad/util/posix/signals_test.cc b/third_party/crashpad/crashpad/util/posix/signals_test.cc index 769483c..d9b44de0 100644 --- a/third_party/crashpad/crashpad/util/posix/signals_test.cc +++ b/third_party/crashpad/crashpad/util/posix/signals_test.cc
@@ -33,7 +33,7 @@ #include "test/scoped_temp_dir.h" #include "util/posix/scoped_mmap.h" -#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) #include <sys/auxv.h> #include <sys/prctl.h> @@ -57,7 +57,8 @@ #define PR_MTE_TCF_ASYNC (1UL << 2) #endif #endif // defined(ARCH_CPU_ARM64) -#endif // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_CHROMEOS) +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || + // BUILDFLAG(IS_CHROMEOS) namespace crashpad { namespace test { @@ -89,15 +90,16 @@ #endif // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL) signals.push_back({SIGPIPE, 0}); signals.push_back({SIGSEGV, 0}); -#if (defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_CHROMEOS)) && \ +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || \ + BUILDFLAG(IS_CHROMEOS)) && \ defined(ARCH_CPU_ARM64) if (getauxval(AT_HWCAP2) & HWCAP2_MTE) { signals.push_back({SIGSEGV, SEGV_MTEAERR}); } #endif -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) signals.push_back({SIGSYS, 0}); -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM64) signals.push_back({SIGTRAP, 0}); #endif // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM64) @@ -207,7 +209,8 @@ *i = 0; break; } -#if (defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_CHROMEOS)) && \ +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || \ + BUILDFLAG(IS_CHROMEOS)) && \ defined(ARCH_CPU_ARM64) case SEGV_MTEAERR: { ScopedMmap mapping; @@ -229,13 +232,13 @@ mapping.addr_as<char*>()[1ULL << 56] = 0; break; } -#endif // (defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_CHROMEOS)) && - // defined(ARCH_CPU_ARM64) +#endif // (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || + // BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_ARM64) } break; } -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) case SIGSYS: { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -247,7 +250,7 @@ } break; } -#endif // OS_APPLE +#endif // BUILDFLAG(IS_APPLE) #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM64) case SIGTRAP: { @@ -520,7 +523,7 @@ continue; } -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) if (sig == SIGBUS #if defined(ARCH_CPU_ARM64) || sig == SIGILL || sig == SIGSEGV @@ -533,7 +536,7 @@ // test must be skipped. continue; } -#endif // defined(OS_APPLE) +#endif // BUILDFLAG(IS_APPLE) SignalsTest test(SignalsTest::TestType::kHandlerReraisesToDefault, SignalsTest::SignalSource::kRaise, @@ -552,7 +555,7 @@ continue; } -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) if (sig == SIGBUS #if defined(ARCH_CPU_ARM64) || sig == SIGILL || sig == SIGSEGV @@ -565,7 +568,7 @@ // test must be skipped. continue; } -#endif // defined(OS_APPLE) +#endif // BUILDFLAG(IS_APPLE) SignalsTest test(SignalsTest::TestType::kHandlerReraisesToPrevious, SignalsTest::SignalSource::kRaise,
diff --git a/third_party/crashpad/crashpad/util/posix/symbolic_constants_posix.cc b/third_party/crashpad/crashpad/util/posix/symbolic_constants_posix.cc index 671d963..6bb0896 100644 --- a/third_party/crashpad/crashpad/util/posix/symbolic_constants_posix.cc +++ b/third_party/crashpad/crashpad/util/posix/symbolic_constants_posix.cc
@@ -29,8 +29,10 @@ constexpr const char* kSignalNames[] = { nullptr, -#if defined(OS_APPLE) - // sed -Ene 's/^#define[[:space:]]SIG([[:alnum:]]+)[[:space:]]+[[:digit:]]{1,2}([[:space:]]|$).*/ "\1",/p' +#if BUILDFLAG(IS_APPLE) + // sed -Ene + // 's/^#define[[:space:]]SIG([[:alnum:]]+)[[:space:]]+[[:digit:]]{1,2}([[:space:]]|$).*/ + // "\1",/p' // /usr/include/sys/signal.h // and fix up by removing the entry for SIGPOLL. "HUP", @@ -64,7 +66,7 @@ "INFO", "USR1", "USR2", -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #if defined(ARCH_CPU_MIPS_FAMILY) "HUP", "INT", @@ -135,7 +137,7 @@ #endif // defined(ARCH_CPU_MIPS_FAMILY) #endif }; -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) // NSIG is 64 to account for real-time signals. static_assert(base::size(kSignalNames) == 32, "kSignalNames length"); #else
diff --git a/third_party/crashpad/crashpad/util/posix/symbolic_constants_posix_test.cc b/third_party/crashpad/crashpad/util/posix/symbolic_constants_posix_test.cc index 61d75e28..d59d46c 100644 --- a/third_party/crashpad/crashpad/util/posix/symbolic_constants_posix_test.cc +++ b/third_party/crashpad/crashpad/util/posix/symbolic_constants_posix_test.cc
@@ -35,38 +35,23 @@ const char* full_name; const char* short_name; } kSignalTestData[] = { - {SIGABRT, "SIGABRT", "ABRT"}, - {SIGALRM, "SIGALRM", "ALRM"}, - {SIGBUS, "SIGBUS", "BUS"}, - {SIGCHLD, "SIGCHLD", "CHLD"}, - {SIGCONT, "SIGCONT", "CONT"}, - {SIGFPE, "SIGFPE", "FPE"}, - {SIGHUP, "SIGHUP", "HUP"}, - {SIGILL, "SIGILL", "ILL"}, - {SIGINT, "SIGINT", "INT"}, - {SIGIO, "SIGIO", "IO"}, - {SIGKILL, "SIGKILL", "KILL"}, - {SIGPIPE, "SIGPIPE", "PIPE"}, - {SIGPROF, "SIGPROF", "PROF"}, - {SIGQUIT, "SIGQUIT", "QUIT"}, - {SIGSEGV, "SIGSEGV", "SEGV"}, - {SIGSTOP, "SIGSTOP", "STOP"}, - {SIGSYS, "SIGSYS", "SYS"}, - {SIGTERM, "SIGTERM", "TERM"}, - {SIGTRAP, "SIGTRAP", "TRAP"}, - {SIGTSTP, "SIGTSTP", "TSTP"}, - {SIGTTIN, "SIGTTIN", "TTIN"}, - {SIGTTOU, "SIGTTOU", "TTOU"}, - {SIGURG, "SIGURG", "URG"}, - {SIGUSR1, "SIGUSR1", "USR1"}, - {SIGUSR2, "SIGUSR2", "USR2"}, - {SIGVTALRM, "SIGVTALRM", "VTALRM"}, - {SIGWINCH, "SIGWINCH", "WINCH"}, - {SIGXCPU, "SIGXCPU", "XCPU"}, -#if defined(OS_APPLE) - {SIGEMT, "SIGEMT", "EMT"}, - {SIGINFO, "SIGINFO", "INFO"}, -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) + {SIGABRT, "SIGABRT", "ABRT"}, {SIGALRM, "SIGALRM", "ALRM"}, + {SIGBUS, "SIGBUS", "BUS"}, {SIGCHLD, "SIGCHLD", "CHLD"}, + {SIGCONT, "SIGCONT", "CONT"}, {SIGFPE, "SIGFPE", "FPE"}, + {SIGHUP, "SIGHUP", "HUP"}, {SIGILL, "SIGILL", "ILL"}, + {SIGINT, "SIGINT", "INT"}, {SIGIO, "SIGIO", "IO"}, + {SIGKILL, "SIGKILL", "KILL"}, {SIGPIPE, "SIGPIPE", "PIPE"}, + {SIGPROF, "SIGPROF", "PROF"}, {SIGQUIT, "SIGQUIT", "QUIT"}, + {SIGSEGV, "SIGSEGV", "SEGV"}, {SIGSTOP, "SIGSTOP", "STOP"}, + {SIGSYS, "SIGSYS", "SYS"}, {SIGTERM, "SIGTERM", "TERM"}, + {SIGTRAP, "SIGTRAP", "TRAP"}, {SIGTSTP, "SIGTSTP", "TSTP"}, + {SIGTTIN, "SIGTTIN", "TTIN"}, {SIGTTOU, "SIGTTOU", "TTOU"}, + {SIGURG, "SIGURG", "URG"}, {SIGUSR1, "SIGUSR1", "USR1"}, + {SIGUSR2, "SIGUSR2", "USR2"}, {SIGVTALRM, "SIGVTALRM", "VTALRM"}, + {SIGWINCH, "SIGWINCH", "WINCH"}, {SIGXCPU, "SIGXCPU", "XCPU"}, +#if BUILDFLAG(IS_APPLE) + {SIGEMT, "SIGEMT", "EMT"}, {SIGINFO, "SIGINFO", "INFO"}, +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) {SIGPWR, "SIGPWR", "PWR"}, #if !defined(ARCH_CPU_MIPS_FAMILY) {SIGSTKFLT, "SIGSTKFLT", "STKFLT"}, @@ -123,7 +108,7 @@ kSignalTestData[index].short_name); } -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) // NSIG is 64 to account for real-time signals. constexpr int kSignalCount = 32; #else
diff --git a/third_party/crashpad/crashpad/util/process/process_id.h b/third_party/crashpad/crashpad/util/process/process_id.h index 113f6fc..0d8273cc7 100644 --- a/third_party/crashpad/crashpad/util/process/process_id.h +++ b/third_party/crashpad/crashpad/util/process/process_id.h
@@ -20,27 +20,27 @@ #include "base/format_macros.h" #include "build/build_config.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #include <sys/types.h> -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) #include <zircon/types.h> #endif namespace crashpad { -#if defined(OS_POSIX) || DOXYGEN +#if BUILDFLAG(IS_POSIX) || DOXYGEN //! \brief Alias for platform-specific type to represent a process. using ProcessID = pid_t; constexpr ProcessID kInvalidProcessID = -1; static_assert(std::is_same<ProcessID, int>::value, "Port."); #define PRI_PROCESS_ID "d" -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) using ProcessID = DWORD; constexpr ProcessID kInvalidProcessID = 0; #define PRI_PROCESS_ID "lu" -#elif defined(OS_FUCHSIA) +#elif BUILDFLAG(IS_FUCHSIA) using ProcessID = zx_koid_t; constexpr ProcessID kInvalidProcessID = ZX_KOID_INVALID; static_assert(std::is_same<ProcessID, int64_t>::value, "Port.");
diff --git a/third_party/crashpad/crashpad/util/process/process_memory.h b/third_party/crashpad/crashpad/util/process/process_memory.h index eeb78e9..d7e6543 100644 --- a/third_party/crashpad/crashpad/util/process/process_memory.h +++ b/third_party/crashpad/crashpad/util/process/process_memory.h
@@ -22,10 +22,10 @@ #include "build/build_config.h" #include "util/misc/address_types.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <basetsd.h> typedef SSIZE_T ssize_t; -#endif // defined(OS_WIN) +#endif // BUILDFLAG(IS_WIN) namespace crashpad {
diff --git a/third_party/crashpad/crashpad/util/process/process_memory_native.h b/third_party/crashpad/crashpad/util/process/process_memory_native.h index 5a792d7..c3b94e8 100644 --- a/third_party/crashpad/crashpad/util/process/process_memory_native.h +++ b/third_party/crashpad/crashpad/util/process/process_memory_native.h
@@ -14,26 +14,26 @@ #include "build/build_config.h" -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) #include "util/process/process_memory_fuchsia.h" -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #include "util/process/process_memory_linux.h" -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include "util/process/process_memory_win.h" -#elif defined(OS_APPLE) +#elif BUILDFLAG(IS_APPLE) #include "util/process/process_memory_mac.h" #endif namespace crashpad { -#if defined(OS_FUCHSIA) || DOXYGEN +#if BUILDFLAG(IS_FUCHSIA) || DOXYGEN //! \brief Alias for platform-specific native implementation of ProcessMemory. using ProcessMemoryNative = ProcessMemoryFuchsia; -#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) using ProcessMemoryNative = ProcessMemoryLinux; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) using ProcessMemoryNative = ProcessMemoryWin; -#elif defined(OS_APPLE) +#elif BUILDFLAG(IS_APPLE) using ProcessMemoryNative = ProcessMemoryMac; #else #error Port.
diff --git a/third_party/crashpad/crashpad/util/process/process_memory_range_test.cc b/third_party/crashpad/crashpad/util/process/process_memory_range_test.cc index 2e34665..78ad81f 100644 --- a/third_party/crashpad/crashpad/util/process/process_memory_range_test.cc +++ b/third_party/crashpad/crashpad/util/process/process_memory_range_test.cc
@@ -23,7 +23,7 @@ #include "util/misc/from_pointer_cast.h" #include "util/process/process_memory_native.h" -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #include "test/linux/fake_ptrace_connection.h" #endif @@ -43,14 +43,15 @@ constexpr bool is_64_bit = false; #endif // ARCH_CPU_64_BITS -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) FakePtraceConnection connection; ASSERT_TRUE(connection.Initialize(GetSelfProcess())); ProcessMemoryLinux memory(&connection); #else ProcessMemoryNative memory; ASSERT_TRUE(memory.Initialize(GetSelfProcess())); -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) ProcessMemoryRange range; ASSERT_TRUE(range.Initialize(&memory, is_64_bit));
diff --git a/third_party/crashpad/crashpad/util/process/process_memory_sanitized_test.cc b/third_party/crashpad/crashpad/util/process/process_memory_sanitized_test.cc index b88eab13..03eee91 100644 --- a/third_party/crashpad/crashpad/util/process/process_memory_sanitized_test.cc +++ b/third_party/crashpad/crashpad/util/process/process_memory_sanitized_test.cc
@@ -14,12 +14,13 @@ #include "util/process/process_memory_sanitized.h" +#include "build/build_config.h" #include "gtest/gtest.h" #include "test/process_type.h" #include "util/misc/from_pointer_cast.h" #include "util/process/process_memory_native.h" -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #include "test/linux/fake_ptrace_connection.h" #endif @@ -28,14 +29,15 @@ namespace { TEST(ProcessMemorySanitized, DenyDisallowedMemory) { -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) FakePtraceConnection connection; ASSERT_TRUE(connection.Initialize(GetSelfProcess())); ProcessMemoryLinux memory(&connection); #else ProcessMemoryNative memory; ASSERT_TRUE(memory.Initialize(GetSelfProcess())); -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) char c = 42; char out; @@ -51,14 +53,15 @@ } TEST(ProcessMemorySanitized, AllowedMemory) { -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) FakePtraceConnection connection; ASSERT_TRUE(connection.Initialize(GetSelfProcess())); ProcessMemoryLinux memory(&connection); #else ProcessMemoryNative memory; ASSERT_TRUE(memory.Initialize(GetSelfProcess())); -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) char str[4] = "ABC"; char out[4];
diff --git a/third_party/crashpad/crashpad/util/process/process_memory_test.cc b/third_party/crashpad/crashpad/util/process/process_memory_test.cc index fe9971bc..17df85de 100644 --- a/third_party/crashpad/crashpad/util/process/process_memory_test.cc +++ b/third_party/crashpad/crashpad/util/process/process_memory_test.cc
@@ -30,14 +30,15 @@ #include "util/misc/from_pointer_cast.h" #include "util/process/process_memory_native.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include "test/mac/mach_multiprocess.h" -#endif // defined(OS_APPLE) +#endif // BUILDFLAG(IS_APPLE) -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #include "test/linux/fake_ptrace_connection.h" #include "util/linux/direct_ptrace_connection.h" -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) namespace crashpad { namespace test { @@ -47,7 +48,7 @@ // port which requires root or a code signing entitlement. To account for this // we implement an adaptor class that wraps MachMultiprocess on macOS, because // it shares the child's task port, and makes it behave like MultiprocessExec. -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) class MultiprocessAdaptor : public MachMultiprocess { public: void SetChildTestMainFunction(const std::string& function_name) { @@ -102,7 +103,7 @@ void MultiprocessParent() override { Parent(); } }; -#endif // defined(OS_APPLE) +#endif // BUILDFLAG(IS_APPLE) void DoChildReadTestSetup(size_t* region_size, std::unique_ptr<char[]>* region) { @@ -156,14 +157,15 @@ } void DoTest(ProcessType process, size_t region_size, VMAddress address) { -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) FakePtraceConnection connection; ASSERT_TRUE(connection.Initialize(process)); ProcessMemoryLinux memory(&connection); #else ProcessMemoryNative memory; ASSERT_TRUE(memory.Initialize(process)); -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) std::unique_ptr<char[]> result(new char[region_size]); @@ -343,14 +345,15 @@ VMAddress local_empty_address, VMAddress local_short_address, VMAddress long_string_address) { -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) FakePtraceConnection connection; ASSERT_TRUE(connection.Initialize(process)); ProcessMemoryLinux memory(&connection); #else ProcessMemoryNative memory; ASSERT_TRUE(memory.Initialize(process)); -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) Compare(memory, const_empty_address, kConstCharEmpty); Compare(memory, const_short_address, kConstCharShort); @@ -421,14 +424,15 @@ } void DoTest(ProcessType process, VMAddress address) { -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) DirectPtraceConnection connection; ASSERT_TRUE(connection.Initialize(process)); ProcessMemoryLinux memory(&connection); #else ProcessMemoryNative memory; ASSERT_TRUE(memory.Initialize(process)); -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) VMAddress page_addr1 = address; VMAddress page_addr2 = page_addr1 + base::GetPageSize(); @@ -554,14 +558,15 @@ void DoTest(ProcessType process, const std::vector<StringDataInChildProcess>& strings) { -#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) DirectPtraceConnection connection; ASSERT_TRUE(connection.Initialize(process)); ProcessMemoryLinux memory(&connection); #else ProcessMemoryNative memory; ASSERT_TRUE(memory.Initialize(process)); -#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) std::string result; result.reserve(kChildProcessStringLength + 1);
diff --git a/third_party/crashpad/crashpad/util/stdlib/aligned_allocator.cc b/third_party/crashpad/crashpad/util/stdlib/aligned_allocator.cc index 797a3ac..8f01c69 100644 --- a/third_party/crashpad/crashpad/util/stdlib/aligned_allocator.cc +++ b/third_party/crashpad/crashpad/util/stdlib/aligned_allocator.cc
@@ -18,12 +18,12 @@ #include "build/build_config.h" -#if defined(OS_POSIX) || defined(_LIBCPP_STD_VER) +#if BUILDFLAG(IS_POSIX) || defined(_LIBCPP_STD_VER) #include <stdlib.h> -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <malloc.h> #include <xutility> -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) namespace { @@ -31,12 +31,12 @@ // library to do so. This works even if C++ exceptions are disabled, causing // program termination if uncaught. void ThrowBadAlloc() { -#if defined(OS_POSIX) || defined(_LIBCPP_STD_VER) +#if BUILDFLAG(IS_POSIX) || defined(_LIBCPP_STD_VER) // This works with both libc++ and libstdc++. std::__throw_bad_alloc(); -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) std::_Xbad_alloc(); -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) } } // namespace @@ -44,7 +44,7 @@ namespace crashpad { void* AlignedAllocate(size_t alignment, size_t size) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) // posix_memalign() requires that alignment be at least sizeof(void*), so the // power-of-2 check needs to happen before potentially changing the alignment. if (alignment == 0 || alignment & (alignment - 1)) { @@ -55,22 +55,22 @@ if (posix_memalign(&pointer, std::max(alignment, sizeof(void*)), size) != 0) { ThrowBadAlloc(); } -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) void* pointer = _aligned_malloc(size, alignment); if (pointer == nullptr) { ThrowBadAlloc(); } -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) return pointer; } void AlignedFree(void* pointer) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) free(pointer); -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) _aligned_free(pointer); -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) } } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/util/stdlib/aligned_allocator_test.cc b/third_party/crashpad/crashpad/util/stdlib/aligned_allocator_test.cc index 40e14e8..ed58d2b9 100644 --- a/third_party/crashpad/crashpad/util/stdlib/aligned_allocator_test.cc +++ b/third_party/crashpad/crashpad/util/stdlib/aligned_allocator_test.cc
@@ -20,7 +20,7 @@ #include "gtest/gtest.h" #include "test/gtest_death.h" -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) #include <crtdbg.h> #endif @@ -91,7 +91,7 @@ } void BadAlignmentTest() { -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) // Suppress the assertion MessageBox() normally displayed by the CRT in debug // mode. In release mode, _CrtSetReportMode() is #defined to ((int)0), so // |previous| would appear unused, thus the [[maybe_unused]]. @@ -103,7 +103,7 @@ AlignedVector<int, 7> bad_aligned_vector; bad_aligned_vector.push_back(0); -#if defined(OS_WIN) +#if BUILDFLAG(IS_WIN) _CrtSetReportMode(_CRT_ASSERT, previous); #endif }
diff --git a/third_party/crashpad/crashpad/util/stdlib/strnlen.cc b/third_party/crashpad/crashpad/util/stdlib/strnlen.cc index 872c0eb..296b131 100644 --- a/third_party/crashpad/crashpad/util/stdlib/strnlen.cc +++ b/third_party/crashpad/crashpad/util/stdlib/strnlen.cc
@@ -14,7 +14,9 @@ #include "util/stdlib/strnlen.h" -#if defined(OS_MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_7 +#include "build/build_config.h" + +#if BUILDFLAG(IS_MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_7 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_7 // Redeclare a method only available on Mac OS X 10.7 and later to suppress a
diff --git a/third_party/crashpad/crashpad/util/stdlib/strnlen.h b/third_party/crashpad/crashpad/util/stdlib/strnlen.h index 59253b7..9fa447c 100644 --- a/third_party/crashpad/crashpad/util/stdlib/strnlen.h +++ b/third_party/crashpad/crashpad/util/stdlib/strnlen.h
@@ -20,7 +20,7 @@ #include "build/build_config.h" -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include <Availability.h> #endif @@ -38,7 +38,7 @@ //! and not all systems’ standard libraries provide an implementation. size_t strnlen(const char* string, size_t max_length); -#if !defined(OS_MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_7 +#if !BUILDFLAG(IS_MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_7 inline size_t strnlen(const char* string, size_t max_length) { return ::strnlen(string, max_length); }
diff --git a/third_party/crashpad/crashpad/util/synchronization/semaphore.h b/third_party/crashpad/crashpad/util/synchronization/semaphore.h index 308b29b0..1bb9e218 100644 --- a/third_party/crashpad/crashpad/util/synchronization/semaphore.h +++ b/third_party/crashpad/crashpad/util/synchronization/semaphore.h
@@ -19,11 +19,11 @@ #include "build/build_config.h" -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) #include <dispatch/dispatch.h> -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) #include <condition_variable> #include <mutex> #else @@ -76,11 +76,11 @@ void Signal(); private: -#if defined(OS_APPLE) +#if BUILDFLAG(IS_APPLE) dispatch_semaphore_t semaphore_; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) HANDLE semaphore_; -#elif defined(OS_ANDROID) +#elif BUILDFLAG(IS_ANDROID) std::condition_variable cv_; std::mutex mutex_; int value_;
diff --git a/third_party/crashpad/crashpad/util/synchronization/semaphore_posix.cc b/third_party/crashpad/crashpad/util/synchronization/semaphore_posix.cc index ebe62a4..9e55ede 100644 --- a/third_party/crashpad/crashpad/util/synchronization/semaphore_posix.cc +++ b/third_party/crashpad/crashpad/util/synchronization/semaphore_posix.cc
@@ -23,11 +23,12 @@ #include "base/check_op.h" #include "base/logging.h" #include "base/posix/eintr_wrapper.h" +#include "build/build_config.h" #include "util/misc/time.h" namespace crashpad { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) Semaphore::Semaphore(int value) : cv_(), mutex_(), value_(value) {} @@ -63,7 +64,7 @@ cv_.notify_one(); } -#elif !defined(OS_APPLE) +#elif !BUILDFLAG(IS_APPLE) Semaphore::Semaphore(int value) { PCHECK(sem_init(&semaphore_, 0, value) == 0) << "sem_init"; @@ -104,6 +105,6 @@ PCHECK(sem_post(&semaphore_) == 0) << "sem_post"; } -#endif // OS_ANDROID +#endif // BUILDFLAG(IS_ANDROID) } // namespace crashpad
diff --git a/third_party/crashpad/crashpad/util/synchronization/semaphore_test.cc b/third_party/crashpad/crashpad/util/synchronization/semaphore_test.cc index 5cb91e4..08fc9e6 100644 --- a/third_party/crashpad/crashpad/util/synchronization/semaphore_test.cc +++ b/third_party/crashpad/crashpad/util/synchronization/semaphore_test.cc
@@ -17,11 +17,12 @@ #include <sys/types.h> #include "base/cxx17_backports.h" +#include "build/build_config.h" #include "gtest/gtest.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #include <pthread.h> -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) namespace crashpad { namespace test { @@ -60,50 +61,50 @@ } struct ThreadMainInfo { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) pthread_t pthread; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) HANDLE thread; #endif Semaphore* semaphore; size_t iterations; }; -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) void* -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) DWORD WINAPI -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) ThreadMain(void* argument) { ThreadMainInfo* info = reinterpret_cast<ThreadMainInfo*>(argument); for (size_t iteration = 0; iteration < info->iterations; ++iteration) { info->semaphore->Wait(); } -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) return nullptr; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) return 0; -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) } void StartThread(ThreadMainInfo* info) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) int rv = pthread_create(&info->pthread, nullptr, ThreadMain, info); ASSERT_EQ(rv, 0) << "pthread_create"; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) info->thread = CreateThread(nullptr, 0, ThreadMain, info, 0, nullptr); ASSERT_NE(info->thread, nullptr) << "CreateThread"; -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) } void JoinThread(ThreadMainInfo* info) { -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) int rv = pthread_join(info->pthread, nullptr); EXPECT_EQ(rv, 0) << "pthread_join"; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) DWORD result = WaitForSingleObject(info->thread, INFINITE); EXPECT_EQ(result, WAIT_OBJECT_0) << "WaitForSingleObject"; -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) } TEST(Semaphore, Threaded) {
diff --git a/third_party/crashpad/crashpad/util/thread/thread.h b/third_party/crashpad/crashpad/util/thread/thread.h index e06ca3c..25fccb8 100644 --- a/third_party/crashpad/crashpad/util/thread/thread.h +++ b/third_party/crashpad/crashpad/util/thread/thread.h
@@ -17,11 +17,11 @@ #include "build/build_config.h" -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) #include <pthread.h> -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) #include <windows.h> -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) namespace crashpad { @@ -49,16 +49,16 @@ virtual void ThreadMain() = 0; static -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) void* -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) DWORD WINAPI -#endif // OS_POSIX +#endif // BUILDFLAG(IS_POSIX) ThreadEntryThunk(void* argument); -#if defined(OS_POSIX) +#if BUILDFLAG(IS_POSIX) pthread_t platform_thread_; -#elif defined(OS_WIN) +#elif BUILDFLAG(IS_WIN) HANDLE platform_thread_; #endif };
diff --git a/third_party/crashpad/crashpad/util/thread/worker_thread_test.cc b/third_party/crashpad/crashpad/util/thread/worker_thread_test.cc index 811d09c..86f8474 100644 --- a/third_party/crashpad/crashpad/util/thread/worker_thread_test.cc +++ b/third_party/crashpad/crashpad/util/thread/worker_thread_test.cc
@@ -14,6 +14,7 @@ #include "util/thread/worker_thread.h" +#include "build/build_config.h" #include "gtest/gtest.h" #include "util/misc/clock.h" #include "util/synchronization/semaphore.h" @@ -78,7 +79,7 @@ // also somewhat useful. The expected time "should" be ~40-50ms with a work // interval of 0.05s, but on Fuchsia, 1200ms was observed. So, on Fuchsia, use a // much larger timeout. See https://crashpad.chromium.org/bug/231. -#if defined(OS_FUCHSIA) +#if BUILDFLAG(IS_FUCHSIA) constexpr uint64_t kUpperBoundTime = 10; #else constexpr uint64_t kUpperBoundTime = 1;
diff --git a/third_party/fdlibm/chromium/0001-Import-a-copy-of-V8-s-fdlibm-fork-into-Chromium-thir.patch b/third_party/fdlibm/chromium/0001-Import-a-copy-of-V8-s-fdlibm-fork-into-Chromium-thir.patch index 395c5941..24d08234 100644 --- a/third_party/fdlibm/chromium/0001-Import-a-copy-of-V8-s-fdlibm-fork-into-Chromium-thir.patch +++ b/third_party/fdlibm/chromium/0001-Import-a-copy-of-V8-s-fdlibm-fork-into-Chromium-thir.patch
@@ -65,7 +65,7 @@ index 000000000000..a94f56d77fbf --- /dev/null +++ b/third_party/fdlibm/DEPS -@@ -0,0 +1,6 @@ +@@ -0,0 +1,5 @@ +include_rules = [ + "+base/bit_cast.h", + "+base/compiler_specific.h", @@ -75,13 +75,14 @@ index eb45e2ab9438..48b3ab4bc6cc 100644 --- a/third_party/fdlibm/README.chromium +++ b/third_party/fdlibm/README.chromium -@@ -13,3 +13,13 @@ This library is a copy of that V8 library intended for use in Chromium. +@@ -13,3 +13,15 @@ This library is a copy of that V8 library intended for use in Chromium. This library may be useful when mathematical consistency across OS platforms is desired. + +The initial commit is not a pristine import -- the patch in the chromium/ -+subdirectory documents the changes made to the original sources. ++subdirectory documents the changes made to the original sources. This patch was ++produced via `git format-patch` and can be applied using `git am`. + +Changes from V8 upstream: +- Changed namespace to fdlibm. @@ -89,6 +90,7 @@ +- Implement 32-bit float functions (sinf(), etc.) by calling the 64-bit + versions. +- Format the code. ++- Remove MSVC code, which is not supported by Chromium anymore. diff --git a/third_party/fdlibm/ieee754.cc b/third_party/fdlibm/ieee754.cc index 1706b56dfd90..4825b22fc6f5 100644 --- a/third_party/fdlibm/ieee754.cc @@ -98,7 +100,7 @@ // The following is adapted from fdlibm (http://www.netlib.org/fdlibm). // // ==================================================== -@@ -12,30 +13,23 @@ +@@ -12,30 +13,22 @@ // The original source code covered by the above license above has been // modified significantly by Google Inc. // Copyright 2016 the V8 project authors. All rights reserved. @@ -382,7 +384,7 @@ index 14dcfb10de1a..815fa624ce11 100644 --- a/third_party/fdlibm/overflowing-math.h +++ b/third_party/fdlibm/overflowing-math.h -@@ -1,19 +1,19 @@ +@@ -1,19 +1,17 @@ // Copyright 2019 the V8 project authors. All rights reserved. +// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be @@ -399,7 +401,7 @@ #include <type_traits> -#include "src/base/macros.h" - +- -namespace v8 { -namespace base { +namespace fdlibm {
diff --git a/third_party/liburlpattern/tokenize.cc b/third_party/liburlpattern/tokenize.cc index cbc38dc..b9e48f0 100644 --- a/third_party/liburlpattern/tokenize.cc +++ b/third_party/liburlpattern/tokenize.cc
@@ -5,7 +5,6 @@ #include "third_party/liburlpattern/tokenize.h" -#include "base/compiler_specific.h" #include "third_party/abseil-cpp/absl/strings/str_format.h" #include "third_party/icu/source/common/unicode/uchar.h" #include "third_party/icu/source/common/unicode/utf8.h" @@ -242,7 +241,7 @@ // `codepoint_`. In addition, `next_index_` is updated to the codepoint to be // read next. Returns true iff the codepoint was read successfully. On // success, `codepoint_` is non-negative. - bool Next() WARN_UNUSED_RESULT { + [[nodiscard]] bool Next() { U8_NEXT(pattern_.data(), next_index_, pattern_.size(), codepoint_); return codepoint_ >= 0; } @@ -251,7 +250,7 @@ // `codepoint_`. In addition, `next_index_` is updated to the codepoint to be // read next. Returns true iff the codepoint was read successfully. On // success, `codepoint_` is non-negative. - bool NextAt(size_t index) WARN_UNUSED_RESULT { + [[nodiscard]] bool NextAt(size_t index) { next_index_ = index; return Next(); }
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index e06b32d..7162e3c 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -98,7 +98,7 @@ # This bot must use the gpu_tests mixin to match 'Android FYI Release (Nexus 5X)' # on the chromium.gpu waterfall, which it mirrors via trybots.pyl. - 'android-marshmallow-arm64-rel': 'gpu_tests_android_release_bot_minimal_symbols_arm64_fastbuild', + 'android-marshmallow-arm64-rel': 'gpu_tests_android_release_bot_minimal_symbols_arm64_fastbuild_reclient', 'android-marshmallow-x86-rel': 'android_release_bot_minimal_symbols_x86_fastbuild_resource_allowlisting_webview_google', 'android-marshmallow-x86-rel-non-cq': 'android_release_bot_minimal_symbols_x86_fastbuild_resource_allowlisting_webview_google', @@ -2253,6 +2253,12 @@ 'webview_google', ], + 'gpu_tests_android_release_bot_minimal_symbols_arm64_fastbuild_reclient': [ + 'gpu_tests', 'android', 'release_bot_reclient', 'minimal_symbols', 'arm64', + 'resource_allowlisting', 'static_angle', 'android_fastbuild', + 'webview_google', + ], + 'gpu_tests_android_release_bot_minimal_symbols_arm64_fastbuild_java_coverage': [ 'gpu_tests', 'android', 'release_bot', 'minimal_symbols', 'arm64', 'resource_allowlisting', 'static_angle', 'android_fastbuild', 'webview_google',
diff --git a/tools/mb/mb_config_expectations/chromium.android.json b/tools/mb/mb_config_expectations/chromium.android.json index 5b86ecb..b415978 100644 --- a/tools/mb/mb_config_expectations/chromium.android.json +++ b/tools/mb/mb_config_expectations/chromium.android.json
@@ -429,7 +429,8 @@ "target_cpu": "arm64", "target_os": "android", "use_errorprone_java_compiler": false, - "use_goma": true, + "use_rbe": true, + "use_remoteexec": true, "use_static_angle": true } },
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index 7a48b19..2e67f1b 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -32065,7 +32065,7 @@ <action name="WindowDrag_Maximize"> <owner>sammiequon@chromium.org</owner> - <owner>tclaiborne@chromium.org</owner> + <owner>shidi@chromium.org</owner> <description> Tracks if a window has been snapped to maximized state by dragging the window to the top of the screen. @@ -32074,7 +32074,7 @@ <action name="WindowDrag_MaximizeLeft"> <owner>sammiequon@chromium.org</owner> - <owner>tclaiborne@chromium.org</owner> + <owner>shidi@chromium.org</owner> <description> Tracks if a window has been snapped to to the left by dragging the window to the left side of the screen. @@ -32083,13 +32083,31 @@ <action name="WindowDrag_MaximizeRight"> <owner>sammiequon@chromium.org</owner> - <owner>tclaiborne@chromium.org</owner> + <owner>shidi@chromium.org</owner> <description> Tracks if a window has been snapped to to the right by dragging the window to the right side of the screen. </description> </action> +<action name="WindowDrag_Unmaximize"> + <owner>sammiequon@chromium.org</owner> + <owner>shidi@chromium.org</owner> + <description> + Tracks if a window has been unmaximized by dragging down on the title bar of + a maximized window. + </description> +</action> + +<action name="WindowDrag_Unsnap"> + <owner>sammiequon@chromium.org</owner> + <owner>shidi@chromium.org</owner> + <description> + Tracks if a window has been unsnapped by dragging down on the title bar of a + snapped window. + </description> +</action> + <action name="WindowNaming_Cleared"> <owner>ellyjones@chromium.org</owner> <description>
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 8f74977c..bf012e59 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -52772,6 +52772,7 @@ <int value="-671992446" label="TranslateRankerEnforcement:disabled"/> <int value="-670188266" label="enable-zip-archiver-unpacker"/> <int value="-669761849" label="SplitSettings:disabled"/> + <int value="-669400536" label="FastPairSoftwareScanning:disabled"/> <int value="-668114930" label="WindowsFollowCursor:disabled"/> <int value="-667517406" label="overscroll-history-navigation"/> <int value="-667018797" @@ -54639,6 +54640,7 @@ <int value="710700286" label="ImmersiveFullscreen:disabled"/> <int value="711424932" label="enable-cloud-print-xps"/> <int value="713946324" label="OmniboxSearchReadyIncognito:disabled"/> + <int value="714871827" label="FastPairSoftwareScanning:enabled"/> <int value="715617684" label="OriginTrials:disabled"/> <int value="716073306" label="AssistantVoiceMatch:disabled"/> <int value="716080990" label="restrict-iframe-permissions"/> @@ -70025,6 +70027,11 @@ <int value="3" label="REPEATED_IGNORES"/> </enum> +<enum name="PermissionPredictionSource"> + <int value="0" label="ON_DEVICE"/> + <int value="1" label="SERVER_SIDE"/> +</enum> + <enum name="PermissionPromptDispositionReason"> <int value="0" label="User preference in settings"/> <int value="1" label="Safe Browsing verdict"/>
diff --git a/tools/metrics/histograms/metadata/ash/histograms.xml b/tools/metrics/histograms/metadata/ash/histograms.xml index dd89922..d759e5d 100644 --- a/tools/metrics/histograms/metadata/ash/histograms.xml +++ b/tools/metrics/histograms/metadata/ash/histograms.xml
@@ -1011,7 +1011,7 @@ </histogram> <histogram name="Ash.Desks.AnimationSmoothness.DeskEndGesture" units="%" - expires_after="2022-08-03"> + expires_after="2023-01-10"> <owner>afakhry@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> @@ -1269,7 +1269,7 @@ </histogram> <histogram name="Ash.Desks.PresentationTime.UpdateGesture" units="ms" - expires_after="2022-03-27"> + expires_after="2023-01-10"> <owner>afakhry@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> @@ -1283,7 +1283,7 @@ </histogram> <histogram name="Ash.Desks.PresentationTime.UpdateGesture.MaxLatency" - units="ms" expires_after="2022-08-03"> + units="ms" expires_after="2023-01-10"> <owner>afakhry@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> @@ -1662,7 +1662,7 @@ </histogram> <histogram name="Ash.Homescreen.AnimationSmoothness" units="%" - expires_after="2020-08-01"> + expires_after="2023-01-10"> <owner>sammiequon@chromium.org</owner> <owner>tbarzic@chromium.org</owner> <summary> @@ -2316,7 +2316,7 @@ </histogram> <histogram name="Ash.Overview.Scroll.PresentationTime.MaxLatency.TabletMode" - units="ms" expires_after="2021-12-31"> + units="ms" expires_after="2023-01-10"> <owner>sammiequon@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> <summary> @@ -2326,7 +2326,7 @@ </histogram> <histogram name="Ash.Overview.Scroll.PresentationTime.TabletMode" units="ms" - expires_after="2022-04-17"> + expires_after="2023-01-10"> <owner>sammiequon@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> <summary> @@ -3277,7 +3277,7 @@ <histogram name="Ash.SplitViewResize.PresentationTime.MaxLatency{SplitViewResizeModes}" - units="ms" expires_after="2022-10-12"> + units="ms" expires_after="2023-01-10"> <owner>amusbach@chromium.org</owner> <owner>xdai@chromium.org</owner> <owner>omrilio@chromium.org</owner> @@ -3447,7 +3447,7 @@ </histogram> <histogram name="Ash.TabletMode.AnimationSmoothness.Enter" units="%" - expires_after="2022-04-17"> + expires_after="2023-01-10"> <owner>oshima@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <summary> @@ -3458,7 +3458,7 @@ </histogram> <histogram name="Ash.TabletMode.AnimationSmoothness.Exit" units="%" - expires_after="2022-04-24"> + expires_after="2023-01-10"> <owner>oshima@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <summary> @@ -3780,7 +3780,8 @@ </histogram> <histogram name="Ash.Window.AnimationSmoothness.CrossFade" units="%" - expires_after="2022-04-10"> + expires_after="2023-01-10"> + <owner>sammiequon@chromium.org</owner> <owner>wutao@chromium.org</owner> <summary> Relative smoothness of cross fade animation when setting window bounds. 100% @@ -3792,34 +3793,37 @@ </histogram> <histogram name="Ash.Window.AnimationSmoothness.CrossFade.DragMaximize" - units="%" expires_after="2022-05-10"> + units="%" expires_after="2023-01-10"> <owner>sammiequon@chromium.org</owner> <owner>xdai@chromium.org</owner> <summary> When dragging a maximized window, the window will shrink to restore bounds. Dragging the window back to the top of the screen will expand the window. - This histogram will be recorded to measure the smoothenss of the expand - animation. 100% represents ideally smooth 60 frames per second. 50% - represents when only 30 frames per second is achieved during the animations. - 0% should not happen. + This histogram is fired only if the window is initially maximized. If we + drag a normal window to maximized state, the animation smoothness will be + recorded in the regular cross fade histogram above. This histogram will be + recorded to measure the smoothenss of the expand animation. 100% represents + ideally smooth 60 frames per second. 50% represents when only 30 frames per + second is achieved during the animations. 0% should not happen. </summary> </histogram> <histogram name="Ash.Window.AnimationSmoothness.CrossFade.DragUnmaximize" - units="%" expires_after="2022-05-10"> + units="%" expires_after="2023-01-10"> <owner>sammiequon@chromium.org</owner> <owner>xdai@chromium.org</owner> <summary> When dragging a maximized window, the window will shrink to restore bounds. - This histogram will be recorded to measure the smoothness of the shrink - animation. 100% represents ideally smooth 60 frames per second. 50% + This histogram is fired everytime we drag a maximized window to normal + state. This histogram will be recorded to measure the smoothness of the + shrink animation. 100% represents ideally smooth 60 frames per second. 50% represents when only 30 frames per second is achieved during the animations. 0% should not happen. </summary> </histogram> <histogram name="Ash.Window.AnimationSmoothness.Hide" units="%" - expires_after="2022-07-25"> + expires_after="2023-01-10"> <owner>sammiequon@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> <summary> @@ -3832,7 +3836,7 @@ </histogram> <histogram name="Ash.Window.AnimationSmoothness.Snap" units="%" - expires_after="2022-07-01"> + expires_after="2023-01-10"> <owner>oshima@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/blink/histograms.xml b/tools/metrics/histograms/metadata/blink/histograms.xml index 174ed7a..31736a3f 100644 --- a/tools/metrics/histograms/metadata/blink/histograms.xml +++ b/tools/metrics/histograms/metadata/blink/histograms.xml
@@ -1645,36 +1645,6 @@ </summary> </histogram> -<histogram name="Blink.Layout.FlexNGRatio.Blocks" units="%" - expires_after="2022-09-30"> - <owner>ikilpatrick@chromium.org</owner> - <owner>layout-dev@chromium.org</owner> - <summary> - Records FlexNG block percentage. - - This records the percentage of LayoutNGFlexibleBox objects, compared with - the total number of blocks. This is recorded once per page on unloading the - page. A value takes into account of all frames in a single page. - - See https://bit.ly/ng-ratio for more details. - </summary> -</histogram> - -<histogram name="Blink.Layout.GridNGRatio.Blocks" units="%" - expires_after="2022-09-30"> - <owner>ikilpatrick@chromium.org</owner> - <owner>layout-dev@chromium.org</owner> - <summary> - Records GridNG block percentage. - - This records the percentage of LayoutNGGrid objects, compared with the total - number of blocks. This is recorded once per page on unloading the page. A - value takes into account of all frames in a single page. - - See https://bit.ly/ng-ratio for more details. - </summary> -</histogram> - <histogram name="Blink.Layout.NGRatio.Blocks" units="%" expires_after="2022-09-30"> <owner>tkent@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/content/histograms.xml b/tools/metrics/histograms/metadata/content/histograms.xml index f029ce2..ae2309f 100644 --- a/tools/metrics/histograms/metadata/content/histograms.xml +++ b/tools/metrics/histograms/metadata/content/histograms.xml
@@ -535,7 +535,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.ActivityLoggingEnabled" enum="Boolean" - expires_after="2022-07-03"> + expires_after="2023-03-01"> <owner>rogerm@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -568,7 +568,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.ContentAgeOnLoad.BlockingRefresh" - units="ms" expires_after="2022-07-03"> + units="ms" expires_after="2023-03-01"> <owner>carlosk@chromium.org</owner> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -582,7 +582,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.ContentAgeOnLoad.NotRefreshed" - units="ms" expires_after="2022-07-03"> + units="ms" expires_after="2023-03-01"> <owner>carlosk@chromium.org</owner> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -606,7 +606,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.DisplayStatusOnOpen" - enum="ContentSuggestionsDisplayStatus" expires_after="2022-06-26"> + enum="ContentSuggestionsDisplayStatus" expires_after="2023-03-01"> <owner>carlosk@chromium.org</owner> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -619,7 +619,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.ImageFetchStatus" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2022-03-01"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -630,7 +630,7 @@ </histogram> <histogram base="true" name="ContentSuggestions.Feed.LoadStepLatency" - units="ms" expires_after="2022-07-03"> + units="ms" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -644,7 +644,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.LoadStreamStatus.LoadMore" - enum="FeedLoadStreamStatus" expires_after="2022-07-03"> + enum="FeedLoadStreamStatus" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>carlosk@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -669,7 +669,7 @@ <histogram name="ContentSuggestions.Feed.Network.CompressedResponseSizeKB{NetworkRequestType}" - units="KB" expires_after="2022-07-03"> + units="KB" expires_after="2023-03-01"> <owner>carlosk@chromium.org</owner> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -683,8 +683,8 @@ </token> </histogram> -<histogram name="ContentSuggestions.Feed.Network.Duration{NetworkEvent}" - units="ms" expires_after="2022-07-03"> +<histogram name="ContentSuggestions.Feed.Network.Duration.{NetworkEvent}" + units="ms" expires_after="2023-03-01"> <owner>sczs@chromium.org</owner> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -714,7 +714,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.Network.RequestStatusCode" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2022-03-01"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2023-03-01"> <owner>carlosk@chromium.org</owner> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -726,7 +726,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.Network.ResponseSizeKB" units="KB" - expires_after="2022-07-03"> + expires_after="2023-03-01"> <owner>carlosk@chromium.org</owner> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -737,7 +737,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.Network.ResponseStatus{Type}" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2022-07-03"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2023-03-01"> <owner>carlosk@chromium.org</owner> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -761,7 +761,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.Network.TokenFetchStatus" - enum="GoogleServiceAuthError" expires_after="2022-07-11"> + enum="GoogleServiceAuthError" expires_after="2023-03-01"> <owner>carlosk@chromium.org</owner> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -772,7 +772,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.NoticeCardFulfilled" enum="Boolean" - expires_after="2022-07-03"> + expires_after="2023-03-01"> <owner>vincb@google.com</owner> <owner>feed@chromium.org</owner> <summary> @@ -783,7 +783,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.NoticeCardFulfilled2" enum="Boolean" - expires_after="2022-06-26"> + expires_after="2023-03-01"> <owner>vincb@google.com</owner> <owner>feed@chromium.org</owner> <summary> @@ -937,7 +937,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.SendFeedback" - enum="FeedSendFeedbackType" expires_after="2022-02-01"> + enum="FeedSendFeedbackType" expires_after="2023-03-01"> <owner>carlosk@chromium.org</owner> <owner>petewil@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -976,7 +976,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.TimeSpentInFeed" units="ms" - expires_after="2022-07-03"> + expires_after="2023-03-01"> <owner>carlosk@chromium.org</owner> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1024,7 +1024,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.UploadActionsBatchStatus" - enum="FeedUploadActionsBatchStatus" expires_after="2022-06-05"> + enum="FeedUploadActionsBatchStatus" expires_after="2023-03-01"> <owner>iwells@chromium.org</owner> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1034,7 +1034,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.UploadActionsStatus" - enum="FeedUploadActionsStatus" expires_after="2022-04-03"> + enum="FeedUploadActionsStatus" expires_after="2023-03-01"> <owner>iwells@chromium.org</owner> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1046,7 +1046,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.UploadVisibilityLog" enum="Boolean" - expires_after="2022-06-01"> + expires_after="2023-03-01"> <owner>freedjm@google.com</owner> <owner>feed@chromium.org</owner> <summary> @@ -1055,7 +1055,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.UploadVisibilityLog.{LogType}" - enum="Boolean" expires_after="2022-06-01"> + enum="Boolean" expires_after="2023-03-01"> <owner>freedjm@google.com</owner> <owner>feed@chromium.org</owner> <summary> @@ -1068,7 +1068,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.UserActions" enum="FeedUserActionType" - expires_after="2022-07-03"> + expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>carlosk@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1079,7 +1079,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.UserActions.Commands" - enum="FeedUserCommandType" expires_after="2022-07-03"> + enum="FeedUserCommandType" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>sczs@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1091,7 +1091,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.UserJourney.GetMore.FailureDuration" - units="ms" expires_after="2022-05-01"> + units="ms" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>carlosk@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1102,7 +1102,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.UserJourney.GetMore.SuccessDuration" - units="ms" expires_after="2022-07-03"> + units="ms" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>carlosk@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1114,7 +1114,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.UserJourney.{Surface}.Failure" - enum="Boolean" expires_after="2022-03-01"> + enum="Boolean" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>carlosk@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1129,7 +1129,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.UserJourney.{Surface}.SuccessDuration" - units="ms" expires_after="2022-03-01"> + units="ms" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>carlosk@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1145,7 +1145,7 @@ <histogram name="ContentSuggestions.Feed.UserJourney.{Surface}.{Status}Duration" - units="ms" expires_after="2022-03-01"> + units="ms" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>carlosk@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1167,7 +1167,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.VisibilityLoggingEnabled" - enum="Boolean" expires_after="2022-06-01"> + enum="Boolean" expires_after="2023-03-01"> <owner>freedjm@google.com</owner> <owner>feed@chromium.org</owner> <summary> @@ -1177,7 +1177,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.VisitDuration" units="ms" - expires_after="2022-06-12"> + expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>freedjm@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1194,7 +1194,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.WebFeed.FollowByIdResult" - enum="WebFeedSubscriptionRequestStatus" expires_after="2022-07-01"> + enum="WebFeedSubscriptionRequestStatus" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1205,7 +1205,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.WebFeed.FollowCount.{Event}" - units="follows" expires_after="2022-07-01"> + units="follows" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1229,7 +1229,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.WebFeed.FollowUriResult" - enum="WebFeedSubscriptionRequestStatus" expires_after="2022-07-01"> + enum="WebFeedSubscriptionRequestStatus" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1241,7 +1241,7 @@ <histogram name="ContentSuggestions.Feed.WebFeed.LoadedCardCount.{ContentOrder}" - units="index" expires_after="2022-07-01"> + units="index" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1257,7 +1257,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.WebFeed.NewFollow.IsRecommended" - enum="Boolean" expires_after="2022-09-01"> + enum="Boolean" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1288,7 +1288,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.WebFeed.PostFollowDialog.Show" - enum="WebFeedPostFollowDialogPresentation" expires_after="2022-07-01"> + enum="WebFeedPostFollowDialogPresentation" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1299,7 +1299,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.WebFeed.RefreshContentOrder" - enum="FeedContentOrder" expires_after="2022-09-01"> + enum="FeedContentOrder" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1310,7 +1310,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.WebFeed.RefreshRecommendedFeeds" - enum="WebFeedRefreshStatus" expires_after="2022-07-01"> + enum="WebFeedRefreshStatus" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1321,7 +1321,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.WebFeed.RefreshSubscribedFeeds.{Kind}" - enum="WebFeedRefreshStatus" expires_after="2022-07-01"> + enum="WebFeedRefreshStatus" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1356,7 +1356,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.WebFeed.UnfollowResult" - enum="WebFeedSubscriptionRequestStatus" expires_after="2022-07-01"> + enum="WebFeedSubscriptionRequestStatus" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1444,7 +1444,7 @@ </histogram> <histogram name="ContentSuggestions.{FeedType}.InvalidNoticeKey" enum="Boolean" - expires_after="2022-10-01"> + expires_after="2023-03-01"> <owner>jianli@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1457,7 +1457,7 @@ </histogram> <histogram name="ContentSuggestions.{FeedType}.LoadedCardCount" units="index" - expires_after="2022-07-01"> + expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1474,7 +1474,7 @@ <histogram name="ContentSuggestions.{FeedType}.LoadMoreTrigger.NumCardsRemaining" - units="cards" expires_after="2022-03-01"> + units="cards" expires_after="2023-03-01"> <owner>rogerm@chromium.org</owner> <owner>dewittj@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1489,7 +1489,7 @@ </histogram> <histogram name="ContentSuggestions.{FeedType}.LoadMoreTrigger.TotalCards" - units="cards" expires_after="2022-03-01"> + units="cards" expires_after="2023-03-01"> <owner>rogerm@chromium.org</owner> <owner>dewittj@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1505,7 +1505,7 @@ <histogram name="ContentSuggestions.{FeedType}.LoadStreamStatus.BackgroundRefresh" - enum="FeedLoadStreamStatus" expires_after="2022-03-01"> + enum="FeedLoadStreamStatus" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>carlosk@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1522,7 +1522,7 @@ </histogram> <histogram name="ContentSuggestions.{FeedType}.LoadStreamStatus.Initial" - enum="FeedLoadStreamStatus" expires_after="2022-03-01"> + enum="FeedLoadStreamStatus" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>carlosk@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1538,7 +1538,7 @@ <histogram name="ContentSuggestions.{FeedType}.LoadStreamStatus.InitialFromStore" - enum="FeedLoadStreamStatus" expires_after="2022-03-01"> + enum="FeedLoadStreamStatus" expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>carlosk@chromium.org</owner> <owner>feed@chromium.org</owner> @@ -1555,7 +1555,7 @@ </histogram> <histogram name="ContentSuggestions.{FeedType}.LoadStreamStatus.ManualRefresh" - enum="FeedLoadStreamStatus" expires_after="2022-07-01"> + enum="FeedLoadStreamStatus" expires_after="2023-03-01"> <owner>jianli@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1570,7 +1570,7 @@ <histogram name="ContentSuggestions.{FeedType}.NoticeAcknowledgementPath.{NoticeType}" - enum="FeedNoticeAcknowledgementPath" expires_after="2022-10-01"> + enum="FeedNoticeAcknowledgementPath" expires_after="2023-03-01"> <owner>jianli@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1588,7 +1588,7 @@ </histogram> <histogram name="ContentSuggestions.{FeedType}.Notice{Action}.{NoticeType}" - enum="Boolean" expires_after="2022-10-01"> + enum="Boolean" expires_after="2023-03-01"> <owner>jianli@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1622,7 +1622,7 @@ </histogram> <histogram name="ContentSuggestions.{FeedType}.ReachedEndOfFeed" units="index" - expires_after="2022-07-01"> + expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1640,7 +1640,7 @@ </histogram> <histogram name="ContentSuggestions.{FeedType}.SharedStateSizeKB" units="KB" - expires_after="2022-07-01"> + expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1655,7 +1655,7 @@ </histogram> <histogram name="ContentSuggestions.{FeedType}.StreamContentSizeKB" units="KB" - expires_after="2022-07-01"> + expires_after="2023-03-01"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/net/histograms.xml b/tools/metrics/histograms/metadata/net/histograms.xml index b5faed4..bc3b412 100644 --- a/tools/metrics/histograms/metadata/net/histograms.xml +++ b/tools/metrics/histograms/metadata/net/histograms.xml
@@ -4285,7 +4285,7 @@ </histogram> <histogram name="Net.Reporting.HeaderType" enum="NetReportingHeaderType" - expires_after="2022-06-26"> + expires_after="2023-02-18"> <owner>rodneyding@google.com</owner> <owner>src/net/reporting/OWNERS</owner> <summary> @@ -4295,7 +4295,7 @@ </histogram> <histogram name="Net.Reporting.UploadHeaderType" - enum="NetReportingUploadHeaderType" expires_after="2022-02-18"> + enum="NetReportingUploadHeaderType" expires_after="2023-02-18"> <owner>rodneyding@google.com</owner> <owner>src/net/reporting/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/omnibox/histograms.xml b/tools/metrics/histograms/metadata/omnibox/histograms.xml index 141dcaf..574c4d5 100644 --- a/tools/metrics/histograms/metadata/omnibox/histograms.xml +++ b/tools/metrics/histograms/metadata/omnibox/histograms.xml
@@ -1066,6 +1066,9 @@ <histogram name="Omnibox.ZeroSuggest.Eligible.OnProfileOpen" enum="BooleanSupported" expires_after="2022-01-02"> + <obsolete> + Since Q1 2022 + </obsolete> <owner>mpearson@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/permissions/histograms.xml b/tools/metrics/histograms/metadata/permissions/histograms.xml index 70a5fddc..b6a77a45 100644 --- a/tools/metrics/histograms/metadata/permissions/histograms.xml +++ b/tools/metrics/histograms/metadata/permissions/histograms.xml
@@ -468,6 +468,17 @@ </summary> </histogram> +<histogram name="Permissions.PredictionService.PredictionSource" + enum="PermissionPredictionSource" expires_after="2022-06-30"> + <owner>ravjit@chromium.org</owner> + <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> + <summary> + Recorded whenever a permission is sent to the prediction service. Records + whether the request was sent to the local on-device prediction service or + the server side prediction service. + </summary> +</histogram> + <histogram name="Permissions.PredictionService.Request" enum="BooleanSent" expires_after="2022-06-12"> <owner>engedy@chromium.org</owner>
diff --git a/tools/python/.style.yapf b/tools/python/.style.yapf new file mode 100644 index 0000000..557fa7b --- /dev/null +++ b/tools/python/.style.yapf
@@ -0,0 +1,2 @@ +[style] +based_on_style = pep8
diff --git a/tools/python/OWNERS b/tools/python/OWNERS new file mode 100644 index 0000000..2c66280 --- /dev/null +++ b/tools/python/OWNERS
@@ -0,0 +1,3 @@ +agrieve@chromium.org +wnwen@chromium.org +dpranke@chromium.org
diff --git a/tools/python/README.md b/tools/python/README.md new file mode 100644 index 0000000..b5bf52e --- /dev/null +++ b/tools/python/README.md
@@ -0,0 +1,17 @@ +# //tools/python + +This directory is meant to contain Python code that is: + +1) Not platform-specific (e.g. `//tools/android/python_utils`). +2) Useful to multiple other tools. + +All Python code that is used by GN actions or templates within `//build` must +live under `//build`, since that directory cannot have deps outside of it. +However, code here can be used by GN actions or templates that live outside of +`//build`. + +When adding code to this directory, or when adding a dep onto code that lives in +this directory, please consider whether or not duplicating the code would +actually a better choice. Code re-use is helpful, but dependencies also come +with a cost, especially when it comes to being able to test changes to shared +code.
diff --git a/tools/python/google/.style.yapf b/tools/python/google/.style.yapf new file mode 100644 index 0000000..b4ebbe2 --- /dev/null +++ b/tools/python/google/.style.yapf
@@ -0,0 +1,6 @@ +[style] +based_on_style = pep8 + +# New directories should use a .style.yapf that does not include the following: +column_limit = 80 +indent_width = 2
diff --git a/ui/android/java/res/values-night/colors.xml b/ui/android/java/res/values-night/colors.xml index b441248..403e097 100644 --- a/ui/android/java/res/values-night/colors.xml +++ b/ui/android/java/res/values-night/colors.xml
@@ -29,12 +29,12 @@ <color name="default_bg_color">@color/default_bg_color_baseline</color> <color name="default_bg_color_baseline">@color/default_bg_color_dark</color> <color name="default_bg_color_secondary">@color/default_bg_color_secondary_dark</color> - <color name="default_bg_color_elev_1_baseline">@color/default_bg_color_dark_elev_1_baseline</color> - <color name="default_bg_color_elev_2_baseline">@color/default_bg_color_dark_elev_2_baseline</color> - <color name="default_bg_color_elev_3_baseline">@color/default_bg_color_dark_elev_3_baseline</color> - <color name="default_bg_color_elev_4_baseline">@color/default_bg_color_dark_elev_4_baseline</color> - <color name="default_bg_color_elev_5_baseline">@color/default_bg_color_dark_elev_5_baseline</color> - <color name="default_bg_color_elev_6_baseline">@color/default_bg_color_dark_elev_6_baseline</color> + <color name="default_bg_color_elev_1_baseline">@color/default_bg_color_dark_elev_1</color> + <color name="default_bg_color_elev_2_baseline">@color/default_bg_color_dark_elev_2</color> + <color name="default_bg_color_elev_3_baseline">@color/default_bg_color_dark_elev_3</color> + <color name="default_bg_color_elev_4_baseline">@color/default_bg_color_dark_elev_4</color> + <color name="default_bg_color_elev_5_baseline">@color/default_bg_color_dark_elev_5</color> + <color name="default_bg_color_elev_6_baseline">@color/default_bg_color_dark_elev_6</color> <!-- Legacy elevation/surface colors kept around for tab switcher, which has a separate feature to control enabling baseline. This is most noticeable in the title background color for thumbnails, legacy will @@ -45,13 +45,13 @@ <color name="default_bg_color_blue">@color/default_bg_color_blue_light</color> <!-- Bottom sheet colors --> - <color name="sheet_bg_color">@color/default_bg_color_dark_elev_4_baseline</color> + <color name="sheet_bg_color">@color/default_bg_color_dark_elev_4</color> <!-- Dialog colors --> - <color name="dialog_bg_color">@color/dialog_bg_color_dark_baseline</color> + <color name="dialog_bg_color">@color/dialog_bg_color_dark</color> <!-- Snackbar colors --> - <color name="snackbar_background_color_baseline">@color/default_bg_color_dark_elev_4_baseline</color> + <color name="snackbar_background_color">@color/default_bg_color_dark_elev_4</color> <!-- Ripple colors for clickable widgets --> <color name="ripple_color_blue">@color/ripple_color_blue_light</color> @@ -85,8 +85,8 @@ <color name="adaptive_toolbar_preference_header_omnibox">@color/adaptive_toolbar_preference_header_omnibox_dark</color> <!-- Menu colors --> - <color name="menu_action_bar_bg_color_baseline">@color/menu_action_bar_bg_color_dark_baseline</color> - <color name="menu_item_bg_color">@color/menu_item_bg_color_dark_baseline</color> + <color name="menu_action_bar_bg_color">@color/menu_action_bar_bg_color_dark</color> + <color name="menu_item_bg_color">@color/menu_item_bg_color_dark</color> <!-- Other colors --> <color name="default_red">@color/default_red_light</color>
diff --git a/ui/android/java/res/values/semantic_colors_adaptive.xml b/ui/android/java/res/values/semantic_colors_adaptive.xml index 44e7b12..ff5fd201 100644 --- a/ui/android/java/res/values/semantic_colors_adaptive.xml +++ b/ui/android/java/res/values/semantic_colors_adaptive.xml
@@ -54,18 +54,18 @@ <color name="legacy_bg_color_elev_4">@color/legacy_bg_color_light_elev_4</color> <!-- Dialog colors --> - <color name="dialog_bg_color">@color/dialog_bg_color_light_baseline</color> - <color name="dialog_bg_color_light_baseline">@color/default_bg_color_baseline</color> - <color name="dialog_bg_color_dark_baseline">@color/default_bg_color_dark_elev_3_baseline</color> + <color name="dialog_bg_color">@color/dialog_bg_color_light</color> + <color name="dialog_bg_color_light">@color/default_bg_color_light</color> + <color name="dialog_bg_color_dark">@color/default_bg_color_dark_elev_3</color> <!-- Snackbar colors --> - <color name="snackbar_background_color_baseline">@color/default_bg_color_baseline</color> + <color name="snackbar_background_color">@color/default_bg_color</color> <!-- Infobar colors --> - <color name="infobar_background_color" tools:ignore="UnusedResources">@color/snackbar_background_color_baseline</color> + <color name="infobar_background_color" tools:ignore="UnusedResources">@color/snackbar_background_color</color> <!-- Bottom sheet colors --> - <color name="sheet_bg_color" tools:ignore="UnusedResources">@color/default_bg_color_baseline</color> + <color name="sheet_bg_color" tools:ignore="UnusedResources">@color/default_bg_color</color> <!-- Ripple colors for clickable widgets --> <color name="ripple_color_blue">@color/ripple_color_blue_dark</color> @@ -112,12 +112,12 @@ <!-- TODO(https://crbug.com/1232518): Move light/dark colors to non-adaptive file. These reference non-color palette colors which is currently blocked by PRESUBMIT scripts. --> - <color name="menu_action_bar_bg_color_baseline">@color/menu_action_bar_bg_color_light_baseline</color> - <color name="menu_action_bar_bg_color_light_baseline">@color/default_bg_color_light_elev_1_baseline</color> - <color name="menu_action_bar_bg_color_dark_baseline">@color/default_bg_color_dark_elev_6_baseline</color> - <color name="menu_item_bg_color">@color/menu_item_bg_color_light_baseline</color> - <color name="menu_item_bg_color_light_baseline">@color/default_bg_color_light</color> - <color name="menu_item_bg_color_dark_baseline">@color/default_bg_color_dark_elev_5_baseline</color> + <color name="menu_action_bar_bg_color">@color/menu_action_bar_bg_color_light</color> + <color name="menu_action_bar_bg_color_light">@color/default_bg_color_light_elev_1_baseline</color> + <color name="menu_action_bar_bg_color_dark">@color/default_bg_color_dark_elev_6</color> + <color name="menu_item_bg_color">@color/menu_item_bg_color_light</color> + <color name="menu_item_bg_color_light">@color/default_bg_color_light</color> + <color name="menu_item_bg_color_dark">@color/default_bg_color_dark_elev_5</color> <!-- Other colors --> <color name="default_red" tools:ignore="UnusedResources">@color/default_red_dark</color>
diff --git a/ui/android/java/res/values/semantic_colors_non_adaptive.xml b/ui/android/java/res/values/semantic_colors_non_adaptive.xml index 35ddeb9..17ea20c8 100644 --- a/ui/android/java/res/values/semantic_colors_non_adaptive.xml +++ b/ui/android/java/res/values/semantic_colors_non_adaptive.xml
@@ -68,12 +68,12 @@ <color name="default_bg_color_light_elev_6_baseline" tools:ignore="UnusedResources">@color/baseline_neutral_0_with_neutral_600_alpha_20_with_primary_600_2</color> <color name="legacy_bg_color_light_elev_1">@color/modern_white</color> <color name="legacy_bg_color_light_elev_4">@color/modern_white</color> - <color name="default_bg_color_dark_elev_1_baseline" tools:ignore="UnusedResources">@color/baseline_neutral_900_with_neutral_200_alpha_5_with_primary_200_alpha_2</color> - <color name="default_bg_color_dark_elev_2_baseline" tools:ignore="UnusedResources">@color/baseline_neutral_900_with_neutral_200_alpha_8_with_primary_200_alpha_2</color> - <color name="default_bg_color_dark_elev_3_baseline" tools:ignore="UnusedResources">@color/baseline_neutral_900_with_neutral_200_alpha_11_with_primary_200_alpha_2</color> - <color name="default_bg_color_dark_elev_4_baseline" tools:ignore="UnusedResources">@color/baseline_neutral_900_with_neutral_200_alpha_12_with_primary_200_alpha_2</color> - <color name="default_bg_color_dark_elev_5_baseline" tools:ignore="UnusedResources">@color/baseline_neutral_900_with_neutral_200_alpha_14_with_primary_200_alpha_2</color> - <color name="default_bg_color_dark_elev_6_baseline" tools:ignore="UnusedResources">@color/baseline_neutral_900_with_neutral_200_alpha_20_with_primary_200_alpha_2</color> + <color name="default_bg_color_dark_elev_1" tools:ignore="UnusedResources">@color/baseline_neutral_900_with_neutral_200_alpha_5_with_primary_200_alpha_2</color> + <color name="default_bg_color_dark_elev_2" tools:ignore="UnusedResources">@color/baseline_neutral_900_with_neutral_200_alpha_8_with_primary_200_alpha_2</color> + <color name="default_bg_color_dark_elev_3" tools:ignore="UnusedResources">@color/baseline_neutral_900_with_neutral_200_alpha_11_with_primary_200_alpha_2</color> + <color name="default_bg_color_dark_elev_4" tools:ignore="UnusedResources">@color/baseline_neutral_900_with_neutral_200_alpha_12_with_primary_200_alpha_2</color> + <color name="default_bg_color_dark_elev_5" tools:ignore="UnusedResources">@color/baseline_neutral_900_with_neutral_200_alpha_14_with_primary_200_alpha_2</color> + <color name="default_bg_color_dark_elev_6" tools:ignore="UnusedResources">@color/baseline_neutral_900_with_neutral_200_alpha_20_with_primary_200_alpha_2</color> <color name="legacy_bg_color_dark_elev_1">@color/baseline_neutral_900_with_neutral_200_alpha_5_with_primary_200_alpha_2</color> <color name="legacy_bg_color_dark_elev_4">@color/baseline_neutral_900_with_neutral_200_alpha_12_with_primary_200_alpha_2</color>
diff --git a/ui/ozone/platform/flatland/flatland_surface.cc b/ui/ozone/platform/flatland/flatland_surface.cc index 60ab05b..ec02099 100644 --- a/ui/ozone/platform/flatland/flatland_surface.cc +++ b/ui/ozone/platform/flatland/flatland_surface.cc
@@ -116,6 +116,9 @@ image_id, collection->GetFlatlandImportToken(), handle.buffer_index, std::move(image_properties)); flatland_.flatland()->SetImageDestinationSize(image_id, size); + // Set main layer to be opaque. + flatland_.flatland()->SetImageBlendingFunction( + image_id, fuchsia::ui::composition::BlendMode::SRC); // Add Flatland Image to |buffer_collection_to_image_id_|. buffer_collection_to_image_id_[collection->id()] = image_id;
diff --git a/ui/views/metadata/view_factory.h b/ui/views/metadata/view_factory.h index 4940408..8ea6632 100644 --- a/ui/views/metadata/view_factory.h +++ b/ui/views/metadata/view_factory.h
@@ -12,7 +12,6 @@ #include <vector> #include "base/bind.h" -#include "base/compiler_specific.h" #include "base/memory/raw_ptr.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/class_property.h" @@ -99,7 +98,7 @@ return std::move(this->AddChildrenImpl(&child, &args...)); } - std::unique_ptr<ViewClass_> Build() && WARN_UNUSED_RESULT { + [[nodiscard]] std::unique_ptr<ViewClass_> Build() && { DCHECK(!root_view_) << "Root view specified. Use BuildChildren() instead."; DCHECK(view_); SetProperties(view_.get()); @@ -400,8 +399,8 @@ Builder<ViewClass_>(Builder&&) = default; \ Builder<ViewClass_>& operator=(Builder<ViewClass_>&&) = default; \ ~Builder<ViewClass_>() = default; \ - std::unique_ptr<internal::ViewBuilderCore> Release() override \ - WARN_UNUSED_RESULT { \ + [[nodiscard]] std::unique_ptr<internal::ViewBuilderCore> Release() \ + override { \ return std::make_unique<Builder<view_class>>(std::move(*this)); \ } \ }; \
diff --git a/ui/views/view.h b/ui/views/view.h index eb31250..bc6f04c 100644 --- a/ui/views/view.h +++ b/ui/views/view.h
@@ -199,7 +199,7 @@ // a callback. // // base::CallbackListSubscription AddFrobbleChangedCallback( -// PropertyChangedCallback callback) WARN_UNUSED_RESULT; +// PropertyChangedCallback callback); // // Each callback uses the the existing base::Bind mechanisms which allow for // various kinds of callbacks; object methods, normal functions and lambdas.
diff --git a/weblayer/browser/profile_impl.cc b/weblayer/browser/profile_impl.cc index f21fae9..054714d 100644 --- a/weblayer/browser/profile_impl.cc +++ b/weblayer/browser/profile_impl.cc
@@ -300,6 +300,8 @@ remove_mask |= BrowsingDataRemoverDelegate::DATA_TYPE_AD_INTERVENTIONS; remove_mask |= content::BrowsingDataRemover::DATA_TYPE_TRUST_TOKENS; remove_mask |= content::BrowsingDataRemover::DATA_TYPE_CONVERSIONS; + remove_mask |= + content::BrowsingDataRemover::DATA_TYPE_AGGREGATION_SERVICE; break; case BrowsingDataType::CACHE: remove_mask |= content::BrowsingDataRemover::DATA_TYPE_CACHE;