diff --git a/DEPS b/DEPS index b7fe5c7e..4d9fa75 100644 --- a/DEPS +++ b/DEPS
@@ -167,11 +167,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'dca6b5fe9a3243c3ca646a7d9fd2c5c23a3291b9', + 'skia_revision': '7aeabcfa6a7370d5482d77e138ba2475ae5ac958', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': 'b1db47127366167e720281589d2951b16c2bd97b', + 'v8_revision': '656e25f970901daff67319c68a19b109bee5ad1a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -179,7 +179,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': 'a0159c03485b0ac91784d12d544927d83453d186', + 'angle_revision': '71c1138d6739b58cb8cc849ea1a2fd8c9f2776c3', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -218,7 +218,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling freetype # and whatever else without interference from each other. - 'freetype_revision': '432efa25b3476a6884426c0a30f6d6a624310e5d', + 'freetype_revision': 'c37a501458e2b5389ac977ed2523eed3e2d9bd61', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling HarfBuzz # and whatever else without interference from each other. @@ -230,7 +230,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': 'ed74a5890e50e44f88799ed788bb0fbf46b2cfe0', + 'catapult_revision': '5f4659d6f7a8b48728247d88b64abe806ccc6822', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -302,7 +302,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. - 'dawn_revision': 'f622a447500234810f3eb3aafff6358d7cff6628', + 'dawn_revision': '52bd6b7da6a758888e99436656e836f178b762af', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -862,7 +862,7 @@ # Build tools for Chrome OS. Note: This depends on third_party/pyelftools. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'b04334392d997af0a0aae652e4394d73857fd34c', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'd9d7419a45d6766ae607250101548ad8a13681f5', 'condition': 'checkout_linux', }, @@ -887,7 +887,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '69d781151b8a374bd7bb42730dd0e5f6331604ba', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '0081c0ff173c3af29933cbc6965d4a2d83b09576', 'src/third_party/devtools-node-modules': Var('chromium_git') + '/external/github.com/ChromeDevTools/devtools-node-modules' + '@' + Var('devtools_node_modules_revision'), @@ -1269,7 +1269,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'f96bdd640172f1cc2b7e505fd883e2caea25c919', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '6a28e95a8e403120ced88f347d0c7ffe24b7b8f7', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1459,7 +1459,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '7c4e67ff117d6c640e6dd17989afe2fb7da7eecb', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'ba2ba59c4ba1009ad04e56bb3804c882bc63441b', + Var('webrtc_git') + '/src.git' + '@' + '0e3517d55865290b695b59a4cb8ed08e429bbe69', 'src/third_party/xdg-utils': { 'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d', @@ -1521,7 +1521,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@4400cb93e9b9381b4995cad49738499c921d9f36', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@5efc9bd8e0097b2083e37979114bb92523dbe396', 'condition': 'checkout_src_internal', },
diff --git a/android_webview/browser/BUILD.gn b/android_webview/browser/BUILD.gn index 2e45158..edcb40f 100644 --- a/android_webview/browser/BUILD.gn +++ b/android_webview/browser/BUILD.gn
@@ -146,6 +146,8 @@ "network_service/input_stream_reader.h", "network_service/net_helpers.cc", "network_service/net_helpers.h", + "page_load_metrics/page_load_metrics_initialize.cc", + "page_load_metrics/page_load_metrics_initialize.h", "permission/aw_permission_request.cc", "permission/aw_permission_request.h", "permission/aw_permission_request_delegate.cc", @@ -206,6 +208,7 @@ "//components/metrics:ui", "//components/minidump_uploader", "//components/navigation_interception", + "//components/page_load_metrics/browser", "//components/policy/content/", "//components/policy/core/browser", "//components/pref_registry",
diff --git a/android_webview/browser/DEPS b/android_webview/browser/DEPS index 93c7a26..0f90e72 100644 --- a/android_webview/browser/DEPS +++ b/android_webview/browser/DEPS
@@ -20,6 +20,7 @@ "+components/keyed_service/core", "+components/minidump_uploader", "+components/navigation_interception", + "+components/page_load_metrics/browser", "+components/policy/core/browser", "+components/policy/core/common", "+components/policy/content",
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc index 7ca0612..a7f1d2d8 100644 --- a/android_webview/browser/aw_content_browser_client.cc +++ b/android_webview/browser/aw_content_browser_client.cc
@@ -56,6 +56,8 @@ #include "components/content_capture/browser/content_capture_receiver_manager.h" #include "components/crash/content/browser/crash_handler_host_linux.h" #include "components/navigation_interception/intercept_navigation_delegate.h" +#include "components/page_load_metrics/browser/metrics_navigation_throttle.h" +#include "components/page_load_metrics/browser/metrics_web_contents_observer.h" #include "components/policy/content/policy_blacklist_navigation_throttle.h" #include "components/policy/core/browser/browser_policy_connector_base.h" #include "components/prefs/pref_service.h" @@ -155,12 +157,9 @@ }; AwContentsMessageFilter::AwContentsMessageFilter(int process_id) - : BrowserMessageFilter(AndroidWebViewMsgStart), - process_id_(process_id) { -} + : BrowserMessageFilter(AndroidWebViewMsgStart), process_id_(process_id) {} -AwContentsMessageFilter::~AwContentsMessageFilter() { -} +AwContentsMessageFilter::~AwContentsMessageFilter() = default; void AwContentsMessageFilter::OverrideThreadForMessage( const IPC::Message& message, @@ -656,6 +655,13 @@ // is used to post onPageStarted. We handle shouldOverrideUrlLoading // via a sync IPC. if (navigation_handle->IsInMainFrame()) { + // MetricsNavigationThrottle requires that it runs before + // NavigationThrottles that may delay or cancel navigations, so only + // NavigationThrottles that don't delay or cancel navigations (e.g. + // throttles that are only observing callbacks without affecting navigation + // behavior) should be added before MetricsNavigationThrottle. + throttles.push_back(page_load_metrics::MetricsNavigationThrottle::Create( + navigation_handle)); // Use Synchronous mode for the navigation interceptor, since this class // doesn't actually call into an arbitrary client, it just posts a task to // call onPageStarted. shouldOverrideUrlLoading happens earlier (see @@ -1034,6 +1040,15 @@ return WideColorGamutHeuristic::kNone; } +void AwContentBrowserClient::LogWebFeatureForCurrentPage( + content::RenderFrameHost* render_frame_host, + blink::mojom::WebFeature feature) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + page_load_metrics::mojom::PageLoadFeatures new_features({feature}, {}, {}); + page_load_metrics::MetricsWebContentsObserver::RecordFeatureUsage( + render_frame_host, new_features); +} + content::SpeechRecognitionManagerDelegate* AwContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { return new AwSpeechRecognitionManagerDelegate();
diff --git a/android_webview/browser/aw_content_browser_client.h b/android_webview/browser/aw_content_browser_client.h index 361114c..755ab41 100644 --- a/android_webview/browser/aw_content_browser_client.h +++ b/android_webview/browser/aw_content_browser_client.h
@@ -53,6 +53,7 @@ // moment during startup. AwContentBrowserClient owns the result. AwBrowserContext* InitBrowserContext(); + // content::ContentBrowserClient: void OnNetworkServiceCreated( network::mojom::NetworkService* network_service) override; mojo::Remote<network::mojom::NetworkContext> CreateNetworkContext( @@ -221,6 +222,8 @@ std::string GetUserAgent() override; ContentBrowserClient::WideColorGamutHeuristic GetWideColorGamutHeuristic() override; + void LogWebFeatureForCurrentPage(content::RenderFrameHost* render_frame_host, + blink::mojom::WebFeature feature) override; AwFeatureListCreator* aw_feature_list_creator() { return aw_feature_list_creator_;
diff --git a/android_webview/browser/aw_contents.cc b/android_webview/browser/aw_contents.cc index e2c29a4..a101e4c 100644 --- a/android_webview/browser/aw_contents.cc +++ b/android_webview/browser/aw_contents.cc
@@ -28,6 +28,7 @@ #include "android_webview/browser/gfx/java_browser_view_renderer_helper.h" #include "android_webview/browser/gfx/render_thread_manager.h" #include "android_webview/browser/gfx/scoped_app_gl_state_restore.h" +#include "android_webview/browser/page_load_metrics/page_load_metrics_initialize.h" #include "android_webview/browser/permission/aw_permission_request.h" #include "android_webview/browser/permission/permission_request_handler.h" #include "android_webview/browser/permission/simple_permission_request.h" @@ -245,6 +246,8 @@ render_view_host_ext_.reset( new AwRenderViewHostExt(this, web_contents_.get())); + InitializePageLoadMetricsForWebContents(web_contents_.get()); + permission_request_handler_.reset( new PermissionRequestHandler(this, web_contents_.get()));
diff --git a/android_webview/browser/page_load_metrics/page_load_metrics_initialize.cc b/android_webview/browser/page_load_metrics/page_load_metrics_initialize.cc new file mode 100644 index 0000000..81ea3d0 --- /dev/null +++ b/android_webview/browser/page_load_metrics/page_load_metrics_initialize.cc
@@ -0,0 +1,71 @@ +// Copyright 2019 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 "android_webview/browser/page_load_metrics/page_load_metrics_initialize.h" + +#include "base/macros.h" +#include "components/page_load_metrics/browser/metrics_web_contents_observer.h" +#include "components/page_load_metrics/browser/page_load_metrics_embedder_base.h" + +namespace android_webview { + +namespace { + +class PageLoadMetricsEmbedder + : public page_load_metrics::PageLoadMetricsEmbedderBase { + public: + explicit PageLoadMetricsEmbedder(content::WebContents* web_contents); + ~PageLoadMetricsEmbedder() override; + + // page_load_metrics::PageLoadMetricsEmbedderBase: + bool IsNewTabPageUrl(const GURL& url) override; + bool IsPrerender(content::WebContents* web_contents) override; + bool IsExtensionUrl(const GURL& url) override; + + protected: + // page_load_metrics::PageLoadMetricsEmbedderBase: + void RegisterEmbedderObservers( + page_load_metrics::PageLoadTracker* tracker) override; + bool IsPrerendering() const override; + + private: + DISALLOW_COPY_AND_ASSIGN(PageLoadMetricsEmbedder); +}; + +PageLoadMetricsEmbedder::PageLoadMetricsEmbedder( + content::WebContents* web_contents) + : PageLoadMetricsEmbedderBase(web_contents) {} + +PageLoadMetricsEmbedder::~PageLoadMetricsEmbedder() = default; + +void PageLoadMetricsEmbedder::RegisterEmbedderObservers( + page_load_metrics::PageLoadTracker* tracker) {} + +bool PageLoadMetricsEmbedder::IsPrerendering() const { + return false; +} + +bool PageLoadMetricsEmbedder::IsNewTabPageUrl(const GURL& url) { + return false; +} + +bool PageLoadMetricsEmbedder::IsPrerender(content::WebContents* web_contents) { + return false; +} + +bool PageLoadMetricsEmbedder::IsExtensionUrl(const GURL& url) { + return false; +} + +} // namespace + +void InitializePageLoadMetricsForWebContents( + content::WebContents* web_contents) { + // Change this method? consider to modify the peer in + // chrome/browser/page_load_metrics/page_load_metrics_initialize.cc as well. + page_load_metrics::MetricsWebContentsObserver::CreateForWebContents( + web_contents, std::make_unique<PageLoadMetricsEmbedder>(web_contents)); +} + +} // namespace android_webview
diff --git a/android_webview/browser/page_load_metrics/page_load_metrics_initialize.h b/android_webview/browser/page_load_metrics/page_load_metrics_initialize.h new file mode 100644 index 0000000..3396c5d --- /dev/null +++ b/android_webview/browser/page_load_metrics/page_load_metrics_initialize.h
@@ -0,0 +1,19 @@ +// Copyright 2019 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 ANDROID_WEBVIEW_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_INITIALIZE_H_ +#define ANDROID_WEBVIEW_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_INITIALIZE_H_ + +namespace content { +class WebContents; +} + +namespace android_webview { + +void InitializePageLoadMetricsForWebContents( + content::WebContents* web_contents); + +} // namespace android_webview + +#endif // ANDROID_WEBVIEW_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_INITIALIZE_H_
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwPageLoadMetricsTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwPageLoadMetricsTest.java new file mode 100644 index 0000000..f78ae9de --- /dev/null +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwPageLoadMetricsTest.java
@@ -0,0 +1,74 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.android_webview.test; + +import static org.junit.Assert.assertEquals; + +import android.support.test.filters.SmallTest; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import org.chromium.android_webview.AwContents; +import org.chromium.base.test.util.Feature; +import org.chromium.base.test.util.MetricsUtils; +import org.chromium.blink.mojom.WebFeature; +import org.chromium.net.test.util.TestWebServer; + +/** + * Integration test for PageLoadMetrics. + */ +public class AwPageLoadMetricsTest { + private static final String MAIN_FRAME_FILE = "/main_frame.html"; + + @Rule + public AwActivityTestRule mRule = new AwActivityTestRule(); + + private AwTestContainerView mTestContainerView; + private AwContents mAwContents; + private TestAwContentsClient mContentsClient; + private TestWebServer mWebServer; + + @Before + public void setUp() throws Exception { + mContentsClient = new TestAwContentsClient(); + mTestContainerView = mRule.createAwTestContainerViewOnMainSync(mContentsClient); + mAwContents = mTestContainerView.getAwContents(); + AwActivityTestRule.enableJavaScriptOnUiThread(mAwContents); + mWebServer = TestWebServer.start(); + } + + @After + public void tearDown() throws Exception { + mWebServer.shutdown(); + } + + private void loadUrlSync(String url) throws Exception { + mRule.loadUrlSync( + mTestContainerView.getAwContents(), mContentsClient.getOnPageFinishedHelper(), url); + } + + @Test + @SmallTest + @Feature({"AndroidWebView"}) + /** + * This test doesn't intent to cover all UseCounter metrics, and just test WebView integration + * works + */ + public void testUseCounterMetrics() throws Throwable { + final String data = "<html><head></head><body><form></form></body></html>"; + final String url = mWebServer.setResponse(MAIN_FRAME_FILE, data, null); + MetricsUtils.HistogramDelta delta = new MetricsUtils.HistogramDelta( + "Blink.UseCounter.MainFrame.Features", WebFeature.PAGE_VISITS); + MetricsUtils.HistogramDelta form = new MetricsUtils.HistogramDelta( + "Blink.UseCounter.Features", WebFeature.FORM_ELEMENT); + loadUrlSync(url); + loadUrlSync("about:blank"); + assertEquals(1, delta.getDelta()); + assertEquals(1, form.getDelta()); + } +}
diff --git a/android_webview/renderer/BUILD.gn b/android_webview/renderer/BUILD.gn index 8fca0ca8..9e5f11c 100644 --- a/android_webview/renderer/BUILD.gn +++ b/android_webview/renderer/BUILD.gn
@@ -40,6 +40,7 @@ "//components/cdm/renderer", "//components/content_capture/common", "//components/content_capture/renderer", + "//components/page_load_metrics/renderer", "//components/printing/common", "//components/printing/renderer", "//components/safe_browsing:features",
diff --git a/android_webview/renderer/DEPS b/android_webview/renderer/DEPS index 0073ac2..189cedd 100644 --- a/android_webview/renderer/DEPS +++ b/android_webview/renderer/DEPS
@@ -6,6 +6,7 @@ "+components/autofill/content/renderer", "+components/cdm/renderer", + "+components/page_load_metrics/renderer", "+components/printing/common", "+components/printing/renderer", "+components/safe_browsing/common",
diff --git a/android_webview/renderer/aw_content_renderer_client.cc b/android_webview/renderer/aw_content_renderer_client.cc index 183aace5..9ed3527 100644 --- a/android_webview/renderer/aw_content_renderer_client.cc +++ b/android_webview/renderer/aw_content_renderer_client.cc
@@ -26,6 +26,7 @@ #include "base/metrics/histogram_macros.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "components/page_load_metrics/renderer/metrics_render_frame_observer.h" #include "components/printing/renderer/print_render_frame_helper.h" #include "components/visitedlink/renderer/visitedlink_slave.h" #include "content/public/child/child_thread.h" @@ -181,6 +182,9 @@ #if BUILDFLAG(ENABLE_SPELLCHECK) new SpellCheckProvider(render_frame, spellcheck_.get(), this); #endif + + // Owned by |render_frame|. + new page_load_metrics::MetricsRenderFrameObserver(render_frame); } void AwContentRendererClient::RenderViewCreated(
diff --git a/android_webview/test/BUILD.gn b/android_webview/test/BUILD.gn index e964831..85f23bd 100644 --- a/android_webview/test/BUILD.gn +++ b/android_webview/test/BUILD.gn
@@ -229,6 +229,7 @@ "../javatests/src/org/chromium/android_webview/test/AwJavaBridgeTest.java", "../javatests/src/org/chromium/android_webview/test/AwLegacyQuirksTest.java", "../javatests/src/org/chromium/android_webview/test/AwNetworkConfigurationTest.java", + "../javatests/src/org/chromium/android_webview/test/AwPageLoadMetricsTest.java", "../javatests/src/org/chromium/android_webview/test/AwPermissionManagerTest.java", "../javatests/src/org/chromium/android_webview/test/AwProxyControllerTest.java", "../javatests/src/org/chromium/android_webview/test/AwQuotaManagerBridgeTest.java",
diff --git a/ash/app_list/app_list_controller_impl.cc b/ash/app_list/app_list_controller_impl.cc index 18a5527f..a21e28d 100644 --- a/ash/app_list/app_list_controller_impl.cc +++ b/ash/app_list/app_list_controller_impl.cc
@@ -1295,12 +1295,16 @@ return; } - last_target_visible_ = real_target_visibility; - last_target_visible_display_id_ = display_id; - // Notify chrome of target visibility changes. if (client_) client_->OnAppListTargetVisibilityChanged(real_target_visibility); + + for (auto& observer : observers_) + observer.OnAppListTargetVisibilityChanged(real_target_visibility, + display_id); + + last_target_visible_ = real_target_visibility; + last_target_visible_display_id_ = display_id; } ////////////////////////////////////////////////////////////////////////////////
diff --git a/ash/assistant/assistant_ui_controller.cc b/ash/assistant/assistant_ui_controller.cc index f00d85e..a021dec 100644 --- a/ash/assistant/assistant_ui_controller.cc +++ b/ash/assistant/assistant_ui_controller.cc
@@ -435,6 +435,11 @@ AssistantVisibility old_visibility, base::Optional<AssistantEntryPoint> entry_point, base::Optional<AssistantExitPoint> exit_point) { + AssistantState::Get()->NotifyStatusChanged( + new_visibility == AssistantVisibility::kVisible + ? mojom::AssistantState::VISIBLE + : mojom::AssistantState::READY); + switch (new_visibility) { case AssistantVisibility::kClosed: // When the UI is closed, we stop the auto close timer as it may be
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index 9d5abfc..8dd902a 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc
@@ -4571,4 +4571,52 @@ display::Screen::GetScreen()->GetPrimaryDisplay().size()); } +TEST_F(DisplayManagerTest, PanelOrientation) { + int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); + + display::test::ScopedSetInternalDisplayId set_internal(display_manager(), + display_id); + + // The panel is portrait but its orientation is landscape. + display::ManagedDisplayInfo native_display_info = + display::CreateDisplayInfo(display_id, gfx::Rect(0, 0, 1920, 1080)); + native_display_info.set_panel_orientation( + display::PanelOrientation::kRightUp); + const display::ManagedDisplayMode base_mode(gfx::Size(1920, 1080), 60.0f, + false, false); + display::ManagedDisplayInfo::ManagedDisplayModeList mode_list = + CreateInternalManagedDisplayModeList(base_mode); + native_display_info.SetManagedDisplayModes(mode_list); + + std::vector<display::ManagedDisplayInfo> display_info_list; + display_info_list.push_back(native_display_info); + display_manager()->OnNativeDisplaysChanged(display_info_list); + // Check display is landscape at ROTATE_0. + EXPECT_EQ(gfx::Size(1080, 1920), + display::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel()); + EXPECT_EQ(display::Display::ROTATE_0, + display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); + + // Check the orientation controller reports correct orientation. + auto* screen_orientation_controller = + Shell::Get()->screen_orientation_controller(); + EXPECT_EQ(OrientationLockType::kLandscape, + screen_orientation_controller->natural_orientation()); + EXPECT_EQ(OrientationLockType::kLandscapePrimary, + screen_orientation_controller->GetCurrentOrientation()); + + // Test if changing rotation works as if it's landscape panel. + DisplayConfigurationController::DisableAnimatorForTest(); + ScreenOrientationControllerTestApi(screen_orientation_controller) + .SetDisplayRotation(display::Display::ROTATE_270, + display::Display::RotationSource::USER); + + EXPECT_EQ(gfx::Size(1920, 1080), + display::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel()); + EXPECT_EQ(display::Display::ROTATE_270, + display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); + EXPECT_EQ(OrientationLockType::kPortraitPrimary, + screen_orientation_controller->GetCurrentOrientation()); +} + } // namespace ash
diff --git a/ash/display/root_window_transformers.cc b/ash/display/root_window_transformers.cc index 54c4932..6fbf5e06 100644 --- a/ash/display/root_window_transformers.cc +++ b/ash/display/root_window_transformers.cc
@@ -36,12 +36,13 @@ const display::Display& display) { display::ManagedDisplayInfo info = Shell::Get()->display_manager()->GetDisplayInfo(display.id()); - gfx::SizeF size(display.GetSizeInPixel()); + gfx::SizeF size(info.size_in_pixel()); + // Use SizeF so that the origin of translated layer will be // aligned when scaled back at pixels. size.Scale(1.f / display.device_scale_factor()); return CreateRotationTransform(display::Display::ROTATE_0, - info.GetActiveRotation(), size); + info.GetLogicalActiveRotation(), size); } gfx::Transform CreateInsetsAndScaleTransform(const gfx::Insets& insets, @@ -141,8 +142,8 @@ // Calculate the transform to undo the rotation and apply it to the // source display. rotation_transform = CreateRotationTransform( - source_display_info.GetActiveRotation(), display::Display::ROTATE_0, - gfx::SizeF(root_bounds_.size())); + source_display_info.GetLogicalActiveRotation(), + display::Display::ROTATE_0, gfx::SizeF(root_bounds_.size())); gfx::RectF rotated_bounds(root_bounds_); rotation_transform.TransformRect(&rotated_bounds); root_bounds_ = gfx::ToNearestRect(rotated_bounds);
diff --git a/ash/display/screen_orientation_controller.cc b/ash/display/screen_orientation_controller.cc index 76d56ada1..5f63ed91 100644 --- a/ash/display/screen_orientation_controller.cc +++ b/ash/display/screen_orientation_controller.cc
@@ -45,7 +45,7 @@ display::ManagedDisplayInfo info = Shell::Get()->display_manager()->GetDisplayInfo( display::Display::InternalDisplayId()); - gfx::Size size = info.bounds_in_native().size(); + gfx::Size size = info.GetSizeInPixelWithPanelOrientation(); return size.width() > size.height() ? OrientationLockType::kLandscape : OrientationLockType::kPortrait; } @@ -545,7 +545,7 @@ // The reference vector is the angle of gravity when the device is rotated // clockwise by 45 degrees. Computing the angle between this vector and // gravity we can easily determine the expected display rotation. - static const gfx::Vector3dF rotation_reference(-1.0f, 1.0f, 0.0f); + static constexpr gfx::Vector3dF rotation_reference(-1.0f, 1.0f, 0.0f); // Set the down vector to match the expected direction of gravity given the // last configured rotation. This is used to enforce a stickiness that the
diff --git a/ash/magnifier/docked_magnifier_controller_impl_unittest.cc b/ash/magnifier/docked_magnifier_controller_impl_unittest.cc index 5eae57b99..d796d33 100644 --- a/ash/magnifier/docked_magnifier_controller_impl_unittest.cc +++ b/ash/magnifier/docked_magnifier_controller_impl_unittest.cc
@@ -20,7 +20,12 @@ #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "ash/test/ash_test_helper.h" +#include "ash/wm/desks/desks_bar_view.h" +#include "ash/wm/desks/new_desk_button.h" #include "ash/wm/overview/overview_controller.h" +#include "ash/wm/overview/overview_grid.h" +#include "ash/wm/overview/overview_item.h" +#include "ash/wm/overview/overview_test_util.h" #include "ash/wm/splitview/split_view_controller.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_state.h" @@ -362,6 +367,38 @@ EXPECT_TRUE(WindowState::Get(window.get())->IsMaximized()); } +TEST_P(DockedMagnifierTest, OverviewTabbing) { + auto window = CreateTestWindow(); + controller()->SetEnabled(true); + + auto* overview_controller = Shell::Get()->overview_controller(); + overview_controller->StartOverview(); + EXPECT_TRUE(overview_controller->InOverviewSession()); + + auto* root_window = Shell::GetPrimaryRootWindow(); + const auto* desk_bar_view = GetOverviewSession() + ->GetGridWithRootWindow(root_window) + ->desks_bar_view(); + + // Tab once. The viewport should be centered on the center of the new desk + // button. + SendKey(ui::VKEY_TAB); + TestMagnifierLayerTransform( + desk_bar_view->new_desk_button()->GetBoundsInScreen().CenterPoint(), + root_window); + + // Tab one more time. The viewport should be centered on the beginning of the + // overview item's title. + SendKey(ui::VKEY_TAB); + OverviewItem* item = GetOverviewItemForWindow(window.get()); + ASSERT_TRUE(item); + const auto label_bounds_in_screen = + item->caption_container_view()->title_label()->GetBoundsInScreen(); + const gfx::Point expected_point_of_interest( + label_bounds_in_screen.x(), label_bounds_in_screen.CenterPoint().y()); + TestMagnifierLayerTransform(expected_point_of_interest, root_window); +} + // Test that we exist split view and over view modes when a single window is // snapped and the other snap region is hosting overview mode. TEST_P(DockedMagnifierTest, DisplaysWorkAreasSingleSplitView) {
diff --git a/ash/public/mojom/assistant_state_controller.mojom b/ash/public/mojom/assistant_state_controller.mojom index c52356b..89562b0 100644 --- a/ash/public/mojom/assistant_state_controller.mojom +++ b/ash/public/mojom/assistant_state_controller.mojom
@@ -11,6 +11,8 @@ NOT_READY = 0, // The Assistant service is ready. READY, + // The Assistant UI is showing. + VISIBLE }; enum AssistantAllowedState {
diff --git a/ash/shelf/home_button.cc b/ash/shelf/home_button.cc index c810f47..eb30de9 100644 --- a/ash/shelf/home_button.cc +++ b/ash/shelf/home_button.cc
@@ -28,8 +28,8 @@ namespace ash { namespace { -constexpr uint8_t kAssistantVisibleAlpha = 255; // 100% alpha -constexpr uint8_t kAssistantInvisibleAlpha = 138; // 54% alpha +constexpr uint8_t kVoiceInteractionRunningAlpha = 255; // 100% alpha +constexpr uint8_t kVoiceInteractionNotRunningAlpha = 138; // 54% alpha } // namespace @@ -93,7 +93,7 @@ OnPressed(show_source, event.time_stamp()); } -void HomeButton::OnAssistantAvailabilityChanged() { +void HomeButton::OnVoiceInteractionAvailabilityChanged() { SchedulePaint(); } @@ -125,7 +125,7 @@ // factors. float ring_outer_radius_dp = 7.f; float ring_thickness_dp = 1.5f; - if (controller_.IsAssistantAvailable()) { + if (controller_.IsVoiceInteractionAvailable()) { ring_outer_radius_dp = 8.f; ring_thickness_dp = 1.f; } @@ -138,11 +138,11 @@ fg_flags.setStyle(cc::PaintFlags::kStroke_Style); fg_flags.setColor(ShelfConfig::Get()->shelf_icon_color()); - if (controller_.IsAssistantAvailable()) { + if (controller_.IsVoiceInteractionAvailable()) { // active: 100% alpha, inactive: 54% alpha - fg_flags.setAlpha(controller_.IsAssistantVisible() - ? kAssistantVisibleAlpha - : kAssistantInvisibleAlpha); + fg_flags.setAlpha(controller_.IsVoiceInteractionRunning() + ? kVoiceInteractionRunningAlpha + : kVoiceInteractionNotRunningAlpha); } const float thickness = std::ceil(ring_thickness_dp * dsf); @@ -151,7 +151,7 @@ // Make sure the center of the circle lands on pixel centers. canvas->DrawCircle(circle_center, radius, fg_flags); - if (controller_.IsAssistantAvailable()) { + if (controller_.IsVoiceInteractionAvailable()) { fg_flags.setAlpha(255); const float kCircleRadiusDp = 5.f; fg_flags.setStyle(cc::PaintFlags::kFill_Style);
diff --git a/ash/shelf/home_button.h b/ash/shelf/home_button.h index c7b4a66..a80f9b352 100644 --- a/ash/shelf/home_button.h +++ b/ash/shelf/home_button.h
@@ -49,7 +49,7 @@ // Called when the availability of a long-press gesture may have changed, e.g. // when Assistant becomes enabled. - void OnAssistantAvailabilityChanged(); + void OnVoiceInteractionAvailabilityChanged(); // True if the app list is shown for the display containing this button. bool IsShowingAppList() const;
diff --git a/ash/shelf/home_button_controller.cc b/ash/shelf/home_button_controller.cc index 0636c26..4b55cbd 100644 --- a/ash/shelf/home_button_controller.cc +++ b/ash/shelf/home_button_controller.cc
@@ -20,6 +20,7 @@ #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" +#include "base/timer/timer.h" #include "chromeos/constants/chromeos_features.h" #include "components/account_id/account_id.h" #include "ui/display/screen.h" @@ -29,6 +30,8 @@ namespace ash { namespace { +constexpr int kVoiceInteractionAnimationDelayMs = 200; + // Returns true if the button should appear activatable. bool CanActivate() { return Shell::Get()->tablet_mode_controller()->InTabletMode() || @@ -46,11 +49,11 @@ shell->tablet_mode_controller()->AddObserver(this); AssistantState::Get()->AddObserver(this); - // Initialize the Assistant overlay and sync the flags if active user session - // has already started. This could happen when an external monitor is plugged - // in. + // Initialize voice interaction overlay and sync the flags if active user + // session has already started. This could happen when an external monitor + // is plugged in. if (shell->session_controller()->IsActiveUserSessionStarted()) - InitializeAssistantOverlay(); + InitializeVoiceInteractionOverlay(); } HomeButtonController::~HomeButtonController() { @@ -71,8 +74,9 @@ switch (event->type()) { case ui::ET_GESTURE_TAP: case ui::ET_GESTURE_TAP_CANCEL: - if (IsAssistantAvailable()) { + if (IsVoiceInteractionAvailable()) { assistant_overlay_->EndAnimation(); + assistant_animation_delay_timer_->Stop(); } if (CanActivate()) @@ -81,13 +85,23 @@ // After animating the ripple, let the button handle the event. return false; case ui::ET_GESTURE_TAP_DOWN: + if (IsVoiceInteractionAvailable()) { + assistant_animation_delay_timer_->Start( + FROM_HERE, + base::TimeDelta::FromMilliseconds( + kVoiceInteractionAnimationDelayMs), + base::BindOnce( + &HomeButtonController::StartVoiceInteractionAnimation, + base::Unretained(this))); + } + if (CanActivate()) button_->AnimateInkDrop(views::InkDropState::ACTION_PENDING, event); return false; case ui::ET_GESTURE_LONG_PRESS: - // Only consume the long press event if the Assistant is available. - if (!IsAssistantAvailable()) + // Only consume the long press event if voice interaction is available. + if (!IsVoiceInteractionAvailable()) return false; base::RecordAction(base::UserMetricsAction( @@ -100,8 +114,8 @@ AssistantEntryPoint::kLongPressLauncher); return true; case ui::ET_GESTURE_LONG_TAP: - // Only consume the long tap event if the Assistant is available. - if (!IsAssistantAvailable()) + // Only consume the long tap event if voice interaction is available. + if (!IsVoiceInteractionAvailable()) return false; // This event happens after the user long presses and lifts the finger. @@ -116,7 +130,7 @@ } } -bool HomeButtonController::IsAssistantAvailable() { +bool HomeButtonController::IsVoiceInteractionAvailable() { AssistantStateBase* state = AssistantState::Get(); bool settings_enabled = state->settings_enabled().value_or(false); bool feature_allowed = @@ -125,12 +139,11 @@ return assistant_overlay_ && feature_allowed && settings_enabled; } -bool HomeButtonController::IsAssistantVisible() { - return Shell::Get() - ->assistant_controller() - ->ui_controller() - ->model() - ->visibility() == AssistantVisibility::kVisible; +bool HomeButtonController::IsVoiceInteractionRunning() { + // TODO(b/140823590): Update the method name/description and use Assistant + // visibility state instead. + return AssistantState::Get()->assistant_state() == + mojom::AssistantState::VISIBLE; } void HomeButtonController::OnAppListVisibilityChanged(bool shown, @@ -145,12 +158,12 @@ void HomeButtonController::OnActiveUserSessionChanged( const AccountId& account_id) { - button_->OnAssistantAvailabilityChanged(); - // Initialize the Assistant overlay when primary user session becomes + button_->OnVoiceInteractionAvailabilityChanged(); + // Initialize voice interaction overlay when primary user session becomes // active. if (Shell::Get()->session_controller()->IsUserPrimary() && !assistant_overlay_) { - InitializeAssistantOverlay(); + InitializeVoiceInteractionOverlay(); } } @@ -160,14 +173,30 @@ void HomeButtonController::OnAssistantStatusChanged( mojom::AssistantState state) { - button_->OnAssistantAvailabilityChanged(); + button_->OnVoiceInteractionAvailabilityChanged(); + + if (!assistant_overlay_) + return; + + switch (state) { + case mojom::AssistantState::READY: + UMA_HISTOGRAM_TIMES( + "VoiceInteraction.OpenDuration", + base::TimeTicks::Now() - voice_interaction_start_timestamp_); + break; + case mojom::AssistantState::NOT_READY: + break; + case mojom::AssistantState::VISIBLE: + voice_interaction_start_timestamp_ = base::TimeTicks::Now(); + break; + } } void HomeButtonController::OnAssistantSettingsEnabled(bool enabled) { - button_->OnAssistantAvailabilityChanged(); + button_->OnVoiceInteractionAvailabilityChanged(); } -void HomeButtonController::StartAssistantAnimation() { +void HomeButtonController::StartVoiceInteractionAnimation() { assistant_overlay_->StartAnimation(false); } @@ -188,10 +217,11 @@ ->UpdateShelfVisibility(); } -void HomeButtonController::InitializeAssistantOverlay() { +void HomeButtonController::InitializeVoiceInteractionOverlay() { assistant_overlay_ = new AssistantOverlay(button_); button_->AddChildView(assistant_overlay_); assistant_overlay_->SetVisible(false); + assistant_animation_delay_timer_ = std::make_unique<base::OneShotTimer>(); } } // namespace ash
diff --git a/ash/shelf/home_button_controller.h b/ash/shelf/home_button_controller.h index 9588e48c..54a967456 100644 --- a/ash/shelf/home_button_controller.h +++ b/ash/shelf/home_button_controller.h
@@ -13,6 +13,10 @@ #include "ash/session/session_observer.h" #include "base/macros.h" +namespace base { +class OneShotTimer; +} // namespace base + namespace ui { class GestureEvent; } // namespace ui @@ -33,16 +37,16 @@ explicit HomeButtonController(HomeButton* button); ~HomeButtonController() override; - // Maybe handles a gesture event based on the event and whether the Assistant - // is available. Returns true if the event is consumed; otherwise, HomeButton - // should pass the event along to Button to consume. + // Maybe handles a gesture event based on the event and whether voice + // interaction is available. Returns true if the event is consumed; otherwise, + // HomeButton should pass the event along to Button to consume. bool MaybeHandleGestureEvent(ui::GestureEvent* event); - // Whether the Assistant is available via long-press. - bool IsAssistantAvailable(); + // Whether voice interaction is available via long-press. + bool IsVoiceInteractionAvailable(); - // Whether the Assistant UI currently showing. - bool IsAssistantVisible(); + // Whether voice interaction is currently running. + bool IsVoiceInteractionRunning(); bool is_showing_app_list() const { return is_showing_app_list_; } @@ -63,10 +67,10 @@ void OnAppListShown(); void OnAppListDismissed(); - void StartAssistantAnimation(); + void StartVoiceInteractionAnimation(); - // Initialize the Assistant overlay. - void InitializeAssistantOverlay(); + // Initialize the voice interaction overlay. + void InitializeVoiceInteractionOverlay(); // True if the app list is currently showing for the button's display. // This is useful because other app_list_visible functions aren't per-display. @@ -75,9 +79,11 @@ // The button that owns this controller. HomeButton* const button_; - // Owned by the button's view hierarchy. Null if the Assistant is not + // Owned by the button's view hierarchy. Null if voice interaction is not // enabled. AssistantOverlay* assistant_overlay_ = nullptr; + std::unique_ptr<base::OneShotTimer> assistant_animation_delay_timer_; + base::TimeTicks voice_interaction_start_timestamp_; DISALLOW_COPY_AND_ASSIGN(HomeButtonController); };
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc index 4d6f68b..5539e7a 100644 --- a/ash/shelf/shelf_layout_manager.cc +++ b/ash/shelf/shelf_layout_manager.cc
@@ -2039,7 +2039,8 @@ // offset to the hotseats extended position. if (state_.hotseat_state == HotseatState::kExtended && visibility_state() == SHELF_VISIBLE) { - drag_amount_ = -ShelfConfig::Get()->hotseat_size(); + drag_amount_ = -(ShelfConfig::Get()->hotseat_size() + + ShelfConfig::Get()->hotseat_bottom_padding()); } else { drag_amount_ = 0.f; }
diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc index 12349bc..22bc30b 100644 --- a/ash/shelf/shelf_widget.cc +++ b/ash/shelf/shelf_widget.cc
@@ -50,6 +50,7 @@ // the screen edge). constexpr int kShelfMaxOvershootHeight = 40; constexpr float kShelfBlurQuality = 0.33f; +constexpr gfx::Size kDragHandleSize(80, 4); // Return the first or last focusable child of |root|. views::View* FindFirstOrLastFocusableChild(views::View* root, @@ -101,6 +102,8 @@ void ReorderChildLayers(ui::Layer* parent_layer) override; void UpdateBackgroundBlur(); void UpdateOpaqueBackground(); + void UpdateDragHandle(); + // This will be called when the parent local bounds change. void OnBoundsChanged(const gfx::Rect& old_bounds) override; @@ -119,6 +122,10 @@ // ShelfBackgroundAnimator. ui::Layer opaque_background_; + // A drag handle shown in tablet mode when we are not on the home screen. + // Owned by the view hierarchy. + views::View* drag_handle_ = nullptr; + // When true, the default focus of the shelf is the last focusable child. bool default_last_focusable_child_ = false; @@ -136,9 +143,15 @@ DCHECK(shelf_widget_); set_owned_by_client(); // Deleted by DeleteDelegate(). - SetLayoutManager(std::make_unique<views::FillLayout>()); set_allow_deactivate_on_esc(true); + std::unique_ptr<views::View> drag_handle_ptr = + std::make_unique<views::View>(); + drag_handle_ = AddChildView(std::move(drag_handle_ptr)); + drag_handle_->SetPaintToLayer(ui::LAYER_SOLID_COLOR); + drag_handle_->layer()->SetColor(SK_ColorWHITE); + drag_handle_->SetSize(kDragHandleSize); + UpdateOpaqueBackground(); } @@ -239,10 +252,27 @@ opaque_background_.AddCacheRenderSurfaceRequest(); } opaque_background_.SetBounds(opaque_background_bounds); + UpdateDragHandle(); UpdateBackgroundBlur(); SchedulePaint(); } +void ShelfWidget::DelegateView::UpdateDragHandle() { + if (!Shell::Get()->tablet_mode_controller()->InTabletMode() || + !ShelfConfig::Get()->is_in_app() || + !chromeos::switches::ShouldShowShelfHotseat()) { + drag_handle_->SetVisible(false); + return; + } + drag_handle_->SetVisible(true); + drag_handle_->SetX((shelf_widget_->GetClientAreaBoundsInScreen().width() - + kDragHandleSize.width()) / + 2); + drag_handle_->SetY((shelf_widget_->GetClientAreaBoundsInScreen().height() - + kDragHandleSize.height()) / + 2); +} + void ShelfWidget::DelegateView::OnBoundsChanged(const gfx::Rect& old_bounds) { UpdateOpaqueBackground(); } @@ -528,29 +558,11 @@ if (!using_views_shelf || unknown_state || hide_on_secondary_screen) { HideIfShown(); } else { - switch (state) { - case session_manager::SessionState::ACTIVE: - login_shelf_view_->SetVisible(false); - hotseat_widget()->GetShelfView()->SetVisible(true); - break; - case session_manager::SessionState::LOCKED: - case session_manager::SessionState::LOGIN_SECONDARY: - hotseat_widget()->GetShelfView()->SetVisible(false); - login_shelf_view_->SetVisible(true); - break; - case session_manager::SessionState::OOBE: - login_shelf_view_->SetVisible(true); - hotseat_widget()->GetShelfView()->SetVisible(false); - break; - case session_manager::SessionState::LOGIN_PRIMARY: - case session_manager::SessionState::LOGGED_IN_NOT_ACTIVE: - login_shelf_view_->SetVisible(true); - hotseat_widget()->GetShelfView()->SetVisible(false); - break; - default: - // session_manager::SessionState::UNKNOWN handled in if statement above. - NOTREACHED(); - } + bool show_hotseat = (state == session_manager::SessionState::ACTIVE); + hotseat_widget()->GetShelfView()->SetVisible(show_hotseat); + login_shelf_view()->SetVisible(!show_hotseat); + delegate_view_->SetLayoutManager( + show_hotseat ? nullptr : std::make_unique<views::FillLayout>()); ShowIfHidden(); } login_shelf_view_->UpdateAfterSessionChange();
diff --git a/ash/system/palette/palette_tray_unittest.cc b/ash/system/palette/palette_tray_unittest.cc index c613ec39..aa907a2 100644 --- a/ash/system/palette/palette_tray_unittest.cc +++ b/ash/system/palette/palette_tray_unittest.cc
@@ -338,7 +338,7 @@ TEST_F(PaletteTrayTestWithAssistant, MetalayerToolActivatesHighlighter) { ui::ScopedAnimationDurationScaleMode animation_duration_mode( ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); - assistant_state()->NotifyStatusChanged(mojom::AssistantState::READY); + assistant_state()->NotifyStatusChanged(mojom::AssistantState::VISIBLE); prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantEnabled, true); prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantContextEnabled, true); @@ -453,7 +453,7 @@ false /* no highlighter on press */); // Once the service is ready, the button should start working. - assistant_state()->NotifyStatusChanged(mojom::AssistantState::READY); + assistant_state()->NotifyStatusChanged(mojom::AssistantState::VISIBLE); // Press and drag with no button, still no highlighter. WaitDragAndAssertMetalayer("all enabled, no button ", origin, ui::EF_NONE,
diff --git a/ash/system/palette/tools/metalayer_unittest.cc b/ash/system/palette/tools/metalayer_unittest.cc index bb59e54..e12c615 100644 --- a/ash/system/palette/tools/metalayer_unittest.cc +++ b/ash/system/palette/tools/metalayer_unittest.cc
@@ -71,7 +71,8 @@ // has enabled the metalayer AND the Assistant framework is ready. TEST_F(MetalayerToolTest, PaletteMenuState) { const mojom::AssistantState kStates[] = {mojom::AssistantState::NOT_READY, - mojom::AssistantState::READY}; + mojom::AssistantState::READY, + mojom::AssistantState::VISIBLE}; const mojom::AssistantAllowedState kAllowedStates[] = { mojom::AssistantAllowedState::ALLOWED, mojom::AssistantAllowedState::DISALLOWED_BY_POLICY, @@ -143,6 +144,7 @@ // Verifies that disabling the metalayer support disables the tool. TEST_F(MetalayerToolTest, MetalayerUnsupportedDisablesPaletteTool) { + assistant_state()->NotifyStatusChanged(mojom::AssistantState::VISIBLE); prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantEnabled, true); prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantContextEnabled, true); @@ -173,6 +175,7 @@ DisableTool(PaletteToolId::METALAYER)) .Times(0); assistant_state()->NotifyStatusChanged(mojom::AssistantState::READY); + assistant_state()->NotifyStatusChanged(mojom::AssistantState::VISIBLE); testing::Mock::VerifyAndClearExpectations(palette_tool_delegate_.get()); // Changing the state to NOT_READY should disable the tool.
diff --git a/ash/wm/overview/caption_container_view.cc b/ash/wm/overview/caption_container_view.cc index f67f8e62..283865f 100644 --- a/ash/wm/overview/caption_container_view.cc +++ b/ash/wm/overview/caption_container_view.cc
@@ -274,6 +274,14 @@ event_delegate_->OnHighlightedViewClosed(); } +gfx::Point CaptionContainerView::GetMagnifierFocusPointInScreen() { + // When this item is tabbed into, put the magnifier focus on the front of the + // title, so that users can read the title first thing. + const gfx::Rect title_bounds = title_label_->GetBoundsInScreen(); + return gfx::Point(GetMirroredXInView(title_bounds.x()), + title_bounds.CenterPoint().y()); +} + void CaptionContainerView::Layout() { gfx::Rect bounds(GetLocalBounds()); bounds.Inset(kOverviewMargin, kOverviewMargin);
diff --git a/ash/wm/overview/caption_container_view.h b/ash/wm/overview/caption_container_view.h index 16d6dce..d0584f3 100644 --- a/ash/wm/overview/caption_container_view.h +++ b/ash/wm/overview/caption_container_view.h
@@ -95,6 +95,7 @@ gfx::Rect GetHighlightBoundsInScreen() override; void MaybeActivateHighlightedView() override; void MaybeCloseHighlightedView() override; + gfx::Point GetMagnifierFocusPointInScreen() override; // TODO(sammiequon): Move these to a test api. views::View* header_view() { return header_view_; }
diff --git a/ash/wm/overview/overview_highlight_controller.cc b/ash/wm/overview/overview_highlight_controller.cc index 03c0f2d..0883bbd 100644 --- a/ash/wm/overview/overview_highlight_controller.cc +++ b/ash/wm/overview/overview_highlight_controller.cc
@@ -4,6 +4,8 @@ #include "ash/wm/overview/overview_highlight_controller.h" +#include "ash/magnifier/docked_magnifier_controller_impl.h" +#include "ash/magnifier/magnification_controller.h" #include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/window_properties.h" #include "ash/shell.h" @@ -179,6 +181,11 @@ return overview_session->highlight_controller()->highlighted_view_ == this; } +gfx::Point OverviewHighlightController::OverviewHighlightableView:: + GetMagnifierFocusPointInScreen() { + return GetHighlightBoundsInScreen().CenterPoint(); +} + // ----------------------------------------------------------------------------- // OverviewHighlightController::TestApi @@ -376,8 +383,24 @@ OverviewHighlightableView* previous_view = highlighted_view_; highlighted_view_ = view_to_be_highlighted; + + // Perform accessiblity related tasks. highlighted_view_->GetView()->NotifyAccessibilityEvent( ax::mojom::Event::kSelection, true); + // Note that both magnifiers are mutually exclusive. The overview "focus" + // works differently from regular focusing so we need to update the magnifier + // manually here. + DockedMagnifierControllerImpl* docked_magnifier = + Shell::Get()->docked_magnifier_controller(); + MagnificationController* fullscreen_magnifier = + Shell::Get()->magnification_controller(); + const gfx::Point point_of_interest = + highlighted_view_->GetMagnifierFocusPointInScreen(); + if (docked_magnifier->GetEnabled()) + docked_magnifier->CenterOnPoint(point_of_interest); + else if (fullscreen_magnifier->IsEnabled()) + fullscreen_magnifier->CenterOnPoint(point_of_interest); + if (previous_view) previous_view->OnViewUnhighlighted();
diff --git a/ash/wm/overview/overview_highlight_controller.h b/ash/wm/overview/overview_highlight_controller.h index b76a392..4c88473 100644 --- a/ash/wm/overview/overview_highlight_controller.h +++ b/ash/wm/overview/overview_highlight_controller.h
@@ -59,6 +59,10 @@ // Returns true if this is the current highlighted view. bool IsViewHighlighted(); + // Returns the point the accessibility magnifiers should focus when this is + // highlighted. If not overridden, this will return the centerpoint. + virtual gfx::Point GetMagnifierFocusPointInScreen(); + protected: virtual ~OverviewHighlightableView() {} };
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index af82c66..d0f6174 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -8901506071232259296 \ No newline at end of file +8900990138279554656 \ No newline at end of file
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1 index 908d9741..a1fa977 100644 --- a/build/fuchsia/mac.sdk.sha1 +++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@ -8901506068351790832 \ No newline at end of file +8900988970603371744 \ No newline at end of file
diff --git a/chrome/VERSION b/chrome/VERSION index 09054b9a..843ad14 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=79 MINOR=0 -BUILD=3926 +BUILD=3928 PATCH=0
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java index 0e8d609..3d23738 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
@@ -204,6 +204,7 @@ public static final String CHROME_DUET_ADAPTIVE = "ChromeDuetAdaptive"; public static final String DONT_AUTO_HIDE_BROWSER_CONTROLS = "DontAutoHideBrowserControls"; public static final String CHROME_DUET_LABELED = "ChromeDuetLabeled"; + public static final String CHROME_SHARING_HUB = "ChromeSharingHub"; public static final String CHROME_SMART_SELECTION = "ChromeSmartSelection"; public static final String CLEAR_OLD_BROWSING_DATA = "ClearOldBrowsingData"; public static final String CLICK_TO_CALL_OPEN_DIALER_DIRECTLY = "ClickToCallOpenDialerDirectly";
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/LocationBarLayoutTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/LocationBarLayoutTest.java index 273b052..88f80e1 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/LocationBarLayoutTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/LocationBarLayoutTest.java
@@ -21,7 +21,6 @@ import org.chromium.base.ContextUtils; import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Restriction; import org.chromium.chrome.R; @@ -242,7 +241,7 @@ @Test @SmallTest - @DisabledTest + @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) @EnableFeatures(ChromeFeatureList.OMNIBOX_SEARCH_ENGINE_LOGO) @Feature({"OmniboxSearchEngineLogo"}) public void testOmniboxSearchEngineLogo_goneWhenIncognito() throws Exception {
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index a7a593a..63217e63 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -1050,9 +1050,6 @@ "page_load_metrics/observers/third_party_metrics_observer.h", "page_load_metrics/observers/ukm_page_load_metrics_observer.cc", "page_load_metrics/observers/ukm_page_load_metrics_observer.h", - "page_load_metrics/observers/use_counter/ukm_features.cc", - "page_load_metrics/observers/use_counter_page_load_metrics_observer.cc", - "page_load_metrics/observers/use_counter_page_load_metrics_observer.h", "page_load_metrics/page_load_metrics_initialize.cc", "page_load_metrics/page_load_metrics_initialize.h", "password_manager/account_storage/account_password_store_factory.cc",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index c6483761..ddbcb40 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -1978,6 +1978,9 @@ {"enable-chrome-duet-labels", flag_descriptions::kChromeDuetLabelsName, flag_descriptions::kChromeDuetLabelsDescription, kOsAndroid, FEATURE_VALUE_TYPE(chrome::android::kChromeDuetLabeled)}, + {"chrome-sharing-hub", flag_descriptions::kChromeSharingHubName, + flag_descriptions::kChromeSharingHubDescription, kOsAndroid, + FEATURE_VALUE_TYPE(chrome::android::kChromeSharingHub)}, {"enable-bookmark-reorder", flag_descriptions::kReorderBookmarksName, flag_descriptions::kReorderBookmarksDescription, kOsAndroid, FEATURE_VALUE_TYPE(chrome::android::kReorderBookmarks)}, @@ -3085,12 +3088,6 @@ flag_descriptions::kNtpCustomizationMenuV2Description, kOsDesktop, FEATURE_VALUE_TYPE(features::kNtpCustomizationMenuV2)}, - {"ntp-disable-initial-most-visited-fade-in", - flag_descriptions::kNtpDisableInitialMostVisitedFadeInName, - flag_descriptions::kNtpDisableInitialMostVisitedFadeInDescription, - kOsDesktop, - FEATURE_VALUE_TYPE(features::kDisableInitialMostVisitedFadeIn)}, - {"ntp-dismiss-promos", flag_descriptions::kNtpDismissPromosName, flag_descriptions::kNtpDismissPromosDescription, kOsDesktop, FEATURE_VALUE_TYPE(features::kDismissNtpPromos)}, @@ -4637,6 +4634,12 @@ FEATURE_VALUE_TYPE(features::kLegacyTLSWarnings)}, #endif +#if defined(OS_CHROMEOS) + {"enable-assistant-aec", flag_descriptions::kEnableGoogleAssistantAecName, + flag_descriptions::kEnableGoogleAssistantAecDescription, kOsCrOS, + FEATURE_VALUE_TYPE(chromeos::assistant::features::kAssistantAudioEraser)}, +#endif + // NOTE: Adding a new flag requires adding a corresponding entry to enum // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag // Histograms" in tools/metrics/histograms/README.md (run the
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc index 008ec7f..2d98eee 100644 --- a/chrome/browser/android/chrome_feature_list.cc +++ b/chrome/browser/android/chrome_feature_list.cc
@@ -116,6 +116,7 @@ &kDarkenWebsitesCheckboxInThemesSetting, &kDontAutoHideBrowserControls, &kChromeDuetLabeled, + &kChromeSharingHub, &kChromeSmartSelection, &kClickToCallOpenDialerDirectly, &kCommandLineOnNonRooted, @@ -346,6 +347,9 @@ const base::Feature kChromeDuetLabeled{"ChromeDuetLabeled", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kChromeSharingHub{"ChromeSharingHub", + base::FEATURE_DISABLED_BY_DEFAULT}; + const base::Feature kChromeSmartSelection{"ChromeSmartSelection", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/chrome/browser/android/chrome_feature_list.h b/chrome/browser/android/chrome_feature_list.h index a122753..a2cd83a 100644 --- a/chrome/browser/android/chrome_feature_list.h +++ b/chrome/browser/android/chrome_feature_list.h
@@ -46,6 +46,7 @@ extern const base::Feature kChromeDuetAdaptive; extern const base::Feature kDontAutoHideBrowserControls; extern const base::Feature kChromeDuetLabeled; +extern const base::Feature kChromeSharingHub; extern const base::Feature kChromeSmartSelection; extern const base::Feature kClickToCallOpenDialerDirectly; extern const base::Feature kCommandLineOnNonRooted;
diff --git a/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.cc b/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.cc index 7780ff51..113229fc 100644 --- a/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.cc +++ b/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.cc
@@ -262,9 +262,8 @@ std::unique_ptr<AvatarMenu> ExtensionAppShimHandler::Delegate::CreateAvatarMenu( AvatarMenuObserver* observer) { - ProfileManager* profile_manager = g_browser_process->profile_manager(); - return std::make_unique<AvatarMenu>( - &profile_manager->GetProfileAttributesStorage(), observer, nullptr); + // TODO(https://crbug.com/1008947): Fix use-after-free caused by AvatarMenu. + return nullptr; } Profile* ExtensionAppShimHandler::Delegate::ProfileForPath(
diff --git a/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.cc b/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.cc index 57e283d..1cd98d5 100644 --- a/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.cc +++ b/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.cc
@@ -83,6 +83,7 @@ #include "components/arc/metrics/arc_metrics_constants.h" #include "components/user_manager/user_manager.h" #include "content/public/browser/histogram_fetcher.h" +#include "extensions/browser/event_router.h" #include "extensions/browser/extension_function_registry.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_system.h" @@ -97,6 +98,8 @@ #include "net/base/filename_util.h" #include "ui/aura/window.h" #include "ui/aura/window_observer.h" +#include "ui/base/clipboard/clipboard.h" +#include "ui/base/clipboard/scoped_clipboard_writer.h" #include "ui/base/ime/ime_bridge.h" #include "ui/base/ui_base_features.h" #include "ui/display/display.h" @@ -412,6 +415,21 @@ } // namespace /////////////////////////////////////////////////////////////////////////////// +// AutotestPrivateInitializeEventsFunction +/////////////////////////////////////////////////////////////////////////////// + +AutotestPrivateInitializeEventsFunction:: + ~AutotestPrivateInitializeEventsFunction() = default; + +ExtensionFunction::ResponseAction +AutotestPrivateInitializeEventsFunction::Run() { + // AutotestPrivateAPI is lazily initialized, but needs to be created before + // any of its events can be fired, so we get the instance here and return. + AutotestPrivateAPI::GetFactoryInstance()->Get(browser_context()); + return RespondNow(NoArguments()); +} + +/////////////////////////////////////////////////////////////////////////////// // AutotestPrivateLogoutFunction /////////////////////////////////////////////////////////////////////////////// @@ -1172,6 +1190,42 @@ } /////////////////////////////////////////////////////////////////////////////// +// AutotestPrivateGetClipboardTextDataFunction +/////////////////////////////////////////////////////////////////////////////// + +AutotestPrivateGetClipboardTextDataFunction:: + ~AutotestPrivateGetClipboardTextDataFunction() = default; + +ExtensionFunction::ResponseAction +AutotestPrivateGetClipboardTextDataFunction::Run() { + base::string16 data; + ui::Clipboard::GetForCurrentThread()->ReadText( + ui::ClipboardBuffer::kCopyPaste, &data); + return RespondNow( + OneArgument(base::Value::ToUniquePtrValue(base::Value(data)))); +} + +/////////////////////////////////////////////////////////////////////////////// +// AutotestPrivateSetClipboardTextDataFunction +/////////////////////////////////////////////////////////////////////////////// + +AutotestPrivateSetClipboardTextDataFunction:: + ~AutotestPrivateSetClipboardTextDataFunction() = default; + +ExtensionFunction::ResponseAction +AutotestPrivateSetClipboardTextDataFunction::Run() { + std::unique_ptr<api::autotest_private::SetClipboardTextData::Params> params( + api::autotest_private::SetClipboardTextData::Params::Create(*args_)); + EXTENSION_FUNCTION_VALIDATE(params); + + const base::string16 data = base::UTF8ToUTF16(params->data); + ui::ScopedClipboardWriter clipboard_writer(ui::ClipboardBuffer::kCopyPaste); + clipboard_writer.WriteText(data); + + return RespondNow(NoArguments()); +} + +/////////////////////////////////////////////////////////////////////////////// // AutotestPrivateSetCrostiniEnabledFunction /////////////////////////////////////////////////////////////////////////////// @@ -2614,11 +2668,28 @@ KeyedService* BrowserContextKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor( content::BrowserContext* context) const { - return new AutotestPrivateAPI(); + return new AutotestPrivateAPI(context); } -AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) {} +AutotestPrivateAPI::AutotestPrivateAPI(content::BrowserContext* context) + : clipboard_observer_(this), browser_context_(context), test_mode_(false) { + clipboard_observer_.Add(ui::ClipboardMonitor::GetInstance()); +} AutotestPrivateAPI::~AutotestPrivateAPI() = default; +void AutotestPrivateAPI::OnClipboardDataChanged() { + EventRouter* event_router = EventRouter::Get(browser_context_); + if (!event_router) + return; + + std::unique_ptr<base::ListValue> event_args = + std::make_unique<base::ListValue>(); + std::unique_ptr<Event> event( + new Event(events::AUTOTESTPRIVATE_ON_CLIPBOARD_DATA_CHANGED, + api::autotest_private::OnClipboardDataChanged::kEventName, + std::move(event_args))); + event_router->BroadcastEvent(std::move(event)); +} + } // namespace extensions
diff --git a/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h b/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h index 429094c..d3eba5f 100644 --- a/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h +++ b/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h
@@ -12,6 +12,7 @@ #include "ash/public/cpp/assistant/assistant_state.h" #include "ash/public/cpp/window_state_type.h" #include "base/compiler_specific.h" +#include "base/scoped_observer.h" #include "base/timer/timer.h" #include "chrome/browser/chromeos/printing/cups_printers_manager.h" #include "chrome/browser/extensions/chrome_extension_function.h" @@ -19,6 +20,8 @@ #include "chromeos/services/machine_learning/public/mojom/model.mojom.h" #include "extensions/browser/browser_context_keyed_api_factory.h" #include "mojo/public/cpp/bindings/receiver.h" +#include "ui/base/clipboard/clipboard_monitor.h" +#include "ui/base/clipboard/clipboard_observer.h" #include "ui/snapshot/screenshot_grabber.h" namespace crostini { @@ -29,6 +32,16 @@ class AssistantInteractionHelper; +class AutotestPrivateInitializeEventsFunction : public ExtensionFunction { + public: + DECLARE_EXTENSION_FUNCTION("autotestPrivate.initializeEvents", + AUTOTESTPRIVATE_INITIALIZEEVENTS) + + private: + ~AutotestPrivateInitializeEventsFunction() override; + ResponseAction Run() override; +}; + class AutotestPrivateLogoutFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("autotestPrivate.logout", AUTOTESTPRIVATE_LOGOUT) @@ -318,6 +331,26 @@ ResponseAction Run() override; }; +class AutotestPrivateGetClipboardTextDataFunction : public ExtensionFunction { + public: + DECLARE_EXTENSION_FUNCTION("autotestPrivate.getClipboardTextData", + AUTOTESTPRIVATE_GETCLIPBOARDTEXTDATA) + + private: + ~AutotestPrivateGetClipboardTextDataFunction() override; + ResponseAction Run() override; +}; + +class AutotestPrivateSetClipboardTextDataFunction : public ExtensionFunction { + public: + DECLARE_EXTENSION_FUNCTION("autotestPrivate.setClipboardTextData", + AUTOTESTPRIVATE_SETCLIPBOARDTEXTDATA) + + private: + ~AutotestPrivateSetClipboardTextDataFunction() override; + ResponseAction Run() override; +}; + class AutotestPrivateSetCrostiniEnabledFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("autotestPrivate.setCrostiniEnabled", @@ -578,7 +611,8 @@ }; // The profile-keyed service that manages the autotestPrivate extension API. -class AutotestPrivateAPI : public BrowserContextKeyedAPI { +class AutotestPrivateAPI : public BrowserContextKeyedAPI, + public ui::ClipboardObserver { public: static BrowserContextKeyedAPIFactory<AutotestPrivateAPI>* GetFactoryInstance(); @@ -590,7 +624,7 @@ private: friend class BrowserContextKeyedAPIFactory<AutotestPrivateAPI>; - AutotestPrivateAPI(); + explicit AutotestPrivateAPI(content::BrowserContext* context); ~AutotestPrivateAPI() override; // BrowserContextKeyedAPI implementation. @@ -598,6 +632,13 @@ static const bool kServiceIsNULLWhileTesting = true; static const bool kServiceRedirectedInIncognito = true; + // ui::ClipboardObserver + void OnClipboardDataChanged() override; + + ScopedObserver<ui::ClipboardMonitor, ui::ClipboardObserver> + clipboard_observer_; + + content::BrowserContext* const browser_context_; bool test_mode_; // true for AutotestPrivateApiTest.AutotestPrivate test. };
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_browsertest.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_browsertest.cc index bbfde7a5..4ad890d 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_browsertest.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_browsertest.cc
@@ -10,6 +10,7 @@ #include "base/stl_util.h" #include "base/test/scoped_feature_list.h" #include "base/values.h" +#include "build/buildflag.h" #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" #include "chrome/browser/prefs/session_startup_pref.h" #include "chrome/browser/profiles/profile.h" @@ -20,6 +21,7 @@ #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_features.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" +#include "chromeos/assistant/buildflags.h" #include "components/arc/arc_features.h" #include "components/arc/arc_prefs.h" #include "components/policy/core/browser/browser_policy_connector.h" @@ -220,7 +222,15 @@ using UserCloudPolicyManagerChildTest = UserCloudPolicyManagerTest; -IN_PROC_BROWSER_TEST_P(UserCloudPolicyManagerChildTest, PolicyForChildUser) { +// TODO(https://crbug.com/1005454): This test is failing on bots that show the +// assistent opt-in screen. +#if BUILDFLAG(ENABLE_CROS_LIBASSISTANT) +#define MAYBE_PolicyForChildUser DISABLED_PolicyForChildUser +#else +#define MAYBE_PolicyForChildUser PolicyForChildUser +#endif +IN_PROC_BROWSER_TEST_P(UserCloudPolicyManagerChildTest, + MAYBE_PolicyForChildUser) { policy::BrowserPolicyConnector::SetNonEnterpriseDomainForTesting( "example.com"); EXPECT_TRUE(policy::BrowserPolicyConnector::IsNonEnterpriseUser(
diff --git a/chrome/browser/download/download_frame_policy_browsertest.cc b/chrome/browser/download/download_frame_policy_browsertest.cc index fe2d9d7..f927903 100644 --- a/chrome/browser/download/download_frame_policy_browsertest.cc +++ b/chrome/browser/download/download_frame_policy_browsertest.cc
@@ -11,12 +11,12 @@ #include "base/test/scoped_feature_list.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/metrics/subprocess_metrics_provider.h" -#include "chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/subresource_filter/subresource_filter_browser_test_harness.h" #include "chrome/browser/ui/browser.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.h" #include "components/page_load_metrics/browser/page_load_metrics_test_waiter.h" #include "components/subresource_filter/content/browser/ruleset_service.h" #include "components/subresource_filter/core/browser/subresource_filter_features.h"
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 172ebc5..20b6b22f 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -441,6 +441,11 @@ "expiry_milestone": 79 }, { + "name": "chrome-sharing-hub", + "owners": ["kmilka"], + "expiry_milestone": 83 + }, + { "name": "clear-old-browsing-data", "owners": [ "dullweber" ], "expiry_milestone": 78 @@ -894,6 +899,11 @@ "expiry_milestone": 76 }, { + "name": "enable-assistant-aec", + "owners": [ "croissant-eng" ], + "expiry_milestone": 88 + }, + { "name": "enable-assistant-app-support", "owners": [ "croissant-eng" ], "expiry_milestone": 78 @@ -2483,7 +2493,7 @@ { "name": "ntp-disable-initial-most-visited-fade-in", "owners": ["dbeam"], - "expiry_milestone": 80 + "expiry_milestone": 79 }, { "name": "ntp-dismiss-promos",
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index f3b4261..88cf8b3 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -2390,6 +2390,10 @@ const char kChromeDuetLabelsDescription[] = "Enables Chrome Duet (split toolbar) labels."; +const char kChromeSharingHubName[] = "Chrome Sharing Hub"; +const char kChromeSharingHubDescription[] = + "Enables the Chrome Sharing Hub/custom share sheet."; + const char kClearOldBrowsingDataName[] = "Clear older browsing data"; const char kClearOldBrowsingDataDescription[] = "Enables clearing of browsing data which is older than a given time " @@ -2848,11 +2852,6 @@ const char kNtpCustomizationMenuV2Description[] = "Use the second version of the NTP customization menu."; -const char kNtpDisableInitialMostVisitedFadeInName[] = - "Disable NTP initial most visited fade in"; -const char kNtpDisableInitialMostVisitedFadeInDescription[] = - "Do not initially fade in most visited tiles on the New Tab Page"; - const char kNtpDismissPromosName[] = "Dismiss promos on the New Tab Page"; const char kNtpDismissPromosDescription[] = "Enables a UI to persistently dismiss [non-emergency] promos on the " @@ -3384,6 +3383,11 @@ "Enable an experimental feature that uses stereo audio input for hotword " "and voice to text detection in Google Assistant."; +const char kEnableGoogleAssistantAecName[] = "Enable Google Assistant AEC"; +const char kEnableGoogleAssistantAecDescription[] = + "Enable an experimental feature that removes local feedback from audio " + "input to help hotword and ASR when background audio is playing."; + const char kEnableHeuristicStylusPalmRejectionName[] = "Enable Heuristic for Stylus/Palm Rejection."; const char kEnableHeuristicStylusPalmRejectionDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 90f242f..feaa489 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1415,6 +1415,9 @@ extern const char kChromeDuetLabelsName[]; extern const char kChromeDuetLabelsDescription[]; +extern const char kChromeSharingHubName[]; +extern const char kChromeSharingHubDescription[]; + extern const char kClearOldBrowsingDataName[]; extern const char kClearOldBrowsingDataDescription[]; @@ -1676,9 +1679,6 @@ extern const char kNtpCustomizationMenuV2Name[]; extern const char kNtpCustomizationMenuV2Description[]; -extern const char kNtpDisableInitialMostVisitedFadeInName[]; -extern const char kNtpDisableInitialMostVisitedFadeInDescription[]; - extern const char kNtpDismissPromosName[]; extern const char kNtpDismissPromosDescription[]; @@ -2010,6 +2010,9 @@ extern const char kEnableGoogleAssistantStereoInputName[]; extern const char kEnableGoogleAssistantStereoInputDescription[]; +extern const char kEnableGoogleAssistantAecName[]; +extern const char kEnableGoogleAssistantAecDescription[]; + extern const char kEnableHeuristicStylusPalmRejectionName[]; extern const char kEnableHeuristicStylusPalmRejectionDescription[];
diff --git a/chrome/browser/lookalikes/lookalike_url_interstitial_page.cc b/chrome/browser/lookalikes/lookalike_url_interstitial_page.cc index f9efcdca..758d3a00b 100644 --- a/chrome/browser/lookalikes/lookalike_url_interstitial_page.cc +++ b/chrome/browser/lookalikes/lookalike_url_interstitial_page.cc
@@ -90,8 +90,8 @@ const base::string16 hostname = security_interstitials::common_string_util::GetFormattedHostName( request_url()); - load_time_data->SetString("tabTitle", l10n_util::GetStringFUTF16( - IDS_LOOKALIKE_URL_TITLE, hostname)); + load_time_data->SetString("tabTitle", + l10n_util::GetStringUTF16(IDS_LOOKALIKE_URL_TITLE)); load_time_data->SetString( "heading", l10n_util::GetStringFUTF16(IDS_LOOKALIKE_URL_HEADING, hostname));
diff --git a/chrome/browser/metrics/chrome_stability_metrics_provider.cc b/chrome/browser/metrics/chrome_stability_metrics_provider.cc index a02875f..968b903 100644 --- a/chrome/browser/metrics/chrome_stability_metrics_provider.cc +++ b/chrome/browser/metrics/chrome_stability_metrics_provider.cc
@@ -7,14 +7,12 @@ #include <vector> #include "base/logging.h" -#include "base/metrics/histogram_macros.h" -#include "base/metrics/sparse_histogram.h" #include "build/build_config.h" -#include "chrome/browser/chrome_notification_types.h" #include "content/public/browser/browser_child_process_observer.h" #include "content/public/browser/child_process_data.h" #include "content/public/browser/child_process_termination_info.h" #include "content/public/browser/notification_service.h" +#include "content/public/browser/notification_types.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/process_type.h" #include "extensions/buildflags/buildflags.h"
diff --git a/chrome/browser/metrics/chrome_stability_metrics_provider.h b/chrome/browser/metrics/chrome_stability_metrics_provider.h index 6b63a380..ae996e9e 100644 --- a/chrome/browser/metrics/chrome_stability_metrics_provider.h +++ b/chrome/browser/metrics/chrome_stability_metrics_provider.h
@@ -7,7 +7,6 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" -#include "base/process/kill.h" #include "base/scoped_observer.h" #include "build/build_config.h" #include "components/metrics/metrics_provider.h"
diff --git a/chrome/browser/net_benchmarking.cc b/chrome/browser/net_benchmarking.cc index 9d3d09cc1..c4354f5 100644 --- a/chrome/browser/net_benchmarking.cc +++ b/chrome/browser/net_benchmarking.cc
@@ -18,7 +18,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/storage_partition.h" -#include "mojo/public/cpp/bindings/strong_binding.h" +#include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "services/network/public/mojom/network_context.mojom.h" using content::BrowserThread; @@ -51,11 +51,12 @@ void NetBenchmarking::Create( base::WeakPtr<predictors::LoadingPredictor> loading_predictor, int render_process_id, - chrome::mojom::NetBenchmarkingRequest request) { + mojo::PendingReceiver<chrome::mojom::NetBenchmarking> receiver) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - mojo::MakeStrongBinding(std::make_unique<NetBenchmarking>( - std::move(loading_predictor), render_process_id), - std::move(request)); + mojo::MakeSelfOwnedReceiver( + std::make_unique<NetBenchmarking>(std::move(loading_predictor), + render_process_id), + std::move(receiver)); } // static
diff --git a/chrome/browser/net_benchmarking.h b/chrome/browser/net_benchmarking.h index 045d2c1..f8b6c0d 100644 --- a/chrome/browser/net_benchmarking.h +++ b/chrome/browser/net_benchmarking.h
@@ -8,6 +8,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chrome/common/net_benchmarking.mojom.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" namespace predictors { class LoadingPredictor; @@ -28,7 +29,7 @@ static void Create( base::WeakPtr<predictors::LoadingPredictor> loading_predictor, int render_process_id, - chrome::mojom::NetBenchmarkingRequest request); + mojo::PendingReceiver<chrome::mojom::NetBenchmarking> receiver); // This method is thread-safe. static bool CheckBenchmarkingEnabled();
diff --git a/chrome/browser/offline_pages/android/offline_page_auto_fetcher.cc b/chrome/browser/offline_pages/android/offline_page_auto_fetcher.cc index 0dfd12c..1d91f46 100644 --- a/chrome/browser/offline_pages/android/offline_page_auto_fetcher.cc +++ b/chrome/browser/offline_pages/android/offline_page_auto_fetcher.cc
@@ -14,7 +14,7 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" -#include "mojo/public/cpp/bindings/strong_binding.h" +#include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "url/gurl.h" namespace offline_pages { @@ -72,13 +72,13 @@ // static void OfflinePageAutoFetcher::Create( - chrome::mojom::OfflinePageAutoFetcherRequest request, + mojo::PendingReceiver<chrome::mojom::OfflinePageAutoFetcher> receiver, content::RenderFrameHost* render_frame_host) { - // Lifetime of the strong binding can exceed the render frame host, so + // Lifetime of the self owned receiver can exceed the render frame host, so // OfflinePageAutoFetcher does not retain a reference. - mojo::MakeStrongBinding( + mojo::MakeSelfOwnedReceiver( std::make_unique<OfflinePageAutoFetcher>(render_frame_host), - std::move(request)); + std::move(receiver)); } } // namespace offline_pages
diff --git a/chrome/browser/offline_pages/android/offline_page_auto_fetcher.h b/chrome/browser/offline_pages/android/offline_page_auto_fetcher.h index a7ca7c4..aecd7294 100644 --- a/chrome/browser/offline_pages/android/offline_page_auto_fetcher.h +++ b/chrome/browser/offline_pages/android/offline_page_auto_fetcher.h
@@ -13,6 +13,7 @@ #include "chrome/common/offline_page_auto_fetcher.mojom.h" #include "components/offline_pages/core/background/request_queue_results.h" #include "components/offline_pages/core/background/save_page_request.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" namespace content { class RenderFrameHost; @@ -29,8 +30,9 @@ void TrySchedule(bool user_requested, TryScheduleCallback callback) override; void CancelSchedule() override; - static void Create(chrome::mojom::OfflinePageAutoFetcherRequest request, - content::RenderFrameHost* render_frame_host); + static void Create( + mojo::PendingReceiver<chrome::mojom::OfflinePageAutoFetcher> receiver, + content::RenderFrameHost* render_frame_host); private: OfflinePageAutoFetcherService* GetService();
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 0f96fb6..70aacfe2 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
@@ -16,13 +16,13 @@ #include "chrome/browser/metrics/subprocess_metrics_provider.h" #include "chrome/browser/page_load_metrics/observers/ad_metrics/ads_page_load_metrics_observer.h" #include "chrome/browser/page_load_metrics/observers/ad_metrics/frame_data.h" -#include "chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/subresource_filter/subresource_filter_browser_test_harness.h" #include "chrome/browser/ui/browser.h" #include "chrome/common/chrome_features.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.h" #include "components/page_load_metrics/browser/page_load_metrics_test_waiter.h" #include "components/subresource_filter/content/browser/ruleset_service.h" #include "components/subresource_filter/core/browser/subresource_filter_features.h" @@ -31,8 +31,6 @@ #include "components/subresource_filter/core/common/test_ruleset_utils.h" #include "components/subresource_filter/core/mojom/subresource_filter.mojom.h" #include "components/ukm/test_ukm_recorder.h" -#include "content/public/browser/render_process_host.h" -#include "content/public/common/content_features.h" #include "content/public/common/url_constants.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" @@ -93,7 +91,9 @@ : public subresource_filter::SubresourceFilterBrowserTest { public: AdsPageLoadMetricsObserverBrowserTest() - : subresource_filter::SubresourceFilterBrowserTest() {} + : subresource_filter::SubresourceFilterBrowserTest() { + scoped_feature_list_.InitAndEnableFeature(subresource_filter::kAdTagging); + } ~AdsPageLoadMetricsObserverBrowserTest() override {} std::unique_ptr<page_load_metrics::PageLoadMetricsTestWaiter> @@ -104,20 +104,6 @@ web_contents); } - void SetUp() override { - std::vector<base::Feature> enabled = {subresource_filter::kAdTagging, - features::kSitePerProcess}; - std::vector<base::Feature> disabled = {}; - - if (use_process_priority_) { - enabled.push_back(features::kUseFramePriorityInRenderProcessHost); - } else { - disabled.push_back(features::kUseFramePriorityInRenderProcessHost); - } - scoped_feature_list_.InitWithFeatures(enabled, disabled); - subresource_filter::SubresourceFilterBrowserTest::SetUp(); - } - void SetUpOnMainThread() override { SubresourceFilterBrowserTest::SetUpOnMainThread(); SetRulesetWithRules( @@ -127,9 +113,6 @@ "expensive_animation_frame.html*")}); } - protected: - bool use_process_priority_ = false; - private: base::test::ScopedFeatureList scoped_feature_list_; @@ -1310,156 +1293,3 @@ histogram_tester.ExpectTotalCount( "PageLoad.Clients.Ads.Bytes.AdFrames.Aggregate.Total", 0); } - -IN_PROC_BROWSER_TEST_F( - AdsPageLoadMetricsObserverBrowserTest, - RenderProcessHostNotBackgroundedWhenFramePriorityDisabled) { - // Used for assignment during testing. - auto frame1_pred = base::BindRepeating(&content::FrameMatchesName, "iframe1"); - auto frame2_pred = base::BindRepeating(&content::FrameMatchesName, "iframe2"); - - // Navigate to a page with an iframe. Make sure the two frames share a - // process and that process is not low priority. - ui_test_utils::NavigateToURL( - browser(), embedded_test_server()->GetURL("/two_iframes_blank.html")); - content::RenderFrameHost* main_frame = web_contents()->GetMainFrame(); - content::RenderFrameHost* frame1 = - content::FrameMatchingPredicate(web_contents(), frame1_pred); - content::RenderFrameHost* frame2 = - content::FrameMatchingPredicate(web_contents(), frame2_pred); - EXPECT_EQ(main_frame->GetProcess(), frame1->GetProcess()); - EXPECT_EQ(main_frame->GetProcess(), frame2->GetProcess()); - EXPECT_FALSE(main_frame->GetProcess()->IsProcessBackgrounded()); - - // Navigate iframe1 to a cross-origin non-ad frame. It should be on a - // different process, but still not be low priority. - NavigateIframeToURL( - web_contents(), "iframe1", - embedded_test_server()->GetURL("a.com", "/iframe_blank.html")); - frame1 = content::FrameMatchingPredicate(web_contents(), frame1_pred); - EXPECT_NE(main_frame->GetProcess(), frame1->GetProcess()); - EXPECT_FALSE(main_frame->GetProcess()->IsProcessBackgrounded()); - EXPECT_FALSE(frame1->GetProcess()->IsProcessBackgrounded()); - - // Navigate iframe1 to an ad on its current domain. It should have the same - // process host but because the feature is turned off, not be low priority. - content::DOMMessageQueue message_queue1(web_contents()); - NavigateIframeToURL( - web_contents(), "iframe1", - embedded_test_server()->GetURL( - "a.com", "/ads_observer/expensive_animation_frame.html?delay=0")); - WaitForRAF(&message_queue1); - EXPECT_EQ(frame1->GetProcess(), - content::FrameMatchingPredicate(web_contents(), frame1_pred) - ->GetProcess()); - EXPECT_FALSE(main_frame->GetProcess()->IsProcessBackgrounded()); - EXPECT_FALSE(frame1->GetProcess()->IsProcessBackgrounded()); -} - -class AdsPageLoadMetricsObserverWithBackgroundingBrowserTest - : public AdsPageLoadMetricsObserverBrowserTest { - public: - AdsPageLoadMetricsObserverWithBackgroundingBrowserTest() - : AdsPageLoadMetricsObserverBrowserTest() { - use_process_priority_ = true; - } - ~AdsPageLoadMetricsObserverWithBackgroundingBrowserTest() override {} -}; - -IN_PROC_BROWSER_TEST_F(AdsPageLoadMetricsObserverWithBackgroundingBrowserTest, - RenderProcessHostBackgroundedForAd) { - // Used for assignment during testing. - auto frame1_pred = base::BindRepeating(&content::FrameMatchesName, "iframe1"); - auto frame2_pred = base::BindRepeating(&content::FrameMatchesName, "iframe2"); - - // Navigate to a page with an iframe. Make sure the two frames share a - // process and that process is not low priority. - ui_test_utils::NavigateToURL( - browser(), embedded_test_server()->GetURL("/two_iframes_blank.html")); - content::RenderFrameHost* main_frame = web_contents()->GetMainFrame(); - content::RenderFrameHost* frame1 = - content::FrameMatchingPredicate(web_contents(), frame1_pred); - content::RenderFrameHost* frame2 = - content::FrameMatchingPredicate(web_contents(), frame2_pred); - EXPECT_EQ(main_frame->GetProcess(), frame1->GetProcess()); - EXPECT_EQ(main_frame->GetProcess(), frame2->GetProcess()); - EXPECT_FALSE(main_frame->GetProcess()->IsProcessBackgrounded()); - - // Navigate iframe1 to a cross-origin non-ad frame. It should be on a - // different process, but still not be low priority. - NavigateIframeToURL( - web_contents(), "iframe1", - embedded_test_server()->GetURL("a.com", "/iframe_blank.html")); - frame1 = content::FrameMatchingPredicate(web_contents(), frame1_pred); - EXPECT_NE(main_frame->GetProcess(), frame1->GetProcess()); - EXPECT_FALSE(main_frame->GetProcess()->IsProcessBackgrounded()); - EXPECT_FALSE(frame1->GetProcess()->IsProcessBackgrounded()); - - // Navigate iframe1 to an ad on its current domain. It should have the - // same process host but now be low priority. - content::DOMMessageQueue message_queue1(web_contents()); - NavigateIframeToURL( - web_contents(), "iframe1", - embedded_test_server()->GetURL( - "a.com", "/ads_observer/expensive_animation_frame.html?delay=0")); - WaitForRAF(&message_queue1); - EXPECT_EQ(frame1->GetProcess(), - content::FrameMatchingPredicate(web_contents(), frame1_pred) - ->GetProcess()); - EXPECT_FALSE(main_frame->GetProcess()->IsProcessBackgrounded()); - EXPECT_TRUE(frame1->GetProcess()->IsProcessBackgrounded()); - - // Navigate the iframe2 to a non-ad on the same domain as iframe1. Make sure - // that they get assigned the same process and that it's not low priority. - NavigateIframeToURL( - web_contents(), "iframe2", - embedded_test_server()->GetURL("a.com", "/iframe_blank.html")); - frame2 = content::FrameMatchingPredicate(web_contents(), frame2_pred); - EXPECT_EQ(frame1->GetProcess(), frame2->GetProcess()); - EXPECT_FALSE(main_frame->GetProcess()->IsProcessBackgrounded()); - EXPECT_FALSE(frame1->GetProcess()->IsProcessBackgrounded()); - - // Delete iframe2, make sure that iframe1 is now low priority, as it now only - // has ads assigned to it. - EXPECT_TRUE(content::ExecuteScriptWithoutUserGesture( - web_contents(), - "var frame = document.getElementById('iframe2'); " - "frame.parentNode.removeChild(frame);")); - EXPECT_TRUE(frame1->GetProcess()->IsProcessBackgrounded()); - - // Navigate the subframe to a non-ad on its current domain. Even though this - // is a non-ad, the frame is still identified as an ad because it was - // previously identified as an ad by SubresourceFilterThrottle. - NavigateIframeToURL( - web_contents(), "iframe1", - embedded_test_server()->GetURL("a.com", "/iframe_blank.html")); - EXPECT_EQ(frame1->GetProcess(), - content::FrameMatchingPredicate(web_contents(), frame1_pred) - ->GetProcess()); - EXPECT_FALSE(main_frame->GetProcess()->IsProcessBackgrounded()); - EXPECT_TRUE(frame1->GetProcess()->IsProcessBackgrounded()); - - // Navigate the subframe to an ad on the original domain. It should now have - // the same process as the main frame, but not be low priority because it - // shares a process with a non-ad frame (the main frame). - content::DOMMessageQueue message_queue2(web_contents()); - NavigateIframeToURL( - web_contents(), "iframe1", - embedded_test_server()->GetURL( - "/ads_observer/expensive_animation_frame.html?delay=0")); - WaitForRAF(&message_queue2); - frame1 = content::FrameMatchingPredicate(web_contents(), frame1_pred); - EXPECT_EQ(main_frame->GetProcess(), frame1->GetProcess()); - EXPECT_FALSE(frame1->GetProcess()->IsProcessBackgrounded()); - - // Navigate the subframe to a non-ad on a different domain. Even though this - // is a non-ad, the frame is still identified as an ad because it was - // previously identified as an ad by SubresourceFilterThrottle. - NavigateIframeToURL( - web_contents(), "iframe1", - embedded_test_server()->GetURL("b.com", "/iframe_blank.html")); - frame1 = content::FrameMatchingPredicate(web_contents(), frame1_pred); - EXPECT_NE(main_frame->GetProcess(), frame1->GetProcess()); - EXPECT_FALSE(main_frame->GetProcess()->IsProcessBackgrounded()); - EXPECT_TRUE(frame1->GetProcess()->IsProcessBackgrounded()); -}
diff --git a/chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer_unittest.cc index f8545b2..89c2734 100644 --- a/chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.h" +#include "components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.h" #include <memory> #include <vector>
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 0cf3bf1..7973a93 100644 --- a/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc +++ b/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
@@ -29,7 +29,6 @@ #include "chrome/browser/page_load_metrics/observers/no_state_prefetch_page_load_metrics_observer.h" #include "chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer.h" #include "chrome/browser/page_load_metrics/observers/ukm_page_load_metrics_observer.h" -#include "chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.h" #include "chrome/browser/page_load_metrics/page_load_metrics_initialize.h" #include "chrome/browser/prefs/session_startup_pref.h" #include "chrome/browser/prerender/prerender_handle.h" @@ -57,6 +56,7 @@ #include "chrome/test/base/ui_test_utils.h" #include "components/keep_alive_registry/keep_alive_types.h" #include "components/keep_alive_registry/scoped_keep_alive.h" +#include "components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.h" #include "components/page_load_metrics/browser/page_load_metrics_test_waiter.h" #include "components/page_load_metrics/browser/page_load_tracker.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc b/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc index 9b4354b6..8ef39ca0 100644 --- a/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc +++ b/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc
@@ -41,7 +41,6 @@ #include "chrome/browser/page_load_metrics/observers/tab_restore_page_load_metrics_observer.h" #include "chrome/browser/page_load_metrics/observers/third_party_metrics_observer.h" #include "chrome/browser/page_load_metrics/observers/ukm_page_load_metrics_observer.h" -#include "chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.h" #include "chrome/browser/prerender/prerender_contents.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search/search.h" @@ -133,7 +132,6 @@ web_contents()->GetBrowserContext())); tracker->AddObserver(std::make_unique<ProtocolPageLoadMetricsObserver>()); tracker->AddObserver(std::make_unique<TabRestorePageLoadMetricsObserver>()); - tracker->AddObserver(std::make_unique<UseCounterPageLoadMetricsObserver>()); tracker->AddObserver( std::make_unique<DataSaverSiteBreakdownMetricsObserver>()); std::unique_ptr<AdsPageLoadMetricsObserver> ads_observer = @@ -207,6 +205,9 @@ void InitializePageLoadMetricsForWebContents( content::WebContents* web_contents) { + // Change this method? consider to modify the peer in + // android_webview/browser/page_load_metrics/page_load_metrics_initialize.cc + // as well. page_load_metrics::MetricsWebContentsObserver::CreateForWebContents( web_contents, std::make_unique<PageLoadMetricsEmbedder>(web_contents)); }
diff --git a/chrome/browser/resources/local_ntp/most_visited_single.css b/chrome/browser/resources/local_ntp/most_visited_single.css index 995e9a8..3a73a79 100644 --- a/chrome/browser/resources/local_ntp/most_visited_single.css +++ b/chrome/browser/resources/local_ntp/most_visited_single.css
@@ -65,6 +65,7 @@ position: static; /* This align correctly for both LTR and RTL */ text-align: -webkit-auto; + transition: opacity 300ms; user-select: none; } @@ -78,10 +79,6 @@ text-align: unset; } -html:not(.no-initial-fade) :-webkit-any(#mv-tiles, .mv-tiles-old) { - transition: opacity 300ms; -} - .mv-tiles-old { left: 0; margin: auto;
diff --git a/chrome/browser/resources/local_ntp/most_visited_single.html b/chrome/browser/resources/local_ntp/most_visited_single.html index 9d8db29..0fa5b62 100644 --- a/chrome/browser/resources/local_ntp/most_visited_single.html +++ b/chrome/browser/resources/local_ntp/most_visited_single.html
@@ -1,5 +1,5 @@ <!doctype html> -<html class="$i18n{noInitialFade}"> +<html> <!-- Copyright 2015 The Chromium Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. -->
diff --git a/chrome/browser/resources/local_ntp/most_visited_single.js b/chrome/browser/resources/local_ntp/most_visited_single.js index cd107c2..e33debf 100644 --- a/chrome/browser/resources/local_ntp/most_visited_single.js +++ b/chrome/browser/resources/local_ntp/most_visited_single.js
@@ -64,7 +64,6 @@ MD_TILE: 'md-tile', MD_TILE_INNER: 'md-tile-inner', MD_TITLE: 'md-title', - NO_INITIAL_FADE: 'no-initial-fade', }; /** @@ -957,11 +956,6 @@ flushOpacity(); cur.style.opacity = 1.0; - if (document.documentElement.classList.contains(CLASSES.NO_INITIAL_FADE)) { - flushOpacity(); - document.documentElement.classList.remove(CLASSES.NO_INITIAL_FADE); - } - // Make sure the tiles variable contain the next tileset we'll use if the host // page sends us an updated set of tiles. tiles = document.createElement('div');
diff --git a/chrome/browser/search/most_visited_iframe_source.cc b/chrome/browser/search/most_visited_iframe_source.cc index cba6bd0..d89b02d 100644 --- a/chrome/browser/search/most_visited_iframe_source.cc +++ b/chrome/browser/search/most_visited_iframe_source.cc
@@ -4,8 +4,6 @@ #include "chrome/browser/search/most_visited_iframe_source.h" -#include "base/command_line.h" -#include "base/feature_list.h" #include "base/memory/ref_counted_memory.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" @@ -68,11 +66,7 @@ std::string path(url.path()); if (path == kSingleHTMLPath) { - ui::TemplateReplacements replacements; - bool disable_fade = base::FeatureList::IsEnabled( - features::kDisableInitialMostVisitedFadeIn); - replacements["noInitialFade"] = disable_fade ? "no-initial-fade" : ""; - SendResource(IDR_MOST_VISITED_SINGLE_HTML, callback, &replacements); + SendResource(IDR_MOST_VISITED_SINGLE_HTML, callback); } else if (path == kSingleCSSPath) { SendResource(IDR_MOST_VISITED_SINGLE_CSS, callback); } else if (path == kSingleJSPath) { @@ -162,20 +156,9 @@ void MostVisitedIframeSource::SendResource( int resource_id, - const content::URLDataSource::GotDataCallback& callback, - const ui::TemplateReplacements* replacements) { - scoped_refptr<base::RefCountedMemory> bytes = - ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes( - resource_id); - if (!replacements) { - callback.Run(bytes); - return; - } - - base::StringPiece input(reinterpret_cast<const char*>(bytes->front()), - bytes->size()); - std::string response = ui::ReplaceTemplateExpressions(input, *replacements); - callback.Run(base::RefCountedString::TakeString(&response)); + const content::URLDataSource::GotDataCallback& callback) { + callback.Run(ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes( + resource_id)); } void MostVisitedIframeSource::SendJSWithOrigin(
diff --git a/chrome/browser/search/most_visited_iframe_source.h b/chrome/browser/search/most_visited_iframe_source.h index 1af6aec..12af692 100644 --- a/chrome/browser/search/most_visited_iframe_source.h +++ b/chrome/browser/search/most_visited_iframe_source.h
@@ -8,7 +8,6 @@ #include "base/macros.h" #include "build/build_config.h" #include "content/public/browser/url_data_source.h" -#include "ui/base/template_expressions.h" #if defined(OS_ANDROID) #error "Instant is only used on desktop"; @@ -40,8 +39,7 @@ // Sends unmodified resource bytes. void SendResource(int resource_id, - const content::URLDataSource::GotDataCallback& callback, - const ui::TemplateReplacements* replacements = nullptr); + const content::URLDataSource::GotDataCallback& callback); // Sends Javascript with an expected postMessage origin interpolated. void SendJSWithOrigin(
diff --git a/chrome/browser/search/ntp_features.cc b/chrome/browser/search/ntp_features.cc index fb1db0f..58cea3b 100644 --- a/chrome/browser/search/ntp_features.cc +++ b/chrome/browser/search/ntp_features.cc
@@ -19,10 +19,6 @@ const base::Feature kChromeColorsCustomColorPicker{ "ChromeColorsCustomColorPicker", base::FEATURE_DISABLED_BY_DEFAULT}; -// If enabled, does not fade in most visited tiles on initial page load. -const base::Feature kDisableInitialMostVisitedFadeIn{ - "DisableInitialMostVisitedFadeIn", base::FEATURE_DISABLED_BY_DEFAULT}; - // If enabled, the NTP shortcut layout will be replaced with a grid layout that // enables better animations. const base::Feature kGridLayoutForNtpShortcuts{
diff --git a/chrome/browser/search/ntp_features.h b/chrome/browser/search/ntp_features.h index 1878a8f..6c281d4 100644 --- a/chrome/browser/search/ntp_features.h +++ b/chrome/browser/search/ntp_features.h
@@ -14,7 +14,6 @@ extern const base::Feature kChromeColors; extern const base::Feature kChromeColorsCustomColorPicker; -extern const base::Feature kDisableInitialMostVisitedFadeIn; extern const base::Feature kGridLayoutForNtpShortcuts; extern const base::Feature kNtpCustomizationMenuV2;
diff --git a/chrome/browser/search/promos/promo_service.cc b/chrome/browser/search/promos/promo_service.cc index 9f8ace34..574c30a 100644 --- a/chrome/browser/search/promos/promo_service.cc +++ b/chrome/browser/search/promos/promo_service.cc
@@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/callback.h" +#include "base/feature_list.h" #include "base/values.h" #include "chrome/browser/search/ntp_features.h" #include "chrome/common/pref_names.h" @@ -144,7 +145,6 @@ auto resource_request = std::make_unique<network::ResourceRequest>(); resource_request->url = GetApiUrl(); - resource_request->credentials_mode = network::mojom::CredentialsMode::kOmit; resource_request->request_initiator = url::Origin::Create(GURL(chrome::kChromeUINewTabURL));
diff --git a/chrome/browser/send_tab_to_self/send_tab_to_self_util.cc b/chrome/browser/send_tab_to_self/send_tab_to_self_util.cc index cb07330..13c3c2a 100644 --- a/chrome/browser/send_tab_to_self/send_tab_to_self_util.cc +++ b/chrome/browser/send_tab_to_self/send_tab_to_self_util.cc
@@ -52,12 +52,10 @@ } bool ShouldOfferFeature(content::WebContents* web_contents) { - if (!web_contents) { + if (!web_contents) return false; - } Profile* profile = Profile::FromBrowserContext(web_contents->GetBrowserContext()); - // If sending is enabled, then so is receiving. return IsSendingEnabled() && IsUserSyncTypeActive(profile) && HasValidTargetDevice(profile) && @@ -79,4 +77,11 @@ IsContentRequirementsMet(link_url, profile)); } +bool ShouldOfferOmniboxIcon(content::WebContents* web_contents) { + if (!web_contents) + return false; + return !web_contents->IsWaitingForResponse() && + ShouldOfferFeature(web_contents); +} + } // namespace send_tab_to_self
diff --git a/chrome/browser/send_tab_to_self/send_tab_to_self_util.h b/chrome/browser/send_tab_to_self/send_tab_to_self_util.h index d04da63..8efab87 100644 --- a/chrome/browser/send_tab_to_self/send_tab_to_self_util.h +++ b/chrome/browser/send_tab_to_self/send_tab_to_self_util.h
@@ -30,13 +30,16 @@ // User is not in Incongnito mode. bool IsContentRequirementsMet(const GURL& gurl, Profile* profile); -// Returns true if all conditions are true and shows the option onto the menu. +// Returns true if the feature should be offered in menus. bool ShouldOfferFeature(content::WebContents* web_contents); -// Returns true if all conditions are true and shows the option onto the link -// menu. +// Returns true if the feature should be offered in link context menus. bool ShouldOfferFeatureForLink(content::WebContents* web_contents, const GURL& link_url); + +// Returns true if the omnibox icon for the feature should be offered. +bool ShouldOfferOmniboxIcon(content::WebContents* web_contents); + } // namespace send_tab_to_self #endif // CHROME_BROWSER_SEND_TAB_TO_SELF_SEND_TAB_TO_SELF_UTIL_H_
diff --git a/chrome/browser/send_tab_to_self/send_tab_to_self_util_unittest.cc b/chrome/browser/send_tab_to_self/send_tab_to_self_util_unittest.cc index 888f657f..e85ff1e 100644 --- a/chrome/browser/send_tab_to_self/send_tab_to_self_util_unittest.cc +++ b/chrome/browser/send_tab_to_self/send_tab_to_self_util_unittest.cc
@@ -19,6 +19,7 @@ #include "components/send_tab_to_self/send_tab_to_self_sync_service.h" #include "components/send_tab_to_self/test_send_tab_to_self_model.h" #include "components/sync/driver/sync_driver_switches.h" +#include "content/public/test/navigation_simulator.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -112,7 +113,7 @@ EXPECT_FALSE(IsContentRequirementsMet(url_, incognito_profile_)); } -TEST_F(SendTabToSelfUtilTest, ShouldOfferFeatureForTelephoneLink) { +TEST_F(SendTabToSelfUtilTest, ShouldNotOfferFeatureForTelephoneLink) { url_ = GURL("tel:07387252578"); scoped_feature_list_.InitWithFeatures({kSendTabToSelfShowSendingUI}, {}); @@ -139,6 +140,32 @@ EXPECT_TRUE(ShouldOfferFeatureForLink(web_contents, url_)); } + +TEST_F(SendTabToSelfUtilTest, ShouldNotOfferFeatureInOmniboxWhileNavigating) { + scoped_feature_list_.InitWithFeatures({kSendTabToSelfShowSendingUI}, {}); + AddTab(browser(), url_); + SendTabToSelfSyncServiceFactory::GetInstance()->SetTestingFactory( + profile(), base::BindRepeating(&BuildTestSendTabToSelfSyncService)); + + content::WebContents* web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + + EXPECT_FALSE(web_contents->IsWaitingForResponse()); + EXPECT_TRUE(ShouldOfferOmniboxIcon(web_contents)); + + std::unique_ptr<content::NavigationSimulator> simulator = + content::NavigationSimulator::CreateRendererInitiated( + GURL("http://test.com/"), web_contents->GetMainFrame()); + simulator->SetTransition(ui::PAGE_TRANSITION_LINK); + simulator->Start(); + EXPECT_TRUE(web_contents->IsWaitingForResponse()); + EXPECT_FALSE(ShouldOfferOmniboxIcon(web_contents)); + + simulator->Commit(); + EXPECT_FALSE(web_contents->IsWaitingForResponse()); + EXPECT_TRUE(ShouldOfferOmniboxIcon(web_contents)); +} + } // namespace } // namespace send_tab_to_self
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index d0918502..f8a1d1e 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc
@@ -87,7 +87,6 @@ #include "chrome/browser/sessions/session_tab_helper.h" #include "chrome/browser/sessions/tab_restore_service_factory.h" #include "chrome/browser/ssl/security_state_tab_helper.h" -#include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h" #include "chrome/browser/tab_contents/tab_util.h" #include "chrome/browser/task_manager/web_contents_tags.h" #include "chrome/browser/themes/theme_service.h" @@ -180,7 +179,6 @@ #include "components/sessions/core/session_types.h" #include "components/sessions/core/tab_restore_service.h" #include "components/startup_metric_utils/browser/startup_metric_utils.h" -#include "components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h" #include "components/translate/core/browser/language_state.h" #include "components/user_manager/user_manager.h" #include "components/viz/common/surfaces/surface_id.h" @@ -1378,15 +1376,6 @@ #endif // defined(OS_CHROMEOS) } -bool Browser::IsFrameLowPriority( - const content::WebContents* web_contents, - const content::RenderFrameHost* render_frame_host) { - const auto* client = - ChromeSubresourceFilterClient::FromWebContents(web_contents); - return client && - client->GetThrottleManager()->IsFrameTaggedAsAd(render_frame_host); -} - bool Browser::IsMouseLocked() const { return exclusive_access_manager_->mouse_lock_controller()->IsMouseLocked(); }
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index a99f31d..cac6e0a 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h
@@ -582,9 +582,6 @@ bool did_start_load, bool did_finish_load) override; bool ShouldShowStaleContentOnEviction(content::WebContents* source) override; - bool IsFrameLowPriority( - const content::WebContents* web_contents, - const content::RenderFrameHost* render_frame_host) override; bool is_type_normal() const { return type_ == TYPE_NORMAL; } bool is_type_popup() const { return type_ == TYPE_POPUP; }
diff --git a/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.cc b/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.cc index 88f5794..d1a2933 100644 --- a/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.cc +++ b/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.cc
@@ -41,7 +41,7 @@ bool SendTabToSelfIconView::Update() { content::WebContents* web_contents = GetWebContents(); - if (!web_contents) { + if (!send_tab_to_self::ShouldOfferOmniboxIcon(web_contents)) { return false; } @@ -68,17 +68,14 @@ } } } - } else { - if (send_tab_to_self::ShouldOfferFeature(web_contents) && - omnibox_view->model()->has_focus() && - !omnibox_view->model()->user_input_in_progress()) { - // Shows the "Send" animation one time per window. - if (initial_animation_state_ == AnimationState::kNotShown) { - AnimateIn(IDS_OMNIBOX_ICON_SEND_TAB_TO_SELF); - initial_animation_state_ = AnimationState::kShowing; - } - SetVisible(true); + } else if (omnibox_view->model()->has_focus() && + !omnibox_view->model()->user_input_in_progress()) { + // Shows the "Send" animation one time per window. + if (initial_animation_state_ == AnimationState::kNotShown) { + AnimateIn(IDS_OMNIBOX_ICON_SEND_TAB_TO_SELF); + initial_animation_state_ = AnimationState::kShowing; } + SetVisible(true); } return was_visible != GetVisible();
diff --git a/chrome/child/pdf_child_init.cc b/chrome/child/pdf_child_init.cc index 9a744f3c..7427947 100644 --- a/chrome/child/pdf_child_init.cc +++ b/chrome/child/pdf_child_init.cc
@@ -52,39 +52,46 @@ #if defined(OS_WIN) const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); - std::string process_type = + const std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); - bool is_pdf_utility_process = false; - if (command_line.HasSwitch(service_manager::switches::kServiceSandboxType)) { + + // Patch utility processes, which includes ones that do PDF to EMF conversion. + // They are hard to differentiate because they can also be launched from + // chrome/service/ in a different manner vs. from chrome/browser/. + bool needs_gdi32_patching = process_type == switches::kUtilityProcess; + + if (!needs_gdi32_patching) { + // Windows prior to Win10 use GDI fonts in the PDF PPAPI process. + needs_gdi32_patching = process_type == switches::kPpapiPluginProcess && + base::win::GetVersion() < base::win::Version::WIN10; + } + + if (!needs_gdi32_patching) { + // Printing uses GDI for fonts on all versions of Windows. + // TODO(thestig): Check and see if this is actually necessary. std::string service_sandbox_type = command_line.GetSwitchValueASCII( service_manager::switches::kServiceSandboxType); - if (service_sandbox_type == - service_manager::switches::kPdfCompositorSandbox) { - is_pdf_utility_process = true; - } + needs_gdi32_patching = service_sandbox_type == + service_manager::switches::kPdfCompositorSandbox; } - // On Win10, pdf does not use GDI fonts and does not need to run this - // initialization for the ppapi process. Printing does still use GDI for - // fonts on Win10 though. - if (is_pdf_utility_process || - (process_type == switches::kPpapiPluginProcess && - base::win::GetVersion() < base::win::Version::WIN10)) { - // Need to patch a few functions for font loading to work correctly. This - // can be removed once we switch PDF to use Skia - // (https://bugs.chromium.org/p/pdfium/issues/detail?id=11). + + if (!needs_gdi32_patching) + return; + #if defined(COMPONENT_BUILD) - HMODULE module = ::GetModuleHandleA("pdfium.dll"); - DCHECK(module); + HMODULE module = ::GetModuleHandleA("pdfium.dll"); + DCHECK(module); #else - HMODULE module = CURRENT_MODULE(); + HMODULE module = CURRENT_MODULE(); #endif // defined(COMPONENT_BUILD) - static base::NoDestructor<base::win::IATPatchFunction> patch_get_font_data; - patch_get_font_data->PatchFromModule( - module, "gdi32.dll", "GetFontData", - reinterpret_cast<void*>(GetFontDataPatch)); - g_original_get_font_data = reinterpret_cast<GetFontDataPtr>( - patch_get_font_data->original_function()); - } + // Need to patch GetFontData() for font loading to work correctly. This can be + // removed once PDFium switches to use Skia. https://crbug.com/pdfium/11 + static base::NoDestructor<base::win::IATPatchFunction> patch_get_font_data; + patch_get_font_data->PatchFromModule( + module, "gdi32.dll", "GetFontData", + reinterpret_cast<void*>(GetFontDataPatch)); + g_original_get_font_data = reinterpret_cast<GetFontDataPtr>( + patch_get_font_data->original_function()); #endif // defined(OS_WIN) }
diff --git a/chrome/common/extensions/api/autotest_private.idl b/chrome/common/extensions/api/autotest_private.idl index 3c344a7..9e7df0e 100644 --- a/chrome/common/extensions/api/autotest_private.idl +++ b/chrome/common/extensions/api/autotest_private.idl
@@ -303,7 +303,12 @@ callback VoidCallback = void (); + callback DOMStringCallback = void (DOMString data); + interface Functions { + // Must be called to allow autotestPrivateAPI events to be fired. + static void initializeEvents(); + // Logout of a user session. static void logout(); @@ -421,6 +426,14 @@ // |callback|: Invoked with details. static void getHistogram(DOMString name, HistogramCallback callback); + // Get text from ui::Clipboard. + // |callback|: Called with result. + static void getClipboardTextData(DOMStringCallback callback); + + // Set text in ui::Clipbaord. + // |callback|: Called when operation is complete. + static void setClipboardTextData(DOMString data, VoidCallback callback); + // Run the crostini installer GUI to install the default crostini // vm / container and create sshfs mount. The installer launches the // crostini terminal app on completion. The installer expects that @@ -599,4 +612,9 @@ static void setArcAppWindowFocus(DOMString packageName, VoidCallback callback); }; + + interface Events { + // Fired when the data in ui::Clipboard is changed. + static void onClipboardDataChanged(); + }; };
diff --git a/chrome/common/extensions/docs/templates/articles/getstarted.html b/chrome/common/extensions/docs/templates/articles/getstarted.html index 6183144..cefb33a2 100644 --- a/chrome/common/extensions/docs/templates/articles/getstarted.html +++ b/chrome/common/extensions/docs/templates/articles/getstarted.html
@@ -5,7 +5,7 @@ Components can include <a href="/background_pages.html">background scripts</a>, <a href="/content_scripts.html">content scripts</a>, - an <a href="/optionsV2">options page</a>, + an <a href="/options">options page</a>, <a href="/user_interface.html">UI elements</a> and various logic files. Extension components are created with web development technologies:
diff --git a/chrome/common/extensions/docs/templates/private/site.html b/chrome/common/extensions/docs/templates/private/site.html index f2db530..1485e502 100644 --- a/chrome/common/extensions/docs/templates/private/site.html +++ b/chrome/common/extensions/docs/templates/private/site.html
@@ -69,8 +69,6 @@ </div> <div class="g-unit g-last"> <div id="social-buttons"> - <div data-size="small" data-href="http://www.google.com/chrome" data-annotation="bubble" class="g-plusone"></div> - <a rel="publisher" target="_blank" href="https://plus.google.com/+GoogleChromeDevelopers?prsrc=3" data-g-label="plus" data-g-event="nav-subfooter">Add us on <span class="element-invisible">Google+</span><img src="//ssl.gstatic.com/images/icons/gplus-16.png" data-g-label="plus" data-g-event="nav-subfooter" alt=""></a> </div> </div> </div>
diff --git a/chrome/renderer/net/net_error_helper_core_unittest.cc b/chrome/renderer/net/net_error_helper_core_unittest.cc index e1da046..437e13e 100644 --- a/chrome/renderer/net/net_error_helper_core_unittest.cc +++ b/chrome/renderer/net/net_error_helper_core_unittest.cc
@@ -36,8 +36,8 @@ #include "content/public/common/service_names.mojom.h" #include "content/public/common/url_constants.h" #include "content/public/test/mock_render_thread.h" -#include "mojo/public/cpp/bindings/binding_set.h" #include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "net/base/net_errors.h" #include "testing/gmock/include/gmock/gmock.h" @@ -2683,8 +2683,9 @@ void CancelSchedule() override { cancel_calls_++; } - void AddBinding(chrome::mojom::OfflinePageAutoFetcherRequest request) { - bindings_.AddBinding(this, std::move(request)); + void AddReceiver( + mojo::PendingReceiver<chrome::mojom::OfflinePageAutoFetcher> receiver) { + receivers_.Add(this, std::move(receiver)); } int cancel_calls() const { return cancel_calls_; } @@ -2695,7 +2696,7 @@ } private: - mojo::BindingSet<chrome::mojom::OfflinePageAutoFetcher> bindings_; + mojo::ReceiverSet<chrome::mojom::OfflinePageAutoFetcher> receivers_; int cancel_calls_ = 0; std::vector<TryScheduleParameters> try_schedule_calls_; @@ -2706,17 +2707,19 @@ class TestPageAutoFetcherHelper : public PageAutoFetcherHelper { public: explicit TestPageAutoFetcherHelper( - base::RepeatingCallback<chrome::mojom::OfflinePageAutoFetcherPtr()> - binder) + base::RepeatingCallback< + mojo::PendingRemote<chrome::mojom::OfflinePageAutoFetcher>()> binder) : PageAutoFetcherHelper(nullptr), binder_(binder) {} bool Bind() override { if (!fetcher_) - fetcher_ = binder_.Run(); + fetcher_.Bind(binder_.Run()); return true; } private: - base::RepeatingCallback<chrome::mojom::OfflinePageAutoFetcherPtr()> binder_; + base::RepeatingCallback< + mojo::PendingRemote<chrome::mojom::OfflinePageAutoFetcher>()> + binder_; }; // Provides set up for testing the 'auto fetch on dino' feature. @@ -2725,9 +2728,10 @@ void SetUp() override { NetErrorHelperCoreTest::SetUp(); auto binder = base::BindLambdaForTesting([&]() { - chrome::mojom::OfflinePageAutoFetcherPtr fetcher_ptr; - fake_fetcher_.AddBinding(mojo::MakeRequest(&fetcher_ptr)); - return fetcher_ptr; + mojo::PendingRemote<chrome::mojom::OfflinePageAutoFetcher> fetcher_remote; + fake_fetcher_.AddReceiver( + fetcher_remote.InitWithNewPipeAndPassReceiver()); + return fetcher_remote; }); core()->SetPageAutoFetcherHelperForTesting(
diff --git a/chrome/renderer/net/page_auto_fetcher_helper_android.cc b/chrome/renderer/net/page_auto_fetcher_helper_android.cc index 6b5d424..655069f5 100644 --- a/chrome/renderer/net/page_auto_fetcher_helper_android.cc +++ b/chrome/renderer/net/page_auto_fetcher_helper_android.cc
@@ -54,6 +54,6 @@ if (fetcher_) return true; render_frame_->GetRemoteInterfaces()->GetInterface( - mojo::MakeRequest(&fetcher_)); + fetcher_.BindNewPipeAndPassReceiver()); return fetcher_.is_bound(); }
diff --git a/chrome/renderer/net/page_auto_fetcher_helper_android.h b/chrome/renderer/net/page_auto_fetcher_helper_android.h index f250510..fdb9554b 100644 --- a/chrome/renderer/net/page_auto_fetcher_helper_android.h +++ b/chrome/renderer/net/page_auto_fetcher_helper_android.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chrome/common/offline_page_auto_fetcher.mojom.h" +#include "mojo/public/cpp/bindings/remote.h" namespace content { class RenderFrame; @@ -39,7 +40,7 @@ virtual bool Bind(); content::RenderFrame* render_frame_; - chrome::mojom::OfflinePageAutoFetcherPtr fetcher_; + mojo::Remote<chrome::mojom::OfflinePageAutoFetcher> fetcher_; base::WeakPtrFactory<PageAutoFetcherHelper> weak_ptr_factory_{this};
diff --git a/chrome/renderer/net_benchmarking_extension.cc b/chrome/renderer/net_benchmarking_extension.cc index 3f13433..3677aee 100644 --- a/chrome/renderer/net_benchmarking_extension.cc +++ b/chrome/renderer/net_benchmarking_extension.cc
@@ -8,6 +8,7 @@ #include "chrome/common/net_benchmarking.mojom.h" #include "content/public/common/service_names.mojom.h" #include "content/public/renderer/render_thread.h" +#include "mojo/public/cpp/bindings/remote.h" #include "third_party/blink/public/platform/web_cache.h" #include "v8/include/v8.h" @@ -74,15 +75,15 @@ } static chrome::mojom::NetBenchmarking& GetNetBenchmarking() { - static base::NoDestructor<chrome::mojom::NetBenchmarkingPtr> + static base::NoDestructor<mojo::Remote<chrome::mojom::NetBenchmarking>> net_benchmarking(ConnectToBrowser()); return **net_benchmarking; } - static chrome::mojom::NetBenchmarkingPtr ConnectToBrowser() { - chrome::mojom::NetBenchmarkingPtr net_benchmarking; + static mojo::Remote<chrome::mojom::NetBenchmarking> ConnectToBrowser() { + mojo::Remote<chrome::mojom::NetBenchmarking> net_benchmarking; content::RenderThread::Get()->BindHostReceiver( - mojo::MakeRequest(&net_benchmarking)); + net_benchmarking.BindNewPipeAndPassReceiver()); return net_benchmarking; }
diff --git a/chromecast/browser/BUILD.gn b/chromecast/browser/BUILD.gn index dcbde1ae..8a62e4c 100644 --- a/chromecast/browser/BUILD.gn +++ b/chromecast/browser/BUILD.gn
@@ -84,6 +84,8 @@ "cast_renderer_block_data.h", "cast_session_id_map.cc", "cast_session_id_map.h", + "cast_system_memory_pressure_evaluator_adjuster.cc", + "cast_system_memory_pressure_evaluator_adjuster.h", "cast_web_contents_impl.cc", "cast_web_contents_impl.h", "cast_web_contents_manager.cc",
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc index 41f2d48..bd678b0 100644 --- a/chromecast/browser/cast_browser_main_parts.cc +++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -37,6 +37,7 @@ #include "chromecast/browser/cast_content_browser_client.h" #include "chromecast/browser/cast_feature_list_creator.h" #include "chromecast/browser/cast_system_memory_pressure_evaluator.h" +#include "chromecast/browser/cast_system_memory_pressure_evaluator_adjuster.h" #include "chromecast/browser/devtools/remote_debugging_server.h" #include "chromecast/browser/media/media_caps_impl.h" #include "chromecast/browser/metrics/cast_browser_metrics.h" @@ -356,7 +357,8 @@ parameters_(parameters), cast_content_browser_client_(cast_content_browser_client), url_request_context_factory_(url_request_context_factory), - media_caps_(new media::MediaCapsImpl()) { + media_caps_(new media::MediaCapsImpl()), + cast_system_memory_pressure_evaluator_adjuster_(nullptr) { DCHECK(cast_content_browser_client); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); AddDefaultCommandLineSwitches(command_line); @@ -471,9 +473,13 @@ void CastBrowserMainParts::PreMainMessageLoopRun() { #if !defined(OS_ANDROID) && !defined(OS_FUCHSIA) memory_pressure_monitor_.reset(new util::MultiSourceMemoryPressureMonitor()); - memory_pressure_monitor_->SetSystemEvaluator( + auto cast_system_memory_pressure_evaluator = std::make_unique<CastSystemMemoryPressureEvaluator>( - memory_pressure_monitor_->CreateVoter())); + memory_pressure_monitor_->CreateVoter()); + cast_system_memory_pressure_evaluator_adjuster_ = + cast_system_memory_pressure_evaluator.get(); + memory_pressure_monitor_->SetSystemEvaluator( + std::move(cast_system_memory_pressure_evaluator)); // base::Unretained() is safe because the browser client will outlive any // component in the browser; this factory method will not be called after @@ -545,6 +551,7 @@ cast_browser_process_->SetCastService( cast_browser_process_->browser_client()->CreateCastService( cast_browser_process_->browser_context(), + cast_system_memory_pressure_evaluator_adjuster_, cast_browser_process_->pref_service(), video_plane_controller_.get(), window_manager_.get())); cast_browser_process_->cast_service()->Initialize();
diff --git a/chromecast/browser/cast_browser_main_parts.h b/chromecast/browser/cast_browser_main_parts.h index 251a177..3ee4652 100644 --- a/chromecast/browser/cast_browser_main_parts.h +++ b/chromecast/browser/cast_browser_main_parts.h
@@ -35,6 +35,7 @@ #endif // defined(USE_AURA) namespace chromecast { +class CastSystemMemoryPressureEvaluatorAdjuster; class WaylandServerController; #if defined(USE_AURA) @@ -110,11 +111,12 @@ // Tracks all media pipeline backends. std::unique_ptr<media::MediaPipelineBackendManager> media_pipeline_backend_manager_; - #if !defined(OS_ANDROID) && !defined(OS_FUCHSIA) std::unique_ptr<util::MultiSourceMemoryPressureMonitor> memory_pressure_monitor_; #endif // !defined(OS_ANDROID) && !defined(OS_FUCHSIA) + CastSystemMemoryPressureEvaluatorAdjuster* + cast_system_memory_pressure_evaluator_adjuster_; #if BUILDFLAG(ENABLE_CHROMECAST_EXTENSIONS) std::unique_ptr<extensions::ExtensionsClient> extensions_client_;
diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc index 1ff0870..58ac93c 100644 --- a/chromecast/browser/cast_content_browser_client.cc +++ b/chromecast/browser/cast_content_browser_client.cc
@@ -239,6 +239,8 @@ std::unique_ptr<CastService> CastContentBrowserClient::CreateCastService( content::BrowserContext* browser_context, + CastSystemMemoryPressureEvaluatorAdjuster* + cast_system_memory_pressure_evaluator_adjuster, PrefService* pref_service, media::VideoPlaneController* video_plane_controller, CastWindowManager* window_manager) {
diff --git a/chromecast/browser/cast_content_browser_client.h b/chromecast/browser/cast_content_browser_client.h index e5acf04..87ebb8df 100644 --- a/chromecast/browser/cast_content_browser_client.h +++ b/chromecast/browser/cast_content_browser_client.h
@@ -47,6 +47,7 @@ namespace chromecast { class CastService; +class CastSystemMemoryPressureEvaluatorAdjuster; class CastWindowManager; class CastFeatureListCreator; class GeneralAudienceBrowsingService; @@ -86,6 +87,8 @@ // Creates and returns the CastService instance for the current process. virtual std::unique_ptr<CastService> CreateCastService( content::BrowserContext* browser_context, + CastSystemMemoryPressureEvaluatorAdjuster* + cast_system_memory_pressure_evaluator_adjuster, PrefService* pref_service, media::VideoPlaneController* video_plane_controller, CastWindowManager* window_manager);
diff --git a/chromecast/browser/cast_system_memory_pressure_evaluator.cc b/chromecast/browser/cast_system_memory_pressure_evaluator.cc index 24772fb..b6a9ac99 100644 --- a/chromecast/browser/cast_system_memory_pressure_evaluator.cc +++ b/chromecast/browser/cast_system_memory_pressure_evaluator.cc
@@ -11,11 +11,21 @@ #include "base/location.h" #include "base/metrics/histogram_macros.h" #include "base/process/process_metrics.h" +#include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" #include "base/threading/thread_task_runner_handle.h" #include "chromecast/base/chromecast_switches.h" #include "chromecast/base/metrics/cast_metrics_helper.h" +#define MAKE_SURE_THREAD(callback, ...) \ + if (!task_runner_->BelongsToCurrentThread()) { \ + task_runner_->PostTask( \ + FROM_HERE, \ + base::BindOnce(&CastSystemMemoryPressureEvaluator::callback, \ + weak_ptr_factory_.GetWeakPtr(), ##__VA_ARGS__)); \ + return; \ + } + namespace chromecast { namespace { @@ -25,6 +35,10 @@ constexpr float kCriticalMemoryFraction = 0.25f; constexpr float kModerateMemoryFraction = 0.4f; +// Default Relaxed memory thresholds selectively applied to a few apps. +constexpr float kRelaxedCriticalMemoryFraction = 0.1f; +constexpr float kRelaxedModerateMemoryFraction = 0.2f; + // Memory thresholds in MB for the simple heuristic based on 'free' memory. constexpr int kCriticalFreeMemoryKB = 20 * 1024; constexpr int kModerateFreeMemoryKB = 30 * 1024; @@ -46,14 +60,22 @@ CastSystemMemoryPressureEvaluator::CastSystemMemoryPressureEvaluator( std::unique_ptr<util::MemoryPressureVoter> voter) : util::SystemMemoryPressureEvaluator(std::move(voter)), - critical_memory_fraction_( + critical_memory_fraction_command_line_( GetSwitchValueDouble(switches::kCastMemoryPressureCriticalFraction, - kCriticalMemoryFraction)), - moderate_memory_fraction_( + -1.0f)), + moderate_memory_fraction_command_line_( GetSwitchValueDouble(switches::kCastMemoryPressureModerateFraction, - kModerateMemoryFraction)), + -1.0f)), system_reserved_kb_(GetSystemReservedKb()), + task_runner_(base::ThreadTaskRunnerHandle::Get()), weak_ptr_factory_(this) { + relaxed_critical_memory_fraction_ = kRelaxedCriticalMemoryFraction; + relaxed_moderate_memory_fraction_ = kRelaxedModerateMemoryFraction; + critical_memory_fraction_ = critical_memory_fraction_command_line_; + moderate_memory_fraction_ = moderate_memory_fraction_command_line_; + // If the fractions from command line parameters are invalid they are subject + // to adjustment. + AdjustMemoryFractions(false); PollPressureLevel(); } @@ -61,6 +83,7 @@ default; void CastSystemMemoryPressureEvaluator::PollPressureLevel() { + DCHECK(task_runner_->BelongsToCurrentThread()); base::MemoryPressureListener::MemoryPressureLevel level = base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE; @@ -106,7 +129,7 @@ info.available / 1024, 1, 2000, 100); } - base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( + task_runner_->PostDelayedTask( FROM_HERE, base::BindOnce(&CastSystemMemoryPressureEvaluator::PollPressureLevel, weak_ptr_factory_.GetWeakPtr()), @@ -115,6 +138,7 @@ void CastSystemMemoryPressureEvaluator::UpdateMemoryPressureLevel( base::MemoryPressureListener::MemoryPressureLevel new_level) { + DCHECK(task_runner_->BelongsToCurrentThread()); auto old_vote = current_vote(); SetCurrentVote(new_level); @@ -128,4 +152,56 @@ "Memory.Pressure.LevelChange", new_level); } +void CastSystemMemoryPressureEvaluator::AdjustMemoryFractions(bool relax) { + DCHECK(task_runner_->BelongsToCurrentThread()); + + if (critical_memory_fraction_command_line_ < 0) { + critical_memory_fraction_ = + relax ? relaxed_critical_memory_fraction_ : kCriticalMemoryFraction; + } + if (moderate_memory_fraction_command_line_ < 0) { + moderate_memory_fraction_ = + relax ? relaxed_moderate_memory_fraction_ : kModerateMemoryFraction; + } + LOG(INFO) << __func__ + << ": critical_memory_fraction_=" << critical_memory_fraction_ + << ", moderate_memory_fraction_=" << moderate_memory_fraction_; +} + +void CastSystemMemoryPressureEvaluator::ConfigRelaxMemoryPressureThresholds( + float relaxed_critical_memory_fraction, + float relaxed_moderate_memory_fraction) { + MAKE_SURE_THREAD(ConfigRelaxMemoryPressureThresholds, + relaxed_critical_memory_fraction, + relaxed_moderate_memory_fraction); + + LOG(INFO) << __func__ << ", " << relaxed_critical_memory_fraction << ", " + << relaxed_moderate_memory_fraction; + + if (relaxed_critical_memory_fraction > 0) { + relaxed_critical_memory_fraction_ = relaxed_critical_memory_fraction; + } + if (relaxed_moderate_memory_fraction > 0) { + relaxed_moderate_memory_fraction_ = relaxed_moderate_memory_fraction; + } +} + +void CastSystemMemoryPressureEvaluator::RelaxMemoryPressureThresholds( + std::string requesting_app_session_id) { + MAKE_SURE_THREAD(RelaxMemoryPressureThresholds, + std::move(requesting_app_session_id)); + apps_needing_relaxed_memory_pressure_thresholds_.insert( + std::move(requesting_app_session_id)); + AdjustMemoryFractions(true); +} +void CastSystemMemoryPressureEvaluator::RestoreMemoryPressureThresholds( + const std::string& requesting_app_session_id) { + MAKE_SURE_THREAD(RestoreMemoryPressureThresholds, requesting_app_session_id); + apps_needing_relaxed_memory_pressure_thresholds_.erase( + requesting_app_session_id); + if (apps_needing_relaxed_memory_pressure_thresholds_.empty()) { + AdjustMemoryFractions(false); + } +} + } // namespace chromecast
diff --git a/chromecast/browser/cast_system_memory_pressure_evaluator.h b/chromecast/browser/cast_system_memory_pressure_evaluator.h index 333e7c73..52cdee3 100644 --- a/chromecast/browser/cast_system_memory_pressure_evaluator.h +++ b/chromecast/browser/cast_system_memory_pressure_evaluator.h
@@ -5,30 +5,63 @@ #ifndef CHROMECAST_BROWSER_CAST_SYSTEM_MEMORY_PRESSURE_EVALUATOR_H_ #define CHROMECAST_BROWSER_CAST_SYSTEM_MEMORY_PRESSURE_EVALUATOR_H_ +#include <string> + +#include "base/containers/flat_set.h" #include "base/macros.h" +#include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" #include "base/util/memory_pressure/system_memory_pressure_evaluator.h" +#include "chromecast/browser/cast_system_memory_pressure_evaluator_adjuster.h" + +namespace base { +class SingleThreadTaskRunner; +} // namespace base namespace chromecast { // Memory pressure evaluator for Cast: polls for current memory // usage periodically and sends memory pressure notifications. class CastSystemMemoryPressureEvaluator - : public util::SystemMemoryPressureEvaluator { + : public util::SystemMemoryPressureEvaluator, + public CastSystemMemoryPressureEvaluatorAdjuster { public: explicit CastSystemMemoryPressureEvaluator( std::unique_ptr<util::MemoryPressureVoter> voter); ~CastSystemMemoryPressureEvaluator() override; + // CastSystemMemoryPressureEvaluatorAdjuster implementation: + void ConfigRelaxMemoryPressureThresholds( + float relaxed_critical_memory_fraction, + float relaxed_moderate_memory_fraction) override; + void RelaxMemoryPressureThresholds( + std::string requesting_app_session_id) override; + void RestoreMemoryPressureThresholds( + const std::string& requesting_app_session_id) override; + private: void PollPressureLevel(); void UpdateMemoryPressureLevel( base::MemoryPressureListener::MemoryPressureLevel new_level); + void AdjustMemoryFractions(bool relax); - const float critical_memory_fraction_; - const float moderate_memory_fraction_; + // Fractions in effect. + float critical_memory_fraction_; + float moderate_memory_fraction_; + + // Fractions when the thrsholds are relaxed. + float relaxed_critical_memory_fraction_; + float relaxed_moderate_memory_fraction_; + + // When negative, no valid critical/moderate memory fraction present + // in command line parameters. + float const critical_memory_fraction_command_line_; + float const moderate_memory_fraction_command_line_; + + base::flat_set<std::string> apps_needing_relaxed_memory_pressure_thresholds_; const int system_reserved_kb_; + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; base::WeakPtrFactory<CastSystemMemoryPressureEvaluator> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(CastSystemMemoryPressureEvaluator);
diff --git a/chromecast/browser/cast_system_memory_pressure_evaluator_adjuster.cc b/chromecast/browser/cast_system_memory_pressure_evaluator_adjuster.cc new file mode 100644 index 0000000..55ed4d8 --- /dev/null +++ b/chromecast/browser/cast_system_memory_pressure_evaluator_adjuster.cc
@@ -0,0 +1,20 @@ +// Copyright 2019 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 "chromecast/browser/cast_system_memory_pressure_evaluator_adjuster.h" + +namespace chromecast { + +void CastSystemMemoryPressureEvaluatorAdjuster:: + ConfigRelaxMemoryPressureThresholds( + float relaxed_critical_memory_fraction, + float relaxed_moderate_memory_fraction) {} + +void CastSystemMemoryPressureEvaluatorAdjuster::RelaxMemoryPressureThresholds( + std::string requesting_app_session_id) {} + +void CastSystemMemoryPressureEvaluatorAdjuster::RestoreMemoryPressureThresholds( + const std::string& requesting_app_session_id) {} + +} // namespace chromecast \ No newline at end of file
diff --git a/chromecast/browser/cast_system_memory_pressure_evaluator_adjuster.h b/chromecast/browser/cast_system_memory_pressure_evaluator_adjuster.h new file mode 100644 index 0000000..8fcb81c --- /dev/null +++ b/chromecast/browser/cast_system_memory_pressure_evaluator_adjuster.h
@@ -0,0 +1,29 @@ +// Copyright 2019 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_BROWSER_CAST_SYSTEM_MEMORY_PRESSURE_EVALUATOR_ADJUSTER_H_ +#define CHROMECAST_BROWSER_CAST_SYSTEM_MEMORY_PRESSURE_EVALUATOR_ADJUSTER_H_ + +#include <string> + +namespace chromecast { +class CastSystemMemoryPressureEvaluatorAdjuster { + public: + CastSystemMemoryPressureEvaluatorAdjuster() = default; + virtual ~CastSystemMemoryPressureEvaluatorAdjuster() = default; + + // The three functions below can be called from any thread. + // Negative fractions are invalid. + virtual void ConfigRelaxMemoryPressureThresholds( + float relaxed_critical_memory_fraction, + float relaxed_moderate_memory_fraction); + virtual void RelaxMemoryPressureThresholds( + std::string requesting_app_session_id); + virtual void RestoreMemoryPressureThresholds( + const std::string& requesting_app_session_id); +}; + +} // namespace chromecast + +#endif // CHROMECAST_BROWSER_CAST_SYSTEM_MEMORY_PRESSURE_EVALUATOR_ADJUSTER_H_ \ No newline at end of file
diff --git a/chromeos/services/assistant/assistant_manager_service_impl.cc b/chromeos/services/assistant/assistant_manager_service_impl.cc index 6d998c9..52c12941 100644 --- a/chromeos/services/assistant/assistant_manager_service_impl.cc +++ b/chromeos/services/assistant/assistant_manager_service_impl.cc
@@ -1002,12 +1002,13 @@ void AssistantManagerServiceImpl::StartAssistantInternal( const base::Optional<std::string>& access_token) { DCHECK(background_thread_.task_runner()->BelongsToCurrentThread()); - - display_connection_ = std::make_unique<CrosDisplayConnection>( + base::AutoLock lock(new_assistant_manager_lock_); + // There can only be one |AssistantManager| instance at any given time. + DCHECK(!assistant_manager_); + new_display_connection_ = std::make_unique<CrosDisplayConnection>( this, assistant::features::IsFeedbackUiEnabled(), assistant::features::IsMediaSessionIntegrationEnabled()); - base::AutoLock lock(new_assistant_manager_lock_); new_assistant_manager_.reset(assistant_client::AssistantManager::Create( platform_api_.get(), CreateLibAssistantConfig())); auto* assistant_manager_internal = @@ -1015,7 +1016,8 @@ UpdateInternalOptions(assistant_manager_internal); - assistant_manager_internal->SetDisplayConnection(display_connection_.get()); + assistant_manager_internal->SetDisplayConnection( + new_display_connection_.get()); assistant_manager_internal->RegisterActionModule(action_module_.get()); assistant_manager_internal->SetAssistantManagerDelegate(this); assistant_manager_internal->GetFuchsiaApiHelperOrDie()->SetFuchsiaApiDelegate( @@ -1054,6 +1056,7 @@ return; } + display_connection_ = std::move(new_display_connection_); assistant_manager_ = std::move(new_assistant_manager_); }
diff --git a/chromeos/services/assistant/assistant_manager_service_impl.h b/chromeos/services/assistant/assistant_manager_service_impl.h index e57fa18..83b8f72 100644 --- a/chromeos/services/assistant/assistant_manager_service_impl.h +++ b/chromeos/services/assistant/assistant_manager_service_impl.h
@@ -318,6 +318,10 @@ // NOTE: |display_connection_| is used by |assistant_manager_| and must be // declared before so it will be destructed after. std::unique_ptr<CrosDisplayConnection> display_connection_; + // Similar to |new_asssistant_manager_|, created on |background_thread_| then + // posted to main thread to finish initialization then move to + // |display_connection_|. + std::unique_ptr<CrosDisplayConnection> new_display_connection_; std::unique_ptr<assistant_client::AssistantManager> assistant_manager_; std::unique_ptr<AssistantSettingsManagerImpl> assistant_settings_manager_; // |new_asssistant_manager_| is created on |background_thread_| then posted to
diff --git a/chromeos/services/assistant/chromium_http_connection.cc b/chromeos/services/assistant/chromium_http_connection.cc index 7b42afa..bd0f054 100644 --- a/chromeos/services/assistant/chromium_http_connection.cc +++ b/chromeos/services/assistant/chromium_http_connection.cc
@@ -41,18 +41,6 @@ } // namespace -ChromiumHttpConnectionFactory::ChromiumHttpConnectionFactory( - std::unique_ptr<SharedURLLoaderFactoryInfo> url_loader_factory_info) - : url_loader_factory_( - SharedURLLoaderFactory::Create(std::move(url_loader_factory_info))) {} - -ChromiumHttpConnectionFactory::~ChromiumHttpConnectionFactory() = default; - -HttpConnection* ChromiumHttpConnectionFactory::Create( - HttpConnection::Delegate* delegate) { - return new ChromiumHttpConnection(url_loader_factory_->Clone(), delegate); -} - ChromiumHttpConnection::ChromiumHttpConnection( std::unique_ptr<SharedURLLoaderFactoryInfo> url_loader_factory_info, Delegate* delegate) @@ -404,5 +392,17 @@ } } +ChromiumHttpConnectionFactory::ChromiumHttpConnectionFactory( + std::unique_ptr<SharedURLLoaderFactoryInfo> url_loader_factory_info) + : url_loader_factory_( + SharedURLLoaderFactory::Create(std::move(url_loader_factory_info))) {} + +ChromiumHttpConnectionFactory::~ChromiumHttpConnectionFactory() = default; + +HttpConnection* ChromiumHttpConnectionFactory::Create( + HttpConnection::Delegate* delegate) { + return new ChromiumHttpConnection(url_loader_factory_->Clone(), delegate); +} + } // namespace assistant } // namespace chromeos
diff --git a/components/nacl/common/nacl.mojom b/components/nacl/common/nacl.mojom index a1d6e47..70b12869 100644 --- a/components/nacl/common/nacl.mojom +++ b/components/nacl/common/nacl.mojom
@@ -18,7 +18,7 @@ [Sync] ReportLoadStatus(NaClErrorCode load_status) => (); - ProvideExitControl(pending_remote<NaClExitControl> exit_control); + ProvideExitControl(NaClExitControl exit_control); }; // When this interface is closed, it indicates that the NaCl loader process
diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc index 083dd5aa..f78eeffe 100644 --- a/components/nacl/loader/nacl_listener.cc +++ b/components/nacl/loader/nacl_listener.cc
@@ -36,7 +36,6 @@ #include "ipc/ipc_channel_handle.h" #include "ipc/ipc_sync_channel.h" #include "ipc/ipc_sync_message_filter.h" -#include "mojo/public/cpp/bindings/pending_remote.h" #include "native_client/src/public/chrome_main.h" #include "native_client/src/public/nacl_app.h" #include "native_client/src/public/nacl_desc.h" @@ -333,10 +332,10 @@ base::Bind(&NaClListener::ResolveFileToken, base::Unretained(this)), base::Bind(&NaClListener::OnOpenResource, base::Unretained(this))); - mojo::PendingRemote<nacl::mojom::NaClRendererHost> renderer_host; + nacl::mojom::NaClRendererHostPtr renderer_host; if (!Send(new NaClProcessHostMsg_PpapiChannelsCreated( browser_handle, ppapi_renderer_handle, - renderer_host.InitWithNewPipeAndPassReceiver().PassPipe().release(), + MakeRequest(&renderer_host).PassMessagePipe().release(), manifest_service_handle, ro_shmem_region))) LOG(FATAL) << "Failed to send IPC channel handle to NaClProcessHost.";
diff --git a/components/nacl/loader/nacl_trusted_listener.cc b/components/nacl/loader/nacl_trusted_listener.cc index c2c60b586..4c8e659 100644 --- a/components/nacl/loader/nacl_trusted_listener.cc +++ b/components/nacl/loader/nacl_trusted_listener.cc
@@ -10,8 +10,7 @@ #include "base/bind.h" #include "base/single_thread_task_runner.h" #include "build/build_config.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "mojo/public/cpp/bindings/self_owned_receiver.h" +#include "mojo/public/cpp/bindings/strong_binding.h" #include "native_client/src/public/chrome_main.h" namespace { @@ -37,25 +36,24 @@ } }; -void CreateExitControl( - mojo::PendingReceiver<nacl::mojom::NaClExitControl> receiver) { - mojo::MakeSelfOwnedReceiver(std::make_unique<NaClExitControlImpl>(), - std::move(receiver)); +void CreateExitControl(nacl::mojom::NaClExitControlRequest request) { + mojo::MakeStrongBinding(std::make_unique<NaClExitControlImpl>(), + std::move(request)); } } // namespace NaClTrustedListener::NaClTrustedListener( - mojo::PendingRemote<nacl::mojom::NaClRendererHost> renderer_host, + nacl::mojom::NaClRendererHostPtr renderer_host, base::SingleThreadTaskRunner* io_task_runner) : renderer_host_(std::move(renderer_host)) { - mojo::PendingRemote<nacl::mojom::NaClExitControl> exit_control; + nacl::mojom::NaClExitControlPtr exit_control; // The exit control binding must run on the IO thread. The main thread used // by NaClListener is busy in NaClChromeMainAppStart(), so it can't be used // for servicing messages. io_task_runner->PostTask( - FROM_HERE, base::BindOnce(&CreateExitControl, - exit_control.InitWithNewPipeAndPassReceiver())); + FROM_HERE, + base::BindOnce(&CreateExitControl, mojo::MakeRequest(&exit_control))); renderer_host_->ProvideExitControl(std::move(exit_control)); }
diff --git a/components/nacl/loader/nacl_trusted_listener.h b/components/nacl/loader/nacl_trusted_listener.h index 423076d..27a9b24 100644 --- a/components/nacl/loader/nacl_trusted_listener.h +++ b/components/nacl/loader/nacl_trusted_listener.h
@@ -7,8 +7,6 @@ #include "base/macros.h" #include "components/nacl/common/nacl.mojom.h" -#include "mojo/public/cpp/bindings/pending_remote.h" -#include "mojo/public/cpp/bindings/remote.h" namespace base { class SingleThreadTaskRunner; @@ -16,9 +14,8 @@ class NaClTrustedListener { public: - NaClTrustedListener( - mojo::PendingRemote<nacl::mojom::NaClRendererHost> renderer_host, - base::SingleThreadTaskRunner* io_task_runner); + NaClTrustedListener(nacl::mojom::NaClRendererHostPtr renderer_host, + base::SingleThreadTaskRunner* io_task_runner); ~NaClTrustedListener(); nacl::mojom::NaClRendererHost* renderer_host() { @@ -26,7 +23,7 @@ } private: - mojo::Remote<nacl::mojom::NaClRendererHost> renderer_host_; + nacl::mojom::NaClRendererHostPtr renderer_host_; DISALLOW_COPY_AND_ASSIGN(NaClTrustedListener); };
diff --git a/components/nacl/loader/nonsfi/nonsfi_listener.cc b/components/nacl/loader/nonsfi/nonsfi_listener.cc index e0041901..b6ca289 100644 --- a/components/nacl/loader/nonsfi/nonsfi_listener.cc +++ b/components/nacl/loader/nonsfi/nonsfi_listener.cc
@@ -24,7 +24,6 @@ #include "ipc/ipc_channel.h" #include "ipc/ipc_channel_handle.h" #include "ipc/ipc_sync_channel.h" -#include "mojo/public/cpp/bindings/pending_remote.h" #include "native_client/src/public/nonsfi/irt_random.h" #include "ppapi/nacl_irt/irt_manifest.h" #include "ppapi/nacl_irt/plugin_startup.h" @@ -107,10 +106,10 @@ ppapi::StartUpPlugin(); trusted_listener_ = std::make_unique<NaClTrustedListener>( - mojo::PendingRemote<nacl::mojom::NaClRendererHost>( + mojo::MakeProxy(nacl::mojom::NaClRendererHostPtrInfo( mojo::ScopedMessagePipeHandle( params.trusted_service_channel_handle.mojo_handle), - nacl::mojom::NaClRendererHost::Version_), + nacl::mojom::NaClRendererHost::Version_)), io_thread_.task_runner().get()); // Ensure that the validation cache key (used as an extra input to the
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc index 4b8e01d..7e516c5 100644 --- a/components/nacl/renderer/ppb_nacl_private_impl.cc +++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -51,7 +51,6 @@ #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view.h" #include "content/public/renderer/renderer_ppapi_host.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" #include "net/base/data_url.h" #include "net/base/net_errors.h" #include "net/http/http_util.h" @@ -534,9 +533,8 @@ std::unique_ptr<TrustedPluginChannel> trusted_plugin_channel( new TrustedPluginChannel( load_manager, - mojo::PendingReceiver<mojom::NaClRendererHost>( - mojo::ScopedMessagePipeHandle( - launch_result.trusted_ipc_channel_handle.mojo_handle)), + mojom::NaClRendererHostRequest(mojo::ScopedMessagePipeHandle( + launch_result.trusted_ipc_channel_handle.mojo_handle)), is_helper_nexe)); load_manager->set_trusted_plugin_channel(std::move(trusted_plugin_channel));
diff --git a/components/nacl/renderer/trusted_plugin_channel.cc b/components/nacl/renderer/trusted_plugin_channel.cc index d2bb3e0..ff851da 100644 --- a/components/nacl/renderer/trusted_plugin_channel.cc +++ b/components/nacl/renderer/trusted_plugin_channel.cc
@@ -16,12 +16,12 @@ TrustedPluginChannel::TrustedPluginChannel( NexeLoadManager* nexe_load_manager, - mojo::PendingReceiver<mojom::NaClRendererHost> receiver, + mojom::NaClRendererHostRequest request, bool is_helper_nexe) : nexe_load_manager_(nexe_load_manager), - receiver_(this, std::move(receiver)), + binding_(this, std::move(request)), is_helper_nexe_(is_helper_nexe) { - receiver_.set_disconnect_handler(base::BindOnce( + binding_.set_connection_error_handler(base::BindOnce( &TrustedPluginChannel::OnChannelError, base::Unretained(this))); } @@ -64,8 +64,8 @@ } void TrustedPluginChannel::ProvideExitControl( - mojo::PendingRemote<mojom::NaClExitControl> exit_control) { - exit_control_.Bind(std::move(exit_control)); + mojom::NaClExitControlPtr exit_control) { + exit_control_ = std::move(exit_control); } } // namespace nacl
diff --git a/components/nacl/renderer/trusted_plugin_channel.h b/components/nacl/renderer/trusted_plugin_channel.h index 4353829..f562f89 100644 --- a/components/nacl/renderer/trusted_plugin_channel.h +++ b/components/nacl/renderer/trusted_plugin_channel.h
@@ -10,10 +10,7 @@ #include "base/callback.h" #include "base/macros.h" #include "components/nacl/common/nacl.mojom.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "mojo/public/cpp/bindings/pending_remote.h" -#include "mojo/public/cpp/bindings/receiver.h" -#include "mojo/public/cpp/bindings/remote.h" +#include "mojo/public/cpp/bindings/binding.h" #include "native_client/src/trusted/service_runtime/nacl_error_code.h" #include "ppapi/c/pp_instance.h" @@ -23,7 +20,7 @@ class TrustedPluginChannel : public mojom::NaClRendererHost { public: TrustedPluginChannel(NexeLoadManager* nexe_load_manager, - mojo::PendingReceiver<mojom::NaClRendererHost> receiver, + mojom::NaClRendererHostRequest request, bool is_helper_nexe); ~TrustedPluginChannel() override; @@ -35,14 +32,13 @@ ReportExitStatusCallback callback) override; void ReportLoadStatus(NaClErrorCode load_status, ReportLoadStatusCallback callback) override; - void ProvideExitControl( - mojo::PendingRemote<mojom::NaClExitControl> exit_control) override; + void ProvideExitControl(mojom::NaClExitControlPtr exit_control) override; // Non-owning pointer. This is safe because the TrustedPluginChannel is owned // by the NexeLoadManager pointed to here. NexeLoadManager* nexe_load_manager_; - mojo::Receiver<mojom::NaClRendererHost> receiver_; - mojo::Remote<mojom::NaClExitControl> exit_control_; + mojo::Binding<mojom::NaClRendererHost> binding_; + mojom::NaClExitControlPtr exit_control_; const bool is_helper_nexe_; DISALLOW_COPY_AND_ASSIGN(TrustedPluginChannel);
diff --git a/components/page_load_metrics/browser/BUILD.gn b/components/page_load_metrics/browser/BUILD.gn index 817c97f..272e1e45 100644 --- a/components/page_load_metrics/browser/BUILD.gn +++ b/components/page_load_metrics/browser/BUILD.gn
@@ -10,6 +10,9 @@ "metrics_navigation_throttle.h", "metrics_web_contents_observer.cc", "metrics_web_contents_observer.h", + "observers/use_counter/ukm_features.cc", + "observers/use_counter_page_load_metrics_observer.cc", + "observers/use_counter_page_load_metrics_observer.h", "page_load_metrics_embedder_base.cc", "page_load_metrics_embedder_base.h", "page_load_metrics_embedder_interface.h", @@ -34,6 +37,7 @@ "//content/public/browser", "//content/public/common", "//net", + "//services/metrics/public/cpp:ukm_builders", "//ui/base", ] }
diff --git a/chrome/browser/page_load_metrics/observers/use_counter/OWNERS b/components/page_load_metrics/browser/observers/use_counter/OWNERS similarity index 100% rename from chrome/browser/page_load_metrics/observers/use_counter/OWNERS rename to components/page_load_metrics/browser/observers/use_counter/OWNERS
diff --git a/chrome/browser/page_load_metrics/observers/use_counter/ukm_features.cc b/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc similarity index 98% rename from chrome/browser/page_load_metrics/observers/use_counter/ukm_features.cc rename to components/page_load_metrics/browser/observers/use_counter/ukm_features.cc index 9d33ac2..3421dd7 100644 --- a/chrome/browser/page_load_metrics/observers/use_counter/ukm_features.cc +++ b/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.h" +#include "components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.h" #include "base/no_destructor.h"
diff --git a/chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.cc b/components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.cc similarity index 98% rename from chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.cc rename to components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.cc index 3d37e56d..4732b94 100644 --- a/chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.cc +++ b/components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.cc
@@ -2,13 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.h" -#include "chrome/browser/browser_process.h" -#include "content/public/browser/render_frame_host.h" -#include "services/metrics/public/cpp/ukm_builders.h" +#include "components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.h" #include "base/metrics/histogram_macros.h" #include "base/rand_util.h" +#include "content/public/browser/render_frame_host.h" +#include "services/metrics/public/cpp/ukm_builders.h" using Features = page_load_metrics::mojom::PageLoadFeatures; using UkmFeatureList = UseCounterPageLoadMetricsObserver::UkmFeatureList; @@ -102,7 +101,9 @@ } // namespace UseCounterPageLoadMetricsObserver::UseCounterPageLoadMetricsObserver() {} -UseCounterPageLoadMetricsObserver::~UseCounterPageLoadMetricsObserver() {} + +UseCounterPageLoadMetricsObserver::~UseCounterPageLoadMetricsObserver() = + default; page_load_metrics::PageLoadMetricsObserver::ObservePolicy UseCounterPageLoadMetricsObserver::OnCommit(
diff --git a/chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.h b/components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.h similarity index 89% rename from chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.h rename to components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.h index 6347965..542c1dce 100644 --- a/chrome/browser/page_load_metrics/observers/use_counter_page_load_metrics_observer.h +++ b/components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_USE_COUNTER_PAGE_LOAD_METRICS_OBSERVER_H_ -#define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_USE_COUNTER_PAGE_LOAD_METRICS_OBSERVER_H_ +#ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_OBSERVERS_USE_COUNTER_PAGE_LOAD_METRICS_OBSERVER_H_ +#define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_OBSERVERS_USE_COUNTER_PAGE_LOAD_METRICS_OBSERVER_H_ #include <bitset> #include "base/containers/flat_set.h" @@ -65,4 +65,4 @@ DISALLOW_COPY_AND_ASSIGN(UseCounterPageLoadMetricsObserver); }; -#endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_USE_COUNTER_PAGE_LOAD_METRICS_OBSERVER_H_ +#endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_OBSERVERS_USE_COUNTER_PAGE_LOAD_METRICS_OBSERVER_H_
diff --git a/components/page_load_metrics/browser/page_load_metrics_embedder_base.cc b/components/page_load_metrics/browser/page_load_metrics_embedder_base.cc index 7eac918..64a3ea4 100644 --- a/components/page_load_metrics/browser/page_load_metrics_embedder_base.cc +++ b/components/page_load_metrics/browser/page_load_metrics_embedder_base.cc
@@ -5,6 +5,8 @@ #include "components/page_load_metrics/browser/page_load_metrics_embedder_base.h" #include "base/timer/timer.h" +#include "components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.h" +#include "components/page_load_metrics/browser/page_load_tracker.h" namespace page_load_metrics { @@ -14,8 +16,12 @@ PageLoadMetricsEmbedderBase::~PageLoadMetricsEmbedderBase() = default; -void PageLoadMetricsEmbedderBase::RegisterObservers(PageLoadTracker* metrics) { - RegisterEmbedderObservers(metrics); +void PageLoadMetricsEmbedderBase::RegisterObservers(PageLoadTracker* tracker) { + // Register observers used by all embedders + if (!IsPrerendering()) + tracker->AddObserver(std::make_unique<UseCounterPageLoadMetricsObserver>()); + // Allow the embedder to register any embedder-specific observers + RegisterEmbedderObservers(tracker); } std::unique_ptr<base::OneShotTimer> PageLoadMetricsEmbedderBase::CreateTimer() {
diff --git a/components/page_load_metrics/browser/page_load_metrics_embedder_base.h b/components/page_load_metrics/browser/page_load_metrics_embedder_base.h index 54c55ae..4b50013 100644 --- a/components/page_load_metrics/browser/page_load_metrics_embedder_base.h +++ b/components/page_load_metrics/browser/page_load_metrics_embedder_base.h
@@ -27,7 +27,7 @@ protected: ~PageLoadMetricsEmbedderBase() override; - virtual void RegisterEmbedderObservers(PageLoadTracker* metrics) = 0; + virtual void RegisterEmbedderObservers(PageLoadTracker* tracker) = 0; virtual bool IsPrerendering() const = 0; private:
diff --git a/components/security_interstitials_strings.grdp b/components/security_interstitials_strings.grdp index e79c3a3..b3920e5 100644 --- a/components/security_interstitials_strings.grdp +++ b/components/security_interstitials_strings.grdp
@@ -66,7 +66,7 @@ <!-- Lookalike URL warning --> <message name="IDS_LOOKALIKE_URL_TITLE" desc="Tab title. Context: the requested URL might be trying to trick the user since it looks like a more popular URL. This interstitial points the user to the safe site instead."> - Did you mean <ph name="DOMAIN">$1<ex>example.com</ex></ph>? + Did you mean? </message> <message name="IDS_LOOKALIKE_URL_HEADING" desc="Large heading. Context: the error page that's shown when the requested URL might be trying to trick the user since it looks like a more popular URL. This interstitial points the user to the safe site instead."> Did you mean <a href="#" id="dont-proceed-link"><ph name="DOMAIN">$1<ex>example.com</ex></ph></a>?
diff --git a/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_CONTINUE.png.sha1 b/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_CONTINUE.png.sha1 index 6484e32..65af5b2346 100644 --- a/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_CONTINUE.png.sha1 +++ b/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_CONTINUE.png.sha1
@@ -1 +1 @@ -94e03c4a69925c4c0ddc5362977fb31a388f513b \ No newline at end of file +41eff454e1cf545932ccb3a3d60f12f90d73eadd \ No newline at end of file
diff --git a/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_HEADING.png.sha1 b/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_HEADING.png.sha1 index 6484e32..65af5b2346 100644 --- a/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_HEADING.png.sha1 +++ b/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_HEADING.png.sha1
@@ -1 +1 @@ -94e03c4a69925c4c0ddc5362977fb31a388f513b \ No newline at end of file +41eff454e1cf545932ccb3a3d60f12f90d73eadd \ No newline at end of file
diff --git a/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_IGNORE.png.sha1 b/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_IGNORE.png.sha1 index 6484e32..65af5b2346 100644 --- a/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_IGNORE.png.sha1 +++ b/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_IGNORE.png.sha1
@@ -1 +1 @@ -94e03c4a69925c4c0ddc5362977fb31a388f513b \ No newline at end of file +41eff454e1cf545932ccb3a3d60f12f90d73eadd \ No newline at end of file
diff --git a/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_PRIMARY_PARAGRAPH.png.sha1 b/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_PRIMARY_PARAGRAPH.png.sha1 index 6484e32..65af5b2346 100644 --- a/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_PRIMARY_PARAGRAPH.png.sha1 +++ b/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_PRIMARY_PARAGRAPH.png.sha1
@@ -1 +1 @@ -94e03c4a69925c4c0ddc5362977fb31a388f513b \ No newline at end of file +41eff454e1cf545932ccb3a3d60f12f90d73eadd \ No newline at end of file
diff --git a/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_TITLE.png.sha1 b/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_TITLE.png.sha1 index 6484e32..65af5b2346 100644 --- a/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_TITLE.png.sha1 +++ b/components/security_interstitials_strings_grdp/IDS_LOOKALIKE_URL_TITLE.png.sha1
@@ -1 +1 @@ -94e03c4a69925c4c0ddc5362977fb31a388f513b \ No newline at end of file +41eff454e1cf545932ccb3a3d60f12f90d73eadd \ No newline at end of file
diff --git a/components/visitedlink/OWNERS b/components/visitedlink/OWNERS index 90b3e80..d2353bc2 100644 --- a/components/visitedlink/OWNERS +++ b/components/visitedlink/OWNERS
@@ -1 +1,3 @@ sky@chromium.org + +# COMPONENT: UI>Browser>History
diff --git a/content/README.md b/content/README.md index ec6b042..6b7423845 100644 --- a/content/README.md +++ b/content/README.md
@@ -1,11 +1,98 @@ -Content is the core code needed to render a page using a multi-process sandboxed -browser. +# Content module -Developer documentation: -https://www.chromium.org/developers/content-module +## High-level overview +The "content" module is located in `src/content`, and is the core code needed to +render a page using a multi-process sandboxed browser. It includes all the web +platform features (i.e. HTML5) and GPU acceleration. It does not include Chrome +features, e.g. extensions/autofill/spelling etc. -Internal Documentation: +## Motivation +As the Chromium code has grown, features inevitably hooked into the wrong +places, causing layering violations and dependencies that shouldn't exist. It's +been hard for developers to figure out what the "best" way is because the APIs +(when they existed) and features were together in the same directory. To avoid +this happening, and to add a clear separation between the core pieces of the +code that render a page using a multi-process browser, consensus was reached to +move the core Chrome code into `src/content` ([content not +chrome](http://blog.chromium.org/2008/10/content-not-chrome.html) :) ). + +## content vs chrome +As discussed above, `content` should only have the core code needed to render a +page. Chrome features use APIs that are provided by `content` to filter IPCs and +get notified of events that they require. [How to Add New Features (without +bloating +RenderView/RenderViewHost/WebContents)](https://www.chromium.org/developers/design-documents/multi-process-architecture/how-to-add-new-features) +describes how to do this. + +As an example, here's a (non-exhaustive) list of features that are Chrome only, +and so are not in content. This means that `content` code shouldn't have to know +anything about them, only providing generic APIs that they can be built upon. +- Extensions +- NaCl +- SpellCheck +- Autofill +- Sync +- Prerendering +- Safe Browsing +- Translate + +As the list above shows, even browser features that are common to modern +browsers are not in `content`. The dividing line is that `src/content` only has +code that is required to implement the web platform. Features that aren't +covered by web specs should live in `src/chrome`. If a feature is being +implemented and the team foresees that it would be a spec, it should still go in +`src/chrome`. Once it has a spec, then it can move to `src/content`. + +Where code interacts with online network services that must be supplied by the +vendor, the favored approach is to fully implement that feature outside of the +`content` module. E.g. from the list above Safe Browsing, Translate, Sync and +Autofill require various network services to function, and the `chrome` layer is +the natural place to encapsulate that behavior. For those few cases where we +need to make network requests using code in the content module in order to +implement generic HTML5 features (e.g. the network location service for +Geolocation), the embedder must fully define the the endpoint to connect to, +typically it might do this by injecting the service URL. We do not want any such +policy coded into the `content` module at all, again to keep it generic. + +## Architectural Diagram +TODO: Draw a modern diagram. + +See an older diagram at: https://www.chromium.org/developers/content-module. + +The diagram illustrates the layering of the different modules. A module can +include code directly from lower modules. However, a module can not include code +from a module that is higher than it. This is enforced through DEPS rules. +Modules can implement embedder APIs so that modules lower than them can call +them. Examples of these APIs are the WebKit API and the Content API. + +## Content API +The [Content API](public/README.md) is how code in content can indirectly call +Chrome. Where possible, Chrome features try to hook in by filtering IPCs and +listening to events per [How to Add New Features (without bloating +RenderView/RenderViewHost/WebContents)](https://www.chromium.org/developers/design-documents/multi-process-architecture/how-to-add-new-features). +When there isn't enough context (i.e. callback from WebKit) or when the +callback is a one-off, we have a `ContentClient` interface that the embedder +(Chrome) implements. `ContentClient` is available in all processes. Some +processes also have their own callback API as well, i.e. +`ContentBrowserClient/ContentRendererClient/ContentPluginClient`. + +## Status and Roadmap +The current status is `content` doesn't depend on chrome at all (see the meta +[bug](https://bugs.chromium.org/p/chromium/issues/detail?id=76697) and all bugs +it depends on). We now have a basic browser built on top of `content` +("`content_shell`") that renders pages using `content` on all platforms. This +allow developers working on the web platform and core code to only have to +build/test content, instead of all of chrome. + +We have a separate target for `content`'s unit tests in `content_unittests`, and +integration tests in `content_browsertests`. + +`content` is build at a separate dll to speed up the build. + +We've created an API around `content`, similar to our WebKit API. This isolates +embedders from content's inner workings, and makes it clear to people working on +content which methods are used by embedders. + +## Further documentation * [Bluetooth](browser/bluetooth/README.md) - -
diff --git a/content/browser/browser_interface_binders.cc b/content/browser/browser_interface_binders.cc index 53cf5c2c..f90239e 100644 --- a/content/browser/browser_interface_binders.cc +++ b/content/browser/browser_interface_binders.cc
@@ -11,6 +11,7 @@ #include "content/browser/frame_host/render_frame_host_impl.h" #include "content/browser/image_capture/image_capture_impl.h" #include "content/browser/keyboard_lock/keyboard_lock_service_impl.h" +#include "content/browser/media/session/media_session_service_impl.h" #include "content/browser/picture_in_picture/picture_in_picture_service_impl.h" #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/screen_enumeration/screen_enumeration_impl.h" @@ -38,6 +39,7 @@ #include "third_party/blink/public/mojom/idle/idle_manager.mojom.h" #include "third_party/blink/public/mojom/keyboard_lock/keyboard_lock.mojom.h" #include "third_party/blink/public/mojom/locks/lock_manager.mojom.h" +#include "third_party/blink/public/mojom/mediasession/media_session.mojom.h" #include "third_party/blink/public/mojom/payments/payment_app.mojom.h" #include "third_party/blink/public/mojom/permissions/permission.mojom.h" #include "third_party/blink/public/mojom/picture_in_picture/picture_in_picture.mojom.h" @@ -176,6 +178,8 @@ base::BindRepeating(&ContentIndexServiceImpl::CreateForFrame)); map->Add<blink::mojom::KeyboardLockService>( base::BindRepeating(&KeyboardLockServiceImpl::CreateMojoService)); + map->Add<blink::mojom::MediaSessionService>( + base::BindRepeating(&MediaSessionServiceImpl::Create)); map->Add<blink::mojom::PictureInPictureService>( base::BindRepeating(&PictureInPictureServiceImpl::Create)); map->Add<blink::mojom::WakeLockService>(
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc index 1d9e3e3..0dc44d6 100644 --- a/content/browser/child_process_launcher.cc +++ b/content/browser/child_process_launcher.cc
@@ -186,11 +186,8 @@ } bool ChildProcessLauncherPriority::is_background() const { - if (boost_for_pending_views || has_foreground_service_worker || - has_media_stream) { - return false; - } - return has_only_low_priority_frames || !visible; + return !visible && !has_media_stream && !boost_for_pending_views && + !has_foreground_service_worker; } bool ChildProcessLauncherPriority::operator==( @@ -198,7 +195,6 @@ return visible == other.visible && has_media_stream == other.has_media_stream && has_foreground_service_worker == other.has_foreground_service_worker && - has_only_low_priority_frames == other.has_only_low_priority_frames && frame_depth == other.frame_depth && intersects_viewport == other.intersects_viewport && boost_for_pending_views == other.boost_for_pending_views
diff --git a/content/browser/child_process_launcher.h b/content/browser/child_process_launcher.h index 0136b71..0e5f225 100644 --- a/content/browser/child_process_launcher.h +++ b/content/browser/child_process_launcher.h
@@ -59,7 +59,6 @@ ChildProcessLauncherPriority(bool visible, bool has_media_stream, bool has_foreground_service_worker, - bool has_only_low_priority_frames, unsigned int frame_depth, bool intersects_viewport, bool boost_for_pending_views @@ -71,7 +70,6 @@ : visible(visible), has_media_stream(has_media_stream), has_foreground_service_worker(has_foreground_service_worker), - has_only_low_priority_frames(has_only_low_priority_frames), frame_depth(frame_depth), intersects_viewport(intersects_viewport), boost_for_pending_views(boost_for_pending_views) @@ -108,10 +106,6 @@ // processes. bool has_foreground_service_worker; - // True if this ChildProcessLauncher has a non-zero number of frames attached - // to it and they're all low priority. - bool has_only_low_priority_frames; - // |frame_depth| is the depth of the shallowest frame this process is // responsible for which has |visible| visibility. It only makes sense to // compare this property for two ChildProcessLauncherPriority instances with
diff --git a/content/browser/dom_storage/session_storage_context_mojo_unittest.cc b/content/browser/dom_storage/session_storage_context_mojo_unittest.cc index 8c2372d..3a51f11 100644 --- a/content/browser/dom_storage/session_storage_context_mojo_unittest.cc +++ b/content/browser/dom_storage/session_storage_context_mojo_unittest.cc
@@ -1125,7 +1125,8 @@ EXPECT_EQ(0ul, data.size()); } -TEST_F(SessionStorageContextMojoTest, ClearDiskState) { +// TODO(https://crbug.com/1008697): Flakes when verifying no data found. +TEST_F(SessionStorageContextMojoTest, DISABLED_ClearDiskState) { SetBackingMode(SessionStorageContextMojo::BackingMode::kClearDiskStateOnOpen); std::string namespace_id1 = base::GenerateGUID(); url::Origin origin1 = url::Origin::Create(GURL("http://foobar.com"));
diff --git a/content/browser/download/drag_download_file.cc b/content/browser/download/drag_download_file.cc index 18e264e..ccf3ab9b 100644 --- a/content/browser/download/drag_download_file.cc +++ b/content/browser/download/drag_download_file.cc
@@ -239,9 +239,13 @@ bool DragDownloadFile::Wait() { CheckThread(); + // Store the weakptr in a local variable as |this| may be deleted while + // waiting for the nested RunLoop. + auto ref = weak_ptr_factory_.GetWeakPtr(); if (state_ == STARTED) nested_loop_.Run(); - return state_ == SUCCESS; + // If the weakptr is destroyed, the download should be successful. + return !ref.get() || state_ == SUCCESS; } void DragDownloadFile::Stop() {
diff --git a/content/browser/frame_host/render_frame_host_delegate.cc b/content/browser/frame_host/render_frame_host_delegate.cc index 4dfe0da..e4f2dcf 100644 --- a/content/browser/frame_host/render_frame_host_delegate.cc +++ b/content/browser/frame_host/render_frame_host_delegate.cc
@@ -163,9 +163,4 @@ return nullptr; } -bool RenderFrameHostDelegate::IsFrameLowPriority( - const RenderFrameHost* render_frame_host) { - return false; -} - } // namespace content
diff --git a/content/browser/frame_host/render_frame_host_delegate.h b/content/browser/frame_host/render_frame_host_delegate.h index 43ce596..7ab07c2 100644 --- a/content/browser/frame_host/render_frame_host_delegate.h +++ b/content/browser/frame_host/render_frame_host_delegate.h
@@ -455,9 +455,6 @@ virtual RenderFrameHostImpl* GetMainFrameForInnerDelegate( FrameTreeNode* frame_tree_node); - // Determine if the frame is of a low priority. - virtual bool IsFrameLowPriority(const RenderFrameHost* render_frame_host); - protected: virtual ~RenderFrameHostDelegate() {} };
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index 1b8c55f..86c5db3 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -71,7 +71,6 @@ #include "content/browser/log_console_message.h" #include "content/browser/media/capture/audio_mirroring_manager.h" #include "content/browser/media/media_interface_proxy.h" -#include "content/browser/media/session/media_session_service_impl.h" #include "content/browser/media/webaudio/audio_context_manager_impl.h" #include "content/browser/native_file_system/native_file_system_manager_impl.h" #include "content/browser/navigation_subresource_loader_params.h" @@ -969,10 +968,6 @@ ClearAllWebUI(); SetLastCommittedSiteUrl(GURL()); - RenderProcessHostImpl* rph = - static_cast<RenderProcessHostImpl*>(GetProcess()); - rph->UpdateFrameWithPriority(last_committed_document_priority_, - base::nullopt); if (overlay_routing_token_) g_token_frame_map.Get().erase(*overlay_routing_token_); @@ -2302,18 +2297,6 @@ last_committed_url_ = url; } -void RenderFrameHostImpl::UpdateRenderProcessHostFramePriorities() { - const auto new_committed_document_priority = - (delegate_ && delegate_->IsFrameLowPriority(this)) - ? RenderProcessHostImpl::FramePriority::kLow - : RenderProcessHostImpl::FramePriority::kNormal; - RenderProcessHostImpl* rph = - static_cast<RenderProcessHostImpl*>(GetProcess()); - rph->UpdateFrameWithPriority(last_committed_document_priority_, - new_committed_document_priority); - last_committed_document_priority_ = new_committed_document_priority; -} - void RenderFrameHostImpl::OnDetach() { if (!parent_) { bad_message::ReceivedBadMessage(GetProcess(), @@ -4346,9 +4329,6 @@ } } - registry_->AddInterface( - base::Bind(&MediaSessionServiceImpl::Create, base::Unretained(this))); - registry_->AddInterface(base::BindRepeating( &RenderFrameHostImpl::CreateWebUsbService, base::Unretained(this))); @@ -6916,8 +6896,6 @@ last_http_status_code_ = validated_params->http_status_code; UpdateSiteURL(validated_params->url, validated_params->url_is_unreachable); - if (!is_same_document_navigation) - UpdateRenderProcessHostFramePriorities(); // Set the state whether this navigation is to an MHTML document, since there // are certain security checks that we cannot apply to subframes in MHTML
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h index 1584b6d..2ed48ec 100644 --- a/content/browser/frame_host/render_frame_host_impl.h +++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -1300,9 +1300,6 @@ class DroppedInterfaceRequestLogger; - // Update the RenderProcessHost priority when a navigation occurs. - void UpdateRenderProcessHostFramePriorities(); - // IPC Message handlers. void OnDetach(); void OnOpenURL(const FrameHostMsg_OpenURL_Params& params); @@ -1939,11 +1936,6 @@ // Track this frame's last committed URL. GURL last_committed_url_; - // Track the frame priority of the last committed document, which is nullopt - // prior to the first commit. - base::Optional<RenderProcessHostImpl::FramePriority> - last_committed_document_priority_; - // Track this frame's last committed origin. url::Origin last_committed_origin_;
diff --git a/content/browser/locks/lock_manager.cc b/content/browser/locks/lock_manager.cc index eb76f03..b83c1542 100644 --- a/content/browser/locks/lock_manager.cc +++ b/content/browser/locks/lock_manager.cc
@@ -85,15 +85,6 @@ ~Lock() = default; - // Abort a lock request. - void Abort(const std::string& message) { - DCHECK(request_); - DCHECK(!handle_); - - request_->Abort(message); - request_.reset(); - } - // Grant a lock request. This mints a LockHandle and returns it over the // request pipe. void Grant(base::WeakPtr<LockManager> context, const url::Origin& origin) {
diff --git a/content/browser/locks/lock_manager.h b/content/browser/locks/lock_manager.h index b16f1f99..9b0b7c0 100644 --- a/content/browser/locks/lock_manager.h +++ b/content/browser/locks/lock_manager.h
@@ -80,20 +80,10 @@ url::Origin origin; }; - bool IsGrantable(const url::Origin& origin, - const std::string& name, - blink::mojom::LockMode mode) const; - // Mints a monotonically increasing identifier. Used both for lock requests // and granted locks as keys in ordered maps. int64_t NextLockId(); - void Break(const url::Origin& origin, const std::string& name); - - // Called when a lock is requested and optionally when a lock is released, - // to process outstanding requests within the origin. - void ProcessRequests(const url::Origin& origin); - mojo::ReceiverSet<blink::mojom::LockManager, ReceiverState> receivers_; int64_t next_lock_id_ = 0;
diff --git a/content/browser/renderer_host/render_process_host_browsertest.cc b/content/browser/renderer_host/render_process_host_browsertest.cc index 06a2cde..446db60 100644 --- a/content/browser/renderer_host/render_process_host_browsertest.cc +++ b/content/browser/renderer_host/render_process_host_browsertest.cc
@@ -21,7 +21,6 @@ #include "content/public/browser/render_process_host_observer.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" -#include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/common/url_constants.h" #include "content/public/test/browser_test_utils.h" @@ -50,6 +49,7 @@ #endif namespace content { +namespace { std::unique_ptr<net::test_server::HttpResponse> HandleBeacon( const net::test_server::HttpRequest& request) { @@ -68,19 +68,7 @@ class RenderProcessHostTest : public ContentBrowserTest, public RenderProcessHostObserver { public: - RenderProcessHostTest() - : process_exits_(0), host_destructions_(0), use_frame_priority_(false) {} - - void SetUp() override { - if (use_frame_priority_) { - feature_list_.InitAndEnableFeature( - features::kUseFramePriorityInRenderProcessHost); - } else { - feature_list_.InitAndDisableFeature( - features::kUseFramePriorityInRenderProcessHost); - } - ContentBrowserTest::SetUp(); - } + RenderProcessHostTest() : process_exits_(0), host_destructions_(0) {} void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII( @@ -93,11 +81,6 @@ host_resolver()->AddRule("*", "127.0.0.1"); } - void SetVisibleClients(RenderProcessHost* process, int32_t visible_clients) { - RenderProcessHostImpl* impl = static_cast<RenderProcessHostImpl*>(process); - impl->visible_clients_ = visible_clients; - } - protected: void set_process_exit_callback(const base::Closure& callback) { process_exit_callback_ = callback; @@ -121,8 +104,6 @@ int process_exits_; int host_destructions_; base::Closure process_exit_callback_; - bool use_frame_priority_; - base::test::ScopedFeatureList feature_list_; }; // A mock ContentBrowserClient that only considers a spare renderer to be a @@ -1079,28 +1060,6 @@ rph->RemoveObserver(this); } -IN_PROC_BROWSER_TEST_F(RenderProcessHostTest, LowPriorityFramesDisabled) { - // RenderProcessHostImpl::UpdateProcessPriority has an early check of - // run_renderer_in_process and exits for RenderProcessHosts without a child - // process launcher. In order to skip initializing that here and the layer of - // indirection, we explicitly run in-process, which we must also disable once - // the test has finished to prevent crashing on exit. - RenderProcessHost::SetRunRendererInProcess(true); - RenderProcessHostImpl* process = static_cast<RenderProcessHostImpl*>( - RenderProcessHostImpl::CreateRenderProcessHost( - ShellContentBrowserClient::Get()->browser_context(), nullptr, nullptr, - false /* is_for_guests_only */)); - // It starts off as normal priority. - EXPECT_FALSE(process->IsProcessBackgrounded()); - // With the feature off it stays low priority when adding low priority frames. - process->UpdateFrameWithPriority(base::nullopt, - RenderProcessHostImpl::FramePriority::kLow); - process->UpdateFrameWithPriority(base::nullopt, - RenderProcessHostImpl::FramePriority::kLow); - EXPECT_FALSE(process->IsProcessBackgrounded()); - RenderProcessHost::SetRunRendererInProcess(false); -} - // This test verifies properties of RenderProcessHostImpl *before* Init method // is called. IN_PROC_BROWSER_TEST_F(RenderProcessHostTest, ConstructedButNotInitializedYet) { @@ -1143,73 +1102,5 @@ process->Cleanup(); } -class RenderProcessHostFramePriorityTest : public RenderProcessHostTest { - public: - RenderProcessHostFramePriorityTest() : RenderProcessHostTest() { - use_frame_priority_ = true; - } -}; - -IN_PROC_BROWSER_TEST_F(RenderProcessHostFramePriorityTest, - LowPriorityFramesEnabled) { - // RenderProcessHostImpl::UpdateProcessPriority has an early check of - // run_renderer_in_process and exits for RenderProcessHosts without a child - // process launcher. In order to skip initializing that here and the layer of - // indirection, we explicitly run in-process, which we must also disable once - // the test has finished to prevent crashing on exit. - RenderProcessHost::SetRunRendererInProcess(true); - RenderProcessHostImpl* process = static_cast<RenderProcessHostImpl*>( - RenderProcessHostImpl::CreateRenderProcessHost( - ShellContentBrowserClient::Get()->browser_context(), nullptr, nullptr, - false /* is_for_guests_only */)); - // For these tests, assume something is always visible. - SetVisibleClients(process, 1); - // When no frames are attached, it's not low priority. - EXPECT_FALSE(process->IsProcessBackgrounded()); - // When all frames added are low priority, it's low priority. - process->UpdateFrameWithPriority(base::nullopt, - RenderProcessHostImpl::FramePriority::kLow); - process->UpdateFrameWithPriority(base::nullopt, - RenderProcessHostImpl::FramePriority::kLow); - EXPECT_TRUE(process->IsProcessBackgrounded()); - // When all the low priority frames are removed, it's not low priority. - process->UpdateFrameWithPriority(RenderProcessHostImpl::FramePriority::kLow, - base::nullopt); - process->UpdateFrameWithPriority(RenderProcessHostImpl::FramePriority::kLow, - base::nullopt); - EXPECT_FALSE(process->IsProcessBackgrounded()); - // When a low priority frame is added back in, it's low priority. - process->UpdateFrameWithPriority(base::nullopt, - RenderProcessHostImpl::FramePriority::kLow); - EXPECT_TRUE(process->IsProcessBackgrounded()); - // As soon as a non-low priority frame is added, it's not low priority. - process->UpdateFrameWithPriority( - base::nullopt, RenderProcessHostImpl::FramePriority::kNormal); - EXPECT_FALSE(process->IsProcessBackgrounded()); - // It remains not low priority even if we add more low priority frames. - process->UpdateFrameWithPriority(base::nullopt, - RenderProcessHostImpl::FramePriority::kLow); - EXPECT_FALSE(process->IsProcessBackgrounded()); - // As soon as the non-low priority frame is removed, it becomes low priority. - process->UpdateFrameWithPriority( - RenderProcessHostImpl::FramePriority::kNormal, base::nullopt); - EXPECT_TRUE(process->IsProcessBackgrounded()); - // Add a non-low priority frame, but then transition it to low, the process - // should go from unbackgrounded to backgrounded. - process->UpdateFrameWithPriority( - base::nullopt, RenderProcessHostImpl::FramePriority::kNormal); - EXPECT_FALSE(process->IsProcessBackgrounded()); - process->UpdateFrameWithPriority( - RenderProcessHostImpl::FramePriority::kNormal, - RenderProcessHostImpl::FramePriority::kLow); - EXPECT_TRUE(process->IsProcessBackgrounded()); - // Transition the frame back to normal priority, it becomes normal priority. - process->UpdateFrameWithPriority( - RenderProcessHostImpl::FramePriority::kLow, - RenderProcessHostImpl::FramePriority::kNormal); - EXPECT_FALSE(process->IsProcessBackgrounded()); - - RenderProcessHost::SetRunRendererInProcess(false); -} - +} // namespace } // namespace content
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 5a67b09..23ebf96 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1465,7 +1465,6 @@ priority_(!blink::kLaunchingProcessIsBackgrounded, false /* has_media_stream */, false /* has_foreground_service_worker */, - false /* all_low_priority_frames */, frame_depth_, false /* intersects_viewport */, true /* boost_for_pending_views */ @@ -1745,10 +1744,6 @@ InitializeChannelProxy(); } -bool RenderProcessHostImpl::HasOnlyLowPriorityFrames() { - return (low_priority_frames_ > 0) && (total_frames_ == low_priority_frames_); -} - void RenderProcessHostImpl::InitializeChannelProxy() { scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = base::CreateSingleThreadTaskRunner({BrowserThread::IO}); @@ -2664,25 +2659,6 @@ UpdateProcessPriorityInputs(); } -void RenderProcessHostImpl::UpdateFrameWithPriority( - base::Optional<FramePriority> previous_priority, - base::Optional<FramePriority> new_priority) { - if (!base::FeatureList::IsEnabled( - features::kUseFramePriorityInRenderProcessHost)) { - return; - } - - const bool previous_all_low_priority_frames = HasOnlyLowPriorityFrames(); - total_frames_ = - total_frames_ - (previous_priority ? 1 : 0) + (new_priority ? 1 : 0); - low_priority_frames_ = - low_priority_frames_ - - (previous_priority && previous_priority == FramePriority::kLow ? 1 : 0) + - (new_priority && new_priority == FramePriority::kLow ? 1 : 0); - if (previous_all_low_priority_frames != HasOnlyLowPriorityFrames()) - UpdateProcessPriority(); -} - int RenderProcessHostImpl::VisibleClientCount() { return visible_clients_; } @@ -4406,7 +4382,7 @@ visible_clients_ > 0 || base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableRendererBackgrounding), media_stream_count_ > 0, foreground_service_worker_count_ > 0, - HasOnlyLowPriorityFrames(), frame_depth_, intersects_viewport_, + frame_depth_, intersects_viewport_, !!pending_views_ /* boost_for_pending_views */ #if defined(OS_ANDROID) , @@ -4414,11 +4390,11 @@ #endif ); - if (priority_ == priority) - return; const bool background_state_changed = priority_.is_background() != priority.is_background(); const bool visibility_state_changed = priority_.visible != priority.visible; + if (priority_ == priority) + return; TRACE_EVENT2("renderer_host", "RenderProcessHostImpl::UpdateProcessPriority", "should_background", priority.is_background(), @@ -4463,14 +4439,14 @@ } void RenderProcessHostImpl::SendProcessStateToRenderer() { - mojom::RenderProcessBackgroundState background_state = - priority_.is_background() - ? mojom::RenderProcessBackgroundState::kBackgrounded - : mojom::RenderProcessBackgroundState::kForegrounded; - mojom::RenderProcessVisibleState visible_state = - priority_.visible ? mojom::RenderProcessVisibleState::kVisible - : mojom::RenderProcessVisibleState::kHidden; - GetRendererInterface()->SetProcessState(background_state, visible_state); + mojom::RenderProcessState process_state; + if (priority_.is_background()) + process_state = mojom::RenderProcessState::kBackgrounded; + else if (priority_.visible) + process_state = mojom::RenderProcessState::kVisible; + else + process_state = mojom::RenderProcessState::kHidden; + GetRendererInterface()->SetProcessState(process_state); } void RenderProcessHostImpl::OnProcessLaunched() {
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h index 1613e1ee..a826a1e 100644 --- a/content/browser/renderer_host/render_process_host_impl.h +++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -105,7 +105,6 @@ class PushMessagingManager; class RenderFrameMessageFilter; class RenderProcessHostFactory; -class RenderProcessHostTest; class RenderWidgetHelper; class SiteInstance; class SiteInstanceImpl; @@ -143,9 +142,6 @@ public mojom::RendererHost, public memory_instrumentation::mojom::CoordinatorConnector { public: - // The priority of a frame added to the RenderProcessHost. - enum class FramePriority { kLow, kNormal }; - // Special depth used when there are no PriorityClients. static const unsigned int kMaxFrameDepthForPriority; @@ -282,13 +278,6 @@ header_client, network::mojom::URLLoaderFactoryRequest request); - // Update the total and low priority count as indicated by the previous and - // new priorities of the underlying document. The nullopt option is used when - // there is no previous/subsequent navigation (when the frame is added/removed - // from the RenderProcessHostImpl). - void UpdateFrameWithPriority(base::Optional<FramePriority> previous_priority, - base::Optional<FramePriority> new_priority); - // Call this function when it is evident that the child process is actively // performing some operation, for example if we just received an IPC message. void mark_child_process_activity_time() { @@ -466,7 +455,6 @@ get_render_process_host_factory_for_testing(); // Tracks which sites frames are hosted in which RenderProcessHosts. - // TODO(ericrobinson): These don't need to be static. static void AddFrameWithSite(BrowserContext* browser_context, RenderProcessHost* render_process_host, const GURL& site_url); @@ -575,7 +563,6 @@ friend class ChildProcessLauncherBrowserTest_ChildSpawnFail_Test; friend class VisitRelayingRenderProcessHost; friend class StoragePartitonInterceptor; - friend class RenderProcessHostTest; // Use CreateRenderProcessHost() instead of calling this constructor // directly. @@ -583,13 +570,8 @@ StoragePartitionImpl* storage_partition_impl, bool is_for_guests_only); - // True if this ChildProcessLauncher has a non-zero number of frames attached - // to it and they're all low priority. Note: This will always return false - // unless features::kUseFramePriorityInProcessHost is enabled. - bool HasOnlyLowPriorityFrames(); - - // Initializes a new IPC::ChannelProxy in |channel_|, which will be - // connected to the next child process launched for this host, if any. + // Initializes a new IPC::ChannelProxy in |channel_|, which will be connected + // to the next child process launched for this host, if any. void InitializeChannelProxy(); // Resets |channel_|, removing it from the attachment broker if necessary. @@ -839,12 +821,6 @@ // processes of same visibility. It indicates process has frames that // intersect with the viewport. bool intersects_viewport_ = false; - // Tracks the number of low priority frames currently hosted in this process. - // Always 0 unless features::kUseFramePriorityInProcessHost is enabled. - unsigned int low_priority_frames_ = 0; - // Tracks the total number of frames currently hosted in this process. - // Always 0 unless features::kUseFramePriorityInProcessHost is enabled. - unsigned int total_frames_ = 0; #if defined(OS_ANDROID) // Highest importance of all clients that contribute priority. ChildProcessImportance effective_importance_ = ChildProcessImportance::NORMAL;
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc index 11315f4e..7b552b3 100644 --- a/content/browser/security_exploit_browsertest.cc +++ b/content/browser/security_exploit_browsertest.cc
@@ -751,7 +751,7 @@ RenderProcessHostKillWaiter kill_waiter(frame->GetProcess()); ScopedInterfaceParamsReplacer replacer(shell()->web_contents(), nullptr); - NavigateToURLAndExpectNoCommit(shell(), non_same_document_url); + EXPECT_TRUE(NavigateToURLAndExpectNoCommit(shell(), non_same_document_url)); EXPECT_EQ(bad_message::RFH_INTERFACE_PROVIDER_MISSING, kill_waiter.Wait()); // Verify that the death of the renderer process doesn't leave behing and leak
diff --git a/content/browser/tracing/tracing_controller_browsertest.cc b/content/browser/tracing/tracing_controller_browsertest.cc index 9ed33ec..52a96c4 100644 --- a/content/browser/tracing/tracing_controller_browsertest.cc +++ b/content/browser/tracing/tracing_controller_browsertest.cc
@@ -234,9 +234,6 @@ Navigate(shell()); TracingControllerImpl* controller = TracingControllerImpl::GetInstance(); - tracing::TraceEventAgent::GetInstance()->AddMetadataGeneratorFunction( - base::Bind(&TracingControllerTest::GenerateMetadataDict, - base::Unretained(this))); { base::RunLoop run_loop; @@ -266,6 +263,9 @@ metadata_ = std::make_unique<base::DictionaryValue>(); metadata_->SetString("not-whitelisted", "this_not_found"); + tracing::TraceEventAgent::GetInstance()->AddMetadataGeneratorFunction( + base::Bind(&TracingControllerTest::GenerateMetadataDict, + base::Unretained(this))); bool result = controller->StopTracing(trace_data_endpoint); ASSERT_TRUE(result);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index d951280..3eea51d 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -7208,13 +7208,6 @@ return nullptr; } -bool WebContentsImpl::IsFrameLowPriority( - const RenderFrameHost* render_frame_host) { - if (!delegate_) - return false; - return delegate_->IsFrameLowPriority(this, render_frame_host); -} - void WebContentsImpl::UpdateWebContentsVisibility(Visibility visibility) { // Occlusion is disabled when |features::kWebContentsOcclusion| is disabled // (for power and speed impact assessment) or when
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index 58cf3ba..72f7570 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h
@@ -638,7 +638,6 @@ int context_id) override; RenderFrameHostImpl* GetMainFrameForInnerDelegate( FrameTreeNode* frame_tree_node) override; - bool IsFrameLowPriority(const RenderFrameHost* render_frame_host) override; // RenderViewHostDelegate ---------------------------------------------------- RenderViewHostDelegateView* GetDelegateView() override;
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc index 6262fef0..a1b8579 100644 --- a/content/child/blink_platform_impl.cc +++ b/content/child/blink_platform_impl.cc
@@ -66,7 +66,6 @@ #endif using blink::WebData; -using blink::WebLocalizedString; using blink::WebString; using blink::WebThemeEngine; using blink::WebURL; @@ -88,65 +87,6 @@ #endif } -int ToMessageID(int resource_id) { - switch (resource_id) { - case WebLocalizedString::kAXDayOfMonthFieldText: - return IDS_AX_DAY_OF_MONTH_FIELD_TEXT; - case WebLocalizedString::kAXHourFieldText: - return IDS_AX_HOUR_FIELD_TEXT; - case WebLocalizedString::kDetailsLabel: - return IDS_DETAILS_WITHOUT_SUMMARY_LABEL; - case WebLocalizedString::kInputElementAltText: - return IDS_FORM_INPUT_ALT; - case WebLocalizedString::kMissingPluginText: - return IDS_PLUGIN_INITIALIZATION_ERROR; - case WebLocalizedString::kMediaScrubbingMessageText: - return IDS_MEDIA_SCRUBBING_MESSAGE_TEXT; - case WebLocalizedString::kMultipleFileUploadText: - return IDS_FORM_FILE_MULTIPLE_UPLOAD; - case WebLocalizedString::kOtherColorLabel: - return IDS_FORM_OTHER_COLOR_LABEL; - case WebLocalizedString::kOverflowMenuCaptionsSubmenuTitle: - return IDS_MEDIA_OVERFLOW_MENU_CLOSED_CAPTIONS_SUBMENU_TITLE; - case WebLocalizedString::kOverflowMenuUnmute: - return IDS_MEDIA_OVERFLOW_MENU_UNMUTE; - case WebLocalizedString::kPictureInPictureInterstitialText: - return IDS_MEDIA_PICTURE_IN_PICTURE_INTERSTITIAL_TEXT; - case WebLocalizedString::kPlaceholderForDayOfMonthField: - return IDS_FORM_PLACEHOLDER_FOR_DAY_OF_MONTH_FIELD; - case WebLocalizedString::kPlaceholderForMonthField: - return IDS_FORM_PLACEHOLDER_FOR_MONTH_FIELD; - case WebLocalizedString::kPlaceholderForYearField: - return IDS_FORM_PLACEHOLDER_FOR_YEAR_FIELD; - case WebLocalizedString::kResetButtonDefaultLabel: - return IDS_FORM_RESET_LABEL; - case WebLocalizedString::kSubmitButtonDefaultLabel: - return IDS_FORM_SUBMIT_LABEL; - case WebLocalizedString::kValidationStepMismatchCloseToLimit: - return IDS_FORM_VALIDATION_STEP_MISMATCH_CLOSE_TO_LIMIT; - case WebLocalizedString::kValidationTooShort: - return IDS_FORM_VALIDATION_TOO_SHORT; - case WebLocalizedString::kValidationTooShortPlural: - return IDS_FORM_VALIDATION_TOO_SHORT_PLURAL; - case WebLocalizedString::kWeekNumberLabel: - return IDS_FORM_WEEK_NUMBER_LABEL; - case WebLocalizedString::kTextTracksNoLabel: - return IDS_MEDIA_TRACKS_NO_LABEL; - case WebLocalizedString::kTextTracksOff: - return IDS_MEDIA_TRACKS_OFF; - // There is no matched IDS_FOO for kBlockedPluginText. Return -1. - case WebLocalizedString::kBlockedPluginText: - return -1; - // This "default:" line exists to avoid compile warnings about enum - // coverage when we add a new symbol to WebLocalizedString.h in blink. - // After a planned blink patch is landed, we need to add a case statement - // for the added symbol here. - default: - break; - } - return resource_id; -} - // This must match third_party/WebKit/public/blink_resources.grd. // In particular, |is_gzipped| corresponds to compress="gzip". struct DataResource { @@ -258,28 +198,26 @@ } WebString BlinkPlatformImpl::QueryLocalizedString(int resource_id) { - int message_id = ToMessageID(resource_id); - if (message_id < 0) + if (resource_id < 0) return WebString(); return WebString::FromUTF16( - GetContentClient()->GetLocalizedString(message_id)); + GetContentClient()->GetLocalizedString(resource_id)); } WebString BlinkPlatformImpl::QueryLocalizedString(int resource_id, const WebString& value) { - int message_id = ToMessageID(resource_id); - if (message_id < 0) + if (resource_id < 0) return WebString(); base::string16 format_string = - GetContentClient()->GetLocalizedString(message_id); + GetContentClient()->GetLocalizedString(resource_id); // If the ContentClient returned an empty string, e.g. because it's using the // default implementation of ContentClient::GetLocalizedString, return an // empty string instead of crashing with a failed DCHECK in // base::ReplaceStringPlaceholders below. This is useful for tests that don't // specialize a full ContentClient, since this way they can behave as though - // there isn't a defined |message_id| for the |name| instead of crashing + // there isn't a defined |resource_id| for the |name| instead of crashing // outright. if (format_string.empty()) return WebString(); @@ -291,15 +229,14 @@ WebString BlinkPlatformImpl::QueryLocalizedString(int resource_id, const WebString& value1, const WebString& value2) { - int message_id = ToMessageID(resource_id); - if (message_id < 0) + if (resource_id < 0) return WebString(); std::vector<base::string16> values; values.reserve(2); values.push_back(value1.Utf16()); values.push_back(value2.Utf16()); return WebString::FromUTF16(base::ReplaceStringPlaceholders( - GetContentClient()->GetLocalizedString(message_id), values, nullptr)); + GetContentClient()->GetLocalizedString(resource_id), values, nullptr)); } bool BlinkPlatformImpl::AllowScriptExtensionForServiceWorker(
diff --git a/content/common/renderer.mojom b/content/common/renderer.mojom index c782d9a..fbb4196 100644 --- a/content/common/renderer.mojom +++ b/content/common/renderer.mojom
@@ -174,24 +174,14 @@ map<SystemThemeColor, uint32> colors; }; -// The background state for the render process. When backgrounded the process's -// priority will be lower (via base::Process::SetProcessBackgrounded()) if -// allowed on the current platform (as determined by -// base::Process::CanBackgroundProcesses()). -enum RenderProcessBackgroundState { - // The renderer process has not been backgrounded, a hidden renderer may still - // be foregrounded, e.g. when it is playing audio. - kForegrounded, - // The renderer process has been backgrounded, a visible renderer may still - // be backgrounded, e.g. when it is hosting only low priority frames. - kBackgrounded, -}; - -// The visibility state for the renderer process, indicating whether or not any -// of the frames associated with the renderer process are visible. -enum RenderProcessVisibleState { +enum RenderProcessState { kVisible, + // Hidden render processes can still be foregrounded. For example, a hidden + // renderer playing audio would be foregrounded. kHidden, + // Refers to a renderer that is hidden and running at background process + // priority. + kBackgrounded, }; // The primordial Channel-associated interface implemented by a render process. @@ -273,8 +263,7 @@ // Tells the renderer process of a change in visibility or background state. - SetProcessState(RenderProcessBackgroundState background_state, - RenderProcessVisibleState visible_state); + SetProcessState(RenderProcessState process_state); // Tells the scheduler about "keep-alive" state which can be due to: // service workers, shared workers, or fetch keep-alive.
diff --git a/content/public/app/content_browser_manifest.cc b/content/public/app/content_browser_manifest.cc index b9c64b4..ad3fca62 100644 --- a/content/public/app/content_browser_manifest.cc +++ b/content/public/app/content_browser_manifest.cc
@@ -220,7 +220,6 @@ "blink.mojom.InsecureInputService", "blink.mojom.MediaDevicesDispatcherHost", "blink.mojom.MediaStreamDispatcherHost", - "blink.mojom.MediaSessionService", "blink.mojom.NativeFileSystemManager", "blink.mojom.NotificationService", "blink.mojom.Portal",
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc index a69ff67..e6881a1 100644 --- a/content/public/browser/web_contents_delegate.cc +++ b/content/public/browser/web_contents_delegate.cc
@@ -320,11 +320,4 @@ WebContents* source) { return false; } - -bool WebContentsDelegate::IsFrameLowPriority( - const WebContents* web_contents, - const RenderFrameHost* render_frame_host) { - return false; -} - } // namespace content
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h index b882e1b..70afb53 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h
@@ -675,10 +675,6 @@ // solid color is displayed instead. virtual bool ShouldShowStaleContentOnEviction(WebContents* source); - // Determine if the frame is of a low priority. - virtual bool IsFrameLowPriority(const WebContents* web_contents, - const RenderFrameHost* render_frame_host); - protected: virtual ~WebContentsDelegate();
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 171d36b..238fa57 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -551,13 +551,6 @@ const base::Feature kTouchpadAsyncPinchEvents{"TouchpadAsyncPinchEvents", base::FEATURE_ENABLED_BY_DEFAULT}; -// Controls whether the RenderProcessHost uses its frames' priorities for -// determining if it should be backgrounded. When all frames associated with a -// RenderProcessHost are low priority, that process may be backgrounded even if -// those frames are visible. -const base::Feature kUseFramePriorityInRenderProcessHost{ - "UseFramePriorityInRenderProcessHost", base::FEATURE_DISABLED_BY_DEFAULT}; - // Allows developers transfer user activation state to any target window in the // frame tree. const base::Feature kUserActivationPostMessageTransfer{
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 677a952..b8aaa14 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -124,7 +124,6 @@ CONTENT_EXPORT extern const base::Feature kTimerThrottlingForHiddenFrames; CONTENT_EXPORT extern const base::Feature kTouchpadAsyncPinchEvents; CONTENT_EXPORT extern const base::Feature kTouchpadOverscrollHistoryNavigation; -CONTENT_EXPORT extern const base::Feature kUseFramePriorityInRenderProcessHost; CONTENT_EXPORT extern const base::Feature kUserActivationPostMessageTransfer; CONTENT_EXPORT extern const base::Feature kUserActivationSameOriginVisibility; CONTENT_EXPORT extern const base::Feature kUserActivationV2;
diff --git a/content/public/test/content_browser_test_utils.h b/content/public/test/content_browser_test_utils.h index ddfaf61..66513af 100644 --- a/content/public/test/content_browser_test_utils.h +++ b/content/public/test/content_browser_test_utils.h
@@ -106,7 +106,8 @@ // Navigates |window| to |url|, blocks until the navigation finishes, and // checks that the navigation did not commit (e.g., due to a crash or // download). -bool NavigateToURLAndExpectNoCommit(Shell* window, const GURL& url); +WARN_UNUSED_RESULT bool NavigateToURLAndExpectNoCommit(Shell* window, + const GURL& url); // Reloads |window|, blocking until the given number of navigations finishes. void ReloadBlockUntilNavigationsComplete(Shell* window,
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index fe55e45..ac9ff1dc 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc
@@ -1617,27 +1617,26 @@ } void RenderThreadImpl::SetProcessState( - mojom::RenderProcessBackgroundState background_state, - mojom::RenderProcessVisibleState visible_state) { - DCHECK(background_state_ != background_state || - visible_state_ != visible_state); + mojom::RenderProcessState process_state) { + DCHECK(process_state_ != process_state); - if (background_state != background_state_) { - if (background_state == mojom::RenderProcessBackgroundState::kForegrounded) - OnRendererForegrounded(); - else - OnRendererBackgrounded(); + if (process_state_ == mojom::RenderProcessState::kBackgrounded || + (!process_state_.has_value() && + process_state != mojom::RenderProcessState::kBackgrounded)) { + OnRendererForegrounded(); } - if (visible_state != visible_state_) { - if (visible_state == mojom::RenderProcessVisibleState::kVisible) - OnRendererVisible(); - else - OnRendererHidden(); + if (process_state == mojom::RenderProcessState::kVisible) { + OnRendererVisible(); + } else if (process_state_ == mojom::RenderProcessState::kVisible || + !process_state_.has_value()) { + OnRendererHidden(); } - background_state_ = background_state; - visible_state_ = visible_state; + if (process_state == mojom::RenderProcessState::kBackgrounded) + OnRendererBackgrounded(); + + process_state_ = process_state; } void RenderThreadImpl::SetIsLockedToSite() { @@ -2300,7 +2299,8 @@ } bool RenderThreadImpl::RendererIsHidden() const { - return visible_state_ == mojom::RenderProcessVisibleState::kHidden; + return process_state_ == mojom::RenderProcessState::kHidden || + process_state_ == mojom::RenderProcessState::kBackgrounded; } void RenderThreadImpl::OnRendererHidden() { @@ -2320,8 +2320,7 @@ } bool RenderThreadImpl::RendererIsBackgrounded() const { - return background_state_ == - mojom::RenderProcessBackgroundState::kBackgrounded; + return process_state_ == mojom::RenderProcessState::kBackgrounded; } void RenderThreadImpl::OnRendererBackgrounded() {
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index 65bfa5c..7cd7d03 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h
@@ -511,8 +511,7 @@ void UpdateSystemColorInfo( mojom::UpdateSystemColorInfoParamsPtr params) override; void PurgePluginListCache(bool reload_pages) override; - void SetProcessState(mojom::RenderProcessBackgroundState background_state, - mojom::RenderProcessVisibleState visible_state) override; + void SetProcessState(mojom::RenderProcessState process_state) override; void SetSchedulerKeepActive(bool keep_active) override; void SetIsLockedToSite() override; void EnableV8LowMemoryMode() override; @@ -578,8 +577,7 @@ // Used to keep track of the renderer's backgrounded and visibility state. // Updated via an IPC from the browser process. If nullopt, the browser // process has yet to send an update and the state is unknown. - base::Optional<mojom::RenderProcessBackgroundState> background_state_; - base::Optional<mojom::RenderProcessVisibleState> visible_state_; + base::Optional<mojom::RenderProcessState> process_state_; blink::WebString user_agent_; blink::UserAgentMetadata user_agent_metadata_;
diff --git a/content/renderer/render_thread_impl_browsertest.cc b/content/renderer/render_thread_impl_browsertest.cc index a7e206f8..129cea20 100644 --- a/content/renderer/render_thread_impl_browsertest.cc +++ b/content/renderer/render_thread_impl_browsertest.cc
@@ -239,22 +239,9 @@ protected: IPC::Sender* sender() { return channel_.get(); } - void SetBackgroundState( - mojom::RenderProcessBackgroundState background_state) { + void SetProcessState(mojom::RenderProcessState process_state) { mojom::Renderer* renderer_interface = thread_; - const mojom::RenderProcessVisibleState visible_state = - RendererIsHidden() ? mojom::RenderProcessVisibleState::kHidden - : mojom::RenderProcessVisibleState::kVisible; - renderer_interface->SetProcessState(background_state, visible_state); - } - - void SetVisibleState(mojom::RenderProcessVisibleState visible_state) { - mojom::Renderer* renderer_interface = thread_; - const mojom::RenderProcessBackgroundState background_state = - RendererIsBackgrounded() - ? mojom::RenderProcessBackgroundState::kBackgrounded - : mojom::RenderProcessBackgroundState::kForegrounded; - renderer_interface->SetProcessState(background_state, visible_state); + renderer_interface->SetProcessState(process_state); } bool RendererIsBackgrounded() { return thread_->RendererIsBackgrounded(); } @@ -316,18 +303,24 @@ } TEST_F(RenderThreadImplBrowserTest, RendererIsBackgrounded) { - SetBackgroundState(mojom::RenderProcessBackgroundState::kBackgrounded); + SetProcessState(mojom::RenderProcessState::kBackgrounded); EXPECT_TRUE(RendererIsBackgrounded()); - SetBackgroundState(mojom::RenderProcessBackgroundState::kForegrounded); + SetProcessState(mojom::RenderProcessState::kHidden); + EXPECT_FALSE(RendererIsBackgrounded()); + + SetProcessState(mojom::RenderProcessState::kVisible); EXPECT_FALSE(RendererIsBackgrounded()); } TEST_F(RenderThreadImplBrowserTest, RendererIsHidden) { - SetVisibleState(mojom::RenderProcessVisibleState::kHidden); + SetProcessState(mojom::RenderProcessState::kBackgrounded); EXPECT_TRUE(RendererIsHidden()); - SetVisibleState(mojom::RenderProcessVisibleState::kVisible); + SetProcessState(mojom::RenderProcessState::kHidden); + EXPECT_TRUE(RendererIsHidden()); + + SetProcessState(mojom::RenderProcessState::kVisible); EXPECT_FALSE(RendererIsHidden()); } @@ -338,24 +331,27 @@ EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)); EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(true)).Times(0); EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)).Times(0); - SetVisibleState(mojom::RenderProcessVisibleState::kVisible); + SetProcessState(mojom::RenderProcessState::kVisible); testing::Mock::VerifyAndClear(main_thread_scheduler_); // Going from a hidden to a visible state should mark the renderer as visible. - SetVisibleState(mojom::RenderProcessVisibleState::kHidden); + // A hidden renderer is already foregrounded. + SetProcessState(mojom::RenderProcessState::kHidden); EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)); EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(false)).Times(0); EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(true)).Times(0); EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)).Times(0); - SetVisibleState(mojom::RenderProcessVisibleState::kVisible); + SetProcessState(mojom::RenderProcessState::kVisible); testing::Mock::VerifyAndClear(main_thread_scheduler_); - // Going from a visible to a hidden state should mark the renderer as hidden. - EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(false)).Times(0); - EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)).Times(0); + // Going from a backgrounded to a visible state should mark the renderer as + // foregrounded and visible. + SetProcessState(mojom::RenderProcessState::kBackgrounded); + EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(false)); + EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)); EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(true)).Times(0); - EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)); - SetVisibleState(mojom::RenderProcessVisibleState::kHidden); + EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)).Times(0); + SetProcessState(mojom::RenderProcessState::kVisible); testing::Mock::VerifyAndClear(main_thread_scheduler_); testing::Mock::AllowLeak(main_thread_scheduler_); @@ -368,7 +364,27 @@ EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)); EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(true)).Times(0); EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)).Times(0); - SetVisibleState(mojom::RenderProcessVisibleState::kHidden); + SetProcessState(mojom::RenderProcessState::kHidden); + testing::Mock::VerifyAndClear(main_thread_scheduler_); + + // Going from a visible to a hidden state should mark the renderer as hidden. + // A visible renderer is already foregrounded. + SetProcessState(mojom::RenderProcessState::kVisible); + EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)); + EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(false)).Times(0); + EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)).Times(0); + EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(true)).Times(0); + SetProcessState(mojom::RenderProcessState::kHidden); + testing::Mock::VerifyAndClear(main_thread_scheduler_); + + // Going from a backgrounded to a hidden state should mark the renderer as + // foregrounded and hidden. + SetProcessState(mojom::RenderProcessState::kBackgrounded); + EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(false)); + EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)).Times(0); + EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(true)).Times(0); + EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)).Times(0); + SetProcessState(mojom::RenderProcessState::kHidden); testing::Mock::VerifyAndClear(main_thread_scheduler_); testing::Mock::AllowLeak(main_thread_scheduler_); @@ -376,43 +392,32 @@ TEST_F(RenderThreadImplBrowserTest, RendererStateTransitionBackgrounded) { // Going from an unknown to a backgrounded state should mark the renderer as - // backgrounded but not hidden. - EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)).Times(0); - EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(true)); - EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)); - EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(false)).Times(0); - SetBackgroundState(mojom::RenderProcessBackgroundState::kBackgrounded); - testing::Mock::VerifyAndClear(main_thread_scheduler_); - - // Going from a backgrounded to a foregrounded state should mark the renderer - // as foregrounded. - EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(true)).Times(0); - EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)).Times(0); - EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)).Times(0); - EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(false)); - SetBackgroundState(mojom::RenderProcessBackgroundState::kForegrounded); - testing::Mock::VerifyAndClear(main_thread_scheduler_); - - // Going from a foregrounded to a backgrounded state should mark the renderer - // as backgrounded. - EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)).Times(0); + // hidden and backgrounded. + EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)); EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(true)); EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)).Times(0); EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(false)).Times(0); - SetBackgroundState(mojom::RenderProcessBackgroundState::kBackgrounded); + SetProcessState(mojom::RenderProcessState::kBackgrounded); testing::Mock::VerifyAndClear(main_thread_scheduler_); - testing::Mock::AllowLeak(main_thread_scheduler_); -} + // Going from a visible to a backgrounded state should mark the renderer as + // hidden and backgrounded. + SetProcessState(mojom::RenderProcessState::kVisible); + EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)); + EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(true)); + EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)).Times(0); + EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(false)).Times(0); + SetProcessState(mojom::RenderProcessState::kBackgrounded); + testing::Mock::VerifyAndClear(main_thread_scheduler_); -TEST_F(RenderThreadImplBrowserTest, RendererStateTransitionForegrounded) { - // Going from an unknown to a foregrounded state should mark the renderer as - // foregrounded and visible. - EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(false)); + // Going from a hidden state to a backgrounded state should mark the renderer + // backgrounded. A hidden renderer is already marked as hidden. + SetProcessState(mojom::RenderProcessState::kHidden); + EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(true)); EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(true)).Times(0); - EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(true)).Times(0); - EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)); - SetBackgroundState(mojom::RenderProcessBackgroundState::kForegrounded); + EXPECT_CALL(*main_thread_scheduler_, SetRendererHidden(false)).Times(0); + EXPECT_CALL(*main_thread_scheduler_, SetRendererBackgrounded(false)).Times(0); + SetProcessState(mojom::RenderProcessState::kBackgrounded); testing::Mock::VerifyAndClear(main_thread_scheduler_); testing::Mock::AllowLeak(main_thread_scheduler_);
diff --git a/content/test/gpu/gpu_tests/gpu_integration_test.py b/content/test/gpu/gpu_tests/gpu_integration_test.py index df108bb..b6acf57c 100644 --- a/content/test/gpu/gpu_tests/gpu_integration_test.py +++ b/content/test/gpu/gpu_tests/gpu_integration_test.py
@@ -274,6 +274,47 @@ config['nv12_overlay_support'] = 'SCALING' return config + def GetDx12VulkanBotConfig(self): + """Returns expected bot config for DX12 and Vulkan support. + + This configuration is collected on Windows platform only. + The rules to determine bot config are: + 1) DX12: Win7 doesn't support DX12. Only Win10 supports DX12 + 2) Vulkan: All bots support Vulkan except for Win FYI AMD bots + """ + if self.browser is None: + raise Exception("Browser doesn't exist") + system_info = self.browser.GetSystemInfo() + if system_info is None: + raise Exception("Browser doesn't support GetSystemInfo") + gpu = system_info.gpu.devices[0] + if gpu is None: + raise Exception("System Info doesn't have a gpu") + gpu_vendor_id = gpu.vendor_id + gpu_device_id = gpu.device_id + assert gpu_vendor_id in _SUPPORTED_WIN_GPU_VENDORS + + os_version = self.browser.platform.GetOSVersionName() + if os_version is None: + raise Exception("browser.platform.GetOSVersionName() returns None") + os_version = os_version.lower() + assert os_version in _SUPPORTED_WIN_VERSIONS + + config = { + 'supports_dx12': True, + 'supports_vulkan': True, + } + + if os_version == 'win7': + config['supports_dx12'] = False + + # "Win7 FYI Release (AMD)" and "Win7 FYI Debug (AMD)" bots + if (os_version == 'win7' and gpu_vendor_id == 0x1002 + and gpu_device_id == 0x6613): + config['supports_vulkan'] = False + + return config + @classmethod def GenerateTags(cls, finder_options, possible_browser): # If no expectations file paths are returned from cls.ExpectationsFiles()
diff --git a/content/test/gpu/gpu_tests/info_collection_test.py b/content/test/gpu/gpu_tests/info_collection_test.py index ba14a3f..061093a 100644 --- a/content/test/gpu/gpu_tests/info_collection_test.py +++ b/content/test/gpu/gpu_tests/info_collection_test.py
@@ -89,7 +89,7 @@ self.fail('%s mismatch, expected %s but got %s.' % (field, self._ValueToStr(expected), self._ValueToStr(detected))) - def _RunDX12VulkanTest(self, gpu, unused_arg_0, unused_arg_1): + def _RunDX12VulkanTest(self, unused_arg_0, unused_arg_1, unused_arg_2): os_name = self.browser.platform.GetOSName() if os_name and os_name.lower() == 'win': self.RestartBrowserIfNecessaryWithArgs([ @@ -98,7 +98,19 @@ system_info = self.browser.GetSystemInfo() if not system_info: self.fail("Browser doesn't support GetSystemInfo") - # TODO(zmo): Verify Win GPU bots DX12/Vulkan supports are as expected. + gpu = system_info.gpu + if gpu is None: + raise Exception("System Info doesn't have a gpu") + aux_attributes = gpu.aux_attributes + if not aux_attributes: + self.fail('GPU info does not have aux_attributes.') + + dx12_vulkan_bot_config = self.GetDx12VulkanBotConfig() + for field, expected in dx12_vulkan_bot_config.iteritems(): + detected = aux_attributes.get(field) + if expected != detected: + self.fail('%s mismatch, expected %s but got %s.' % + (field, self._ValueToStr(expected), self._ValueToStr(detected))) @staticmethod def _ValueToStr(value):
diff --git a/content/test/gpu/gpu_tests/pixel_test_pages.py b/content/test/gpu/gpu_tests/pixel_test_pages.py index 9efd1eda..6e80874 100644 --- a/content/test/gpu/gpu_tests/pixel_test_pages.py +++ b/content/test/gpu/gpu_tests/pixel_test_pages.py
@@ -1774,6 +1774,7 @@ test_rect=[0, 0, 240, 135], revision=0, browser_args=browser_args, + other_args={'no_overlay': True}, tolerance=tolerance_dc), PixelTestPage(
diff --git a/content/test/gpu/gpu_tests/test_expectations/maps_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/maps_expectations.txt index ad9885ae..307de8f 100644 --- a/content/test/gpu/gpu_tests/test_expectations/maps_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/maps_expectations.txt
@@ -1,6 +1,7 @@ # tags: [ android ] -# tags: [ android-nexus-5x ] -# tags: [ skia-renderer ] +# tags: [ android-nexus-5x android-nexus-5 ] +# tags: [ skia-renderer no-skia-renderer ] # results: [ Failure RetryOnFailure Skip ] crbug.com/1006045 [ android android-nexus-5x skia-renderer ] Maps_maps [ Failure ] +crbug.com/1009137 [ android android-nexus-5 no-skia-renderer ] Maps_maps [ RetryOnFailure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt index 3260186..0d56f55e 100644 --- a/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt
@@ -40,8 +40,3 @@ crbug.com/960007 [ win10 nvidia ] OverlayModeTraceTest_DirectComposition_Nonroot [ RetryOnFailure ] crbug.com/969117 [ win10 intel ] OverlayModeTraceTest_DirectComposition_Video_MP4_FourColors_Aspect_4x3 [ RetryOnFailure ] crbug.com/978181 [ win10 nvidia ] OverlayModeTraceTest_DirectComposition_Underlay [ RetryOnFailure ] - -# These tests check if overlay is being used for the test, but they shouldn't. -# TODO(sunnyps) - Remove when this inherent check is removed. -crbug.com/1007411 [ win10 ] OverlayModeTraceTest_DirectComposition_Video_MP4_Rounded_Corner [ Failure ] -crbug.com/1007411 [ win10 ] VideoPathTraceTest_DirectComposition_Video_MP4_Rounded_Corner [ Failure ]
diff --git a/device/vr/test/fake_vr_display_impl_client.cc b/device/vr/test/fake_vr_display_impl_client.cc index 94f13e2e..09f64c69 100644 --- a/device/vr/test/fake_vr_display_impl_client.cc +++ b/device/vr/test/fake_vr_display_impl_client.cc
@@ -8,8 +8,8 @@ namespace device { FakeVRDisplayImplClient::FakeVRDisplayImplClient( - mojom::VRDisplayClientRequest request) - : m_binding_(this, std::move(request)) {} + mojo::PendingReceiver<mojom::VRDisplayClient> receiver) + : receiver_(this, std::move(receiver)) {} FakeVRDisplayImplClient::~FakeVRDisplayImplClient() {}
diff --git a/device/vr/test/fake_vr_display_impl_client.h b/device/vr/test/fake_vr_display_impl_client.h index 62b0838..836ff308 100644 --- a/device/vr/test/fake_vr_display_impl_client.h +++ b/device/vr/test/fake_vr_display_impl_client.h
@@ -6,8 +6,8 @@ #define DEVICE_VR_TEST_FAKE_VR_DISPLAY_IMPL_CLIENT_H_ #include "device/vr/public/mojom/vr_service.mojom.h" -#include "mojo/public/cpp/bindings/binding.h" -#include "mojo/public/cpp/bindings/interface_request.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/receiver.h" namespace device { class FakeVRServiceClient; @@ -15,7 +15,8 @@ class FakeVRDisplayImplClient : public mojom::VRDisplayClient, public mojom::XRSessionClient { public: - FakeVRDisplayImplClient(mojom::VRDisplayClientRequest request); + explicit FakeVRDisplayImplClient( + mojo::PendingReceiver<mojom::VRDisplayClient> receiver); ~FakeVRDisplayImplClient() override; void SetServiceClient(FakeVRServiceClient* service_client); @@ -32,7 +33,7 @@ private: FakeVRServiceClient* service_client_; mojom::VRDisplayInfoPtr last_display_; - mojo::Binding<mojom::VRDisplayClient> m_binding_; + mojo::Receiver<mojom::VRDisplayClient> receiver_; DISALLOW_COPY_AND_ASSIGN(FakeVRDisplayImplClient); };
diff --git a/device/vr/test/fake_vr_service_client.cc b/device/vr/test/fake_vr_service_client.cc index e5a45ac..62e99f7e 100644 --- a/device/vr/test/fake_vr_service_client.cc +++ b/device/vr/test/fake_vr_service_client.cc
@@ -7,8 +7,9 @@ namespace device { -FakeVRServiceClient::FakeVRServiceClient(mojom::VRServiceClientRequest request) - : m_binding_(this, std::move(request)) {} +FakeVRServiceClient::FakeVRServiceClient( + mojo::PendingReceiver<mojom::VRServiceClient> receiver) + : receiver_(this, std::move(receiver)) {} FakeVRServiceClient::~FakeVRServiceClient() {}
diff --git a/device/vr/test/fake_vr_service_client.h b/device/vr/test/fake_vr_service_client.h index 1adf196c..f52e660 100644 --- a/device/vr/test/fake_vr_service_client.h +++ b/device/vr/test/fake_vr_service_client.h
@@ -7,8 +7,8 @@ #include "device/vr/public/mojom/vr_service.mojom.h" #include "device/vr/vr_export.h" -#include "mojo/public/cpp/bindings/binding.h" -#include "mojo/public/cpp/bindings/interface_request.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/receiver.h" namespace device { class FakeVRDisplayImplClient; @@ -16,7 +16,8 @@ // TODO(mthiesse, crbug.com/769373): Remove DEVICE_VR_EXPORT. class DEVICE_VR_EXPORT FakeVRServiceClient : public mojom::VRServiceClient { public: - FakeVRServiceClient(mojom::VRServiceClientRequest request); + explicit FakeVRServiceClient( + mojo::PendingReceiver<mojom::VRServiceClient> receiver); ~FakeVRServiceClient() override; void OnDeviceChanged() override {} @@ -27,7 +28,7 @@ std::vector<mojom::VRDisplayInfoPtr> displays_; std::vector<std::unique_ptr<FakeVRDisplayImplClient>> display_clients_; mojom::XRDeviceId last_device_id_ = static_cast<mojom::XRDeviceId>(0); - mojo::Binding<mojom::VRServiceClient> m_binding_; + mojo::Receiver<mojom::VRServiceClient> receiver_; DISALLOW_COPY_AND_ASSIGN(FakeVRServiceClient); };
diff --git a/extensions/browser/api/display_source/wifi_display/wifi_display_session_service_impl.cc b/extensions/browser/api/display_source/wifi_display/wifi_display_session_service_impl.cc index 0cae1c6c..e9fd317 100644 --- a/extensions/browser/api/display_source/wifi_display/wifi_display_session_service_impl.cc +++ b/extensions/browser/api/display_source/wifi_display/wifi_display_session_service_impl.cc
@@ -47,11 +47,11 @@ } void WiFiDisplaySessionServiceImpl::SetClient( - mojom::WiFiDisplaySessionServiceClientPtr client) { + mojo::PendingRemote<mojom::WiFiDisplaySessionServiceClient> client) { DCHECK(client); DCHECK(!client_); - client_ = std::move(client); - client_.set_connection_error_handler( + client_.Bind(std::move(client)); + client_.set_disconnect_handler( base::Bind(&WiFiDisplaySessionServiceImpl::OnClientConnectionError, weak_factory_.GetWeakPtr())); }
diff --git a/extensions/browser/api/display_source/wifi_display/wifi_display_session_service_impl.h b/extensions/browser/api/display_source/wifi_display/wifi_display_session_service_impl.h index 65260a0..51f94f8a 100644 --- a/extensions/browser/api/display_source/wifi_display/wifi_display_session_service_impl.h +++ b/extensions/browser/api/display_source/wifi_display/wifi_display_session_service_impl.h
@@ -9,6 +9,8 @@ #include "extensions/browser/api/display_source/display_source_connection_delegate.h" #include "extensions/common/mojom/wifi_display_session_service.mojom.h" #include "mojo/public/cpp/bindings/interface_request.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/strong_binding.h" namespace content { @@ -31,7 +33,8 @@ private: // WiFiDisplaySessionService overrides. - void SetClient(mojom::WiFiDisplaySessionServiceClientPtr client) override; + void SetClient(mojo::PendingRemote<mojom::WiFiDisplaySessionServiceClient> + client) override; void Connect(int32_t sink_id, int32_t auth_method, const std::string& auth_data) override; @@ -57,7 +60,7 @@ // Mojo error callback. void OnClientConnectionError(); - mojom::WiFiDisplaySessionServiceClientPtr client_; + mojo::Remote<mojom::WiFiDisplaySessionServiceClient> client_; DisplaySourceConnectionDelegate* delegate_; api::display_source::SinkState sink_state_;
diff --git a/extensions/browser/extension_event_histogram_value.h b/extensions/browser/extension_event_histogram_value.h index 9dbe05d..678827d 100644 --- a/extensions/browser/extension_event_histogram_value.h +++ b/extensions/browser/extension_event_histogram_value.h
@@ -462,6 +462,7 @@ ACCESSIBILITY_PRIVATE_FIND_SCROLLABLE_BOUNDS_FOR_POINT = 440, LOGIN_STATE_ON_SESSION_STATE_CHANGED = 441, PRINTING_METRICS_ON_PRINT_JOB_FINISHED = 442, + AUTOTESTPRIVATE_ON_CLIPBOARD_DATA_CHANGED = 443, // Last entry: Add new entries above, then run: // python tools/metrics/histograms/update_extension_histograms.py ENUM_BOUNDARY
diff --git a/extensions/browser/extension_function_histogram_value.h b/extensions/browser/extension_function_histogram_value.h index 8c42f20..942411e0 100644 --- a/extensions/browser/extension_function_histogram_value.h +++ b/extensions/browser/extension_function_histogram_value.h
@@ -1448,6 +1448,9 @@ USERSPRIVATE_ISWHITELISTEDUSER = 1385, PRINTINGMETRICS_GETPRINTJOBS = 1386, AUTOTESTPRIVATE_WAITFORASSISTANTQUERYSTATUS = 1387, + AUTOTESTPRIVATE_GETCLIPBOARDTEXTDATA = 1388, + AUTOTESTPRIVATE_SETCLIPBOARDTEXTDATA = 1389, + AUTOTESTPRIVATE_INITIALIZEEVENTS = 1390, // Last entry: Add new entries above, then run: // python tools/metrics/histograms/update_extension_histograms.py ENUM_BOUNDARY
diff --git a/extensions/common/mojom/wifi_display_session_service.mojom b/extensions/common/mojom/wifi_display_session_service.mojom index c24edb7..a5e6048 100644 --- a/extensions/common/mojom/wifi_display_session_service.mojom +++ b/extensions/common/mojom/wifi_display_session_service.mojom
@@ -11,7 +11,9 @@ // WiFiDisplaySessionService class provides access to the network for // the render-hosted Wi-Fi Display session. interface WiFiDisplaySessionService { - SetClient(WiFiDisplaySessionServiceClient client); + // Sets the client whose methods are invoked in order to to notify the client + // and to transmit controlling messages. + SetClient(pending_remote<WiFiDisplaySessionServiceClient> client); // Requires connection to a sink using the given authentication information. // Note: 'auth_method' values must correspond to 'enum AuthenticationMethod' @@ -21,7 +23,7 @@ // Drops the established connection to the connected sink. Disconnect(); - // Sends a controlling mesage to the connected sink. + // Sends a controlling message to the connected sink. SendMessage(string message); };
diff --git a/extensions/renderer/api/display_source/wifi_display/wifi_display_session.cc b/extensions/renderer/api/display_source/wifi_display/wifi_display_session.cc index f255531..9f2436c 100644 --- a/extensions/renderer/api/display_source/wifi_display/wifi_display_session.cc +++ b/extensions/renderer/api/display_source/wifi_display/wifi_display_session.cc
@@ -11,6 +11,7 @@ #include "base/timer/timer.h" #include "content/public/renderer/render_frame.h" #include "extensions/renderer/api/display_source/wifi_display/wifi_display_media_manager.h" +#include "mojo/public/cpp/bindings/remote.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "third_party/wds/src/libwds/public/logging.h" #include "third_party/wds/src/libwds/public/media_manager.h" @@ -34,13 +35,8 @@ using api::display_source::ErrorType; -WiFiDisplaySession::WiFiDisplaySession( - const DisplaySourceSessionParams& params) - : binding_(this), - params_(params), - cseq_(0), - timer_id_(0), - weak_factory_(this) { +WiFiDisplaySession::WiFiDisplaySession(const DisplaySourceSessionParams& params) + : params_(params), cseq_(0), timer_id_(0), weak_factory_(this) { DCHECK(params_.render_frame); wds::LogSystem::set_error_func(&LogWDSError); params.render_frame->GetRemoteInterfaces()->GetInterface(&service_); @@ -48,12 +44,11 @@ &WiFiDisplaySession::OnIPCConnectionError, weak_factory_.GetWeakPtr())); - WiFiDisplaySessionServiceClientPtr client; - binding_.Bind(mojo::MakeRequest(&client)); + mojo::Remote<WiFiDisplaySessionServiceClient> client; + receiver_.Bind(client.BindNewPipeAndPassReceiver()); service_->SetClient(std::move(client)); - binding_.set_connection_error_handler(base::Bind( - &WiFiDisplaySession::OnIPCConnectionError, - weak_factory_.GetWeakPtr())); + receiver_.set_disconnect_handler(base::Bind( + &WiFiDisplaySession::OnIPCConnectionError, weak_factory_.GetWeakPtr())); } WiFiDisplaySession::~WiFiDisplaySession() {
diff --git a/extensions/renderer/api/display_source/wifi_display/wifi_display_session.h b/extensions/renderer/api/display_source/wifi_display/wifi_display_session.h index 670fab7a..0acc735 100644 --- a/extensions/renderer/api/display_source/wifi_display/wifi_display_session.h +++ b/extensions/renderer/api/display_source/wifi_display/wifi_display_session.h
@@ -10,7 +10,7 @@ #include "extensions/common/mojom/wifi_display_session_service.mojom.h" #include "extensions/renderer/api/display_source/display_source_session.h" -#include "mojo/public/cpp/bindings/binding.h" +#include "mojo/public/cpp/bindings/receiver.h" #include "third_party/wds/src/libwds/public/source.h" namespace base { @@ -75,7 +75,7 @@ std::unique_ptr<wds::Source> wfd_source_; std::unique_ptr<WiFiDisplayMediaManager> media_manager_; mojom::WiFiDisplaySessionServicePtr service_; - mojo::Binding<WiFiDisplaySessionServiceClient> binding_; + mojo::Receiver<WiFiDisplaySessionServiceClient> receiver_{this}; std::string local_ip_address_; std::map<int, std::unique_ptr<base::RepeatingTimer>> timers_;
diff --git a/infra/config/cr-buildbucket.cfg b/infra/config/cr-buildbucket.cfg index f124b900..ce76fc2 100644 --- a/infra/config/cr-buildbucket.cfg +++ b/infra/config/cr-buildbucket.cfg
@@ -1504,6 +1504,12 @@ } builders { + name: "chromeos-amd64-generic-dbg" + mixins: "chromeos-ci" + mixins: "builderless" + } + + builders { name: "chromeos-amd64-generic-rel" mixins: "chromeos-ci" mixins: "builderless" @@ -1517,6 +1523,12 @@ } builders { + name: "chromeos-arm-generic-dbg" + mixins: "chromeos-ci" + mixins: "builderless" + } + + builders { name: "chromeos-arm-generic-rel" mixins: "chromeos-ci" mixins: "builderless" @@ -4219,11 +4231,21 @@ builders { mixins: "chromeos-try" mixins: "builderless" + name: "chromeos-amd64-generic-dbg" + } + builders { + mixins: "chromeos-try" + mixins: "builderless" name: "chromeos-amd64-generic-rel" } builders { mixins: "chromeos-try" mixins: "builderless" + name: "chromeos-arm-generic-dbg" + } + builders { + mixins: "chromeos-try" + mixins: "builderless" name: "chromeos-arm-generic-rel" } builders {
diff --git a/infra/config/luci-milo.cfg b/infra/config/luci-milo.cfg index dd57fb7..5d11042 100644 --- a/infra/config/luci-milo.cfg +++ b/infra/config/luci-milo.cfg
@@ -625,11 +625,21 @@ short_name: "cfi" } builders { + name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-dbg" + category: "chromium.chromiumos|simple|debug|x64" + short_name: "dbg" + } + builders { name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-rel" category: "chromium.chromiumos|simple|release|x64" short_name: "rel" } builders { + name: "buildbucket/luci.chromium.ci/chromeos-arm-generic-dbg" + category: "chromium.chromiumos|simple|debug" + short_name: "arm" + } + builders { name: "buildbucket/luci.chromium.ci/chromeos-arm-generic-rel" category: "chromium.chromiumos|simple|release" short_name: "arm" @@ -1050,11 +1060,21 @@ short_name: "cfi" } builders { + name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-dbg" + category: "simple|debug|x64" + short_name: "dbg" + } + builders { name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-rel" category: "simple|release|x64" short_name: "rel" } builders { + name: "buildbucket/luci.chromium.ci/chromeos-arm-generic-dbg" + category: "simple|debug" + short_name: "arm" + } + builders { name: "buildbucket/luci.chromium.ci/chromeos-arm-generic-rel" category: "simple|release" short_name: "arm" @@ -4086,206 +4106,6 @@ } consoles { - header_id: "chromiumos" - id: "chromiumos-Closers" - name: "chromiumos: Closers" - repo_url: "https://chromium.googlesource.com/chromium/src" - refs: "refs/heads/master" - manifest_name: "REVISION" - builders { - name: "buildbot/chromiumos/amd64-generic-incremental" - } - builders { - name: "buildbot/chromiumos/daisy-incremental" - } - builders { - name: "buildbot/chromiumos/amd64-generic-full" - } - builders { - name: "buildbot/chromiumos/arm-generic-full" - } - builders { - name: "buildbot/chromiumos/daisy-full" - } - builders { - name: "buildbot/chromiumos/lakitu-full" - } - builders { - name: "buildbot/chromiumos/oak-full" - } - builders { - name: "buildbot/chromiumos/tatl-paladin" - } - builders { - name: "buildbot/chromiumos/amd64-generic-asan" - } -} - -consoles { - header_id: "chromiumos" - id: "chromiumos-Full" - name: "chromiumos: Full" - repo_url: "https://chromium.googlesource.com/chromium/src" - refs: "refs/heads/master" - manifest_name: "REVISION" - builders { - name: "buildbot/chromiumos/amd64-generic-full" - } - builders { - name: "buildbot/chromiumos/arm-generic-full" - } - builders { - name: "buildbot/chromiumos/daisy-full" - } - builders { - name: "buildbot/chromiumos/lakitu-full" - } - builders { - name: "buildbot/chromiumos/oak-full" - } - builders { - name: "buildbot/chromiumos/tatl-paladin" - } -} - -consoles { - header_id: "chromiumos" - id: "chromiumos-Incremental" - name: "chromiumos: Incremental" - repo_url: "https://chromium.googlesource.com/chromium/src" - refs: "refs/heads/master" - manifest_name: "REVISION" - builders { - name: "buildbot/chromiumos/amd64-generic-incremental" - } - builders { - name: "buildbot/chromiumos/daisy-incremental" - } -} - -consoles { - header_id: "chromiumos" - id: "chromiumos-ASAN" - name: "chromiumos: ASAN" - repo_url: "https://chromium.googlesource.com/chromium/src" - refs: "refs/heads/master" - manifest_name: "REVISION" - builders { - name: "buildbot/chromiumos/amd64-generic-asan" - } -} - -consoles { - header_id: "chromiumos" - id: "chromiumos-CommitQueue" - name: "chromiumos: Commit Queue" - repo_url: "https://chromium.googlesource.com/chromium/src" - refs: "refs/heads/master" - manifest_name: "REVISION" - builders { - name: "buildbot/chromiumos/amd64-generic-paladin" - } - builders { - name: "buildbot/chromiumos/arm-generic-paladin" - } - builders { - name: "buildbot/chromiumos/moblab-generic-vm-paladin" - } - builders { - name: "buildbot/chromiumos/tatl-paladin" - } -} - -consoles { - header_id: "chromiumos" - id: "chromiumos" - name: "chromiumos" - repo_url: "https://chromium.googlesource.com/chromium/src" - refs: "refs/heads/master" - manifest_name: "REVISION" - builders { - name: "buildbot/chromiumos/amd64-generic-asan" - } - builders { - name: "buildbot/chromiumos/amd64-generic-full" - } - builders { - name: "buildbot/chromiumos/amd64-generic-incremental" - } - builders { - name: "buildbot/chromiumos/amd64-generic-paladin" - } - builders { - name: "buildbot/chromiumos/amd64-generic-fuzzer" - } - builders { - name: "buildbot/chromiumos/arm-generic-full" - } - builders { - name: "buildbot/chromiumos/arm-generic-paladin" - } - builders { - name: "buildbot/chromiumos/chromeos-infra-go" - } - builders { - name: "buildbot/chromiumos/chromiumos-sdk" - } - builders { - name: "buildbot/chromiumos/daisy-full" - } - builders { - name: "buildbot/chromiumos/daisy-incremental" - } - builders { - name: "buildbot/chromiumos/lakitu-full" - } - builders { - name: "buildbot/chromiumos/moblab-generic-vm-paladin" - } - builders { - name: "buildbot/chromiumos/oak-full" - } - builders { - name: "buildbot/chromiumos/tatl-full" - } - builders { - name: "buildbot/chromiumos/tatl-paladin" - } - builders { - name: "buildbot/chromiumos/unallocated-slave-pool" - } -} - -consoles { - header_id: "chromiumos" - id: "chromiumos.chromium" - name: "chromiumos.chromium" - repo_url: "https://chromium.googlesource.com/chromium/src" - refs: "refs/heads/master" - manifest_name: "REVISION" - builders { - name: "buildbot/chromiumos.chromium/amd64-generic-goma-canary-chromium-pfq-informational" - category: "goma" - } - builders { - name: "buildbot/chromiumos.chromium/amd64-generic-telemetry" - category: "chromiumos perf" - } - builders { - name: "buildbot/chromiumos.chromium/amd64-generic-tot-asan-informational" - category: "chromeos asan" - } - builders { - name: "buildbot/chromiumos.chromium/amd64-generic-tot-chromium-pfq-informational" - category: "chromium" - } - builders { - name: "buildbot/chromiumos.chromium/daisy-tot-chromium-pfq-informational" - category: "chromium" - } -} - -consoles { header_id: "chromium" id: "tryserver.chromium.android" name: "tryserver.chromium.android" @@ -4444,9 +4264,15 @@ refs: "refs/heads/master" manifest_name: "REVISION" builders { + name: "buildbucket/luci.chromium.try/chromeos-amd64-generic-dbg" + } + builders { name: "buildbucket/luci.chromium.try/chromeos-amd64-generic-rel" } builders { + name: "buildbucket/luci.chromium.try/chromeos-arm-generic-dbg" + } + builders { name: "buildbucket/luci.chromium.try/chromeos-arm-generic-rel" } builders { @@ -5044,9 +4870,15 @@ name: "buildbucket/luci.chromium.try/chromeos-amd64-generic-cfi-thin-lto-rel" } builders { + name: "buildbucket/luci.chromium.try/chromeos-amd64-generic-dbg" + } + builders { name: "buildbucket/luci.chromium.try/chromeos-amd64-generic-rel" } builders { + name: "buildbucket/luci.chromium.try/chromeos-arm-generic-dbg" + } + builders { name: "buildbucket/luci.chromium.try/chromeos-arm-generic-rel" } builders {
diff --git a/infra/config/luci-scheduler.cfg b/infra/config/luci-scheduler.cfg index 74c3b90a..57bf7f0 100644 --- a/infra/config/luci-scheduler.cfg +++ b/infra/config/luci-scheduler.cfg
@@ -332,6 +332,7 @@ triggers: "android-archive-rel" triggers: "chromeos-amd64-generic-asan-rel" triggers: "chromeos-amd64-generic-cfi-thin-lto-rel" + triggers: "chromeos-amd64-generic-dbg" triggers: "chromeos-amd64-generic-rel" triggers: "chromeos-amd64-generic-rel (Goma RBE FYI)" triggers: "chromeos-amd64-generic-rel-goma-canary" @@ -339,6 +340,7 @@ triggers: "chromeos-amd64-generic-rel-goma-rbe-canary" triggers: "chromeos-amd64-generic-rel-goma-rbe-latest" triggers: "chromeos-amd64-generic-rel-vm-tests" + triggers: "chromeos-arm-generic-dbg" triggers: "chromeos-arm-generic-rel" triggers: "chromeos-kevin-rel" triggers: "chromeos-kevin-rel-hw-tests" @@ -1155,6 +1157,16 @@ } job { + id: "chromeos-amd64-generic-dbg" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "chromeos-amd64-generic-dbg" + } +} + +job { id: "chromeos-amd64-generic-rel" acl_sets: "default" buildbucket: { @@ -1175,6 +1187,16 @@ } job { + id: "chromeos-arm-generic-dbg" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "chromeos-arm-generic-dbg" + } +} + +job { id: "chromeos-arm-generic-rel" acl_sets: "default" buildbucket: {
diff --git a/ipc/ipc_channel_mojo_unittest.cc b/ipc/ipc_channel_mojo_unittest.cc index e085438a..32b7882 100644 --- a/ipc/ipc_channel_mojo_unittest.cc +++ b/ipc/ipc_channel_mojo_unittest.cc
@@ -255,7 +255,8 @@ class ListenerThatBindsATestStructPasser : public IPC::Listener, public IPC::mojom::TestStructPasser { public: - ListenerThatBindsATestStructPasser() : binding_(this) {} + ListenerThatBindsATestStructPasser() = default; + ~ListenerThatBindsATestStructPasser() override = default; bool OnMessageReceived(const IPC::Message& message) override { return true; } @@ -267,15 +268,16 @@ const std::string& interface_name, mojo::ScopedInterfaceEndpointHandle handle) override { CHECK_EQ(interface_name, IPC::mojom::TestStructPasser::Name_); - binding_.Bind( - IPC::mojom::TestStructPasserAssociatedRequest(std::move(handle))); + receiver_.Bind( + mojo::PendingAssociatedReceiver<IPC::mojom::TestStructPasser>( + std::move(handle))); } private: // IPC::mojom::TestStructPasser: void Pass(IPC::mojom::TestStructPtr) override { NOTREACHED(); } - mojo::AssociatedBinding<IPC::mojom::TestStructPasser> binding_; + mojo::AssociatedReceiver<IPC::mojom::TestStructPasser> receiver_{this}; }; class ListenerThatExpectsNoError : public IPC::Listener { @@ -314,9 +316,9 @@ Connect(&listener); wait_to_connect_loop.Run(); - IPC::mojom::TestStructPasserAssociatedPtr passer; + mojo::AssociatedRemote<IPC::mojom::TestStructPasser> passer; channel()->GetAssociatedInterfaceSupport()->GetRemoteAssociatedInterface( - &passer); + passer.BindNewEndpointAndPassReceiver()); // This avoids hitting DCHECKs in the serialization code meant to stop us from // making such "mistakes" as the one we're about to make below. @@ -1006,7 +1008,8 @@ DCHECK(!driver_binding_.is_bound()); DCHECK_EQ(interface_name, IPC::mojom::IndirectTestDriver::Name_); driver_binding_.Bind( - IPC::mojom::IndirectTestDriverAssociatedRequest(std::move(handle))); + mojo::PendingAssociatedReceiver<IPC::mojom::IndirectTestDriver>( + std::move(handle))); } void set_ping_handler(const base::RepeatingClosure& handler) { @@ -1065,7 +1068,7 @@ // message we send will still be dispatched properly even though the remote // endpoint may not have been bound yet by the time the message is initially // processed on the IO thread. - IPC::mojom::IndirectTestDriverAssociatedPtr driver; + mojo::AssociatedRemote<IPC::mojom::IndirectTestDriver> driver; mojo::AssociatedRemote<IPC::mojom::PingReceiver> ping_receiver; proxy()->GetRemoteAssociatedInterface(&driver); driver->GetPingReceiver(ping_receiver.BindNewEndpointAndPassReceiver()); @@ -1425,7 +1428,7 @@ CreateProxy(&listener); RunProxy(); - IPC::mojom::AssociatedInterfaceVendorAssociatedPtr vendor; + mojo::AssociatedRemote<IPC::mojom::AssociatedInterfaceVendor> vendor; proxy()->GetRemoteAssociatedInterface(&vendor); mojo::AssociatedRemote<IPC::mojom::SimpleTestDriver> tester; vendor->GetTestInterface(tester.BindNewEndpointAndPassReceiver());
diff --git a/ipc/ipc_cpu_perftest.cc b/ipc/ipc_cpu_perftest.cc index 5d34690..c5cd5c44 100644 --- a/ipc/ipc_cpu_perftest.cc +++ b/ipc/ipc_cpu_perftest.cc
@@ -20,7 +20,8 @@ #include "ipc/ipc_test_base.h" #include "mojo/core/test/mojo_test_base.h" #include "mojo/core/test/multiprocess_test_helper.h" -#include "mojo/public/cpp/bindings/binding.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/system/message_pipe.h" namespace IPC { @@ -276,7 +277,8 @@ mojo::MessagePipeHandle mp_handle(mp); mojo::ScopedMessagePipeHandle scoped_mp(mp_handle); - ping_receiver_.Bind(IPC::mojom::ReflectorPtrInfo(std::move(scoped_mp), 0u)); + ping_receiver_.Bind( + mojo::PendingRemote<IPC::mojom::Reflector>(std::move(scoped_mp), 0u)); LockThreadAffinity thread_locker(kSharedCore); std::vector<TestParams> params_list = GetDefaultTestParams(); @@ -293,7 +295,7 @@ ping_receiver_->Quit(); - ignore_result(ping_receiver_.PassInterface().PassHandle().release()); + ignore_result(ping_receiver_.Unbind().PassPipe().release()); } void OnHello(const std::string& value) { @@ -380,7 +382,7 @@ std::string label_; bool sync_ = false; - IPC::mojom::ReflectorPtr ping_receiver_; + mojo::Remote<IPC::mojom::Reflector> ping_receiver_; int count_down_ = 0; int frame_count_down_ = 0;
diff --git a/ipc/ipc_mojo_perftest.cc b/ipc/ipc_mojo_perftest.cc index 79b63d23..94b4920 100644 --- a/ipc/ipc_mojo_perftest.cc +++ b/ipc/ipc_mojo_perftest.cc
@@ -27,9 +27,10 @@ #include "mojo/core/test/multiprocess_test_helper.h" #include "mojo/public/cpp/bindings/associated_receiver_set.h" #include "mojo/public/cpp/bindings/associated_remote.h" -#include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/pending_associated_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/system/message_pipe.h" @@ -288,7 +289,8 @@ mojo::MessagePipeHandle mp_handle(mp); mojo::ScopedMessagePipeHandle scoped_mp(mp_handle); - ping_receiver_.Bind(IPC::mojom::ReflectorPtrInfo(std::move(scoped_mp), 0u)); + ping_receiver_.Bind( + mojo::PendingRemote<IPC::mojom::Reflector>(std::move(scoped_mp), 0u)); LockThreadAffinity thread_locker(kSharedCore); std::vector<PingPongTestParams> params = GetDefaultTestParams(); @@ -303,7 +305,7 @@ ping_receiver_->Quit(); - ignore_result(ping_receiver_.PassInterface().PassHandle().release()); + ignore_result(ping_receiver_.Unbind().PassPipe().release()); } void OnPong(const std::string& value) { @@ -360,7 +362,7 @@ int count_down_; std::string label_; std::string payload_; - IPC::mojom::ReflectorPtr ping_receiver_; + mojo::Remote<IPC::mojom::Reflector> ping_receiver_; std::unique_ptr<base::PerfTimeLogger> perf_logger_; DISALLOW_COPY_AND_ASSIGN(MojoInterfacePerfTest); @@ -371,11 +373,12 @@ public: InterfacePassingTestDriverImpl(mojo::ScopedMessagePipeHandle handle, const base::Closure& quit_closure) - : binding_(this, - mojom::InterfacePassingTestDriverRequest(std::move(handle))), + : receiver_(this, + mojo::PendingReceiver<mojom::InterfacePassingTestDriver>( + std::move(handle))), quit_closure_(quit_closure) {} ~InterfacePassingTestDriverImpl() override { - ignore_result(binding_.Unbind().PassMessagePipe().release()); + ignore_result(receiver_.Unbind().PassPipe().release()); } private: @@ -412,7 +415,7 @@ mojo::ReceiverSet<mojom::PingReceiver> ping_receiver_receivers_; mojo::AssociatedReceiverSet<mojom::PingReceiver> ping_receiver_associated_receivers_; - mojo::Binding<mojom::InterfacePassingTestDriver> binding_; + mojo::Receiver<mojom::InterfacePassingTestDriver> receiver_; base::Closure quit_closure_; }; @@ -430,14 +433,14 @@ mojo::MessagePipeHandle mp_handle(mp); mojo::ScopedMessagePipeHandle scoped_mp(mp_handle); - driver_ptr_.Bind( - mojom::InterfacePassingTestDriverPtrInfo(std::move(scoped_mp), 0u)); + driver_remote_.Bind(mojo::PendingRemote<mojom::InterfacePassingTestDriver>( + std::move(scoped_mp), 0u)); auto params = GetDefaultInterfacePassingTestParams(); LockThreadAffinity thread_locker(kSharedCore); for (size_t i = 0; i < params.size(); ++i) { - driver_ptr_->Init( + driver_remote_->Init( base::Bind(&MojoInterfacePassingPerfTest::OnInitCallback, base::Unretained(this))); rounds_ = count_down_ = params[i].rounds(); @@ -448,9 +451,9 @@ run_loop.Run(); } - driver_ptr_->Quit(); + driver_remote_->Quit(); - ignore_result(driver_ptr_.PassInterface().PassHandle().release()); + ignore_result(driver_remote_.Unbind().PassPipe().release()); } void OnInitCallback() { @@ -475,7 +478,7 @@ associated_remotes[i].get(); } - driver_ptr_->GetAssociatedPingReceiver( + driver_remote_->GetAssociatedPingReceiver( std::move(receivers), base::Bind(&MojoInterfacePassingPerfTest::OnGetReceiverCallback, base::Unretained(this))); @@ -490,7 +493,7 @@ remotes[i].get(); } - driver_ptr_->GetPingReceiver( + driver_remote_->GetPingReceiver( std::move(receivers), base::Bind(&MojoInterfacePassingPerfTest::OnGetReceiverCallback, base::Unretained(this))); @@ -533,7 +536,7 @@ bool associated_ = false; std::unique_ptr<base::PerfTimeLogger> perf_logger_; - mojom::InterfacePassingTestDriverPtr driver_ptr_; + mojo::Remote<mojom::InterfacePassingTestDriver> driver_remote_; base::Closure quit_closure_;
diff --git a/ipc/ipc_perftest_util.cc b/ipc/ipc_perftest_util.cc index 3d49189..cf35d3cd 100644 --- a/ipc/ipc_perftest_util.cc +++ b/ipc/ipc_perftest_util.cc
@@ -123,10 +123,12 @@ ReflectorImpl::ReflectorImpl(mojo::ScopedMessagePipeHandle handle, const base::Closure& quit_closure) : quit_closure_(quit_closure), - binding_(this, IPC::mojom::ReflectorRequest(std::move(handle))) {} + receiver_( + this, + mojo::PendingReceiver<IPC::mojom::Reflector>(std::move(handle))) {} ReflectorImpl::~ReflectorImpl() { - ignore_result(binding_.Unbind().PassMessagePipe().release()); + ignore_result(receiver_.Unbind().PassPipe().release()); } void ReflectorImpl::Ping(const std::string& value, PingCallback callback) {
diff --git a/ipc/ipc_perftest_util.h b/ipc/ipc_perftest_util.h index 5925e3db..a2d3cfd 100644 --- a/ipc/ipc_perftest_util.h +++ b/ipc/ipc_perftest_util.h
@@ -23,7 +23,7 @@ #include "ipc/ipc_message.h" #include "ipc/ipc_sender.h" #include "ipc/ipc_test.mojom.h" -#include "mojo/public/cpp/bindings/binding.h" +#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/system/core.h" #if defined(OS_WIN) @@ -119,7 +119,7 @@ void Quit() override; base::Closure quit_closure_; - mojo::Binding<IPC::mojom::Reflector> binding_; + mojo::Receiver<IPC::mojom::Reflector> receiver_; }; } // namespace IPC
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc index 415ab3c..ab05ee8e 100644 --- a/media/blink/webmediaplayer_impl.cc +++ b/media/blink/webmediaplayer_impl.cc
@@ -55,7 +55,6 @@ #include "media/media_buildflags.h" #include "net/base/data_url.h" #include "third_party/blink/public/platform/web_encrypted_media_types.h" -#include "third_party/blink/public/platform/web_localized_string.h" #include "third_party/blink/public/platform/web_media_player_client.h" #include "third_party/blink/public/platform/web_media_player_encrypted_media_client.h" #include "third_party/blink/public/platform/web_media_player_source.h"
diff --git a/media/mojo/mojom/content_decryption_module.mojom b/media/mojo/mojom/content_decryption_module.mojom index 1e0247d..925255e 100644 --- a/media/mojo/mojom/content_decryption_module.mojom +++ b/media/mojo/mojom/content_decryption_module.mojom
@@ -146,5 +146,5 @@ // It should be a reverse domain name, e.g. "com.example.somesystem". However, // this call may be initiated by an untrusted process (e.g. renderer), so the // implementation must fully validate |key_system| before creating the CDM. - CreateCdm(string key_system, pending_receiver<ContentDecryptionModule> cdm); + CreateCdm(string key_system, ContentDecryptionModule& cdm); };
diff --git a/media/mojo/services/cdm_service.cc b/media/mojo/services/cdm_service.cc index 0c1d80e6..36a58b5 100644 --- a/media/mojo/services/cdm_service.cc +++ b/media/mojo/services/cdm_service.cc
@@ -11,8 +11,6 @@ #include "media/media_buildflags.h" #include "media/mojo/services/mojo_cdm_service.h" #include "media/mojo/services/mojo_cdm_service_context.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "mojo/public/cpp/bindings/unique_receiver_set.h" #include "services/service_manager/public/cpp/connector.h" #if defined(OS_MACOSX) @@ -43,7 +41,7 @@ // during browser shutdown, when the Cdservice could be destroyed directly, // ignoring any outstanding ServiceKeepaliveRefs. // - mojo::CdmFactory connection error happens, AND CdmFactoryImpl doesn't own -// any CDMs (|cdm_receivers_| is empty). This is to prevent destroying the +// any CDMs (|cdm_bindings_| is empty). This is to prevent destroying the // CDMs too early (e.g. during page navigation) which could cause errors // (session closed) on the client side. See https://crbug.com/821171 for // details. @@ -57,36 +55,35 @@ keepalive_ref_(std::move(keepalive_ref)) { DVLOG(1) << __func__; - // base::Unretained is safe because |cdm_receivers_| is owned by |this|. If - // |this| is destructed, |cdm_receivers_| will be destructed as well and the + // base::Unretained is safe because |cdm_bindings_| is owned by |this|. If + // |this| is destructed, |cdm_bindings_| will be destructed as well and the // error handler should never be called. - cdm_receivers_.set_disconnect_handler(base::BindRepeating( + cdm_bindings_.set_connection_error_handler(base::BindRepeating( &CdmFactoryImpl::OnBindingConnectionError, base::Unretained(this))); } ~CdmFactoryImpl() final { DVLOG(1) << __func__; } // mojom::CdmFactory implementation. - void CreateCdm( - const std::string& key_system, - mojo::PendingReceiver<mojom::ContentDecryptionModule> receiver) final { + void CreateCdm(const std::string& key_system, + mojom::ContentDecryptionModuleRequest request) final { DVLOG(2) << __func__; auto* cdm_factory = GetCdmFactory(); if (!cdm_factory) return; - cdm_receivers_.Add( + cdm_bindings_.AddBinding( std::make_unique<MojoCdmService>(cdm_factory, &cdm_service_context_), - std::move(receiver)); + std::move(request)); } // DeferredDestroy<mojom::CdmFactory> implemenation. void OnDestroyPending(base::OnceClosure destroy_cb) final { destroy_cb_ = std::move(destroy_cb); - if (cdm_receivers_.empty()) + if (cdm_bindings_.empty()) std::move(destroy_cb_).Run(); - // else the callback will be called when |cdm_receivers_| become empty. + // else the callback will be called when |cdm_bindings_| become empty. } private: @@ -99,7 +96,7 @@ } void OnBindingConnectionError() { - if (destroy_cb_ && cdm_receivers_.empty()) + if (destroy_cb_ && cdm_bindings_.empty()) std::move(destroy_cb_).Run(); } @@ -110,7 +107,7 @@ CdmService::Client* client_; service_manager::mojom::InterfaceProviderPtr interfaces_; - mojo::UniqueReceiverSet<mojom::ContentDecryptionModule> cdm_receivers_; + mojo::StrongBindingSet<mojom::ContentDecryptionModule> cdm_bindings_; std::unique_ptr<ServiceKeepaliveRef> keepalive_ref_; std::unique_ptr<media::CdmFactory> cdm_factory_; base::OnceClosure destroy_cb_;
diff --git a/net/http/transport_security_state_static.json b/net/http/transport_security_state_static.json index 9d28e24..8b120c32 100644 --- a/net/http/transport_security_state_static.json +++ b/net/http/transport_security_state_static.json
@@ -225,15 +225,6 @@ "SwehackBackup", "COMODORSADomainValidationSecureServerCA" ] - }, - { - "name": "tumblr", - "static_spki_hashes": [ - "DigiCertEVRoot", - "DigiCertSHA2HighAssuranceServerCA", - "TumblrBackup" - ], - "report_uri": "https://cspreports.srvcs.tumblr.com/hpkp" } ], @@ -84669,8 +84660,7 @@ { "name": "www.tumblr.com", "policy": "custom", - "mode": "force-https", "include_subdomains": false, - "include_subdomains_for_pinning": true, "pins": "tumblr" + "mode": "force-https", "include_subdomains": false }, { "name": "history.pe",
diff --git a/net/http/transport_security_state_static.pins b/net/http/transport_security_state_static.pins index f199694..24ca599 100644 --- a/net/http/transport_security_state_static.pins +++ b/net/http/transport_security_state_static.pins
@@ -308,37 +308,6 @@ CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= -----END CERTIFICATE----- -# https://www.digicert.com/digicert-root-certificates.htm -DigiCertSHA2HighAssuranceServerCA ------BEGIN CERTIFICATE----- -MIIEsTCCA5mgAwIBAgIQBOHnpNxc8vNtwCtCuF0VnzANBgkqhkiG9w0BAQsFADBs -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j -ZSBFViBSb290IENBMB4XDTEzMTAyMjEyMDAwMFoXDTI4MTAyMjEyMDAwMFowcDEL -MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 -LmRpZ2ljZXJ0LmNvbTEvMC0GA1UEAxMmRGlnaUNlcnQgU0hBMiBIaWdoIEFzc3Vy -YW5jZSBTZXJ2ZXIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC2 -4C/CJAbIbQRf1+8KZAayfSImZRauQkCbztyfn3YHPsMwVYcZuU+UDlqUH1VWtMIC -Kq/QmO4LQNfE0DtyyBSe75CxEamu0si4QzrZCwvV1ZX1QK/IHe1NnF9Xt4ZQaJn1 -itrSxwUfqJfJ3KSxgoQtxq2lnMcZgqaFD15EWCo3j/018QsIJzJa9buLnqS9UdAn -4t07QjOjBSjEuyjMmqwrIw14xnvmXnG3Sj4I+4G3FhahnSMSTeXXkgisdaScus0X -sh5ENWV/UyU50RwKmmMbGZJ0aAo3wsJSSMs5WqK24V3B3aAguCGikyZvFEohQcft -bZvySC/zA/WiaJJTL17jAgMBAAGjggFJMIIBRTASBgNVHRMBAf8ECDAGAQH/AgEA -MA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIw -NAYIKwYBBQUHAQEEKDAmMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2Vy -dC5jb20wSwYDVR0fBEQwQjBAoD6gPIY6aHR0cDovL2NybDQuZGlnaWNlcnQuY29t -L0RpZ2lDZXJ0SGlnaEFzc3VyYW5jZUVWUm9vdENBLmNybDA9BgNVHSAENjA0MDIG -BFUdIAAwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQ -UzAdBgNVHQ4EFgQUUWj/kK8CB3U8zNllZGKiErhZcjswHwYDVR0jBBgwFoAUsT7D -aQP4v0cB1JgmGggC72NkK8MwDQYJKoZIhvcNAQELBQADggEBABiKlYkD5m3fXPwd -aOpKj4PWUS+Na0QWnqxj9dJubISZi6qBcYRb7TROsLd5kinMLYBq8I4g4Xmk/gNH -E+r1hspZcX30BJZr01lYPf7TMSVcGDiEo+afgv2MW5gxTs14nhr9hctJqvIni5ly -/D6q1UEL2tU2ob8cbkdJf17ZSHwD2f2LSaCYJkJA69aSEaRkCldUxPUd1gJea6zu -xICaEnL6VpPX/78whQYwvwt/Tv9XBZ0k7YXDK/umdaisLRbvfXknsuvCnQsH6qqF -0wGjIChBWUMo0oHjqvbsezt3tkBigAVBRQHvFwY+3sAzm2fTYS5yh+Rp/BIAV0Ae -cPUeybQ= ------END CERTIFICATE----- - Tor1 -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlOpp8zfF+jEbI6R7nxnm @@ -1724,18 +1693,6 @@ +AZxAeKCINT+b72x -----END CERTIFICATE----- -# From https://crbug.com/745781#c7 -TumblrBackup ------BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvRHwz8nF03wWD2yzXa9t -zxuxs0ITJIPofPKNshVgIKg7HIMgZ/i7e5Gr6pfoC/majqbcxPFd/AaGcQLjTxv0 -hnDPOnIicG2NpofNDE8n1cmZ0TM3fNp73E+Rp9Fb0p2uLglLBN4SaXRDNXCGGZBI -uGs1xJmIDdgaYCKMCekvD2xwvpXKO9kcSrA7gvCFFP1hKBI6DAL1CNTBCiRKcm/S -GWJTdi+BsmLN41ctt9HKOJ4/J/yrsl8Fbnatt55dEByJDJnwGvgCvkgYbM+pgc1H -3zdFfyi/c3LKxf6ZkKYRNCSCL3UXZcLZZhHBwwC9kMMJQohmxwkV7t2imWWbtnTX -jQIDAQAB ------END PUBLIC KEY----- - # DigiCert Global Root G2 # https://www.digicert.com/CACerts/DigiCertGlobalRootG2.crt DigiCertGlobalRootG2
diff --git a/services/tracing/public/cpp/perfetto/trace_event_data_source.cc b/services/tracing/public/cpp/perfetto/trace_event_data_source.cc index e20abb58..8e83ee5 100644 --- a/services/tracing/public/cpp/perfetto/trace_event_data_source.cc +++ b/services/tracing/public/cpp/perfetto/trace_event_data_source.cc
@@ -8,6 +8,7 @@ #include <map> #include <memory> #include <utility> +#include <vector> #include "base/base64.h" #include "base/bind.h" @@ -23,9 +24,11 @@ #include "base/sequence_checker.h" #include "base/strings/pattern.h" #include "base/strings/string_number_conversions.h" +#include "base/synchronization/lock.h" #include "base/task/common/scoped_defer_task_posting.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/time/time.h" +#include "base/trace_event/trace_config.h" #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_log.h" #include "build/build_config.h" @@ -55,6 +58,7 @@ using TraceEvent = base::trace_event::TraceEvent; using TraceConfig = base::trace_event::TraceConfig; using TracePacketHandle = perfetto::TraceWriter::TracePacketHandle; +using TraceRecordMode = base::trace_event::TraceRecordMode; using perfetto::protos::pbzero::ChromeMetadataPacket; using perfetto::protos::pbzero::ProcessDescriptor; @@ -99,8 +103,8 @@ } // namespace -using ChromeEventBundleHandle = - protozero::MessageHandle<perfetto::protos::pbzero::ChromeEventBundle>; +using perfetto::protos::pbzero::ChromeEventBundle; +using ChromeEventBundleHandle = protozero::MessageHandle<ChromeEventBundle>; // static TraceEventMetadataSource* TraceEventMetadataSource::GetInstance() { @@ -125,12 +129,15 @@ JsonMetadataGeneratorFunction generator) { DCHECK(origin_task_runner_->RunsTasksInCurrentSequence()); json_generator_functions_.push_back(generator); + // An EventBundle is created when nullptr is passed. + GenerateJsonMetadataFromGenerator(generator, nullptr); } void TraceEventMetadataSource::AddGeneratorFunction( MetadataGeneratorFunction generator) { DCHECK(origin_task_runner_->RunsTasksInCurrentSequence()); generator_functions_.push_back(generator); + GenerateMetadataFromGenerator(generator); } std::unique_ptr<base::DictionaryValue> @@ -139,14 +146,12 @@ return nullptr; } - base::trace_event::TraceConfig parsed_chrome_config(chrome_config_); - auto metadata_dict = std::make_unique<base::DictionaryValue>(); // If argument filtering is enabled, we need to check if the trace config is // whitelisted before emitting it. // TODO(eseckler): Figure out a way to solve this without calling directly // into IsMetadataWhitelisted(). - if (!parsed_chrome_config.IsArgumentFilterEnabled() || + if (!parsed_chrome_config_->IsArgumentFilterEnabled() || IsMetadataWhitelisted("trace-config")) { metadata_dict->SetString("trace-config", chrome_config_); } else { @@ -157,81 +162,177 @@ return metadata_dict; } -void TraceEventMetadataSource::GenerateMetadata( - std::unique_ptr<perfetto::TraceWriter> trace_writer) { +void TraceEventMetadataSource::GenerateMetadataFromGenerator( + const TraceEventMetadataSource::MetadataGeneratorFunction& generator) { DCHECK(origin_task_runner_->RunsTasksInCurrentSequence()); - auto trace_packet = trace_writer->NewTracePacket(); - auto* chrome_metadata = trace_packet->set_chrome_metadata(); - for (auto& generator : generator_functions_) { - generator.Run(chrome_metadata, privacy_filtering_enabled_); + perfetto::TraceWriter::TracePacketHandle trace_packet; + { + base::AutoLock lock(lock_); + if (!emit_metadata_at_start_ || !trace_writer_) { + return; + } + trace_packet = trace_writer_->NewTracePacket(); } - trace_packet = TracePacketHandle(); + trace_packet->set_timestamp( + TRACE_TIME_TICKS_NOW().since_origin().InNanoseconds()); + auto* chrome_metadata = trace_packet->set_chrome_metadata(); + generator.Run(chrome_metadata, privacy_filtering_enabled_); +} - // We already have the |trace_writer| and |trace_packet|, so regardless of if - // we need to return due to privacy we need to null out the |producer_| to - // inform the system that we are done tracing with this |producer_| - producer_ = nullptr; - if (privacy_filtering_enabled_) { +void TraceEventMetadataSource::GenerateJsonMetadataFromGenerator( + const TraceEventMetadataSource::JsonMetadataGeneratorFunction& generator, + ChromeEventBundle* event_bundle) { + DCHECK(origin_task_runner_->RunsTasksInCurrentSequence()); + perfetto::TraceWriter::TracePacketHandle trace_packet; + if (!event_bundle) { + { + base::AutoLock lock(lock_); + if (!emit_metadata_at_start_ || !trace_writer_) { + return; + } + trace_packet = trace_writer_->NewTracePacket(); + } + trace_packet->set_timestamp( + TRACE_TIME_TICKS_NOW().since_origin().InNanoseconds()); + event_bundle = trace_packet->set_chrome_events(); + } + + std::unique_ptr<base::DictionaryValue> metadata_dict = generator.Run(); + if (!metadata_dict) { return; } - auto legacy_trace_packet = trace_writer->NewTracePacket(); - ChromeEventBundleHandle event_bundle( - legacy_trace_packet->set_chrome_events()); + for (const auto& it : metadata_dict->DictItems()) { + auto* new_metadata = event_bundle->add_metadata(); + new_metadata->set_name(it.first.c_str()); - for (auto& generator : json_generator_functions_) { - std::unique_ptr<base::DictionaryValue> metadata_dict = generator.Run(); - if (!metadata_dict) { - continue; + if (it.second.is_int()) { + new_metadata->set_int_value(it.second.GetInt()); + } else if (it.second.is_bool()) { + new_metadata->set_bool_value(it.second.GetBool()); + } else if (it.second.is_string()) { + new_metadata->set_string_value(it.second.GetString().c_str()); + } else { + std::string json_value; + base::JSONWriter::Write(it.second, &json_value); + new_metadata->set_json_value(json_value.c_str()); } + } +} - for (const auto& it : metadata_dict->DictItems()) { - auto* new_metadata = event_bundle->add_metadata(); - new_metadata->set_name(it.first.c_str()); +void TraceEventMetadataSource::GenerateMetadata( + std::unique_ptr< + std::vector<TraceEventMetadataSource::JsonMetadataGeneratorFunction>> + json_generators, + std::unique_ptr< + std::vector<TraceEventMetadataSource::MetadataGeneratorFunction>> + proto_generators) { + DCHECK(origin_task_runner_->RunsTasksInCurrentSequence()); + TracePacketHandle trace_packet; + bool privacy_filtering_enabled; + { + base::AutoLock lock(lock_); + trace_packet = trace_writer_->NewTracePacket(); + privacy_filtering_enabled = privacy_filtering_enabled_; + } - if (it.second.is_int()) { - new_metadata->set_int_value(it.second.GetInt()); - } else if (it.second.is_bool()) { - new_metadata->set_bool_value(it.second.GetBool()); - } else if (it.second.is_string()) { - new_metadata->set_string_value(it.second.GetString().c_str()); - } else { - std::string json_value; - base::JSONWriter::Write(it.second, &json_value); - new_metadata->set_json_value(json_value.c_str()); - } - } + trace_packet->set_timestamp( + TRACE_TIME_TICKS_NOW().since_origin().InNanoseconds()); + auto* chrome_metadata = trace_packet->set_chrome_metadata(); + for (auto& generator : *proto_generators) { + generator.Run(chrome_metadata, privacy_filtering_enabled_); + } + + if (privacy_filtering_enabled) { + return; + } + + trace_packet->set_timestamp( + TRACE_TIME_TICKS_NOW().since_origin().InNanoseconds()); + ChromeEventBundle* event_bundle = trace_packet->set_chrome_events(); + + for (auto& generator : *json_generators) { + GenerateJsonMetadataFromGenerator(generator, event_bundle); } } void TraceEventMetadataSource::StartTracing( PerfettoProducer* producer, const perfetto::DataSourceConfig& data_source_config) { - // TODO(eseckler): Once we support streaming of trace data, it would make - // sense to emit the metadata on startup, so the UI can display it right away. - privacy_filtering_enabled_ = - data_source_config.chrome_config().privacy_filtering_enabled(); - chrome_config_ = data_source_config.chrome_config().trace_config(); - trace_writer_ = - producer->CreateTraceWriter(data_source_config.target_buffer()); + auto json_generators = + std::make_unique<std::vector<JsonMetadataGeneratorFunction>>(); + auto proto_generators = + std::make_unique<std::vector<MetadataGeneratorFunction>>(); + { + base::AutoLock lock(lock_); + privacy_filtering_enabled_ = + data_source_config.chrome_config().privacy_filtering_enabled(); + chrome_config_ = data_source_config.chrome_config().trace_config(); + parsed_chrome_config_ = std::make_unique<TraceConfig>(chrome_config_); + trace_writer_ = + producer->CreateTraceWriter(data_source_config.target_buffer()); + switch (parsed_chrome_config_->GetTraceRecordMode()) { + case TraceRecordMode::RECORD_UNTIL_FULL: + case TraceRecordMode::RECORD_AS_MUCH_AS_POSSIBLE: { + emit_metadata_at_start_ = true; + *json_generators = json_generator_functions_; + *proto_generators = generator_functions_; + break; + } + case TraceRecordMode::RECORD_CONTINUOUSLY: + case TraceRecordMode::ECHO_TO_CONSOLE: + emit_metadata_at_start_ = false; + return; + } + } + // |emit_metadata_at_start_| is true if we are in discard packets mode, write + // metadata at the beginning of the trace to make it less likely to be + // dropped. + origin_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&TraceEventMetadataSource::GenerateMetadata, + base::Unretained(this), std::move(json_generators), + std::move(proto_generators))); } void TraceEventMetadataSource::StopTracing( base::OnceClosure stop_complete_callback) { - if (trace_writer_) { - // Write metadata at the end of tracing to make it less likely that it is - // overwritten by other trace data in perfetto's ring buffer. - origin_task_runner_->PostTaskAndReply( - FROM_HERE, - base::BindOnce(&TraceEventMetadataSource::GenerateMetadata, - base::Unretained(this), std::move(trace_writer_)), - std::move(stop_complete_callback)); - } else { - producer_ = nullptr; - trace_writer_.reset(); - chrome_config_ = std::string(); - std::move(stop_complete_callback).Run(); + base::OnceClosure maybe_generate_task = base::DoNothing(); + { + base::AutoLock lock(lock_); + if (!emit_metadata_at_start_ && trace_writer_) { + // Write metadata at the end of tracing if not emitted at start (in ring + // buffer mode), to make it less likely that it is overwritten by other + // trace data in perfetto's ring buffer. + auto json_generators = + std::make_unique<std::vector<JsonMetadataGeneratorFunction>>(); + *json_generators = json_generator_functions_; + auto proto_generators = + std::make_unique<std::vector<MetadataGeneratorFunction>>(); + *proto_generators = generator_functions_; + maybe_generate_task = base::BindOnce( + &TraceEventMetadataSource::GenerateMetadata, base::Unretained(this), + std::move(json_generators), std::move(proto_generators)); + } } + // Even when not generating metadata, make sure the metadata generate task + // posted at the start is finished, by posting task on origin task runner. + origin_task_runner_->PostTaskAndReply( + FROM_HERE, std::move(maybe_generate_task), + base::BindOnce( + [](TraceEventMetadataSource* ds, + base::OnceClosure stop_complete_callback) { + { + base::AutoLock lock(ds->lock_); + ds->producer_ = nullptr; + ds->trace_writer_.reset(); + ds->chrome_config_ = std::string(); + ds->parsed_chrome_config_.reset(); + ds->emit_metadata_at_start_ = false; + } + std::move(stop_complete_callback).Run(); + }, + base::Unretained(this), std::move(stop_complete_callback))); } void TraceEventMetadataSource::Flush(
diff --git a/services/tracing/public/cpp/perfetto/trace_event_data_source.h b/services/tracing/public/cpp/perfetto/trace_event_data_source.h index ddc9c57a6..96967d20 100644 --- a/services/tracing/public/cpp/perfetto/trace_event_data_source.h +++ b/services/tracing/public/cpp/perfetto/trace_event_data_source.h
@@ -20,6 +20,7 @@ #include "base/trace_event/trace_config.h" #include "services/tracing/public/cpp/perfetto/perfetto_traced_process.h" #include "third_party/perfetto/protos/perfetto/trace/chrome/chrome_metadata.pbzero.h" +#include "third_party/perfetto/protos/perfetto/trace/chrome/chrome_trace_event.pbzero.h" namespace perfetto { class StartupTraceWriter; @@ -60,7 +61,9 @@ perfetto::protos::pbzero::ChromeMetadataPacket*, bool /* privacy_filtering_enabled */)>; - // Any callbacks passed here will be called when tracing starts. + // Any callbacks passed here will be called when tracing. Note that if tracing + // is enabled while calling this method, the callback may be invoked + // directly. void AddGeneratorFunction(JsonMetadataGeneratorFunction generator); // Same as above, but for filling in proto format. void AddGeneratorFunction(MetadataGeneratorFunction generator); @@ -81,15 +84,29 @@ TraceEventMetadataSource(); ~TraceEventMetadataSource() override; - void GenerateMetadata(std::unique_ptr<perfetto::TraceWriter> trace_writer); + void GenerateMetadata( + std::unique_ptr<std::vector<JsonMetadataGeneratorFunction>> + json_generators, + std::unique_ptr<std::vector<MetadataGeneratorFunction>> proto_generators); + void GenerateMetadataFromGenerator( + const MetadataGeneratorFunction& generator); + void GenerateJsonMetadataFromGenerator( + const JsonMetadataGeneratorFunction& generator, + perfetto::protos::pbzero::ChromeEventBundle* event_bundle); std::unique_ptr<base::DictionaryValue> GenerateTraceConfigMetadataDict(); + // All members are protected by |lock_|. + base::Lock lock_; std::vector<JsonMetadataGeneratorFunction> json_generator_functions_; std::vector<MetadataGeneratorFunction> generator_functions_; - scoped_refptr<base::SequencedTaskRunner> origin_task_runner_; + + const scoped_refptr<base::SequencedTaskRunner> origin_task_runner_; + std::unique_ptr<perfetto::TraceWriter> trace_writer_; bool privacy_filtering_enabled_ = false; std::string chrome_config_; + std::unique_ptr<base::trace_event::TraceConfig> parsed_chrome_config_; + bool emit_metadata_at_start_ = false; DISALLOW_COPY_AND_ASSIGN(TraceEventMetadataSource); };
diff --git a/services/tracing/public/cpp/perfetto/trace_event_data_source_unittest.cc b/services/tracing/public/cpp/perfetto/trace_event_data_source_unittest.cc index 5fe111e9..4d5684d1 100644 --- a/services/tracing/public/cpp/perfetto/trace_event_data_source_unittest.cc +++ b/services/tracing/public/cpp/perfetto/trace_event_data_source_unittest.cc
@@ -503,21 +503,22 @@ NOTREACHED(); } -TEST_F(TraceEventDataSourceTest, MetadataSourceBasicTypes) { +std::unique_ptr<base::DictionaryValue> AddJsonMetadataGenerator() { + auto metadata = std::make_unique<base::DictionaryValue>(); + metadata->SetInteger("foo_int", 42); + metadata->SetString("foo_str", "bar"); + metadata->SetBoolean("foo_bool", true); + + auto child_dict = std::make_unique<base::DictionaryValue>(); + child_dict->SetString("child_str", "child_val"); + metadata->Set("child_dict", std::move(child_dict)); + return metadata; +} + +TEST_F(TraceEventDataSourceTest, MetadataGeneratorBeforeTracing) { auto* metadata_source = TraceEventMetadataSource::GetInstance(); - metadata_source->AddGeneratorFunction(base::BindRepeating([]() { - auto metadata = std::make_unique<base::DictionaryValue>(); - metadata->SetInteger("foo_int", 42); - metadata->SetString("foo_str", "bar"); - metadata->SetBoolean("foo_bool", true); - - auto child_dict = std::make_unique<base::DictionaryValue>(); - child_dict->SetString("child_str", "child_val"); - metadata->Set("child_dict", std::move(child_dict)); - return metadata; - })); - - CreateTraceEventDataSource(); + metadata_source->AddGeneratorFunction( + base::BindRepeating(&AddJsonMetadataGenerator)); metadata_source->StartTracing(producer_client(), perfetto::DataSourceConfig()); @@ -537,6 +538,61 @@ MetadataHasNamedValue(metadata, "child_dict", *child_dict); } +TEST_F(TraceEventDataSourceTest, MetadataGeneratorWhileTracing) { + auto* metadata_source = TraceEventMetadataSource::GetInstance(); + + metadata_source->StartTracing(producer_client(), + perfetto::DataSourceConfig()); + metadata_source->AddGeneratorFunction( + base::BindRepeating(&AddJsonMetadataGenerator)); + + base::RunLoop wait_for_stop; + metadata_source->StopTracing(wait_for_stop.QuitClosure()); + wait_for_stop.Run(); + + auto metadata = producer_client()->GetChromeMetadata(); + EXPECT_EQ(4, metadata.size()); + MetadataHasNamedValue(metadata, "foo_int", 42); + MetadataHasNamedValue(metadata, "foo_str", "bar"); + MetadataHasNamedValue(metadata, "foo_bool", true); + + auto child_dict = std::make_unique<base::DictionaryValue>(); + child_dict->SetString("child_str", "child_val"); + MetadataHasNamedValue(metadata, "child_dict", *child_dict); +} + +TEST_F(TraceEventDataSourceTest, MultipleMetadataGenerators) { + auto* metadata_source = TraceEventMetadataSource::GetInstance(); + metadata_source->AddGeneratorFunction(base::BindRepeating([]() { + auto metadata = std::make_unique<base::DictionaryValue>(); + metadata->SetInteger("before_int", 42); + return metadata; + })); + + metadata_source->StartTracing(producer_client(), + perfetto::DataSourceConfig()); + metadata_source->AddGeneratorFunction( + base::BindRepeating(&AddJsonMetadataGenerator)); + + base::RunLoop wait_for_stop; + metadata_source->StopTracing(wait_for_stop.QuitClosure()); + wait_for_stop.Run(); + + auto metadata = producer_client()->GetChromeMetadata(); + EXPECT_EQ(4, metadata.size()); + MetadataHasNamedValue(metadata, "foo_int", 42); + MetadataHasNamedValue(metadata, "foo_str", "bar"); + MetadataHasNamedValue(metadata, "foo_bool", true); + + auto child_dict = std::make_unique<base::DictionaryValue>(); + child_dict->SetString("child_str", "child_val"); + MetadataHasNamedValue(metadata, "child_dict", *child_dict); + + metadata = producer_client()->GetChromeMetadata(1); + EXPECT_EQ(1, metadata.size()); + MetadataHasNamedValue(metadata, "before_int", 42); +} + TEST_F(TraceEventDataSourceTest, BasicTraceEvent) { CreateTraceEventDataSource();
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 6bc847a..b4b1982 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -11,6 +11,11 @@ "chromiumos_preflight" ] }, + "chromeos-amd64-generic-dbg": { + "additional_compile_targets": [ + "chromiumos_preflight" + ] + }, "chromeos-amd64-generic-rel": { "additional_compile_targets": [ "chromiumos_preflight" @@ -575,6 +580,11 @@ } ] }, + "chromeos-arm-generic-dbg": { + "additional_compile_targets": [ + "chromiumos_preflight" + ] + }, "chromeos-arm-generic-rel": { "additional_compile_targets": [ "chromiumos_preflight"
diff --git a/testing/buildbot/filters/BUILD.gn b/testing/buildbot/filters/BUILD.gn index ac7d8c42..50a32dba 100644 --- a/testing/buildbot/filters/BUILD.gn +++ b/testing/buildbot/filters/BUILD.gn
@@ -120,6 +120,7 @@ source_set("fuchsia_filters") { data = [ "//testing/buildbot/filters/fuchsia.base_perftests.filter", + "//testing/buildbot/filters/fuchsia.components_unittests.filter", "//testing/buildbot/filters/fuchsia.content_unittests.filter", "//testing/buildbot/filters/fuchsia.mojo_unittests.filter", "//testing/buildbot/filters/fuchsia.net_perftests.filter",
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index c5ccba3..d49393f 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -734,6 +734,11 @@ 'chromiumos_preflight', ], }, + 'chromeos-amd64-generic-dbg': { + 'additional_compile_targets': [ + 'chromiumos_preflight', + ], + }, 'chromeos-amd64-generic-rel': { 'additional_compile_targets': [ 'chromiumos_preflight', @@ -755,6 +760,11 @@ ], }, }, + 'chromeos-arm-generic-dbg': { + 'additional_compile_targets': [ + 'chromiumos_preflight', + ], + }, 'chromeos-arm-generic-rel': { 'additional_compile_targets': [ 'chromiumos_preflight',
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 74c4e3a..434246a 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -2035,24 +2035,6 @@ ] } ], - "DisableInitialMostVisitedFadeIn": [ - { - "platforms": [ - "chromeos", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "DisableInitialMostVisitedFadeIn" - ] - } - ] - } - ], "DistinctModuleDatabaseSequence": [ { "platforms": [
diff --git a/third_party/blink/public/BUILD.gn b/third_party/blink/public/BUILD.gn index b354871..aa42dbd 100644 --- a/third_party/blink/public/BUILD.gn +++ b/third_party/blink/public/BUILD.gn
@@ -270,7 +270,6 @@ "platform/web_keyboard_event.h", "platform/web_loading_behavior_flag.h", "platform/web_loading_hints_provider.h", - "platform/web_localized_string.h", "platform/web_media_constraints.h", "platform/web_media_key_system_configuration.h", "platform/web_media_key_system_media_capability.h",
diff --git a/third_party/blink/public/mojom/web_feature/web_feature.mojom b/third_party/blink/public/mojom/web_feature/web_feature.mojom index 8cf8adb..6352206 100644 --- a/third_party/blink/public/mojom/web_feature/web_feature.mojom +++ b/third_party/blink/public/mojom/web_feature/web_feature.mojom
@@ -2408,15 +2408,19 @@ kDeprecatedFileSystemRead = 3025, kDeprecatedFileSystemWrite = 3026, kPointerLockUnadjustedMovement = 3027, + // The above items are available in M78 branch. + kCreateObjectBlob = 3028, - kQuotaRead = 3029, + kQuotaRead = 3029, // available in M78 branch. kDelegateFocus = 3030, kDelegateFocusNotFirstInFlatTree = 3031, kThirdPartySharedWorker = 3032, kThirdPartyBroadcastChannel = 3033, kMediaSourceGroupEndTimestampDecreaseWithinMediaSegment = 3034, - kTextFragmentAnchorTapToDismiss = 3035, + kTextFragmentAnchorTapToDismiss = 3035, // available in M78 branch. kXRIsSessionSupported = 3036, + kScrollbarUseScrollbarButtonReversedDirection = 3037, + kCSSSelectorPseudoScrollbarButtonReversedDirection = 3038, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h index cd95729..83b3a264 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h
@@ -59,7 +59,6 @@ #include "third_party/blink/public/platform/web_data.h" #include "third_party/blink/public/platform/web_dedicated_worker_host_factory_client.h" #include "third_party/blink/public/platform/web_gesture_device.h" -#include "third_party/blink/public/platform/web_localized_string.h" #include "third_party/blink/public/platform/web_rtc_api_name.h" #include "third_party/blink/public/platform/web_size.h" #include "third_party/blink/public/platform/web_string.h"
diff --git a/third_party/blink/public/platform/web_localized_string.h b/third_party/blink/public/platform/web_localized_string.h deleted file mode 100644 index 2135f44..0000000 --- a/third_party/blink/public/platform/web_localized_string.h +++ /dev/null
@@ -1,75 +0,0 @@ -/* - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_LOCALIZED_STRING_H_ -#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_LOCALIZED_STRING_H_ - -namespace blink { - -struct WebLocalizedString { - enum Name { - kAXDayOfMonthFieldText, - kAXHourFieldText, - kBlockedPluginText, - kDetailsLabel, - kInputElementAltText, - kMediaScrubbingMessageText, - kMissingPluginText, - kMultipleFileUploadText, - kOtherColorLabel, - kOverflowMenuCaptionsSubmenuTitle, - kOverflowMenuUnmute, - kPictureInPictureInterstitialText, - // kPlaceholderForDayOfMonthField is for day placeholder text, e.g. - // "dd", for date field used in multiple fields "date", "datetime", and - // "datetime-local" input UI instead of "--". - kPlaceholderForDayOfMonthField, - // kPlaceholderForfMonthField is for month placeholder text, e.g. - // "mm", for month field used in multiple fields "date", "datetime", and - // "datetime-local" input UI instead of "--". - kPlaceholderForMonthField, - // kPlaceholderForYearField is for year placeholder text, e.g. "yyyy", - // for year field used in multiple fields "date", "datetime", and - // "datetime-local" input UI instead of "----". - kPlaceholderForYearField, - kResetButtonDefaultLabel, - kSubmitButtonDefaultLabel, - kTextTracksNoLabel, - kTextTracksOff, - kValidationStepMismatchCloseToLimit, - kValidationTooShort, - kValidationTooShortPlural, - kWeekNumberLabel, - }; -}; - -} // namespace blink - -#endif
diff --git a/third_party/blink/public/platform/web_media_player_client.h b/third_party/blink/public/platform/web_media_player_client.h index 1befc68..db8f49f6 100644 --- a/third_party/blink/public/platform/web_media_player_client.h +++ b/third_party/blink/public/platform/web_media_player_client.h
@@ -32,7 +32,6 @@ #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_MEDIA_PLAYER_CLIENT_H_ #include "third_party/blink/public/platform/web_common.h" -#include "third_party/blink/public/platform/web_localized_string.h" #include "third_party/blink/public/platform/web_media_player.h" #include "ui/gfx/color_space.h"
diff --git a/third_party/blink/renderer/core/html/forms/base_temporal_input_type.cc b/third_party/blink/renderer/core/html/forms/base_temporal_input_type.cc index b12614db1..9d115cef 100644 --- a/third_party/blink/renderer/core/html/forms/base_temporal_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/base_temporal_input_type.cc
@@ -42,8 +42,6 @@ namespace blink { -using blink::WebLocalizedString; - static const int kMsecPerMinute = 60 * 1000; static const int kMsecPerSecond = 1000;
diff --git a/third_party/blink/renderer/core/html/forms/color_chooser_popup_ui_controller.cc b/third_party/blink/renderer/core/html/forms/color_chooser_popup_ui_controller.cc index 71c2174c..48a04b2 100644 --- a/third_party/blink/renderer/core/html/forms/color_chooser_popup_ui_controller.cc +++ b/third_party/blink/renderer/core/html/forms/color_chooser_popup_ui_controller.cc
@@ -26,6 +26,7 @@ #include "third_party/blink/renderer/core/html/forms/color_chooser_popup_ui_controller.h" #include "third_party/blink/public/platform/platform.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/html/forms/chooser_resource_loader.h" @@ -143,8 +144,8 @@ data); PagePopupClient::AddProperty("values", suggestion_values, data); PagePopupClient::AddProperty( - "otherColorLabel", - GetLocale().QueryString(WebLocalizedString::kOtherColorLabel), data); + "otherColorLabel", GetLocale().QueryString(IDS_FORM_OTHER_COLOR_LABEL), + data); if (RuntimeEnabledFeatures::FormControlsRefreshEnabled()) { PagePopupClient::AddProperty("selectedColor", client_->CurrentColor().Serialized(), data);
diff --git a/third_party/blink/renderer/core/html/forms/date_input_type.cc b/third_party/blink/renderer/core/html/forms/date_input_type.cc index 6f22f11f..90a411f 100644 --- a/third_party/blink/renderer/core/html/forms/date_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/date_input_type.cc
@@ -30,6 +30,7 @@ #include "third_party/blink/renderer/core/html/forms/date_input_type.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/html/forms/date_time_fields_state.h" @@ -41,7 +42,6 @@ namespace blink { -using blink::WebLocalizedString; using namespace html_names; static const int kDateDefaultStep = 1; @@ -115,12 +115,12 @@ if (!ParseToDateComponents(GetElement().FastGetAttribute(kMaxAttr), &layout_parameters.maximum)) layout_parameters.maximum = DateComponents(); - layout_parameters.placeholder_for_day = GetLocale().QueryString( - WebLocalizedString::kPlaceholderForDayOfMonthField); + layout_parameters.placeholder_for_day = + GetLocale().QueryString(IDS_FORM_PLACEHOLDER_FOR_DAY_OF_MONTH_FIELD); layout_parameters.placeholder_for_month = - GetLocale().QueryString(WebLocalizedString::kPlaceholderForMonthField); + GetLocale().QueryString(IDS_FORM_PLACEHOLDER_FOR_MONTH_FIELD); layout_parameters.placeholder_for_year = - GetLocale().QueryString(WebLocalizedString::kPlaceholderForYearField); + GetLocale().QueryString(IDS_FORM_PLACEHOLDER_FOR_YEAR_FIELD); } bool DateInputType::IsValidFormat(bool has_year,
diff --git a/third_party/blink/renderer/core/html/forms/date_time_chooser_impl.cc b/third_party/blink/renderer/core/html/forms/date_time_chooser_impl.cc index f4c402d..088f298 100644 --- a/third_party/blink/renderer/core/html/forms/date_time_chooser_impl.cc +++ b/third_party/blink/renderer/core/html/forms/date_time_chooser_impl.cc
@@ -157,8 +157,7 @@ AddProperty("todayLabel", today_label_string, data); AddProperty("clearLabel", GetLocale().QueryString(IDS_FORM_CALENDAR_CLEAR), data); - AddProperty("weekLabel", - GetLocale().QueryString(WebLocalizedString::kWeekNumberLabel), + AddProperty("weekLabel", GetLocale().QueryString(IDS_FORM_WEEK_NUMBER_LABEL), data); AddProperty("axShowMonthSelector", GetLocale().QueryString(IDS_AX_CALENDAR_SHOW_MONTH_SELECTOR),
diff --git a/third_party/blink/renderer/core/html/forms/date_time_field_elements.cc b/third_party/blink/renderer/core/html/forms/date_time_field_elements.cc index 4886c91b8..42222138 100644 --- a/third_party/blink/renderer/core/html/forms/date_time_field_elements.cc +++ b/third_party/blink/renderer/core/html/forms/date_time_field_elements.cc
@@ -33,8 +33,6 @@ namespace blink { -using blink::WebLocalizedString; - static String QueryString(int resource_id) { return Locale::DefaultLocale().QueryString(resource_id); } @@ -90,8 +88,7 @@ placeholder.IsEmpty() ? "--" : placeholder) { DEFINE_STATIC_LOCAL(AtomicString, day_pseudo_id, ("-webkit-datetime-edit-day-field")); - Initialize(day_pseudo_id, - QueryString(WebLocalizedString::kAXDayOfMonthFieldText)); + Initialize(day_pseudo_id, QueryString(IDS_AX_DAY_OF_MONTH_FIELD_TEXT)); } void DateTimeDayFieldElement::PopulateDateTimeFieldsState( @@ -139,8 +136,8 @@ void DateTimeHourFieldElementBase::Initialize() { DEFINE_STATIC_LOCAL(AtomicString, hour_pseudo_id, ("-webkit-datetime-edit-hour-field")); - DateTimeNumericFieldElement::Initialize( - hour_pseudo_id, QueryString(WebLocalizedString::kAXHourFieldText)); + DateTimeNumericFieldElement::Initialize(hour_pseudo_id, + QueryString(IDS_AX_HOUR_FIELD_TEXT)); } void DateTimeHourFieldElementBase::SetValueAsDate(const DateComponents& date) {
diff --git a/third_party/blink/renderer/core/html/forms/date_time_local_input_type.cc b/third_party/blink/renderer/core/html/forms/date_time_local_input_type.cc index b0bcc91e..bb6b7b29 100644 --- a/third_party/blink/renderer/core/html/forms/date_time_local_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/date_time_local_input_type.cc
@@ -30,6 +30,7 @@ #include "third_party/blink/renderer/core/html/forms/date_time_local_input_type.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/html/forms/date_time_fields_state.h" #include "third_party/blink/renderer/core/html/forms/html_input_element.h" @@ -42,7 +43,6 @@ namespace blink { -using blink::WebLocalizedString; using namespace html_names; static const int kDateTimeLocalDefaultStep = 60; @@ -172,12 +172,12 @@ if (!ParseToDateComponents(GetElement().FastGetAttribute(kMaxAttr), &layout_parameters.maximum)) layout_parameters.maximum = DateComponents(); - layout_parameters.placeholder_for_day = GetLocale().QueryString( - WebLocalizedString::kPlaceholderForDayOfMonthField); + layout_parameters.placeholder_for_day = + GetLocale().QueryString(IDS_FORM_PLACEHOLDER_FOR_DAY_OF_MONTH_FIELD); layout_parameters.placeholder_for_month = - GetLocale().QueryString(WebLocalizedString::kPlaceholderForMonthField); + GetLocale().QueryString(IDS_FORM_PLACEHOLDER_FOR_MONTH_FIELD); layout_parameters.placeholder_for_year = - GetLocale().QueryString(WebLocalizedString::kPlaceholderForYearField); + GetLocale().QueryString(IDS_FORM_PLACEHOLDER_FOR_YEAR_FIELD); } bool DateTimeLocalInputType::IsValidFormat(bool has_year,
diff --git a/third_party/blink/renderer/core/html/forms/email_input_type.cc b/third_party/blink/renderer/core/html/forms/email_input_type.cc index 92767c9a..6061d61 100644 --- a/third_party/blink/renderer/core/html/forms/email_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/email_input_type.cc
@@ -43,8 +43,6 @@ namespace blink { -using blink::WebLocalizedString; - // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address static const char kLocalPartCharacters[] = "abcdefghijklmnopqrstuvwxyz0123456789!#$%&'*+/=?^_`{|}~.-";
diff --git a/third_party/blink/renderer/core/html/forms/file_input_type.cc b/third_party/blink/renderer/core/html/forms/file_input_type.cc index 5abc22a..e34249b 100644 --- a/third_party/blink/renderer/core/html/forms/file_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/file_input_type.cc
@@ -51,7 +51,6 @@ namespace blink { -using blink::WebLocalizedString; using mojom::blink::FileChooserParams; using namespace html_names;
diff --git a/third_party/blink/renderer/core/html/forms/html_input_element.cc b/third_party/blink/renderer/core/html/forms/html_input_element.cc index 09f6b4a..f187ad8 100644 --- a/third_party/blink/renderer/core/html/forms/html_input_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_input_element.cc
@@ -33,6 +33,7 @@ #include "third_party/blink/public/mojom/choosers/date_time_chooser.mojom-blink.h" #include "third_party/blink/public/platform/task_type.h" #include "third_party/blink/public/platform/web_scroll_into_view_params.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/bindings/core/v8/script_event_listener.h" #include "third_party/blink/renderer/core/accessibility/ax_object_cache.h" #include "third_party/blink/renderer/core/css/css_property_names.h" @@ -919,7 +920,7 @@ if (alt.IsNull()) alt = FastGetAttribute(kValueAttr); if (alt.IsNull()) - alt = GetLocale().QueryString(WebLocalizedString::kInputElementAltText); + alt = GetLocale().QueryString(IDS_FORM_INPUT_ALT); return alt; }
diff --git a/third_party/blink/renderer/core/html/forms/input_type.cc b/third_party/blink/renderer/core/html/forms/input_type.cc index bdce40be8..da8c7ae 100644 --- a/third_party/blink/renderer/core/html/forms/input_type.cc +++ b/third_party/blink/renderer/core/html/forms/input_type.cc
@@ -76,7 +76,6 @@ namespace blink { -using blink::WebLocalizedString; using namespace html_names; using InputTypeFactoryFunction = InputType* (*)(HTMLInputElement&); @@ -465,7 +464,7 @@ candidate2 > step_range.Maximum()) { return std::make_pair( GetLocale().QueryString( - WebLocalizedString::kValidationStepMismatchCloseToLimit, + IDS_FORM_VALIDATION_STEP_MISMATCH_CLOSE_TO_LIMIT, localized_candidate1), g_empty_string); }
diff --git a/third_party/blink/renderer/core/html/forms/number_input_type.cc b/third_party/blink/renderer/core/html/forms/number_input_type.cc index e49d1ca..2cd3759 100644 --- a/third_party/blink/renderer/core/html/forms/number_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/number_input_type.cc
@@ -49,7 +49,6 @@ namespace blink { -using blink::WebLocalizedString; using namespace html_names; static const int kNumberDefaultStep = 1;
diff --git a/third_party/blink/renderer/core/html/forms/reset_input_type.cc b/third_party/blink/renderer/core/html/forms/reset_input_type.cc index 73c5cf0..87aa634 100644 --- a/third_party/blink/renderer/core/html/forms/reset_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/reset_input_type.cc
@@ -31,6 +31,7 @@ #include "third_party/blink/renderer/core/html/forms/reset_input_type.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/dom/events/event.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/html/forms/html_form_element.h" @@ -60,7 +61,7 @@ } String ResetInputType::DefaultLabel() const { - return GetLocale().QueryString(WebLocalizedString::kResetButtonDefaultLabel); + return GetLocale().QueryString(IDS_FORM_RESET_LABEL); } bool ResetInputType::IsTextButton() const {
diff --git a/third_party/blink/renderer/core/html/forms/submit_input_type.cc b/third_party/blink/renderer/core/html/forms/submit_input_type.cc index 51eee52..5639595 100644 --- a/third_party/blink/renderer/core/html/forms/submit_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/submit_input_type.cc
@@ -31,6 +31,7 @@ #include "third_party/blink/renderer/core/html/forms/submit_input_type.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/dom/events/event.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/html/forms/form_data.h" @@ -75,7 +76,7 @@ } String SubmitInputType::DefaultLabel() const { - return GetLocale().QueryString(WebLocalizedString::kSubmitButtonDefaultLabel); + return GetLocale().QueryString(IDS_FORM_SUBMIT_LABEL); } bool SubmitInputType::IsTextButton() const {
diff --git a/third_party/blink/renderer/core/html/html_details_element.cc b/third_party/blink/renderer/core/html/html_details_element.cc index f502e8a..043d0e3a 100644 --- a/third_party/blink/renderer/core/html/html_details_element.cc +++ b/third_party/blink/renderer/core/html/html_details_element.cc
@@ -21,6 +21,7 @@ #include "third_party/blink/renderer/core/html/html_details_element.h" #include "third_party/blink/public/platform/task_type.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/css/css_property_names.h" #include "third_party/blink/renderer/core/css_value_keywords.h" #include "third_party/blink/renderer/core/dom/element_traversal.h" @@ -82,7 +83,7 @@ MakeGarbageCollected<HTMLSummaryElement>(GetDocument()); default_summary->AppendChild( Text::Create(GetDocument(), - GetLocale().QueryString(WebLocalizedString::kDetailsLabel))); + GetLocale().QueryString(IDS_DETAILS_WITHOUT_SUMMARY_LABEL))); HTMLSlotElement* summary_slot = HTMLSlotElement::CreateUserAgentCustomAssignSlot(GetDocument());
diff --git a/third_party/blink/renderer/core/html/media/media_remoting_interstitial.cc b/third_party/blink/renderer/core/html/media/media_remoting_interstitial.cc index 281ec0eb..d255d1bd 100644 --- a/third_party/blink/renderer/core/html/media/media_remoting_interstitial.cc +++ b/third_party/blink/renderer/core/html/media/media_remoting_interstitial.cc
@@ -4,7 +4,6 @@ #include "third_party/blink/renderer/core/html/media/media_remoting_interstitial.h" -#include "third_party/blink/public/platform/web_localized_string.h" #include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/css/css_property_names.h" #include "third_party/blink/renderer/core/css_value_keywords.h"
diff --git a/third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.cc b/third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.cc index 5159cdf..e9541ec 100644 --- a/third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.cc +++ b/third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.cc
@@ -5,7 +5,7 @@ #include "third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.h" #include "cc/layers/layer.h" -#include "third_party/blink/public/platform/web_localized_string.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/geometry/dom_rect_read_only.h" #include "third_party/blink/renderer/core/html/html_image_element.h" @@ -81,7 +81,7 @@ AtomicString("-internal-picture-in-picture-interstitial-message")); message_element_->setInnerText( GetVideoElement().GetLocale().QueryString( - WebLocalizedString::kPictureInPictureInterstitialText), + IDS_MEDIA_PICTURE_IN_PICTURE_INTERSTITIAL_TEXT), ASSERT_NO_EXCEPTION); ParserAppendChild(message_element_);
diff --git a/third_party/blink/renderer/core/layout/layout_embedded_object.cc b/third_party/blink/renderer/core/layout/layout_embedded_object.cc index cc9106b..b0a2c06 100644 --- a/third_party/blink/renderer/core/layout/layout_embedded_object.cc +++ b/third_party/blink/renderer/core/layout/layout_embedded_object.cc
@@ -24,6 +24,7 @@ #include "third_party/blink/renderer/core/layout/layout_embedded_object.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/css_value_keywords.h" #include "third_party/blink/renderer/core/exported/web_plugin_container_impl.h" #include "third_party/blink/renderer/core/frame/local_frame.h" @@ -54,9 +55,12 @@ case LayoutEmbeddedObject::kPluginAvailable: break; case LayoutEmbeddedObject::kPluginMissing: - return locale.QueryString(WebLocalizedString::kMissingPluginText); + return locale.QueryString(IDS_PLUGIN_INITIALIZATION_ERROR); case LayoutEmbeddedObject::kPluginBlockedByContentSecurityPolicy: - return locale.QueryString(WebLocalizedString::kBlockedPluginText); + return String(); // There is no matched resource_id for + // kPluginBlockedByContentSecurityPolicy yet. Return an + // empty String(). See crbug.com/302130 for more + // details. } NOTREACHED(); return String();
diff --git a/third_party/blink/renderer/core/layout/layout_scrollbar_part.cc b/third_party/blink/renderer/core/layout/layout_scrollbar_part.cc index a72c970..9872f44 100644 --- a/third_party/blink/renderer/core/layout/layout_scrollbar_part.cc +++ b/third_party/blink/renderer/core/layout/layout_scrollbar_part.cc
@@ -47,9 +47,13 @@ static void RecordScrollbarPartStats(Document& document, ScrollbarPart part) { switch (part) { - case kBackButtonStartPart: - case kForwardButtonStartPart: case kBackButtonEndPart: + case kForwardButtonStartPart: + UseCounter::Count( + document, + WebFeature::kCSSSelectorPseudoScrollbarButtonReversedDirection); + U_FALLTHROUGH; + case kBackButtonStartPart: case kForwardButtonEndPart: UseCounter::Count(document, WebFeature::kCSSSelectorPseudoScrollbarButton);
diff --git a/third_party/blink/renderer/core/layout/layout_theme.cc b/third_party/blink/renderer/core/layout/layout_theme.cc index a65978d..b2b0be7 100644 --- a/third_party/blink/renderer/core/layout/layout_theme.cc +++ b/third_party/blink/renderer/core/layout/layout_theme.cc
@@ -862,7 +862,7 @@ string = file_list->item(0)->name(); } else { return StringTruncator::RightTruncate( - locale.QueryString(WebLocalizedString::kMultipleFileUploadText, + locale.QueryString(IDS_FORM_FILE_MULTIPLE_UPLOAD, locale.ConvertToLocalizedNumber( String::Number(file_list->length()))), width, font);
diff --git a/third_party/blink/renderer/core/layout/layout_theme_mac.mm b/third_party/blink/renderer/core/layout/layout_theme_mac.mm index fe61dd8..f2c3d16 100644 --- a/third_party/blink/renderer/core/layout/layout_theme_mac.mm +++ b/third_party/blink/renderer/core/layout/layout_theme_mac.mm
@@ -1014,7 +1014,7 @@ str_to_truncate = file->name(); } else { return StringTruncator::RightTruncate( - locale.QueryString(WebLocalizedString::kMultipleFileUploadText, + locale.QueryString(IDS_FORM_FILE_MULTIPLE_UPLOAD, locale.ConvertToLocalizedNumber( String::Number(file_list->length()))), width, font);
diff --git a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc index c202b4d..d2baf3e 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc
@@ -2839,9 +2839,13 @@ WebInputEvent::Type type) { WebFeature scrollbar_use_uma; switch (part) { - case kBackButtonStartPart: - case kForwardButtonStartPart: case kBackButtonEndPart: + case kForwardButtonStartPart: + UseCounter::Count( + GetLayoutBox()->GetDocument(), + WebFeature::kScrollbarUseScrollbarButtonReversedDirection); + U_FALLTHROUGH; + case kBackButtonStartPart: case kForwardButtonEndPart: scrollbar_use_uma = (orientation == kVerticalScrollbar
diff --git a/third_party/blink/renderer/core/svg/animation/smil_animation_sandwich.cc b/third_party/blink/renderer/core/svg/animation/smil_animation_sandwich.cc index 6d8c5a1..55e94077 100644 --- a/third_party/blink/renderer/core/svg/animation/smil_animation_sandwich.cc +++ b/third_party/blink/renderer/core/svg/animation/smil_animation_sandwich.cc
@@ -54,15 +54,10 @@ } void SMILAnimationSandwich::UpdateTiming(SMILTime elapsed) { - if (!std::is_sorted(sandwich_.begin(), sandwich_.end(), - PriorityCompare(elapsed))) { - std::sort(sandwich_.begin(), sandwich_.end(), PriorityCompare(elapsed)); - } - for (const auto& animation : sandwich_) { DCHECK(animation->HasValidTarget()); - if (!animation->NeedsToProgress(elapsed)) + if (!animation->CurrentIntervalIsActive(elapsed)) continue; animation->CheckAndUpdateInterval(elapsed); animation->UpdateActiveState(elapsed); @@ -94,6 +89,11 @@ void SMILAnimationSandwich::UpdateSyncBases(SMILTime elapsed) { for (auto& animation : sandwich_) animation->UpdateSyncBases(); + + if (!std::is_sorted(sandwich_.begin(), sandwich_.end(), + PriorityCompare(elapsed))) { + std::sort(sandwich_.begin(), sandwich_.end(), PriorityCompare(elapsed)); + } } SVGSMILElement* SMILAnimationSandwich::ResultElement() const {
diff --git a/third_party/blink/renderer/core/svg/animation/svg_smil_element.cc b/third_party/blink/renderer/core/svg/animation/svg_smil_element.cc index 82f5f20..6a9790d8 100644 --- a/third_party/blink/renderer/core/svg/animation/svg_smil_element.cc +++ b/third_party/blink/renderer/core/svg/animation/svg_smil_element.cc
@@ -115,7 +115,6 @@ void ConditionEventListener::Invoke(ExecutionContext*, Event* event) { if (!animation_) return; - animation_->IntervalIsDirty(); animation_->AddInstanceTime(condition_->GetBeginOrEnd(), animation_->Elapsed() + condition_->Offset(), SMILTimeOrigin::kEvent); @@ -225,7 +224,6 @@ cached_min_(kInvalidCachedTime), cached_max_(kInvalidCachedTime), interval_has_changed_(false) { - ResolveFirstInterval(); } SVGSMILElement::~SVGSMILElement() = default; @@ -1058,29 +1056,31 @@ GetActiveState() == kFrozen; } -// The first part of the processing of the animation, -// this checks if there are any further calculations needed -// to continue and makes sure the intervals are correct. -bool SVGSMILElement::NeedsToProgress(SMILTime elapsed) { +bool SVGSMILElement::CurrentIntervalIsActive(SMILTime elapsed) { // Check we're connected to something and that our conditions have been // "connected". DCHECK(time_container_); DCHECK(conditions_connected_); - // Check that we have some form of start or are prepared to find it. + // If |is_waiting_for_first_interval_| is true, |interval_| can either be the + // actual interval that has been resolved, or unresolved if there are no + // begin times yet. DCHECK(is_waiting_for_first_interval_ || interval_.IsResolved()); - // Check if we need updating, otherwise just return. + // No interval has been resolved yet, we're waiting for an event of some + // sort. if (!interval_.IsResolved()) { DCHECK_EQ(GetActiveState(), kInactive); return false; } + // We have a current interval, but it has not started yet. if (interval_.BeginsAfter(elapsed)) { DCHECK_NE(GetActiveState(), kActive); return false; } if (is_waiting_for_first_interval_) { + // The current internal must be the first, and has started, so clear the flag and (re)resolve. is_waiting_for_first_interval_ = false; if (ResolveFirstInterval()) time_container_->NotifyIntervalsChanged();
diff --git a/third_party/blink/renderer/core/svg/animation/svg_smil_element.h b/third_party/blink/renderer/core/svg/animation/svg_smil_element.h index 5dc4792..75960c0 100644 --- a/third_party/blink/renderer/core/svg/animation/svg_smil_element.h +++ b/third_party/blink/renderer/core/svg/animation/svg_smil_element.h
@@ -85,7 +85,7 @@ SMILTime BeginTimeForPrioritization(SMILTime presentation_time) const; SMILTime SimpleDuration() const; - bool NeedsToProgress(SMILTime elapsed); + bool CurrentIntervalIsActive(SMILTime elapsed); // Check if the current interval is still current, and if not compute the // next interval. void CheckAndUpdateInterval(SMILTime elapsed); @@ -140,11 +140,6 @@ protected: enum BeginOrEnd { kBegin, kEnd }; - void IntervalIsDirty() { - interval_.begin = SMILTime(); - interval_.end = SMILTime(); - } - void AddInstanceTime(BeginOrEnd, SMILTime, SMILTimeOrigin); void SetInactive() { active_state_ = kInactive; }
diff --git a/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc b/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc index a562d98..a5b5e46 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc
@@ -100,8 +100,6 @@ #include "third_party/blink/renderer/platform/text/text_direction.h" #include "third_party/blink/renderer/platform/wtf/std_lib_extras.h" -using blink::WebLocalizedString; - namespace { bool IsNeutralWithinTable(blink::AXObject* obj) { if (!obj)
diff --git a/third_party/blink/renderer/modules/accessibility/ax_media_element.cc b/third_party/blink/renderer/modules/accessibility/ax_media_element.cc index 1d338be5..9ce8949 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_media_element.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_media_element.cc
@@ -11,8 +11,6 @@ namespace blink { -using blink::WebLocalizedString; - AXObject* AccessibilityMediaElement::Create( LayoutObject* layout_object, AXObjectCacheImpl& ax_object_cache) {
diff --git a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc index 20245c1..281f4bf9d 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
@@ -30,6 +30,7 @@ #include <math.h> +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/aom/accessible_node.h" #include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h" #include "third_party/blink/renderer/core/dom/element.h" @@ -3060,8 +3061,8 @@ // localised default value ("Submit") name_from = ax::mojom::NameFrom::kValue; - text_alternative = input_element->GetLocale().QueryString( - WebLocalizedString::kSubmitButtonDefaultLabel); + text_alternative = + input_element->GetLocale().QueryString(IDS_FORM_SUBMIT_LABEL); if (name_sources) { name_sources->push_back(NameSource(*found_text_alternative, kTypeAttr)); NameSource& source = name_sources->back();
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.cc b/third_party/blink/renderer/modules/accessibility/ax_object.cc index 225091f..2e9a5a5 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object.cc
@@ -64,8 +64,6 @@ #include "third_party/blink/renderer/platform/wtf/wtf_size_t.h" #include "third_party/skia/include/core/SkMatrix44.h" -using blink::WebLocalizedString; - namespace blink { using namespace html_names;
diff --git a/third_party/blink/renderer/modules/media_controls/elements/media_control_element_base.h b/third_party/blink/renderer/modules/media_controls/elements/media_control_element_base.h index 3256907..334248f 100644 --- a/third_party/blink/renderer/modules/media_controls/elements/media_control_element_base.h +++ b/third_party/blink/renderer/modules/media_controls/elements/media_control_element_base.h
@@ -5,7 +5,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIA_CONTROLS_ELEMENTS_MEDIA_CONTROL_ELEMENT_BASE_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIA_CONTROLS_ELEMENTS_MEDIA_CONTROL_ELEMENT_BASE_H_ -#include "third_party/blink/public/platform/web_localized_string.h" #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h"
diff --git a/third_party/blink/renderer/modules/media_controls/elements/media_control_scrubbing_message_element.cc b/third_party/blink/renderer/modules/media_controls/elements/media_control_scrubbing_message_element.cc index 27a1ed5..d9e9c8f 100644 --- a/third_party/blink/renderer/modules/media_controls/elements/media_control_scrubbing_message_element.cc +++ b/third_party/blink/renderer/modules/media_controls/elements/media_control_scrubbing_message_element.cc
@@ -4,6 +4,7 @@ #include "third_party/blink/renderer/modules/media_controls/elements/media_control_scrubbing_message_element.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/dom/shadow_root.h" #include "third_party/blink/renderer/core/html/html_style_element.h" #include "third_party/blink/renderer/core/html/media/html_media_element.h" @@ -50,9 +51,9 @@ MediaControlsResourceLoader::GetArrowLeftSVGImage()); arrow_left_div2->SetInnerHTMLFromString( MediaControlsResourceLoader::GetArrowLeftSVGImage()); - message_div->setInnerText(MediaElement().GetLocale().QueryString( - WebLocalizedString::kMediaScrubbingMessageText), - ASSERT_NO_EXCEPTION); + message_div->setInnerText( + MediaElement().GetLocale().QueryString(IDS_MEDIA_SCRUBBING_MESSAGE_TEXT), + ASSERT_NO_EXCEPTION); arrow_right_div1->SetInnerHTMLFromString( MediaControlsResourceLoader::GetArrowRightSVGImage()); arrow_right_div2->SetInnerHTMLFromString(
diff --git a/third_party/blink/renderer/modules/media_controls/elements/media_control_text_track_list_element.cc b/third_party/blink/renderer/modules/media_controls/elements/media_control_text_track_list_element.cc index 859dc94..0dde7c6 100644 --- a/third_party/blink/renderer/modules/media_controls/elements/media_control_text_track_list_element.cc +++ b/third_party/blink/renderer/modules/media_controls/elements/media_control_text_track_list_element.cc
@@ -58,7 +58,7 @@ setAttribute(html_names::kRoleAttr, "menu"); setAttribute(html_names::kAriaLabelAttr, WTF::AtomicString(GetLocale().QueryString( - WebLocalizedString::kOverflowMenuCaptionsSubmenuTitle))); + IDS_MEDIA_OVERFLOW_MENU_CLOSED_CAPTIONS_SUBMENU_TITLE))); SetShadowPseudoId(AtomicString("-internal-media-controls-text-track-list")); } @@ -178,7 +178,7 @@ header_item->ParserAppendChild( Text::Create(GetDocument(), GetLocale().QueryString( - WebLocalizedString::kOverflowMenuCaptionsSubmenuTitle))); + IDS_MEDIA_OVERFLOW_MENU_CLOSED_CAPTIONS_SUBMENU_TITLE))); header_item->setAttribute(html_names::kRoleAttr, "button"); header_item->setAttribute( html_names::kAriaLabelAttr,
diff --git a/third_party/blink/renderer/modules/media_controls/elements/media_control_toggle_closed_captions_button_element_test.cc b/third_party/blink/renderer/modules/media_controls/elements/media_control_toggle_closed_captions_button_element_test.cc index f5c1e83..9c3eaf1 100644 --- a/third_party/blink/renderer/modules/media_controls/elements/media_control_toggle_closed_captions_button_element_test.cc +++ b/third_party/blink/renderer/modules/media_controls/elements/media_control_toggle_closed_captions_button_element_test.cc
@@ -5,6 +5,7 @@ #include "third_party/blink/renderer/modules/media_controls/elements/media_control_toggle_closed_captions_button_element.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/html/media/html_media_element.h" #include "third_party/blink/renderer/core/testing/page_test_base.h" #include "third_party/blink/renderer/modules/media_controls/media_controls_impl.h" @@ -21,7 +22,7 @@ class LocalePlatformSupport : public TestingPlatformSupport { public: WebString QueryLocalizedString(int resource_id) override { - if (resource_id == WebLocalizedString::kTextTracksOff) + if (resource_id == IDS_MEDIA_TRACKS_OFF) return kTextTracksOffString; return TestingPlatformSupport::QueryLocalizedString(resource_id); }
diff --git a/third_party/blink/renderer/modules/media_controls/media_controls_text_track_manager.cc b/third_party/blink/renderer/modules/media_controls/media_controls_text_track_manager.cc index 4f986eb..4097860 100644 --- a/third_party/blink/renderer/modules/media_controls/media_controls_text_track_manager.cc +++ b/third_party/blink/renderer/modules/media_controls/media_controls_text_track_manager.cc
@@ -4,6 +4,7 @@ #include "third_party/blink/renderer/modules/media_controls/media_controls_text_track_manager.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/html/media/html_media_element.h" #include "third_party/blink/renderer/core/html/track/text_track.h" #include "third_party/blink/renderer/core/html/track/text_track_list.h" @@ -18,8 +19,7 @@ String MediaControlsTextTrackManager::GetTextTrackLabel( TextTrack* track) const { if (!track) { - return media_element_->GetLocale().QueryString( - WebLocalizedString::kTextTracksOff); + return media_element_->GetLocale().QueryString(IDS_MEDIA_TRACKS_OFF); } String track_label = track->label(); @@ -29,8 +29,7 @@ if (track_label.IsEmpty()) { track_label = String(media_element_->GetLocale().QueryString( - WebLocalizedString::kTextTracksNoLabel, - String::Number(track->TrackIndex() + 1))); + IDS_MEDIA_TRACKS_NO_LABEL, String::Number(track->TrackIndex() + 1))); } return track_label;
diff --git a/third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_overlay_element.cc b/third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_overlay_element.cc index 75e0b36..c9fdf7d 100644 --- a/third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_overlay_element.cc +++ b/third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_overlay_element.cc
@@ -4,6 +4,7 @@ #include "third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_overlay_element.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_play_button_element.h" #include "third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_seek_button_element.h" #include "third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_volume_button_element.h"
diff --git a/third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_time_display_element.cc b/third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_time_display_element.cc index 4387b28..b6f65741 100644 --- a/third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_time_display_element.cc +++ b/third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_time_display_element.cc
@@ -4,6 +4,7 @@ #include "third_party/blink/renderer/modules/media_controls/touchless/elements/media_controls_touchless_time_display_element.h" +#include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/core/html/media/html_media_element.h" #include "third_party/blink/renderer/modules/media_controls/media_controls_shared_helper.h" #include "third_party/blink/renderer/modules/media_controls/touchless/media_controls_touchless_impl.h"
diff --git a/third_party/blink/renderer/modules/media_controls/touchless/media_controls_touchless_impl_test.cc b/third_party/blink/renderer/modules/media_controls/touchless/media_controls_touchless_impl_test.cc index b18531c6..0e68145 100644 --- a/third_party/blink/renderer/modules/media_controls/touchless/media_controls_touchless_impl_test.cc +++ b/third_party/blink/renderer/modules/media_controls/touchless/media_controls_touchless_impl_test.cc
@@ -41,7 +41,7 @@ class LocalePlatformSupport : public TestingPlatformSupport { public: WebString QueryLocalizedString(int resource_id) override { - if (resource_id == WebLocalizedString::kTextTracksOff) + if (resource_id == IDS_MEDIA_TRACKS_OFF) return kTextTracksOffString; return TestingPlatformSupport::QueryLocalizedString(resource_id); }
diff --git a/third_party/blink/renderer/modules/mediasession/media_session.cc b/third_party/blink/renderer/modules/mediasession/media_session.cc index f194a64..bd6d83f5 100644 --- a/third_party/blink/renderer/modules/mediasession/media_session.cc +++ b/third_party/blink/renderer/modules/mediasession/media_session.cc
@@ -6,7 +6,7 @@ #include <memory> #include "base/optional.h" -#include "services/service_manager/public/cpp/interface_provider.h" +#include "third_party/blink/public/common/browser_interface_broker_proxy.h" #include "third_party/blink/public/platform/platform.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_media_session_action_handler.h" #include "third_party/blink/renderer/core/dom/document.h" @@ -320,7 +320,7 @@ // See https://bit.ly/2S0zRAS for task types. auto task_runner = GetExecutionContext()->GetTaskRunner(TaskType::kMiscPlatformAPI); - frame->GetInterfaceProvider().GetInterface( + frame->GetBrowserInterfaceBroker().GetInterface( service_.BindNewPipeAndPassReceiver()); if (service_.get()) { // Record the eTLD+1 of the frame using the API.
diff --git a/third_party/blink/renderer/modules/modules_idl_files.gni b/third_party/blink/renderer/modules/modules_idl_files.gni index 34723eb..85399269 100644 --- a/third_party/blink/renderer/modules/modules_idl_files.gni +++ b/third_party/blink/renderer/modules/modules_idl_files.gni
@@ -837,12 +837,14 @@ "webgpu/gpu_bind_group_layout_descriptor.idl", "webgpu/gpu_blend_descriptor.idl", "webgpu/gpu_buffer_binding.idl", + "webgpu/gpu_command_buffer_descriptor.idl", "webgpu/gpu_buffer_copy_view.idl", "webgpu/gpu_buffer_descriptor.idl", "webgpu/gpu_color.idl", "webgpu/gpu_color_state_descriptor.idl", "webgpu/gpu_command_encoder_descriptor.idl", "webgpu/gpu_compute_pipeline_descriptor.idl", + "webgpu/gpu_compute_pass_descriptor.idl", "webgpu/gpu_depth_stencil_state_descriptor.idl", "webgpu/gpu_device_descriptor.idl", "webgpu/gpu_extensions.idl",
diff --git a/third_party/blink/renderer/modules/webgpu/gpu.idl b/third_party/blink/renderer/modules/webgpu/gpu.idl index 2e5f6eb..b4fd120 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu.idl
@@ -4,6 +4,8 @@ // https://gpuweb.github.io/gpuweb/ +typedef unsigned long long GPUBufferSize; + [ RuntimeEnabled=WebGPU ] interface GPU {
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_buffer_binding.idl b/third_party/blink/renderer/modules/webgpu/gpu_buffer_binding.idl index e3ee3c6..af62cf63 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_buffer_binding.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_buffer_binding.idl
@@ -6,7 +6,7 @@ dictionary GPUBufferBinding { required GPUBuffer buffer; - unsigned long long offset = 0; + GPUBufferSize offset = 0; // If size is undefined, use the whole size of the buffer. - unsigned long long size; + GPUBufferSize size; };
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_buffer_copy_view.idl b/third_party/blink/renderer/modules/webgpu/gpu_buffer_copy_view.idl index 0ba2fb0..2b18ef07 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_buffer_copy_view.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_buffer_copy_view.idl
@@ -6,7 +6,7 @@ dictionary GPUBufferCopyView { required GPUBuffer buffer; - unsigned long long offset = 0; + GPUBufferSize offset = 0; required unsigned long rowPitch; required unsigned long imageHeight; };
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_buffer_descriptor.idl b/third_party/blink/renderer/modules/webgpu/gpu_buffer_descriptor.idl index f36194db..8272749 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_buffer_descriptor.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_buffer_descriptor.idl
@@ -5,6 +5,6 @@ // https://gpuweb.github.io/gpuweb/ dictionary GPUBufferDescriptor { - required unsigned long long size; + required GPUBufferSize size; required GPUBufferUsageFlags usage; };
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_buffer_usage.idl b/third_party/blink/renderer/modules/webgpu/gpu_buffer_usage.idl index 981d67f..e664b348 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_buffer_usage.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_buffer_usage.idl
@@ -8,14 +8,14 @@ [ RuntimeEnabled=WebGPU ] interface GPUBufferUsage { - const unsigned long NONE = 0; - const unsigned long MAP_READ = 1; - const unsigned long MAP_WRITE = 2; - const unsigned long COPY_SRC = 4; - const unsigned long COPY_DST = 8; - const unsigned long INDEX = 16; - const unsigned long VERTEX = 32; - const unsigned long UNIFORM = 64; - const unsigned long STORAGE = 128; - const unsigned long INDIRECT = 256; + const GPUBufferUsageFlags NONE = 0; + const GPUBufferUsageFlags MAP_READ = 1; + const GPUBufferUsageFlags MAP_WRITE = 2; + const GPUBufferUsageFlags COPY_SRC = 4; + const GPUBufferUsageFlags COPY_DST = 8; + const GPUBufferUsageFlags INDEX = 16; + const GPUBufferUsageFlags VERTEX = 32; + const GPUBufferUsageFlags UNIFORM = 64; + const GPUBufferUsageFlags STORAGE = 128; + const GPUBufferUsageFlags INDIRECT = 256; };
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_color_write.idl b/third_party/blink/renderer/modules/webgpu/gpu_color_write.idl index a28647f..0c79c6d 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_color_write.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_color_write.idl
@@ -8,10 +8,10 @@ [ RuntimeEnabled=WebGPU ] interface GPUColorWrite { - const unsigned long NONE = 0; - const unsigned long RED = 1; - const unsigned long GREEN = 2; - const unsigned long BLUE = 4; - const unsigned long ALPHA = 8; - const unsigned long ALL = 15; + const GPUColorWriteFlags NONE = 0; + const GPUColorWriteFlags RED = 1; + const GPUColorWriteFlags GREEN = 2; + const GPUColorWriteFlags BLUE = 4; + const GPUColorWriteFlags ALPHA = 8; + const GPUColorWriteFlags ALL = 15; };
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_command_buffer_descriptor.idl b/third_party/blink/renderer/modules/webgpu/gpu_command_buffer_descriptor.idl new file mode 100644 index 0000000..700ed99 --- /dev/null +++ b/third_party/blink/renderer/modules/webgpu/gpu_command_buffer_descriptor.idl
@@ -0,0 +1,8 @@ +// Copyright 2019 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. + +// https://gpuweb.github.io/gpuweb/ + +dictionary GPUCommandBufferDescriptor : GPUObjectDescriptorBase { +};
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc b/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc index 0060aaab..c9306b0 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc
@@ -8,7 +8,9 @@ #include "third_party/blink/renderer/modules/webgpu/gpu_buffer.h" #include "third_party/blink/renderer/modules/webgpu/gpu_buffer_copy_view.h" #include "third_party/blink/renderer/modules/webgpu/gpu_command_buffer.h" +#include "third_party/blink/renderer/modules/webgpu/gpu_command_buffer_descriptor.h" #include "third_party/blink/renderer/modules/webgpu/gpu_command_encoder_descriptor.h" +#include "third_party/blink/renderer/modules/webgpu/gpu_compute_pass_descriptor.h" #include "third_party/blink/renderer/modules/webgpu/gpu_compute_pass_encoder.h" #include "third_party/blink/renderer/modules/webgpu/gpu_device.h" #include "third_party/blink/renderer/modules/webgpu/gpu_extent_3d.h" @@ -199,9 +201,16 @@ GetProcs().commandEncoderBeginRenderPass(GetHandle(), &dawn_desc)); } -GPUComputePassEncoder* GPUCommandEncoder::beginComputePass() { +GPUComputePassEncoder* GPUCommandEncoder::beginComputePass( + const GPUComputePassDescriptor* descriptor) { + DawnComputePassDescriptor dawn_desc = {}; + if (descriptor->hasLabel()) { + dawn_desc.label = descriptor->label().Utf8().data(); + } + return GPUComputePassEncoder::Create( - device_, GetProcs().commandEncoderBeginComputePass(GetHandle(), nullptr)); + device_, + GetProcs().commandEncoderBeginComputePass(GetHandle(), &dawn_desc)); } void GPUCommandEncoder::copyBufferToBuffer(GPUBuffer* src, @@ -263,9 +272,15 @@ markerLabel.Utf8().data()); } -GPUCommandBuffer* GPUCommandEncoder::finish() { +GPUCommandBuffer* GPUCommandEncoder::finish( + const GPUCommandBufferDescriptor* descriptor) { + DawnCommandBufferDescriptor dawn_desc = {}; + if (descriptor->hasLabel()) { + dawn_desc.label = descriptor->label().Utf8().data(); + } + return GPUCommandBuffer::Create( - device_, GetProcs().commandEncoderFinish(GetHandle(), nullptr)); + device_, GetProcs().commandEncoderFinish(GetHandle(), &dawn_desc)); } } // namespace blink
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.h b/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.h index 86a2303..486f7e6 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.h +++ b/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.h
@@ -12,7 +12,9 @@ class GPUBuffer; class GPUBufferCopyView; class GPUCommandBuffer; +class GPUCommandBufferDescriptor; class GPUCommandEncoderDescriptor; +class GPUComputePassDescriptor; class GPUComputePassEncoder; class GPUExtent3D; class GPURenderPassDescriptor; @@ -33,7 +35,8 @@ // gpu_command_encoder.idl GPURenderPassEncoder* beginRenderPass( const GPURenderPassDescriptor* descriptor); - GPUComputePassEncoder* beginComputePass(); + GPUComputePassEncoder* beginComputePass( + const GPUComputePassDescriptor* descriptor); void copyBufferToBuffer(GPUBuffer* src, uint64_t src_offset, GPUBuffer* dst, @@ -51,7 +54,7 @@ void pushDebugGroup(String groupLabel); void popDebugGroup(); void insertDebugMarker(String markerLabel); - GPUCommandBuffer* finish(); + GPUCommandBuffer* finish(const GPUCommandBufferDescriptor* descriptor); private: DISALLOW_COPY_AND_ASSIGN(GPUCommandEncoder);
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.idl b/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.idl index 4977bb7..f5a048c 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.idl
@@ -8,12 +8,14 @@ RuntimeEnabled=WebGPU ] interface GPUCommandEncoder { GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor); - GPUComputePassEncoder beginComputePass(); + GPUComputePassEncoder beginComputePass(optional GPUComputePassDescriptor descriptor); void copyBufferToBuffer( - GPUBuffer src, unsigned long long srcOffset, - GPUBuffer dst, unsigned long long dstOffset, - unsigned long long size); + GPUBuffer src, + GPUBufferSize srcOffset, + GPUBuffer dst, + GPUBufferSize dstOffset, + GPUBufferSize size); void copyBufferToTexture( GPUBufferCopyView source, @@ -34,5 +36,5 @@ void popDebugGroup(); void insertDebugMarker(DOMString markerLabel); - GPUCommandBuffer finish(); + GPUCommandBuffer finish(optional GPUCommandBufferDescriptor descriptor); };
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_compute_pass_descriptor.idl b/third_party/blink/renderer/modules/webgpu/gpu_compute_pass_descriptor.idl new file mode 100644 index 0000000..5dcd9e84 --- /dev/null +++ b/third_party/blink/renderer/modules/webgpu/gpu_compute_pass_descriptor.idl
@@ -0,0 +1,8 @@ +// Copyright 2019 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. + +// https://gpuweb.github.io/gpuweb/ + +dictionary GPUComputePassDescriptor : GPUObjectDescriptorBase { +};
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_compute_pass_encoder.idl b/third_party/blink/renderer/modules/webgpu/gpu_compute_pass_encoder.idl index 75149c6..fc1b92f 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_compute_pass_encoder.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_compute_pass_encoder.idl
@@ -10,7 +10,7 @@ // GPUProgrammablePassEncoder methods void setBindGroup(unsigned long index, GPUBindGroup bindGroup, - optional sequence<unsigned long long> dynamicOffsets = []); + optional sequence<GPUBufferSize> dynamicOffsets = []); void pushDebugGroup(DOMString groupLabel); void popDebugGroup(); void insertDebugMarker(DOMString markerLabel); @@ -21,7 +21,7 @@ optional unsigned long y = 1, optional unsigned long z = 1); void dispatchIndirect(GPUBuffer indirectBuffer, - unsigned long long indirectOffset); + GPUBufferSize indirectOffset); void endPass(); };
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_render_bundle_encoder.idl b/third_party/blink/renderer/modules/webgpu/gpu_render_bundle_encoder.idl index 9689b025..9019b80 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_render_bundle_encoder.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_render_bundle_encoder.idl
@@ -10,17 +10,17 @@ // GPUProgrammablePassEncoder methods void setBindGroup(unsigned long index, GPUBindGroup bindGroup, - optional sequence<unsigned long long> dynamicOffsets = []); + optional sequence<GPUBufferSize> dynamicOffsets = []); void pushDebugGroup(DOMString groupLabel); void popDebugGroup(); void insertDebugMarker(DOMString markerLabel); // GPURenderEncoderBase methods void setPipeline(GPURenderPipeline pipeline); - void setIndexBuffer(GPUBuffer buffer, optional unsigned long long offset = 0); + void setIndexBuffer(GPUBuffer buffer, optional GPUBufferSize offset = 0); [RaisesException] void setVertexBuffers(unsigned long startSlot, sequence<GPUBuffer> buffers, - sequence<unsigned long long> offsets); + sequence<GPUBufferSize> offsets); void draw(unsigned long vertexCount, unsigned long instanceCount, unsigned long firstVertex, unsigned long firstInstance); @@ -29,9 +29,9 @@ long baseVertex, unsigned long firstInstance); void drawIndirect(GPUBuffer indirectBuffer, - unsigned long long indirectOffset); + GPUBufferSize indirectOffset); void drawIndexedIndirect(GPUBuffer indirectBuffer, - unsigned long long indirectOffset); + GPUBufferSize indirectOffset); // GPURenderBundleEncoder methods GPURenderBundle finish(optional GPURenderBundleDescriptor descriptor);
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_render_pass_encoder.idl b/third_party/blink/renderer/modules/webgpu/gpu_render_pass_encoder.idl index 40d0203..28bff15 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_render_pass_encoder.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_render_pass_encoder.idl
@@ -10,7 +10,7 @@ // GPUProgrammablePassEncoder methods void setBindGroup(unsigned long index, GPUBindGroup bindGroup, - optional sequence<unsigned long long> dynamicOffsets = []); + optional sequence<GPUBufferSize> dynamicOffsets = []); void pushDebugGroup(DOMString groupLabel); void popDebugGroup(); void insertDebugMarker(DOMString markerLabel); @@ -24,10 +24,10 @@ float minDepth, float maxDepth); void setScissorRect(unsigned long x, unsigned long y, unsigned long width, unsigned long height); - void setIndexBuffer(GPUBuffer buffer, optional unsigned long long offset = 0); + void setIndexBuffer(GPUBuffer buffer, optional GPUBufferSize offset = 0); [RaisesException] void setVertexBuffers(unsigned long startSlot, sequence<GPUBuffer> buffers, - sequence<unsigned long long> offsets); + sequence<GPUBufferSize> offsets); void draw(unsigned long vertexCount, unsigned long instanceCount, unsigned long firstVertex, unsigned long firstInstance); @@ -36,9 +36,9 @@ long baseVertex, unsigned long firstInstance); void drawIndirect(GPUBuffer indirectBuffer, - unsigned long long indirectOffset); + GPUBufferSize indirectOffset); void drawIndexedIndirect(GPUBuffer indirectBuffer, - unsigned long long indirectOffset); + GPUBufferSize indirectOffset); void executeBundles(sequence<GPURenderBundle> bundles); void endPass();
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_shader_stage.idl b/third_party/blink/renderer/modules/webgpu/gpu_shader_stage.idl index 54f8588..54fd416 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_shader_stage.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_shader_stage.idl
@@ -8,8 +8,8 @@ [ RuntimeEnabled=WebGPU ] interface GPUShaderStage { - const unsigned long NONE = 0; - const unsigned long VERTEX = 1; - const unsigned long FRAGMENT = 2; - const unsigned long COMPUTE = 4; + const GPUShaderStageFlags NONE = 0; + const GPUShaderStageFlags VERTEX = 1; + const GPUShaderStageFlags FRAGMENT = 2; + const GPUShaderStageFlags COMPUTE = 4; };
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_texture_usage.idl b/third_party/blink/renderer/modules/webgpu/gpu_texture_usage.idl index 8a5c208..4fe824d 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_texture_usage.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_texture_usage.idl
@@ -8,10 +8,10 @@ [ RuntimeEnabled=WebGPU ] interface GPUTextureUsage { - const unsigned long NONE = 0; - const unsigned long COPY_SRC = 1; - const unsigned long COPY_DST = 2; - const unsigned long SAMPLED = 4; - const unsigned long STORAGE = 8; - const unsigned long OUTPUT_ATTACHMENT = 16; + const GPUTextureUsageFlags NONE = 0; + const GPUTextureUsageFlags COPY_SRC = 1; + const GPUTextureUsageFlags COPY_DST = 2; + const GPUTextureUsageFlags SAMPLED = 4; + const GPUTextureUsageFlags STORAGE = 8; + const GPUTextureUsageFlags OUTPUT_ATTACHMENT = 16; };
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_vertex_attribute_descriptor.idl b/third_party/blink/renderer/modules/webgpu/gpu_vertex_attribute_descriptor.idl index bd18f3c5..3e92bd0 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_vertex_attribute_descriptor.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_vertex_attribute_descriptor.idl
@@ -5,7 +5,7 @@ // https://gpuweb.github.io/gpuweb/ dictionary GPUVertexAttributeDescriptor { - unsigned long long offset = 0; + GPUBufferSize offset = 0; required GPUVertexFormat format; required unsigned long shaderLocation; };
diff --git a/third_party/blink/renderer/platform/graphics/placeholder_image_test.cc b/third_party/blink/renderer/platform/graphics/placeholder_image_test.cc index 82dbed8..81fb9df 100644 --- a/third_party/blink/renderer/platform/graphics/placeholder_image_test.cc +++ b/third_party/blink/renderer/platform/graphics/placeholder_image_test.cc
@@ -9,7 +9,6 @@ #include "base/memory/scoped_refptr.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/blink/public/platform/web_localized_string.h" #include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/public/strings/grit/blink_strings.h" #include "third_party/blink/renderer/platform/fonts/font.h"
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc index 288f8ef..967db79 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc +++ b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc
@@ -97,7 +97,7 @@ if (is_backgrounded) { return "renderer_backgrounded"; } else { - return "renderer_foregrounded"; + return "renderer_visible"; } } @@ -371,12 +371,12 @@ &main_thread_scheduler_impl->tracing_controller_, RAILModeToString), renderer_hidden(false, - "RendererVisibility", + "Scheduler.Hidden", main_thread_scheduler_impl, &main_thread_scheduler_impl->tracing_controller_, HiddenStateToString), renderer_backgrounded(kLaunchingProcessIsBackgrounded, - "RendererPriority", + "RendererVisibility", main_thread_scheduler_impl, &main_thread_scheduler_impl->tracing_controller_, BackgroundStateToString),
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h index 26970c3..6b2b35e 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h +++ b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h
@@ -853,7 +853,7 @@ renderer_pause_count; // Renderer is paused if non-zero. TraceableState<RAILMode, TracingCategoryName::kInfo> rail_mode_for_tracing; // Don't use except for tracing. - TraceableState<bool, TracingCategoryName::kTopLevel> renderer_hidden; + TraceableState<bool, TracingCategoryName::kDebug> renderer_hidden; TraceableState<bool, TracingCategoryName::kTopLevel> renderer_backgrounded; TraceableState<bool, TracingCategoryName::kDefault> keep_active_fetch_or_worker;
diff --git a/third_party/blink/renderer/platform/text/platform_locale.cc b/third_party/blink/renderer/platform/text/platform_locale.cc index 80b9e288..191d623 100644 --- a/third_party/blink/renderer/platform/text/platform_locale.cc +++ b/third_party/blink/renderer/platform/text/platform_locale.cc
@@ -227,12 +227,12 @@ String Locale::ValidationMessageTooShortText(unsigned value_length, int min_length) { if (value_length == 1) { - return QueryString(WebLocalizedString::kValidationTooShort, + return QueryString(IDS_FORM_VALIDATION_TOO_SHORT, ConvertToLocalizedNumber(String::Number(value_length)), ConvertToLocalizedNumber(String::Number(min_length))); } - return QueryString(WebLocalizedString::kValidationTooShortPlural, + return QueryString(IDS_FORM_VALIDATION_TOO_SHORT_PLURAL, ConvertToLocalizedNumber(String::Number(value_length)), ConvertToLocalizedNumber(String::Number(min_length))); }
diff --git a/third_party/blink/renderer/platform/text/platform_locale.h b/third_party/blink/renderer/platform/text/platform_locale.h index 4735101c..3a24603 100644 --- a/third_party/blink/renderer/platform/text/platform_locale.h +++ b/third_party/blink/renderer/platform/text/platform_locale.h
@@ -29,7 +29,6 @@ #include <memory> #include "base/macros.h" -#include "third_party/blink/public/platform/web_localized_string.h" #include "third_party/blink/renderer/platform/language.h" #include "third_party/blink/renderer/platform/text/date_components.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
diff --git a/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py b/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py index d35064d..55dcbfa 100755 --- a/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py +++ b/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py
@@ -459,8 +459,16 @@ ], }, { + 'paths': ['third_party/blink/renderer/core/animation_frame', + 'third_party/blink/renderer/core/offscreencanvas', + 'third_party/blink/renderer/core/html/canvas'], + 'allowed': [ + 'viz::BeginFrameArgs', + ], + }, + { 'paths': ['third_party/blink/renderer/core/clipboard'], - 'allowed': ['gfx::PNGCodec', 'net::EscapeForHTML'], + 'allowed': ['net::EscapeForHTML'], }, { 'paths': ['third_party/blink/renderer/core/css'],
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json index 6e37ed2..7f30bd1 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json
@@ -133096,6 +133096,9 @@ "css/css-fonts/parsing/font-variant-position-valid-expected.txt": [ [] ], + "css/css-fonts/parsing/font-variant-valid-expected.txt": [ + [] + ], "css/css-fonts/quoted-generic-ignored-ref.html": [ [] ], @@ -150754,9 +150757,6 @@ "domparsing/innerhtml-05-expected.txt": [ [] ], - "domparsing/insert_adjacent_html-expected.txt": [ - [] - ], "domparsing/insert_adjacent_html.js": [ [] ], @@ -198247,7 +198247,9 @@ "content-security-policy/frame-ancestors/report-blocked-frame.sub.html": [ [ "content-security-policy/frame-ancestors/report-blocked-frame.sub.html", - {} + { + "timeout": "long" + } ] ], "content-security-policy/frame-src/frame-src-about-blank-allowed-by-default.sub.html": [ @@ -202338,6 +202340,12 @@ {} ] ], + "css/css-animations/parsing/animation-computed.html": [ + [ + "css/css-animations/parsing/animation-computed.html", + {} + ] + ], "css/css-animations/parsing/animation-delay-computed.html": [ [ "css/css-animations/parsing/animation-delay-computed.html", @@ -204896,6 +204904,12 @@ {} ] ], + "css/css-fonts/parsing/font-variant-invalid.html": [ + [ + "css/css-fonts/parsing/font-variant-invalid.html", + {} + ] + ], "css/css-fonts/parsing/font-variant-ligatures-computed.html": [ [ "css/css-fonts/parsing/font-variant-ligatures-computed.html", @@ -204950,6 +204964,12 @@ {} ] ], + "css/css-fonts/parsing/font-variant-valid.html": [ + [ + "css/css-fonts/parsing/font-variant-valid.html", + {} + ] + ], "css/css-fonts/parsing/font-variation-settings-computed.html": [ [ "css/css-fonts/parsing/font-variation-settings-computed.html", @@ -214086,6 +214106,12 @@ {} ] ], + "css/css-transitions/parsing/transition-computed.html": [ + [ + "css/css-transitions/parsing/transition-computed.html", + {} + ] + ], "css/css-transitions/parsing/transition-delay-computed.html": [ [ "css/css-transitions/parsing/transition-delay-computed.html", @@ -308292,6 +308318,24 @@ {} ] ], + "webxr/xrDevice_isSessionSupported_immersive.https.html": [ + [ + "webxr/xrDevice_isSessionSupported_immersive.https.html", + {} + ] + ], + "webxr/xrDevice_isSessionSupported_immersive_unsupported.https.html": [ + [ + "webxr/xrDevice_isSessionSupported_immersive_unsupported.https.html", + {} + ] + ], + "webxr/xrDevice_isSessionSupported_inline.https.html": [ + [ + "webxr/xrDevice_isSessionSupported_inline.https.html", + {} + ] + ], "webxr/xrDevice_requestSession_immersive.https.html": [ [ "webxr/xrDevice_requestSession_immersive.https.html", @@ -330771,7 +330815,7 @@ "testharness" ], "content-security-policy/frame-ancestors/report-blocked-frame.sub.html": [ - "047d377cf4cf5d05851e1d0c9c3b20c77f098cc6", + "69c098d5597f574bfdab312504cc1551ce174bcc", "testharness" ], "content-security-policy/frame-ancestors/support/content-security-policy.sub.html": [ @@ -351214,6 +351258,10 @@ "aba7f9c6edd71d4a2b9446fb6de890866c41da64", "testharness" ], + "css/css-animations/parsing/animation-computed.html": [ + "467f4357f102fb75ed8df196d221d83cd2efdabc", + "testharness" + ], "css/css-animations/parsing/animation-delay-computed.html": [ "832466ac0642616c28bdb4aebad8833e6a4c92d0", "testharness" @@ -363578,6 +363626,10 @@ "0f16ceccfe1fe2668d01dfc64e99f4e3ca3164b1", "testharness" ], + "css/css-fonts/parsing/font-variant-invalid.html": [ + "c591acc3fcdfaac216a915ac4809f8a13fd9f9a4", + "testharness" + ], "css/css-fonts/parsing/font-variant-ligatures-computed.html": [ "a9dfac54e9b85946507b2ce055ea9166aa62518c", "testharness" @@ -363622,6 +363674,14 @@ "3887ab0cc4b59024544338d2338c3a723fe3b625", "testharness" ], + "css/css-fonts/parsing/font-variant-valid-expected.txt": [ + "78bdc6717bdb1339003ccc5bdf496f7b58c90aec", + "support" + ], + "css/css-fonts/parsing/font-variant-valid.html": [ + "921498d738e030ea2a2fe1e424b9d391e2b69a1b", + "testharness" + ], "css/css-fonts/parsing/font-variation-settings-computed.html": [ "0b01320a7f6e2a473a44bc435bfe9507321ce135", "testharness" @@ -392651,11 +392711,11 @@ "testharness" ], "css/css-transforms/animation/rotate-interpolation.html": [ - "911d8e38bd0bb6c3d5652d6824c64c58bd2233cf", + "dbf66a734f443eb608d92980ec38304cc7283530", "testharness" ], "css/css-transforms/animation/scale-interpolation.html": [ - "c6fec26461155ec15d9eb0ab469205c4868db161", + "e71b134ce5f94143127ba830e99d37c20a433313", "testharness" ], "css/css-transforms/animation/transform-interpolation-001-expected.txt": [ @@ -392691,7 +392751,7 @@ "testharness" ], "css/css-transforms/animation/translate-interpolation.html": [ - "c73f68a130e86b39b4832111bbfb05c633e09429", + "3d40863b3b4332799443433f1a470de0100956ce", "testharness" ], "css/css-transforms/backface-visibility-hidden-001.html": [ @@ -393615,27 +393675,27 @@ "testharness" ], "css/css-transforms/parsing/perspective-origin-invalid.html": [ - "2ed6721e091702a436217086eebd81172f359339", + "f4f01a339957df866b8bfad4cea3de1bf26c7915", "testharness" ], "css/css-transforms/parsing/perspective-origin-valid.html": [ - "79f4e0df12e84e880e8c501856a977e1a2c468b8", + "7653d7eceb8d1d0b0ae7adb5c6fb542d5f42adda", "testharness" ], "css/css-transforms/parsing/rotate-parsing-invalid.html": [ - "9eef999716da1025b1c8595f60e52ff2cdb7715e", + "4b6d7cf2ad5f21091e3bd8d47388d28ae964d73a", "testharness" ], "css/css-transforms/parsing/rotate-parsing-valid.html": [ - "ae9732282b7de4555551037b54dadea7ca9b0bc4", + "af0226c96765551a5f7468fcfd1742091f119212", "testharness" ], "css/css-transforms/parsing/scale-parsing-invalid.html": [ - "1072d1d6b1ecc46142ffbdd2ad62b87079651672", + "968e0dc17b1c6bad9f680d4ebfdd80df4f57afe0", "testharness" ], "css/css-transforms/parsing/scale-parsing-valid.html": [ - "2ae12222f1361b6b0016ce235fad92d03b3bff45", + "ac23a17b0133c271cb88d9579ebf33b93f4f502d", "testharness" ], "css/css-transforms/parsing/transform-box-computed-expected.txt": [ @@ -393647,7 +393707,7 @@ "testharness" ], "css/css-transforms/parsing/transform-box-invalid.html": [ - "781601cd26aa43430272011d67447a9079015659", + "af07a7e406ca640c8135802f2f0a8742b7b0e747", "testharness" ], "css/css-transforms/parsing/transform-box-valid-expected.txt": [ @@ -393655,35 +393715,35 @@ "support" ], "css/css-transforms/parsing/transform-box-valid.html": [ - "0754a5c9aeea70b07c9bb7bc1b2d20494f07a060", + "df53d327acf72fef155288094df41b4254e2d1b7", "testharness" ], "css/css-transforms/parsing/transform-invalid.html": [ - "7fb8367ecb2f6e2f151a1ee6afaab9896f07f8c8", + "25aeeae4e5df99febd541a61a5f0b0f9a8ff2471", "testharness" ], "css/css-transforms/parsing/transform-origin-computed.html": [ - "696d89db67fc9dd611fa0c09fccbe0408134e744", + "b8648b8a11a707ec06faa0fae7fd4879c0879631", "testharness" ], "css/css-transforms/parsing/transform-origin-invalid.html": [ - "0dd1eeaf592b94fe65d0ccfb731c826b5dfcb3dc", + "5533be4e22e1b67599f0a064ef9d7580736c7b76", "testharness" ], "css/css-transforms/parsing/transform-origin-valid.html": [ - "f76a0b407e16e3b98c7bac0c4149725deb02ea98", + "d5c952ed0f78f93d1e5fa40c571c3ee1b3d8f958", "testharness" ], "css/css-transforms/parsing/transform-valid.html": [ - "18de33f8a7a21be5b337cc02288471d7ba99f9ae", + "7879bd686a6f32b76947c1ffee6f8aff4c2c4db2", "testharness" ], "css/css-transforms/parsing/translate-parsing-invalid.html": [ - "9064586bdaab692334594a1cc17f24d639aab93c", + "2b7ff750c7cd004e3aaa64cb9ae84dd75bb05c69", "testharness" ], "css/css-transforms/parsing/translate-parsing-valid.html": [ - "c59ac9fa958175948f36bcab5044911f4b9215ba", + "17699ccc1c2d6570a0f20c3c9442cfaf681369d2", "testharness" ], "css/css-transforms/patternTransform/reference/svg-patternTransform-combination-ref.html": [ @@ -396563,11 +396623,11 @@ "reftest" ], "css/css-transforms/transforms-support-calc.html": [ - "1ad1bcc4b68c5419e2fa0651dad1a3386223e36b", + "a952d21b6646c862777b13c8d7a670ad4ae6eb72", "testharness" ], "css/css-transforms/translate-getComputedStyle.html": [ - "46a2c309020b5c66daba37f4d39879998b750214", + "2a4cdc6d6c622d2d131fdc0dfce95db28af4f831", "testharness" ], "css/css-transforms/translate-optional-second-001.html": [ @@ -397138,6 +397198,10 @@ "f26a04895781b389d7bad5aee80122b1e1d878a9", "testharness" ], + "css/css-transitions/parsing/transition-computed.html": [ + "3f253c3a0d1fbe2193bc101872ad67e4a24835cc", + "testharness" + ], "css/css-transitions/parsing/transition-delay-computed.html": [ "8e5b0e80daeb2a56ae05e210a8b682c8c1b9c87f", "testharness" @@ -422638,10 +422702,6 @@ "f43ec406e4b572e0abcca74284716e2cadcc0bd3", "testharness" ], - "domparsing/insert_adjacent_html-expected.txt": [ - "df36e01c72243d3baa8227a69f21c4fda2e58b22", - "support" - ], "domparsing/insert_adjacent_html-xhtml.xhtml": [ "eadf10e2c1fa94d83342deb2f96a61be875d020e", "testharness" @@ -429375,7 +429435,7 @@ "support" ], "fonts/ahem.css": [ - "b278cc14c54af7f6a2d893c6453778bceb65a8ce", + "02c1554537a60863e0a2bea39c4e18b93cdc7ab9", "support" ], "fonts/ahem.css.headers": [ @@ -452103,7 +452163,7 @@ "support" ], "interfaces/accelerometer.idl": [ - "35b09b8d521640b9b4519d665247a3c48d649386", + "f4187b601763a4f96ce9103ed49011e950bd97de", "support" ], "interfaces/ambient-light.idl": [ @@ -452371,7 +452431,7 @@ "support" ], "interfaces/mediasession.idl": [ - "7a5a45c56c6c6ee4de947dceb2808bf15fba966a", + "ecfb70a0d80468d0dbd985c6423ea2d8b75cf493", "support" ], "interfaces/mediastream-recording.idl": [ @@ -452539,7 +452599,7 @@ "support" ], "interfaces/user-timing.idl": [ - "20fb2db9caac7ae112144f76e232da4836aa0e94", + "8af17fdc03fd8bd174dc428d32bf49a23447c1e1", "support" ], "interfaces/vibration.idl": [ @@ -504399,7 +504459,7 @@ "testharness" ], "webxr/idlharness.https.window-expected.txt": [ - "1d166e26fe2d8c465821e0aa37a15a01e306abdc", + "13bd4345794be72fbb852a9927f01cf1cbb32d8d", "support" ], "webxr/idlharness.https.window.js": [ @@ -504462,6 +504522,18 @@ "ace64e8f41212d2e21a450ef6958bf2b7508a0da", "testharness" ], + "webxr/xrDevice_isSessionSupported_immersive.https.html": [ + "2f1129fe16e5592ec9b6982e9defbee78f963a31", + "testharness" + ], + "webxr/xrDevice_isSessionSupported_immersive_unsupported.https.html": [ + "41ae338787e45b13ff42efae752eb8a39f5ffbc8", + "testharness" + ], + "webxr/xrDevice_isSessionSupported_inline.https.html": [ + "bf8d14a8f51ecc6eeb772800be423abfefd35880", + "testharness" + ], "webxr/xrDevice_requestSession_immersive.https.html": [ "be0bb32995b86ee576c1e55414d7f7d81a1e0fc1", "testharness"
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/parsing/font-variant-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-fonts/parsing/font-variant-invalid.html new file mode 100644 index 0000000..c591acc3f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/parsing/font-variant-invalid.html
@@ -0,0 +1,62 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Fonts Module Level 4: parsing font-variant with invalid values</title> +<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#propdef-font-variant"> +<meta name="assert" content="font-variant supports only the grammar 'normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || [ stylistic(<feature-value-name>) || historical-forms || styleset(<feature-value-name>#) || character-variant(<feature-value-name>#) || swash(<feature-value-name>) || ornaments(<feature-value-name>) || annotation(<feature-value-name>) ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby || [ sub | super ] ]'."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +test_invalid_value('font-variant', 'normal none'); + +// <common-lig-values> +test_invalid_value('font-variant', 'common-ligatures no-common-ligatures'); + +// <discretionary-lig-values> +test_invalid_value('font-variant', 'discretionary-ligatures no-discretionary-ligatures'); + +// <historical-lig-values> +test_invalid_value('font-variant', 'historical-ligatures no-historical-ligatures'); + +// <contextual-alt-values> +test_invalid_value('font-variant', 'contextual no-contextual'); + +// [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] +test_invalid_value('font-variant', 'small-caps all-small-caps'); + +// [ stylistic(<feature-value-name>) || historical-forms || styleset(<feature-value-name>#) || character-variant(<feature-value-name>#) || swash(<feature-value-name>) || ornaments(<feature-value-name>) || annotation(<feature-value-name>) ] +test_invalid_value('font-variant', 'stylistic(flowing) stylistic(flowing)'); + +// <numeric-figure-values> +test_invalid_value('font-variant', 'lining-nums oldstyle-nums'); + +// <numeric-spacing-values> +test_invalid_value('font-variant', 'proportional-nums tabular-nums'); + +// <numeric-fraction-values> +test_invalid_value('font-variant', 'diagonal-fractions stacked-fractions'); + +// ordinal +test_invalid_value('font-variant', 'ordinal slashed-zero ordinal'); + +// slashed-zero +test_invalid_value('font-variant', 'slashed-zero jis78 slashed-zero'); + +// <east-asian-variant-values> +test_invalid_value('font-variant', 'jis78 jis83'); + +// <east-asian-width-values> +test_invalid_value('font-variant', 'full-width proportional-width'); + +// ruby +test_invalid_value('font-variant', 'ruby sub ruby'); + +// [ sub | super ] +test_invalid_value('font-variant', 'sub super'); +</script> +</body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/parsing/font-variant-valid-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-fonts/parsing/font-variant-valid-expected.txt new file mode 100644 index 0000000..78bdc671 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/parsing/font-variant-valid-expected.txt
@@ -0,0 +1,49 @@ +This is a testharness.js-based test. +PASS e.style['font-variant'] = "normal" should set the property value +FAIL e.style['font-variant'] = "none" should set the property value assert_equals: serialization should be canonical expected "none" but got "no-common-ligatures no-discretionary-ligatures no-historical-ligatures no-contextual" +PASS e.style['font-variant'] = "common-ligatures" should set the property value +PASS e.style['font-variant'] = "no-common-ligatures" should set the property value +PASS e.style['font-variant'] = "discretionary-ligatures" should set the property value +PASS e.style['font-variant'] = "no-discretionary-ligatures" should set the property value +PASS e.style['font-variant'] = "historical-ligatures" should set the property value +PASS e.style['font-variant'] = "no-historical-ligatures" should set the property value +PASS e.style['font-variant'] = "contextual" should set the property value +PASS e.style['font-variant'] = "no-contextual" should set the property value +PASS e.style['font-variant'] = "small-caps" should set the property value +PASS e.style['font-variant'] = "all-small-caps" should set the property value +PASS e.style['font-variant'] = "petite-caps" should set the property value +PASS e.style['font-variant'] = "all-petite-caps" should set the property value +PASS e.style['font-variant'] = "unicase" should set the property value +PASS e.style['font-variant'] = "titling-caps" should set the property value +FAIL e.style['font-variant'] = "stylistic(flowing)" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['font-variant'] = "historical-forms" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['font-variant'] = "styleset(flowing)" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['font-variant'] = "character-variant(flowing)" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['font-variant'] = "swash(flowing)" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['font-variant'] = "ornaments(flowing)" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['font-variant'] = "annotation(flowing)" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['font-variant'] = "stylistic(flowing) historical-forms styleset(flowing) character-variant(flowing) swash(flowing) ornaments(flowing) annotation(flowing)" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['font-variant'] = "annotation(flowing) ornaments(flowing) swash(flowing) character-variant(flowing) styleset(flowing) historical-forms stylistic(flowing)" should set the property value assert_not_equals: property should be set got disallowed value "" +PASS e.style['font-variant'] = "lining-nums" should set the property value +PASS e.style['font-variant'] = "oldstyle-nums" should set the property value +PASS e.style['font-variant'] = "proportional-nums" should set the property value +PASS e.style['font-variant'] = "tabular-nums" should set the property value +PASS e.style['font-variant'] = "diagonal-fractions" should set the property value +PASS e.style['font-variant'] = "stacked-fractions" should set the property value +PASS e.style['font-variant'] = "ordinal" should set the property value +PASS e.style['font-variant'] = "slashed-zero" should set the property value +PASS e.style['font-variant'] = "jis78" should set the property value +PASS e.style['font-variant'] = "jis83" should set the property value +PASS e.style['font-variant'] = "jis90" should set the property value +PASS e.style['font-variant'] = "jis04" should set the property value +PASS e.style['font-variant'] = "simplified" should set the property value +PASS e.style['font-variant'] = "traditional" should set the property value +PASS e.style['font-variant'] = "full-width" should set the property value +PASS e.style['font-variant'] = "proportional-width" should set the property value +PASS e.style['font-variant'] = "ruby" should set the property value +FAIL e.style['font-variant'] = "sub" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['font-variant'] = "super" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['font-variant'] = "common-ligatures discretionary-ligatures historical-ligatures contextual small-caps stylistic(flowing) lining-nums proportional-nums diagonal-fractions ordinal slashed-zero jis78 full-width ruby sub" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['font-variant'] = "super proportional-width jis83 stacked-fractions tabular-nums oldstyle-nums historical-forms all-small-caps no-contextual no-historical-ligatures no-discretionary-ligatures no-common-ligatures" should set the property value assert_not_equals: property should be set got disallowed value "" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/parsing/font-variant-valid.html b/third_party/blink/web_tests/external/wpt/css/css-fonts/parsing/font-variant-valid.html new file mode 100644 index 0000000..921498d7 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/parsing/font-variant-valid.html
@@ -0,0 +1,106 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Fonts Module Level 4: parsing font-variant with valid values</title> +<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#propdef-font-variant"> +<meta name="assert" content="font-variant supports the full grammar 'normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || [ stylistic(<feature-value-name>) || historical-forms || styleset(<feature-value-name>#) || character-variant(<feature-value-name>#) || swash(<feature-value-name>) || ornaments(<feature-value-name>) || annotation(<feature-value-name>) ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby || [ sub | super ] ]'."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +test_valid_value('font-variant', 'normal'); +test_valid_value('font-variant', 'none'); + +// <common-lig-values> +test_valid_value('font-variant', 'common-ligatures'); +test_valid_value('font-variant', 'no-common-ligatures'); + +// <discretionary-lig-values> +test_valid_value('font-variant', 'discretionary-ligatures'); +test_valid_value('font-variant', 'no-discretionary-ligatures'); + +// <historical-lig-values> +test_valid_value('font-variant', 'historical-ligatures'); +test_valid_value('font-variant', 'no-historical-ligatures'); + +// <contextual-alt-values> +test_valid_value('font-variant', 'contextual'); +test_valid_value('font-variant', 'no-contextual'); + +// [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] +test_valid_value('font-variant', 'small-caps'); +test_valid_value('font-variant', 'all-small-caps'); +test_valid_value('font-variant', 'petite-caps'); +test_valid_value('font-variant', 'all-petite-caps'); +test_valid_value('font-variant', 'unicase'); +test_valid_value('font-variant', 'titling-caps'); + +// [ stylistic(<feature-value-name>) || historical-forms || styleset(<feature-value-name>#) || character-variant(<feature-value-name>#) || swash(<feature-value-name>) || ornaments(<feature-value-name>) || annotation(<feature-value-name>) ] +test_valid_value('font-variant', 'stylistic(flowing)'); +test_valid_value('font-variant', 'historical-forms'); +test_valid_value('font-variant', 'styleset(flowing)'); +test_valid_value('font-variant', 'character-variant(flowing)'); +test_valid_value('font-variant', 'swash(flowing)'); +test_valid_value('font-variant', 'ornaments(flowing)'); +test_valid_value('font-variant', 'annotation(flowing)'); + +test_valid_value('font-variant', 'stylistic(flowing) historical-forms styleset(flowing) character-variant(flowing) swash(flowing) ornaments(flowing) annotation(flowing)'); + +test_valid_value('font-variant', 'annotation(flowing) ornaments(flowing) swash(flowing) character-variant(flowing) styleset(flowing) historical-forms stylistic(flowing)', 'stylistic(flowing) historical-forms styleset(flowing) character-variant(flowing) swash(flowing) ornaments(flowing) annotation(flowing)'); + +// <numeric-figure-values> +test_valid_value('font-variant', 'lining-nums'); +test_valid_value('font-variant', 'oldstyle-nums'); + +// <numeric-spacing-values> +test_valid_value('font-variant', 'proportional-nums'); +test_valid_value('font-variant', 'tabular-nums'); + +// <numeric-fraction-values> +test_valid_value('font-variant', 'diagonal-fractions'); +test_valid_value('font-variant', 'stacked-fractions'); + +// ordinal +test_valid_value('font-variant', 'ordinal'); + +// slashed-zero +test_valid_value('font-variant', 'slashed-zero'); + +// <east-asian-variant-values> +test_valid_value('font-variant', 'jis78'); +test_valid_value('font-variant', 'jis83'); +test_valid_value('font-variant', 'jis90'); +test_valid_value('font-variant', 'jis04'); +test_valid_value('font-variant', 'simplified'); +test_valid_value('font-variant', 'traditional'); + +// <east-asian-width-values> +test_valid_value('font-variant', 'full-width'); +test_valid_value('font-variant', 'proportional-width'); + +// ruby +test_valid_value('font-variant', 'ruby'); + +// [ sub | super ] +test_valid_value('font-variant', 'sub'); +test_valid_value('font-variant', 'super'); + + +test_valid_value('font-variant', + 'common-ligatures discretionary-ligatures historical-ligatures contextual' + + ' small-caps stylistic(flowing) lining-nums proportional-nums diagonal-fractions' + + ' ordinal slashed-zero jis78 full-width ruby sub'); + +test_valid_value('font-variant', + 'super proportional-width jis83 stacked-fractions' + + ' tabular-nums oldstyle-nums historical-forms all-small-caps no-contextual' + + ' no-historical-ligatures no-discretionary-ligatures no-common-ligatures', + 'no-common-ligatures no-discretionary-ligatures no-historical-ligatures' + + ' no-contextual all-small-caps historical-forms oldstyle-nums tabular-nums' + + ' stacked-fractions jis83 proportional-width super'); +</script> +</body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/rotate-interpolation.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/rotate-interpolation.html index 911d8e3..dbf66a73 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/rotate-interpolation.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/rotate-interpolation.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>rotate interpolation</title> - <link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-rotate"> <meta name="assert" content="rotate supports animation."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/scale-interpolation.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/scale-interpolation.html index c6fec26..e71b134 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/scale-interpolation.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/scale-interpolation.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>scale interpolation</title> - <link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-scale"> <meta name="assert" content="scale supports animation."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/translate-interpolation.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/translate-interpolation.html index c73f68a..3d40863 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/translate-interpolation.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/translate-interpolation.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>translate interpolation</title> - <link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-translate"> <meta name="assert" content="translate supports <length> and <percentage> animation."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/perspective-origin-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/perspective-origin-invalid.html index 2ed6721..f4f01a33 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/perspective-origin-invalid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/perspective-origin-invalid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: parsing perspective-origin with invalid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#perspective-origin-property"> <meta name="assert" content="perspective-origin supports only the '<position>' grammar."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/perspective-origin-valid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/perspective-origin-valid.html index 79f4e0d..7653d7e 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/perspective-origin-valid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/perspective-origin-valid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: parsing perspective-origin with valid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#perspective-origin-property"> <meta name="assert" content="perspective-origin supports the full '<position>' grammar."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/rotate-parsing-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/rotate-parsing-invalid.html index 9eef999..4b6d7cf 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/rotate-parsing-invalid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/rotate-parsing-invalid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: parsing rotate with invalid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-rotate"> <meta name="assert" content="rotate supports only the grammar 'none | <number>{3}? <angle>'."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/rotate-parsing-valid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/rotate-parsing-valid.html index ae97322..af0226c96 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/rotate-parsing-valid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/rotate-parsing-valid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: parsing rotate with valid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-rotate"> <meta name="assert" content="rotate supports the full grammar 'none | <number>{3}? <angle>'."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/scale-parsing-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/scale-parsing-invalid.html index 1072d1d6b..968e0dc 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/scale-parsing-invalid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/scale-parsing-invalid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: parsing scale with invalid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-scale"> <meta name="assert" content="scale supports only the grammar 'none | <number>{1,3}'."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/scale-parsing-valid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/scale-parsing-valid.html index 2ae12222..ac23a17 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/scale-parsing-valid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/scale-parsing-valid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: parsing scale with valid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-scale"> <meta name="assert" content="scale supports the full grammar 'none | <number>{1,3}'."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-box-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-box-invalid.html index 781601c..af07a7e 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-box-invalid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-box-invalid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 1: parsing transform-box with invalid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms/#transform-box-property"> <meta name="assert" content="transform-box supports only the grammar 'content-box | border-box | fill-box | stroke-box | view-box'."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-box-valid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-box-valid.html index 0754a5c9..df53d327 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-box-valid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-box-valid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 1: parsing transform-box with valid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms/#transform-box-property"> <meta name="assert" content="transform-box supports the full grammar 'content-box | border-box | fill-box | stroke-box | view-box'."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-invalid.html index 7fb8367e..25aeeae4 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-invalid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-invalid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: parsing transform with invalid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#transform-property"> <meta name="assert" content="transform supports only the grammar 'none | <transform-list>'."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-origin-computed.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-origin-computed.html index 696d89db..b8648b8 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-origin-computed.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-origin-computed.html
@@ -3,7 +3,7 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: getComputedStyle().transformOrigin</title> -<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#transform-origin-property"> +<link rel="help" href="https://drafts.csswg.org/css-transforms/#transform-origin-property"> <meta name="assert" content="transform-origin computed value is two or three absolute lengths"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-origin-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-origin-invalid.html index 0dd1eea..5533be4 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-origin-invalid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-origin-invalid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 1: parsing transform-origin with invalid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms/#transform-origin-property"> <meta name="assert" content="transform-origin supports only the grammar from spec."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-origin-valid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-origin-valid.html index f76a0b40..d5c952e 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-origin-valid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-origin-valid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 1: parsing transform-origin with valid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms/#transform-origin-property"> <meta name="assert" content="transform-origin supports the full grammar from spec."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-valid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-valid.html index 18de33f..7879bd6 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-valid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/transform-valid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: parsing transform with valid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#transform-property"> <meta name="assert" content="transform supports the full grammar 'none | <transform-list>'."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/translate-parsing-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/translate-parsing-invalid.html index 9064586..2b7ff750 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/translate-parsing-invalid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/translate-parsing-invalid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: parsing translate with invalid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-translate"> <meta name="assert" content="translate supports only the grammar 'none | <length-percentage> [ <length-percentage> <length>? ]?'."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/translate-parsing-valid.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/translate-parsing-valid.html index c59ac9f..17699cc 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/translate-parsing-valid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/parsing/translate-parsing-valid.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: parsing translate with valid values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-translate"> <meta name="assert" content="translate supports the full grammar 'none | <length-percentage> [ <length-percentage> <length>? ]?'."> <script src="/resources/testharness.js"></script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/transforms-support-calc.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/transforms-support-calc.html index 1ad1bcc..a952d21b 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/transforms-support-calc.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/transforms-support-calc.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: calc values</title> -<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/"> <link rel="help" href="https://drafts.csswg.org/css-values-3/#calc-notation"> <meta name="assert" content="calc values are supported in css-transforms properties.">
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/translate-getComputedStyle.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/translate-getComputedStyle.html index 46a2c309..2a4cdc6 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/translate-getComputedStyle.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/translate-getComputedStyle.html
@@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> <title>CSS Transform Module Level 2: translate getComputedStyle</title> - <link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-translate"> <meta name="assert" content="translate computed style does not resolve percentages."> <style type="text/css">
diff --git a/third_party/blink/web_tests/external/wpt/fonts/ahem.css b/third_party/blink/web_tests/external/wpt/fonts/ahem.css index b278cc14..02c1554 100644 --- a/third_party/blink/web_tests/external/wpt/fonts/ahem.css +++ b/third_party/blink/web_tests/external/wpt/fonts/ahem.css
@@ -1,5 +1,6 @@ @font-face { font-family: 'Ahem'; - src: url('/fonts/Ahem.ttf'); + src: local('Ahem'), + url('/fonts/Ahem.ttf'); }
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/accelerometer.idl b/third_party/blink/web_tests/external/wpt/interfaces/accelerometer.idl index 35b09b8..f4187b6 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/accelerometer.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/accelerometer.idl
@@ -3,9 +3,9 @@ // (https://github.com/tidoust/reffy-reports) // Source: Accelerometer (https://w3c.github.io/accelerometer/) -[Constructor(optional AccelerometerSensorOptions options = {}), SecureContext, - Exposed=Window] +[SecureContext, Exposed=Window] interface Accelerometer : Sensor { + constructor(optional AccelerometerSensorOptions options = {}); readonly attribute double? x; readonly attribute double? y; readonly attribute double? z; @@ -17,14 +17,14 @@ AccelerometerLocalCoordinateSystem referenceFrame = "device"; }; -[Constructor(optional AccelerometerSensorOptions options = {}), SecureContext, - Exposed=Window] +[SecureContext, Exposed=Window] interface LinearAccelerationSensor : Accelerometer { + constructor(optional AccelerometerSensorOptions options = {}); }; -[Constructor(optional AccelerometerSensorOptions options = {}), SecureContext, - Exposed=Window] +[SecureContext, Exposed=Window] interface GravitySensor : Accelerometer { + constructor(optional AccelerometerSensorOptions options = {}); }; dictionary AccelerometerReadingValues {
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/mediasession.idl b/third_party/blink/web_tests/external/wpt/interfaces/mediasession.idl index 7a5a45c..ecfb70a 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/mediasession.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/mediasession.idl
@@ -77,5 +77,5 @@ dictionary MediaSessionSeekToActionDetails : MediaSessionActionDetails { required double seekTime; - bool? fastSeek; + boolean? fastSeek; };
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/user-timing.idl b/third_party/blink/web_tests/external/wpt/interfaces/user-timing.idl index 20fb2db..8af17fd 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/user-timing.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/user-timing.idl
@@ -22,9 +22,9 @@ void clearMeasures(optional DOMString measureName); }; -[Exposed=(Window,Worker), - Constructor(DOMString markName, optional PerformanceMarkOptions markOptions = {})] +[Exposed=(Window,Worker)] interface PerformanceMark : PerformanceEntry { + constructor(DOMString markName, optional PerformanceMarkOptions markOptions = {}); readonly attribute any detail; };
diff --git a/third_party/blink/web_tests/media/mediasession/mojo/resources/mediasessionservice-mock.js b/third_party/blink/web_tests/media/mediasession/mojo/resources/mediasessionservice-mock.js index 5220d05a..9bc5879 100644 --- a/third_party/blink/web_tests/media/mediasession/mojo/resources/mediasessionservice-mock.js +++ b/third_party/blink/web_tests/media/mediasession/mojo/resources/mediasessionservice-mock.js
@@ -46,7 +46,8 @@ blink.mojom.MediaSessionService); this.interceptor_ = - new MojoInterfaceInterceptor(blink.mojom.MediaSessionService.name); + new MojoInterfaceInterceptor(blink.mojom.MediaSessionService.name, + "context", true); this.interceptor_.oninterfacerequest = e => this.bindingSet_.addBinding(this, e.handle); this.interceptor_.start();
diff --git a/third_party/freetype/README.chromium b/third_party/freetype/README.chromium index 3b7e3a3..66f83e5 100644 --- a/third_party/freetype/README.chromium +++ b/third_party/freetype/README.chromium
@@ -1,7 +1,7 @@ Name: FreeType URL: http://www.freetype.org/ -Version: VER-2-10-1-53-g432efa25b -Revision: 432efa25b3476a6884426c0a30f6d6a624310e5d +Version: VER-2-10-1-56-gc37a50145 +Revision: c37a501458e2b5389ac977ed2523eed3e2d9bd61 License: Custom license "inspired by the BSD, Artistic, and IJG (Independent JPEG Group) licenses" License File: src/docs/FTL.TXT
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index b762a27a..c606302 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -97,7 +97,9 @@ 'chromeos-amd64-generic-asan-rel': 'cros_chrome_sdk_asan', 'chromeos-amd64-generic-cfi-thin-lto-rel': 'cros_chrome_sdk_headless_ozone_cfi_thin_lto', + 'chromeos-amd64-generic-dbg': 'cros_chrome_sdk_dbg', 'chromeos-amd64-generic-rel': 'cros_chrome_sdk_headless_ozone', + 'chromeos-arm-generic-dbg': 'cros_chrome_sdk_dbg', 'chromeos-arm-generic-rel': 'cros_chrome_sdk', 'chromeos-kevin-rel': 'cros_chrome_sdk_headless_ozone', 'linux-chromeos-rel': 'chromeos_with_codecs_release_bot', @@ -734,7 +736,9 @@ # TODO(crbug.com/913750): Enable DCHECKS on the two amd64-generic bots # and two kevin bots when the PFQ has it enabled. 'chromeos-amd64-generic-cfi-thin-lto-rel': 'cros_chrome_sdk_headless_ozone_cfi_thin_lto', + 'chromeos-amd64-generic-dbg': 'cros_chrome_sdk_dbg', 'chromeos-amd64-generic-rel': 'cros_chrome_sdk_headless_ozone', + 'chromeos-arm-generic-dbg': 'cros_chrome_sdk_dbg', 'chromeos-arm-generic-rel': 'cros_chrome_sdk_dchecks_always_on', 'chromeos-kevin-compile-rel': 'cros_chrome_sdk_headless_ozone', 'chromeos-kevin-experimental-rel': 'cros_chrome_sdk_headless_ozone', @@ -1429,6 +1433,10 @@ 'cros_chrome_sdk', 'asan', ], + 'cros_chrome_sdk_dbg': [ + 'cros_chrome_sdk', 'debug', + ], + 'cros_chrome_sdk_dchecks_always_on': [ 'cros_chrome_sdk', 'dcheck_always_on', ],
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 941a22e..8eee741 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -19235,6 +19235,7 @@ label="ACCESSIBILITY_PRIVATE_FIND_SCROLLABLE_BOUNDS_FOR_POINT"/> <int value="441" label="LOGIN_STATE_ON_SESSION_STATE_CHANGED"/> <int value="442" label="PRINTING_METRICS_ON_PRINT_JOB_FINISHED"/> + <int value="443" label="AUTOTESTPRIVATE_ON_CLIPBOARD_DATA_CHANGED"/> </enum> <enum name="ExtensionFileWriteResult"> @@ -20689,6 +20690,9 @@ <int value="1385" label="USERSPRIVATE_ISWHITELISTEDUSER"/> <int value="1386" label="PRINTINGMETRICS_GETPRINTJOBS"/> <int value="1387" label="AUTOTESTPRIVATE_WAITFORASSISTANTQUERYSTATUS"/> + <int value="1388" label="AUTOTESTPRIVATE_GETCLIPBOARDTEXTDATA"/> + <int value="1389" label="AUTOTESTPRIVATE_SETCLIPBOARDTEXTDATA"/> + <int value="1390" label="AUTOTESTPRIVATE_INITIALIZEEVENTS"/> </enum> <enum name="ExtensionIconState"> @@ -24752,6 +24756,8 @@ label="MediaSourceGroupEndTimestampDecreaseWithinMediaSegment"/> <int value="3035" label="TextFragmentAnchorTapToDismiss"/> <int value="3036" label="XRIsSessionSupported"/> + <int value="3037" label="ScrollbarUseScrollbarButtonReversedDirection"/> + <int value="3038" label="CSSSelectorPseudoScrollbarButtonReversedDirection"/> </enum> <enum name="FeaturePolicyAllowlistType"> @@ -36263,6 +36269,7 @@ <int value="-240531943" label="ContextualSearchRankerQuery:disabled"/> <int value="-239616243" label="HighDynamicRange:enabled"/> <int value="-239176328" label="BluetoothAggressiveAppearanceFilter:enabled"/> + <int value="-237367320" label="AssistantAudioEraser:disabled"/> <int value="-234966279" label="PointerEvent:disabled"/> <int value="-234687894" label="NonValidatingReloadOnRefreshContentV2:disabled"/> @@ -36833,6 +36840,7 @@ <int value="549483647" label="EnableUnifiedMultiDeviceSettings:disabled"/> <int value="550378029" label="reset-app-list-install-state"/> <int value="550387510" label="NTPAssetDownloadSuggestions:disabled"/> + <int value="555959995" label="ChromeSharingHub:enabled"/> <int value="556555487" label="AutofillDoNotUploadSaveUnsupportedCards:disabled"/> <int value="557200974" label="WebSocketHandshakeReuseConnection:disabled"/> @@ -36960,6 +36968,7 @@ <int value="715617684" label="OriginTrials:disabled"/> <int value="716073306" label="AssistantVoiceMatch:disabled"/> <int value="716080990" label="restrict-iframe-permissions"/> + <int value="717827121" label="ChromeSharingHub:disabled"/> <int value="719267310" label="KeepAliveRendererForKeepaliveRequests:disabled"/> <int value="720931007" label="WebAuthenticationBle:enabled"/> @@ -37291,6 +37300,7 @@ <int value="1183431946" label="v8-cache-options"/> <int value="1184225265" label="AllowSyncXHRInPageDismissal:enabled"/> <int value="1185424279" label="enable-media-router"/> + <int value="1188109510" label="AssistantAudioEraser:enabled"/> <int value="1190035852" label="MediaRemoting:enabled"/> <int value="1192302892" label="gesture-typing"/> <int value="1192913630" label="OfflinePagesBackgroundLoading:disabled"/>
diff --git a/ui/base/dragdrop/os_exchange_data_provider_win.cc b/ui/base/dragdrop/os_exchange_data_provider_win.cc index 139dd138..6fbf8a2c 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_win.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_win.cc
@@ -842,8 +842,7 @@ DataObjectImpl::StoredDataInfo::StoredDataInfo(const FORMATETC& format_etc, STGMEDIUM* medium) - : format_etc(format_etc), medium(medium), owns_medium(true) { -} + : format_etc(format_etc), medium(medium), owns_medium(true) {} DataObjectImpl::StoredDataInfo::~StoredDataInfo() { if (owns_medium) { @@ -920,43 +919,41 @@ // If medium is NULL, delay-rendering will be used. if (content->medium) { DuplicateMedium(content->format_etc.cfFormat, content->medium, medium); - } else { - // Fail all GetData() attempts for DownloadURL data if the drag and drop - // operation is still in progress. - if (in_drag_loop_) - return DV_E_FORMATETC; - - bool wait_for_data = false; - - // In async mode, we do not want to start waiting for the data before - // the async operation is started. This is because we want to postpone - // until Shell kicks off a background thread to do the work so that - // we do not block the UI thread. - if (!in_async_mode_ || async_operation_started_) - wait_for_data = true; - - if (!wait_for_data) - return DV_E_FORMATETC; - - // Notify the observer we start waiting for the data. This gives - // an observer a chance to end the drag and drop. - if (observer_) - observer_->OnWaitForData(); - - // Now we can start the download. - if (content->downloader.get()) { - content->downloader->Start(this); - if (!content->downloader->Wait()) { - is_aborting_ = true; - return DV_E_FORMATETC; - } - } - - // The stored data should have been updated with the final version. - // So we just need to call this function again to retrieve it. - return GetData(format_etc, medium); + return S_OK; } - return S_OK; + // Fail all GetData() attempts for DownloadURL data if the drag and drop + // operation is still in progress. + if (in_drag_loop_) + return DV_E_FORMATETC; + + bool wait_for_data = false; + + // In async mode, we do not want to start waiting for the data before + // the async operation is started. This is because we want to postpone + // until Shell kicks off a background thread to do the work so that + // we do not block the UI thread. + if (!in_async_mode_ || async_operation_started_) + wait_for_data = true; + + if (!wait_for_data) + return DV_E_FORMATETC; + + // Notify the observer we start waiting for the data. This gives + // an observer a chance to end the drag and drop. + if (observer_) + observer_->OnWaitForData(); + + // Now we can start the download. + if (content->downloader.get()) { + content->downloader->Start(this); + if (!content->downloader->Wait()) { + is_aborting_ = true; + return DV_E_FORMATETC; + } + } + // The stored data should have been updated with the final version. + // So we just need to call this function again to retrieve it. + return GetData(format_etc, medium); } }
diff --git a/ui/display/manager/managed_display_info.cc b/ui/display/manager/managed_display_info.cc index ea1a246..bbeafae 100644 --- a/ui/display/manager/managed_display_info.cc +++ b/ui/display/manager/managed_display_info.cc
@@ -333,6 +333,15 @@ return GetRotation(Display::RotationSource::ACTIVE); } +Display::Rotation ManagedDisplayInfo::GetLogicalActiveRotation() const { + return GetRotationWithPanelOrientation( + GetRotation(Display::RotationSource::ACTIVE)); +} + +Display::Rotation ManagedDisplayInfo::GetNaturalOrientationRotation() const { + return GetRotationWithPanelOrientation(Display::ROTATE_0); +} + Display::Rotation ManagedDisplayInfo::GetRotation( Display::RotationSource source) const { if (rotations_.find(source) == rotations_.end()) @@ -398,8 +407,18 @@ return device_scale_factor_ * zoom_factor_; } +gfx::Size ManagedDisplayInfo::GetSizeInPixelWithPanelOrientation() const { + gfx::Size size = bounds_in_native_.size(); + if (panel_orientation_ == display::PanelOrientation::kLeftUp || + panel_orientation_ == display::PanelOrientation::kRightUp) { + return gfx::Size(size.height(), size.width()); + } + return size; +} + void ManagedDisplayInfo::UpdateDisplaySize() { - size_in_pixel_ = bounds_in_native_.size(); + size_in_pixel_ = GetSizeInPixelWithPanelOrientation(); + if (!overscan_insets_in_dip_.IsEmpty()) { gfx::Insets insets_in_pixel = overscan_insets_in_dip_.Scale(device_scale_factor_); @@ -467,6 +486,26 @@ return ToString() + ", display_modes==" + display_modes_str; } +Display::Rotation ManagedDisplayInfo::GetRotationWithPanelOrientation( + Display::Rotation rotation) const { + int offset = 0; + switch (panel_orientation_) { + case PanelOrientation::kNormal: + break; + case PanelOrientation::kBottomUp: + offset = 2; + break; + case PanelOrientation::kRightUp: + offset = 1; + break; + case PanelOrientation::kLeftUp: + offset = 3; + break; + } + return static_cast<Display::Rotation>((static_cast<int>(rotation) + offset) % + 4); +} + void ResetDisplayIdForTest() { synthesized_display_id = kSynthesizedDisplayIdStart; }
diff --git a/ui/display/manager/managed_display_info.h b/ui/display/manager/managed_display_info.h index a6b795e..913ca9f 100644 --- a/ui/display/manager/managed_display_info.h +++ b/ui/display/manager/managed_display_info.h
@@ -174,10 +174,8 @@ float device_dpi() const { return device_dpi_; } void set_device_dpi(float dpi) { device_dpi_ = dpi; } - display::PanelOrientation panel_orientation() const { - return panel_orientation_; - } - void set_panel_orientation(display::PanelOrientation panel_orientation) { + PanelOrientation panel_orientation() const { return panel_orientation_; } + void set_panel_orientation(PanelOrientation panel_orientation) { panel_orientation_ = panel_orientation; } @@ -185,9 +183,14 @@ // different from the |size_in_pixel| when overscan insets are set. const gfx::Rect& bounds_in_native() const { return bounds_in_native_; } - // The size for the display in pixels. + // The size for the display in pixels with the rotation taking into + // account. const gfx::Size& size_in_pixel() const { return size_in_pixel_; } + // The original size for the display in pixel, without rotation, but + // |panel_orientation_| taking into account. + gfx::Size GetSizeInPixelWithPanelOrientation() const; + // The overscan insets for the display in DIP. const gfx::Insets& overscan_insets_in_dip() const { return overscan_insets_in_dip_; @@ -200,6 +203,14 @@ // Returns the currently active rotation for this display. Display::Rotation GetActiveRotation() const; + // Returns the currently active rotation for this display with the panel + // orientation adjustment applied. + Display::Rotation GetLogicalActiveRotation() const; + + // Returns the natural orientation rotation with the panel orientation + // adjustment applied. + Display::Rotation GetNaturalOrientationRotation() const; + // Returns the source which set the active rotation for this display. Display::RotationSource active_rotation_source() const { return active_rotation_source_; @@ -300,6 +311,10 @@ std::string ToFullString() const; private: + // Return the rotation with the panel orientation applied. + Display::Rotation GetRotationWithPanelOrientation( + Display::Rotation rotation) const; + int64_t id_; std::string name_; std::string manufacturer_id_;
diff --git a/ui/ozone/platform/x11/BUILD.gn b/ui/ozone/platform/x11/BUILD.gn index 008f3a1..f2908c32 100644 --- a/ui/ozone/platform/x11/BUILD.gn +++ b/ui/ozone/platform/x11/BUILD.gn
@@ -30,8 +30,6 @@ "x11_screen_ozone.h", "x11_surface_factory.cc", "x11_surface_factory.h", - "x11_window_manager_ozone.cc", - "x11_window_manager_ozone.h", "x11_window_ozone.cc", "x11_window_ozone.h", ]
diff --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc index fee32a1..109583a 100644 --- a/ui/ozone/platform/x11/ozone_platform_x11.cc +++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
@@ -19,7 +19,6 @@ #include "ui/ozone/platform/x11/x11_cursor_factory_ozone.h" #include "ui/ozone/platform/x11/x11_screen_ozone.h" #include "ui/ozone/platform/x11/x11_surface_factory.h" -#include "ui/ozone/platform/x11/x11_window_manager_ozone.h" #include "ui/ozone/platform/x11/x11_window_ozone.h" #include "ui/ozone/public/gpu_platform_support_host.h" #include "ui/ozone/public/input_controller.h" @@ -84,7 +83,7 @@ PlatformWindowDelegate* delegate, PlatformWindowInitProperties properties) override { std::unique_ptr<X11WindowOzone> window = - std::make_unique<X11WindowOzone>(delegate, window_manager_.get()); + std::make_unique<X11WindowOzone>(delegate); window->Initialize(std::move(properties)); window->SetTitle(base::ASCIIToUTF16("Ozone X11")); return std::move(window); @@ -96,8 +95,7 @@ } std::unique_ptr<PlatformScreen> CreateScreen() override { - DCHECK(window_manager_); - auto screen = std::make_unique<X11ScreenOzone>(window_manager_.get()); + auto screen = std::make_unique<X11ScreenOzone>(); screen->Init(); return screen; } @@ -122,7 +120,6 @@ void InitializeUI(const InitParams& params) override { InitializeCommon(params); CreatePlatformEventSource(); - window_manager_ = std::make_unique<X11WindowManagerOzone>(); overlay_manager_ = std::make_unique<StubOverlayManager>(); input_controller_ = CreateStubInputController(); clipboard_ = std::make_unique<X11ClipboardOzone>(); @@ -175,7 +172,6 @@ bool common_initialized_ = false; // Objects in the UI process. - std::unique_ptr<X11WindowManagerOzone> window_manager_; std::unique_ptr<OverlayManagerOzone> overlay_manager_; std::unique_ptr<InputController> input_controller_; std::unique_ptr<X11ClipboardOzone> clipboard_;
diff --git a/ui/ozone/platform/x11/x11_screen_ozone.cc b/ui/ozone/platform/x11/x11_screen_ozone.cc index 54a8a076..034831f 100644 --- a/ui/ozone/platform/x11/x11_screen_ozone.cc +++ b/ui/ozone/platform/x11/x11_screen_ozone.cc
@@ -10,8 +10,8 @@ #include "ui/events/platform/x11/x11_event_source.h" #include "ui/gfx/font_render_params.h" #include "ui/gfx/geometry/dip_util.h" -#include "ui/ozone/platform/x11/x11_window_manager_ozone.h" #include "ui/ozone/platform/x11/x11_window_ozone.h" +#include "ui/platform_window/x11/x11_window_manager.h" namespace ui { @@ -38,10 +38,10 @@ // lambda/callback instead of Delegate interface. class LocalProcessWindowFinder : public EnumerateWindowsDelegate { public: - explicit LocalProcessWindowFinder(X11WindowManagerOzone* window_manager); + LocalProcessWindowFinder() = default; ~LocalProcessWindowFinder() override = default; - X11WindowOzone* FindWindowAt(const gfx::Point& screen_point_in_pixels); + X11Window* FindWindowAt(const gfx::Point& screen_point_in_pixels); private: // ui::EnumerateWindowsDelegate @@ -49,20 +49,13 @@ // Returns true if |window| is visible and contains the // |screen_point_in_pixels_| within its bounds, even if custom shape is used. - bool MatchWindow(X11WindowOzone* window) const; + bool MatchWindow(X11Window* window) const; - X11WindowManagerOzone* const window_manager_; - X11WindowOzone* window_found_ = nullptr; + X11Window* window_found_ = nullptr; gfx::Point screen_point_in_pixels_; }; -LocalProcessWindowFinder::LocalProcessWindowFinder( - X11WindowManagerOzone* window_manager) - : window_manager_(window_manager) { - DCHECK(window_manager_); -} - -X11WindowOzone* LocalProcessWindowFinder::FindWindowAt( +X11Window* LocalProcessWindowFinder::FindWindowAt( const gfx::Point& screen_point_in_pixels) { screen_point_in_pixels_ = screen_point_in_pixels; ui::EnumerateTopLevelWindows(this); @@ -70,7 +63,7 @@ } bool LocalProcessWindowFinder::ShouldStopIterating(XID xid) { - X11WindowOzone* window = window_manager_->GetWindow(xid); + X11Window* window = X11WindowManager::GetInstance()->GetWindow(xid); if (!window || !MatchWindow(window)) return false; @@ -78,7 +71,7 @@ return true; } -bool LocalProcessWindowFinder::MatchWindow(X11WindowOzone* window) const { +bool LocalProcessWindowFinder::MatchWindow(X11Window* window) const { DCHECK(window); if (!window->IsVisible()) @@ -99,8 +92,8 @@ } // namespace -X11ScreenOzone::X11ScreenOzone(X11WindowManagerOzone* window_manager) - : window_manager_(window_manager), +X11ScreenOzone::X11ScreenOzone() + : window_manager_(X11WindowManager::GetInstance()), x11_display_manager_(std::make_unique<XDisplayManager>(this)) { DCHECK(window_manager_); } @@ -133,7 +126,7 @@ if (widget == gfx::kNullAcceleratedWidget) return GetPrimaryDisplay(); - X11WindowOzone* window = window_manager_->GetWindow(widget); + X11Window* window = window_manager_->GetWindow(widget); return window ? GetDisplayMatching(window->GetBounds()) : GetPrimaryDisplay(); } @@ -150,9 +143,9 @@ gfx::AcceleratedWidget X11ScreenOzone::GetAcceleratedWidgetAtScreenPoint( const gfx::Point& point) const { - LocalProcessWindowFinder finder(window_manager_); - X11WindowOzone* window = finder.FindWindowAt(point); - return window ? window->widget() : gfx::kNullAcceleratedWidget; + LocalProcessWindowFinder finder; + X11Window* window = finder.FindWindowAt(point); + return window ? window->GetWidget() : gfx::kNullAcceleratedWidget; } display::Display X11ScreenOzone::GetDisplayNearestPoint(
diff --git a/ui/ozone/platform/x11/x11_screen_ozone.h b/ui/ozone/platform/x11/x11_screen_ozone.h index c2558d1..fb214b1 100644 --- a/ui/ozone/platform/x11/x11_screen_ozone.h +++ b/ui/ozone/platform/x11/x11_screen_ozone.h
@@ -18,14 +18,14 @@ namespace ui { -class X11WindowManagerOzone; +class X11WindowManager; // A PlatformScreen implementation for X11. class X11ScreenOzone : public PlatformScreen, public XEventDispatcher, public XDisplayManager::Delegate { public: - explicit X11ScreenOzone(X11WindowManagerOzone* window_manager); + X11ScreenOzone(); ~X11ScreenOzone() override; // Fetch display list through Xlib/XRandR @@ -58,7 +58,7 @@ gfx::Point GetCursorLocation() const; - X11WindowManagerOzone* const window_manager_; + X11WindowManager* const window_manager_; std::unique_ptr<ui::XDisplayManager> x11_display_manager_; DISALLOW_COPY_AND_ASSIGN(X11ScreenOzone);
diff --git a/ui/ozone/platform/x11/x11_screen_ozone_unittest.cc b/ui/ozone/platform/x11/x11_screen_ozone_unittest.cc index 2a4b035..87ae05c 100644 --- a/ui/ozone/platform/x11/x11_screen_ozone_unittest.cc +++ b/ui/ozone/platform/x11/x11_screen_ozone_unittest.cc
@@ -13,11 +13,11 @@ #include "ui/display/display.h" #include "ui/display/display_observer.h" #include "ui/events/platform/x11/x11_event_source_default.h" -#include "ui/ozone/platform/x11/x11_window_manager_ozone.h" #include "ui/ozone/platform/x11/x11_window_ozone.h" #include "ui/ozone/test/mock_platform_window_delegate.h" #include "ui/platform_window/platform_window_delegate.h" #include "ui/platform_window/platform_window_init_properties.h" +#include "ui/platform_window/x11/x11_window_manager.h" using ::testing::_; @@ -57,10 +57,9 @@ void SetUp() override { XDisplay* display = gfx::GetXDisplay(); event_source_ = std::make_unique<X11EventSourceDefault>(display); - window_manager_ = std::make_unique<X11WindowManagerOzone>(); primary_display_ = std::make_unique<display::Display>( NextDisplayId(), kPrimaryDisplayBounds); - screen_ = std::make_unique<X11ScreenOzone>(window_manager_.get()); + screen_ = std::make_unique<X11ScreenOzone>(); UpdateDisplayListForTest({*primary_display_}); screen_->AddObserver(&display_observer_); } @@ -103,8 +102,7 @@ EXPECT_CALL(*delegate, OnAcceleratedWidgetAvailable(_)) .WillOnce(StoreWidget(widget)); PlatformWindowInitProperties init_params(bounds); - auto window = - std::make_unique<X11WindowOzone>(delegate, window_manager_.get()); + auto window = std::make_unique<X11WindowOzone>(delegate); window->Initialize(std::move(init_params)); return window; } @@ -112,7 +110,6 @@ MockDisplayObserver display_observer_; private: - std::unique_ptr<X11WindowManagerOzone> window_manager_; std::unique_ptr<display::Display> primary_display_; std::unique_ptr<X11ScreenOzone> screen_; std::unique_ptr<X11EventSourceDefault> event_source_;
diff --git a/ui/ozone/platform/x11/x11_window_manager_ozone.cc b/ui/ozone/platform/x11/x11_window_manager_ozone.cc deleted file mode 100644 index 3da2e8e..0000000 --- a/ui/ozone/platform/x11/x11_window_manager_ozone.cc +++ /dev/null
@@ -1,66 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ui/ozone/platform/x11/x11_window_manager_ozone.h" - -#include "base/stl_util.h" -#include "ui/ozone/platform/x11/x11_window_ozone.h" - -namespace ui { - -X11WindowManagerOzone::X11WindowManagerOzone() : event_grabber_(nullptr) {} - -X11WindowManagerOzone::~X11WindowManagerOzone() {} - -void X11WindowManagerOzone::GrabEvents(X11WindowOzone* window) { - if (event_grabber_ == window) - return; - - X11WindowOzone* old_grabber = event_grabber_; - if (old_grabber) - old_grabber->OnLostCapture(); - - event_grabber_ = window; -} - -void X11WindowManagerOzone::UngrabEvents(X11WindowOzone* window) { - if (event_grabber_ != window) - return; - event_grabber_->OnLostCapture(); - event_grabber_ = nullptr; -} - -void X11WindowManagerOzone::AddWindow(X11WindowOzone* window) { - DCHECK(window); - DCHECK_NE(gfx::kNullAcceleratedWidget, window->widget()); - DCHECK(!base::Contains(windows_, window->widget())); - windows_.emplace(window->widget(), window); -} - -void X11WindowManagerOzone::RemoveWindow(X11WindowOzone* window) { - DCHECK(window); - DCHECK_NE(gfx::kNullAcceleratedWidget, window->widget()); - auto it = windows_.find(window->widget()); - DCHECK(it != windows_.end()); - if (window_mouse_currently_on_ == it->second) - window_mouse_currently_on_ = nullptr; - windows_.erase(it); -} - -X11WindowOzone* X11WindowManagerOzone::GetWindow( - gfx::AcceleratedWidget widget) const { - DCHECK_NE(gfx::kNullAcceleratedWidget, widget); - auto it = windows_.find(widget); - return it != windows_.end() ? it->second : nullptr; -} - -void X11WindowManagerOzone::MouseOnWindow(X11WindowOzone* window) { - if (window_mouse_currently_on_ == window) - return; - - window_mouse_currently_on_ = window; - window->OnMouseEnter(); -} - -} // namespace ui
diff --git a/ui/ozone/platform/x11/x11_window_manager_ozone.h b/ui/ozone/platform/x11/x11_window_manager_ozone.h deleted file mode 100644 index d492ebb..0000000 --- a/ui/ozone/platform/x11/x11_window_manager_ozone.h +++ /dev/null
@@ -1,54 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_OZONE_PLATFORM_X11_X11_WINDOW_MANAGER_OZONE_H_ -#define UI_OZONE_PLATFORM_X11_X11_WINDOW_MANAGER_OZONE_H_ - -#include "base/containers/flat_map.h" -#include "base/macros.h" -#include "ui/gfx/native_widget_types.h" - -namespace ui { - -class X11WindowOzone; - -class X11WindowManagerOzone { - public: - X11WindowManagerOzone(); - ~X11WindowManagerOzone(); - - // Sets a given X11WindowOzone as the recipient for events and calls - // OnLostCapture for another |event_grabber_| if it has been set previously. - void GrabEvents(X11WindowOzone* window); - - // Unsets a given X11WindowOzone as the recipient for events and calls - // OnLostCapture. - void UngrabEvents(X11WindowOzone* window); - - // Gets the current X11WindowOzone recipient of mouse events. - X11WindowOzone* event_grabber() const { return event_grabber_; } - - // Gets the window corresponding to the AcceleratedWidget |widget|. - void AddWindow(X11WindowOzone* window); - void RemoveWindow(X11WindowOzone* window); - X11WindowOzone* GetWindow(gfx::AcceleratedWidget widget) const; - - void MouseOnWindow(X11WindowOzone* delegate); - - const X11WindowOzone* window_mouse_currently_on_for_test() const { - return window_mouse_currently_on_; - } - - private: - X11WindowOzone* event_grabber_; - X11WindowOzone* window_mouse_currently_on_ = nullptr; - - base::flat_map<gfx::AcceleratedWidget, X11WindowOzone*> windows_; - - DISALLOW_COPY_AND_ASSIGN(X11WindowManagerOzone); -}; - -} // namespace ui - -#endif // UI_OZONE_PLATFORM_X11_X11_WINDOW_MANAGER_OZONE_H_
diff --git a/ui/ozone/platform/x11/x11_window_ozone.cc b/ui/ozone/platform/x11/x11_window_ozone.cc index 1c1b8f2a..ee9fd3c 100644 --- a/ui/ozone/platform/x11/x11_window_ozone.cc +++ b/ui/ozone/platform/x11/x11_window_ozone.cc
@@ -13,61 +13,22 @@ #include "ui/base/x/x11_util.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" -#include "ui/events/ozone/events_ozone.h" #include "ui/events/platform/x11/x11_event_source.h" #include "ui/gfx/x/x11.h" #include "ui/gfx/x/x11_atom_cache.h" #include "ui/ozone/platform/x11/x11_cursor_ozone.h" -#include "ui/ozone/platform/x11/x11_window_manager_ozone.h" #include "ui/platform_window/platform_window_init_properties.h" namespace ui { -X11WindowOzone::X11WindowOzone(PlatformWindowDelegate* delegate, - X11WindowManagerOzone* window_manager) - : X11Window(delegate), window_manager_(window_manager) { - DCHECK(window_manager_); -} +X11WindowOzone::X11WindowOzone(PlatformWindowDelegate* delegate) + : X11Window(delegate) {} X11WindowOzone::~X11WindowOzone() { PrepareForShutdown(); Close(); } -void X11WindowOzone::OnLostCapture() { - X11Window::OnXWindowLostCapture(); -} - -void X11WindowOzone::Close() { - if (is_shutting_down_) - return; - - is_shutting_down_ = true; - RemoveFromWindowManager(); - SetWidget(x11::None); - - X11Window::Close(); -} - -void X11WindowOzone::SetCapture() { - if (HasCapture()) - return; - - X11Window::SetCapture(); - window_manager_->GrabEvents(this); -} - -void X11WindowOzone::ReleaseCapture() { - if (!HasCapture()) - return; - - X11Window::ReleasePointerGrab(); - window_manager_->UngrabEvents(this); -} - -bool X11WindowOzone::HasCapture() const { - return window_manager_->event_grabber() == this; -} void X11WindowOzone::PrepareForShutdown() { DCHECK(X11EventSource::GetInstance()); X11EventSource::GetInstance()->RemoveXEventDispatcher(this); @@ -78,24 +39,13 @@ XWindow::SetCursor(cursor_ozone->xcursor()); } -void X11WindowOzone::OnMouseEnter() { - platform_window_delegate()->OnMouseEnter(); -} - -void X11WindowOzone::RemoveFromWindowManager() { - DCHECK(window_manager_); - if (widget_ != gfx::kNullAcceleratedWidget) { - window_manager_->RemoveWindow(this); - } -} - // CheckCanDispatchNextPlatformEvent is called by X11EventSourceLibevent to // determine whether X11WindowOzone instance (XEventDispatcher implementation) // is able to process next translated event sent by it. So, it's done through // |handle_next_event_| internal flag, used in subsequent CanDispatchEvent // call. void X11WindowOzone::CheckCanDispatchNextPlatformEvent(XEvent* xev) { - if (is_shutting_down_) + if (is_shutting_down()) return; handle_next_event_ = XWindow::IsTargetedBy(*xev); @@ -122,48 +72,6 @@ return handle_next_event_; } -uint32_t X11WindowOzone::DispatchEvent(const PlatformEvent& event) { - DCHECK_NE(XWindow::window(), x11::None); - - if (event->IsMouseEvent() && handle_next_event_) - window_manager_->MouseOnWindow(this); - - if (!window_manager_->event_grabber() || - window_manager_->event_grabber() == this) { - // This is unfortunately needed otherwise events that depend on global state - // (eg. double click) are broken. - DispatchEventFromNativeUiEvent( - event, base::BindOnce(&PlatformWindowDelegate::DispatchEvent, - base::Unretained(platform_window_delegate()))); - return POST_DISPATCH_STOP_PROPAGATION; - } - - if (event->IsLocatedEvent()) { - // Another X11WindowOzone has installed itself as capture. Translate the - // event's location and dispatch to the other. - ConvertEventLocationToTargetWindowLocation( - window_manager_->event_grabber()->GetBounds().origin(), - GetBounds().origin(), event->AsLocatedEvent()); - } - return window_manager_->event_grabber()->DispatchEvent(event); -} - -void X11WindowOzone::SetWidget(XID xid) { - // In spite of being defined in Xlib as `unsigned long`, XID (|xid|'s type) - // is fixed at 32-bits (CARD32) in X11 Protocol, therefore can't be larger - // than 32 bits values on the wire (see https://crbug.com/607014 for more - // details). So, It's safe to use static_cast here. - widget_ = static_cast<gfx::AcceleratedWidget>(xid); -} - -void X11WindowOzone::OnXWindowCreated() { - DCHECK_NE(XWindow::window(), x11::None); - SetWidget(XWindow::window()); - - window_manager_->AddWindow(this); - X11Window::OnXWindowCreated(); -} - void X11WindowOzone::SetPlatformEventDispatcher() { DCHECK(X11EventSource::GetInstance()); X11EventSource::GetInstance()->AddXEventDispatcher(this);
diff --git a/ui/ozone/platform/x11/x11_window_ozone.h b/ui/ozone/platform/x11/x11_window_ozone.h index 5c201d49..352be12 100644 --- a/ui/ozone/platform/x11/x11_window_ozone.h +++ b/ui/ozone/platform/x11/x11_window_ozone.h
@@ -20,31 +20,16 @@ namespace ui { -class X11WindowManagerOzone; -struct PlatformWindowInitProperties; - // PlatformWindow implementation for X11 Ozone. PlatformEvents are ui::Events. class X11WindowOzone : public X11Window, public XEventDispatcher { public: - X11WindowOzone(PlatformWindowDelegate* delegate, - X11WindowManagerOzone* window_manager); + explicit X11WindowOzone(PlatformWindowDelegate* delegate); ~X11WindowOzone() override; - gfx::AcceleratedWidget widget() const { return widget_; } - - // Called by |window_manager_| once capture is set to another X11WindowOzone. - void OnLostCapture(); - // Overridden from PlatformWindow: - void Close() override; void PrepareForShutdown() override; - void SetCapture() override; - void ReleaseCapture() override; - bool HasCapture() const override; void SetCursor(PlatformCursor cursor) override; - void OnMouseEnter(); - // Overridden from ui::XEventDispatcher: void CheckCanDispatchNextPlatformEvent(XEvent* xev) override; void PlatformEventDispatchFinished() override; @@ -52,25 +37,11 @@ bool DispatchXEvent(XEvent* event) override; private: - // XWindow overrides: - void OnXWindowCreated() override; - // X11Window overrides: void SetPlatformEventDispatcher() override; // PlatformEventDispatcher: bool CanDispatchEvent(const PlatformEvent& event) override; - uint32_t DispatchEvent(const PlatformEvent& event) override; - - void Init(const PlatformWindowInitProperties& params); - void SetWidget(XID xwindow); - void RemoveFromWindowManager(); - - X11WindowManagerOzone* const window_manager_; - - gfx::AcceleratedWidget widget_ = gfx::kNullAcceleratedWidget; - - bool is_shutting_down_ = false; // Tells if this dispatcher can process next translated event based on a // previous check in ::CheckCanDispatchNextPlatformEvent based on a XID
diff --git a/ui/ozone/platform/x11/x11_window_ozone_unittest.cc b/ui/ozone/platform/x11/x11_window_ozone_unittest.cc index 1a393e9..71e05ec 100644 --- a/ui/ozone/platform/x11/x11_window_ozone_unittest.cc +++ b/ui/ozone/platform/x11/x11_window_ozone_unittest.cc
@@ -10,14 +10,16 @@ #include "base/run_loop.h" #include "base/test/task_environment.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" #include "ui/events/devices/x11/touch_factory_x11.h" #include "ui/events/event.h" #include "ui/events/platform/x11/x11_event_source_default.h" #include "ui/events/test/events_test_utils_x11.h" -#include "ui/ozone/platform/x11/x11_window_manager_ozone.h" #include "ui/ozone/test/mock_platform_window_delegate.h" #include "ui/platform_window/platform_window_delegate.h" #include "ui/platform_window/platform_window_init_properties.h" +#include "ui/platform_window/x11/x11_window_manager.h" namespace ui { @@ -35,6 +37,49 @@ *event_ptr = Event::Clone(*arg0); } +// TestScreen implementation. We need to set a screen instance, because +// X11Window requires it. And as long as depending on views is a dependency +// violation, keep own implementation here. Otherwise, we could just use +// ScreenOzone, but it is impossible. +// We are not really interested in sending back real displays. Thus, default one +// is more than enough. +class TestScreen : public display::Screen { + public: + TestScreen() : displays_({}) {} + ~TestScreen() override = default; + + // display::Screen interface. + gfx::Point GetCursorScreenPoint() override { return {}; } + bool IsWindowUnderCursor(gfx::NativeWindow window) override { return false; } + gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override { + return gfx::NativeWindow(); + } + int GetNumDisplays() const override { return GetAllDisplays().size(); } + const std::vector<display::Display>& GetAllDisplays() const override { + return displays_; + } + display::Display GetDisplayNearestWindow( + gfx::NativeWindow window) const override { + return {}; + } + display::Display GetDisplayNearestPoint( + const gfx::Point& point) const override { + return {}; + } + display::Display GetDisplayMatching( + const gfx::Rect& match_rect) const override { + return {}; + } + display::Display GetPrimaryDisplay() const override { return {}; } + void AddObserver(display::DisplayObserver* observer) override {} + void RemoveObserver(display::DisplayObserver* observer) override {} + + private: + std::vector<display::Display> displays_; + + DISALLOW_COPY_AND_ASSIGN(TestScreen); +}; // namespace + } // namespace class X11WindowOzoneTest : public testing::Test { @@ -48,7 +93,8 @@ void SetUp() override { XDisplay* display = gfx::GetXDisplay(); event_source_ = std::make_unique<X11EventSourceDefault>(display); - window_manager_ = std::make_unique<X11WindowManagerOzone>(); + + display::Screen::SetScreenInstance(new TestScreen()); TouchFactory::GetInstance()->SetPointerDeviceForTest({kPointerDeviceId}); } @@ -61,8 +107,7 @@ EXPECT_CALL(*delegate, OnAcceleratedWidgetAvailable(_)) .WillOnce(StoreWidget(widget)); PlatformWindowInitProperties init_params(bounds); - auto window = - std::make_unique<X11WindowOzone>(delegate, window_manager_.get()); + auto window = std::make_unique<X11WindowOzone>(delegate); window->Initialize(std::move(init_params)); return std::move(window); } @@ -75,13 +120,14 @@ event_source_->ProcessXEvent(event); } - X11WindowManagerOzone* window_manager() const { - return window_manager_.get(); + X11WindowManager* window_manager() const { + auto* window_manager = X11WindowManager::GetInstance(); + DCHECK(window_manager); + return window_manager; } private: std::unique_ptr<base::test::TaskEnvironment> task_env_; - std::unique_ptr<X11WindowManagerOzone> window_manager_; std::unique_ptr<X11EventSourceDefault> event_source_; DISALLOW_COPY_AND_ASSIGN(X11WindowOzoneTest);
diff --git a/ui/platform_window/x11/BUILD.gn b/ui/platform_window/x11/BUILD.gn index c7f7905..52f3268 100644 --- a/ui/platform_window/x11/BUILD.gn +++ b/ui/platform_window/x11/BUILD.gn
@@ -34,5 +34,7 @@ "x11_window.cc", "x11_window.h", "x11_window_export.h", + "x11_window_manager.cc", + "x11_window_manager.h", ] }
diff --git a/ui/platform_window/x11/x11_window.cc b/ui/platform_window/x11/x11_window.cc index d3593f3..605385973 100644 --- a/ui/platform_window/x11/x11_window.cc +++ b/ui/platform_window/x11/x11_window.cc
@@ -14,6 +14,11 @@ #include "ui/events/platform/x11/x11_event_source.h" #include "ui/gfx/x/x11.h" #include "ui/platform_window/platform_window_delegate_linux.h" +#include "ui/platform_window/x11/x11_window_manager.h" + +#if defined(USE_OZONE) +#include "ui/events/ozone/events_ozone.h" +#endif namespace ui { @@ -102,6 +107,22 @@ x_event_delegate_ = delegate; } +void X11Window::OnXWindowLostCapture() { + platform_window_delegate_->OnLostCapture(); +} + +void X11Window::OnMouseEnter() { + platform_window_delegate_->OnMouseEnter(); +} + +gfx::AcceleratedWidget X11Window::GetWidget() const { + // In spite of being defined in Xlib as `unsigned long`, XID (|window()|'s + // type) is fixed at 32-bits (CARD32) in X11 Protocol, therefore can't be + // larger than 32 bits values on the wire (see https://crbug.com/607014 for + // more details). So, It's safe to use static_cast here. + return static_cast<gfx::AcceleratedWidget>(window()); +} + void X11Window::Show(bool inactive) { if (mapped_in_client()) return; @@ -117,6 +138,8 @@ if (is_shutting_down_) return; + X11WindowManager::GetInstance()->RemoveWindow(this); + is_shutting_down_ = true; XWindow::Close(); platform_window_delegate_->OnClosed(); @@ -166,16 +189,21 @@ } void X11Window::SetCapture() { - XWindow::GrabPointer(); + if (HasCapture()) + return; + X11WindowManager::GetInstance()->GrabEvents(this); + GrabPointer(); } void X11Window::ReleaseCapture() { - XWindow::ReleasePointerGrab(); + if (!HasCapture()) + return; + ReleasePointerGrab(); + X11WindowManager::GetInstance()->UngrabEvents(this); } bool X11Window::HasCapture() const { - NOTIMPLEMENTED_LOG_ONCE(); - return false; + return X11WindowManager::GetInstance()->event_grabber() == this; } void X11Window::ToggleFullscreen() { @@ -342,6 +370,7 @@ } void X11Window::StackAbove(gfx::AcceleratedWidget widget) { + // Check comment in the GetWidget method about this this cast. XWindow::StackXWindowAbove(static_cast<::Window>(widget)); } @@ -367,16 +396,17 @@ ProcessEvent(event); return POST_DISPATCH_STOP_PROPAGATION; #else - NOTREACHED() << "Ozone must use own dispatcher as it has different type of " - "PlatformEvent"; - return false; + OnXWindowEvent(event); + return POST_DISPATCH_STOP_PROPAGATION; #endif } void X11Window::OnXWindowCreated() { + X11WindowManager::GetInstance()->AddWindow(this); + // X11WindowOzone overrides this method and manages events by itself. SetPlatformEventDispatcher(); - platform_window_delegate_->OnAcceleratedWidgetAvailable(window()); + platform_window_delegate_->OnAcceleratedWidgetAvailable(GetWidget()); } void X11Window::OnXWindowStateChanged() { @@ -430,12 +460,40 @@ platform_window_delegate_->OnLostMouseGrab(); } -void X11Window::OnXWindowLostCapture() { - platform_window_delegate_->OnLostCapture(); -} - void X11Window::OnXWindowEvent(ui::Event* event) { - platform_window_delegate_->DispatchEvent(event); + DCHECK_NE(window(), x11::None); + + auto* window_manager = X11WindowManager::GetInstance(); + DCHECK(window_manager); + + // If another X11PlatformWindow has capture == set self as the event grabber, + // the |event| must be rerouted to that grabber. Otherwise, just send the + // event. + auto* event_grabber = window_manager->event_grabber(); + if (!event_grabber || event_grabber == this) { + if (event->IsMouseEvent()) + window_manager->MouseOnWindow(this); +#if defined(USE_OZONE) + DispatchEventFromNativeUiEvent( + event, base::BindOnce(&PlatformWindowDelegate::DispatchEvent, + base::Unretained(platform_window_delegate()))); +#else + platform_window_delegate_->DispatchEvent(event); +#endif + return; + } + + DCHECK(event_grabber); + + if (event->IsMouseEvent() || + (event->IsTouchEvent() && event->type() == ui::ET_TOUCH_PRESSED)) { + // Another X11PlatformWindow has installed itself as capture. Translate the + // event's location and dispatch to the other. + ConvertEventLocationToTargetLocation(event_grabber->GetBounds(), + GetBounds(), event->AsLocatedEvent()); + } + + event_grabber->OnXWindowEvent(event); } void X11Window::OnXWindowSelectionEvent(XEvent* xev) { @@ -498,4 +556,24 @@ #endif } +void X11Window::ConvertEventLocationToTargetLocation( + const gfx::Rect& target_window_bounds, + const gfx::Rect& current_window_bounds, + ui::LocatedEvent* located_event) { + // TODO(msisov): for ozone, we need to access PlatformScreen instead and get + // the displays. + auto* display = display::Screen::GetScreen(); + DCHECK(display); + auto display_window_target = + display->GetDisplayMatching(target_window_bounds); + auto display_window_current = + display->GetDisplayMatching(current_window_bounds); + DCHECK_EQ(display_window_target.device_scale_factor(), + display_window_current.device_scale_factor()); + + ConvertEventLocationToTargetWindowLocation(target_window_bounds.origin(), + current_window_bounds.origin(), + located_event); +} + } // namespace ui
diff --git a/ui/platform_window/x11/x11_window.h b/ui/platform_window/x11/x11_window.h index 8f62267..75a3c56 100644 --- a/ui/platform_window/x11/x11_window.h +++ b/ui/platform_window/x11/x11_window.h
@@ -15,6 +15,8 @@ namespace ui { +class LocatedEvent; + // Delegate interface used to communicate the X11PlatformWindow API client about // XEvents of interest. class X11_WINDOW_EXPORT XEventDelegate { @@ -45,6 +47,14 @@ void SetXEventDelegate(XEventDelegate* delegate); + // X11WindowManager calls this. + // XWindow override: + void OnXWindowLostCapture() override; + + void OnMouseEnter(); + + gfx::AcceleratedWidget GetWidget() const; + // PlatformWindow: void Show(bool inactive) override; void Hide() override; @@ -83,9 +93,10 @@ return platform_window_delegate_; } + bool is_shutting_down() const { return is_shutting_down_; } + // XWindow: void OnXWindowCreated() override; - void OnXWindowLostCapture() override; private: void ProcessXInput2Event(XEvent* xev); @@ -124,6 +135,13 @@ // fullscreen. gfx::Size AdjustSizeForDisplay(const gfx::Size& requested_size_in_pixels); + // Converts the location of the |located_event| from the + // |current_window_bounds| to the |target_window_bounds|. + void ConvertEventLocationToTargetLocation( + const gfx::Rect& target_window_bounds, + const gfx::Rect& current_window_bounds, + ui::LocatedEvent* located_event); + // Stores current state of this window. PlatformWindowState state_ = PlatformWindowState::kUnknown;
diff --git a/ui/platform_window/x11/x11_window_manager.cc b/ui/platform_window/x11/x11_window_manager.cc new file mode 100644 index 0000000..3374bf3f --- /dev/null +++ b/ui/platform_window/x11/x11_window_manager.cc
@@ -0,0 +1,99 @@ +// Copyright 2019 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 "ui/platform_window/x11/x11_window_manager.h" + +#include "base/stl_util.h" +#include "ui/platform_window/x11/x11_window.h" + +namespace ui { + +namespace { + +X11WindowManager* g_instance = nullptr; + +} // namespace + +X11WindowManager::X11WindowManager() { + DCHECK(!g_instance) << "There should only be a single X11WindowManager"; + g_instance = this; +} + +X11WindowManager::~X11WindowManager() = default; + +// static +X11WindowManager* X11WindowManager::GetInstance() { + if (!g_instance) { + auto manager = std::make_unique<X11WindowManager>(); + X11WindowManager* manager_ptr = manager.release(); + DCHECK_EQ(g_instance, manager_ptr); + } + return g_instance; +} + +void X11WindowManager::GrabEvents(X11Window* window) { + DCHECK_NE(event_grabber_, window); + + // Grabbing the mouse is asynchronous. However, we synchronously start + // forwarding all mouse events received by Chrome to the + // aura::WindowEventDispatcher which has capture. This makes capture + // synchronous for all intents and purposes if either: + // - |event_grabber_| is set to have capture. + // OR + // - The topmost window underneath the mouse is managed by Chrome. + auto* old_grabber = event_grabber_; + + // Update |event_grabber_| prior to calling OnXWindowLostCapture() to + // avoid releasing pointer grab. + event_grabber_ = window; + if (old_grabber) + old_grabber->OnXWindowLostCapture(); + + // the X11Window calls GrabPointer by itself. +} + +void X11WindowManager::UngrabEvents(X11Window* window) { + DCHECK_EQ(event_grabber_, window); + // Release mouse grab asynchronously. A window managed by Chrome is likely + // the topmost window underneath the mouse so the capture release being + // asynchronous is likely inconsequential. + auto* old_grabber = event_grabber_; + event_grabber_ = nullptr; + old_grabber->OnXWindowLostCapture(); +} + +void X11WindowManager::AddWindow(X11Window* window) { + DCHECK(window); + auto widget = window->GetWidget(); + DCHECK_NE(gfx::kNullAcceleratedWidget, widget); + DCHECK(!base::Contains(windows_, widget)); + windows_.emplace(widget, window); +} + +void X11WindowManager::RemoveWindow(X11Window* window) { + DCHECK(window); + auto widget = window->GetWidget(); + DCHECK_NE(gfx::kNullAcceleratedWidget, widget); + auto it = windows_.find(widget); + DCHECK(it != windows_.end()); + if (window_mouse_currently_on_ == it->second) + window_mouse_currently_on_ = nullptr; + windows_.erase(it); +} + +X11Window* X11WindowManager::GetWindow(gfx::AcceleratedWidget widget) const { + DCHECK_NE(gfx::kNullAcceleratedWidget, widget); + auto it = windows_.find(widget); + return it != windows_.end() ? it->second : nullptr; +} + +void X11WindowManager::MouseOnWindow(X11Window* window) { + if (window_mouse_currently_on_ == window) + return; + + window_mouse_currently_on_ = window; + window->OnMouseEnter(); +} + +} // namespace ui
diff --git a/ui/platform_window/x11/x11_window_manager.h b/ui/platform_window/x11/x11_window_manager.h new file mode 100644 index 0000000..44eddef --- /dev/null +++ b/ui/platform_window/x11/x11_window_manager.h
@@ -0,0 +1,58 @@ +// Copyright 2019 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 UI_PLATFORM_WINDOW_X11_X11_WINDOW_MANAGER_H_ +#define UI_PLATFORM_WINDOW_X11_X11_WINDOW_MANAGER_H_ + +#include "base/containers/flat_map.h" +#include "base/macros.h" +#include "ui/gfx/native_widget_types.h" +#include "ui/platform_window/x11/x11_window_export.h" + +namespace ui { + +class X11Window; + +class X11_WINDOW_EXPORT X11WindowManager { + public: + X11WindowManager(); + ~X11WindowManager(); + + // Returns instance of X11WindowManager. + static X11WindowManager* GetInstance(); + + // Sets a given X11Window as the recipient for events and calls + // OnLostCapture for another |event_grabber_| if it has been set previously. + void GrabEvents(X11Window* window); + + // Unsets a given X11Window as the recipient for events and calls + // OnLostCapture. + void UngrabEvents(X11Window* window); + + // Gets the current X11PlatformWindow recipient of mouse events. + X11Window* event_grabber() const { return event_grabber_; } + + // Gets the window corresponding to the AcceleratedWidget |widget|. + void AddWindow(X11Window* window); + void RemoveWindow(X11Window* window); + X11Window* GetWindow(gfx::AcceleratedWidget widget) const; + + void MouseOnWindow(X11Window* delegate); + + const X11Window* window_mouse_currently_on_for_test() const { + return window_mouse_currently_on_; + } + + private: + X11Window* event_grabber_ = nullptr; + X11Window* window_mouse_currently_on_ = nullptr; + + base::flat_map<gfx::AcceleratedWidget, X11Window*> windows_; + + DISALLOW_COPY_AND_ASSIGN(X11WindowManager); +}; + +} // namespace ui + +#endif // UI_PLATFORM_WINDOW_X11_X11_WINDOW_MANAGER_H_
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc index d5799a1..b1bdae3 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc
@@ -4,8 +4,11 @@ #include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h" +#include "ui/aura/window.h" +#include "ui/aura/window_delegate.h" #include "ui/display/display.h" #include "ui/display/screen.h" +#include "ui/events/event.h" #include "ui/platform_window/platform_window_handler/wm_move_resize_handler.h" #include "ui/platform_window/platform_window_init_properties.h" #include "ui/views/linux_ui/linux_ui.h" @@ -98,6 +101,50 @@ } } +void DesktopWindowTreeHostLinux::DispatchEvent(ui::Event* event) { + // The input can be disabled and the widget marked as non-active in case of + // opened file-dialogs. + if (event->IsKeyEvent() && !native_widget_delegate()->AsWidget()->IsActive()) + return; + + // In Windows, the native events sent to chrome are separated into client + // and non-client versions of events, which we record on our LocatedEvent + // structures. On X11/Wayland, we emulate the concept of non-client. Before we + // pass this event to the cross platform event handling framework, we need to + // make sure it is appropriately marked as non-client if it's in the non + // client area, or otherwise, we can get into a state where the a window is + // set as the |mouse_pressed_handler_| in window_event_dispatcher.cc + // despite the mouse button being released. + // + // We can't do this later in the dispatch process because we share that + // with ash, and ash gets confused about event IS_NON_CLIENT-ness on + // events, since ash doesn't expect this bit to be set, because it's never + // been set before. (This works on ash on Windows because none of the mouse + // events on the ash desktop are clicking in what Windows considers to be a + // non client area.) Likewise, we won't want to do the following in any + // WindowTreeHost that hosts ash. + if (event->IsMouseEvent()) { + ui::MouseEvent* mouse_event = event->AsMouseEvent(); + if (content_window() && content_window()->delegate()) { + int flags = mouse_event->flags(); + gfx::Point location_in_dip = mouse_event->location(); + GetRootTransform().TransformPointReverse(&location_in_dip); + int hit_test_code = + content_window()->delegate()->GetNonClientComponent(location_in_dip); + if (hit_test_code != HTCLIENT && hit_test_code != HTNOWHERE) + flags |= ui::EF_IS_NON_CLIENT; + mouse_event->set_flags(flags); + } + + // While we unset the urgency hint when we gain focus, we also must remove + // it on mouse clicks because we can call FlashFrame() on an active window. + if (mouse_event->IsAnyButton() || mouse_event->IsMouseWheelEvent()) + FlashFrame(false); + } + + WindowTreeHostPlatform::DispatchEvent(event); +} + void DesktopWindowTreeHostLinux::OnClosed() { RemoveNonClientEventFilter(); DesktopWindowTreeHostPlatform::OnClosed();
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h index 69e3d36..baebbf63 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h
@@ -31,6 +31,7 @@ void OnNativeWidgetCreated(const Widget::InitParams& params) override; // PlatformWindowDelegateBase: + void DispatchEvent(ui::Event* event) override; void OnClosed() override; // DesktopWindowTreeHostPlatform:
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc index 486e49e..9191a54 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -70,7 +70,6 @@ namespace views { -DesktopWindowTreeHostX11* DesktopWindowTreeHostX11::g_current_capture = nullptr; std::list<XID>* DesktopWindowTreeHostX11::open_windows_ = nullptr; DEFINE_UI_CLASS_PROPERTY_KEY(aura::Window*, kViewsWindowForRootWindow, NULL) @@ -241,10 +240,6 @@ return GetXWindow()->IsActive(); } -bool DesktopWindowTreeHostX11::HasCapture() const { - return g_current_capture == this; -} - void DesktopWindowTreeHostX11::SetVisibleOnAllWorkspaces(bool always_visible) { GetXWindow()->SetVisibleOnAllWorkspaces(always_visible); } @@ -353,43 +348,6 @@ } //////////////////////////////////////////////////////////////////////////////// -// DesktopWindowTreeHostX11, aura::WindowTreeHost implementatio - -void DesktopWindowTreeHostX11::SetCapture() { - if (HasCapture()) - return; - - // Grabbing the mouse is asynchronous. However, we synchronously start - // forwarding all mouse events received by Chrome to the - // aura::WindowEventDispatcher which has capture. This makes capture - // synchronous for all intents and purposes if either: - // - |g_current_capture|'s X window has capture. - // OR - // - The topmost window underneath the mouse is managed by Chrome. - DesktopWindowTreeHostX11* old_capturer = g_current_capture; - - // Update |g_current_capture| prior to calling OnHostLostWindowCapture() to - // avoid releasing pointer grab. - g_current_capture = this; - if (old_capturer) - old_capturer->OnHostLostWindowCapture(); - - GetXWindow()->GrabPointer(); -} - -void DesktopWindowTreeHostX11::ReleaseCapture() { - if (g_current_capture == this) { - // Release mouse grab asynchronously. A window managed by Chrome is likely - // the topmost window underneath the mouse so the capture release being - // asynchronous is likely inconsequential. - g_current_capture = nullptr; - GetXWindow()->ReleasePointerGrab(); - - OnHostLostWindowCapture(); - } -} - -//////////////////////////////////////////////////////////////////////////////// // DesktopWindowTreeHostX11, private: void DesktopWindowTreeHostX11::SetUseNativeFrame(bool use_native_frame) { @@ -397,72 +355,6 @@ ResetWindowRegion(); } -void DesktopWindowTreeHostX11::DispatchMouseEvent(ui::MouseEvent* event) { - // In Windows, the native events sent to chrome are separated into client - // and non-client versions of events, which we record on our LocatedEvent - // structures. On X11, we emulate the concept of non-client. Before we pass - // this event to the cross platform event handling framework, we need to - // make sure it is appropriately marked as non-client if it's in the non - // client area, or otherwise, we can get into a state where the a window is - // set as the |mouse_pressed_handler_| in window_event_dispatcher.cc - // despite the mouse button being released. - // - // We can't do this later in the dispatch process because we share that - // with ash, and ash gets confused about event IS_NON_CLIENT-ness on - // events, since ash doesn't expect this bit to be set, because it's never - // been set before. (This works on ash on Windows because none of the mouse - // events on the ash desktop are clicking in what Windows considers to be a - // non client area.) Likewise, we won't want to do the following in any - // WindowTreeHost that hosts ash. - if (content_window() && content_window()->delegate()) { - int flags = event->flags(); - gfx::Point location_in_dip = event->location(); - GetRootTransform().TransformPointReverse(&location_in_dip); - int hit_test_code = - content_window()->delegate()->GetNonClientComponent(location_in_dip); - if (hit_test_code != HTCLIENT && hit_test_code != HTNOWHERE) - flags |= ui::EF_IS_NON_CLIENT; - event->set_flags(flags); - } - - // While we unset the urgency hint when we gain focus, we also must remove it - // on mouse clicks because we can call FlashFrame() on an active window. - if (event->IsAnyButton() || event->IsMouseWheelEvent()) - FlashFrame(false); - - if (!g_current_capture || g_current_capture == this) { - SendEventToSink(event); - } else { - // Another DesktopWindowTreeHostX11 has installed itself as - // capture. Translate the event's location and dispatch to the other. - DCHECK_EQ(ui::GetScaleFactorForNativeView(window()), - ui::GetScaleFactorForNativeView(g_current_capture->window())); - ConvertEventLocationToTargetWindowLocation( - g_current_capture->GetLocationOnScreenInPixels(), - GetLocationOnScreenInPixels(), event->AsLocatedEvent()); - g_current_capture->SendEventToSink(event); - } -} - -void DesktopWindowTreeHostX11::DispatchTouchEvent(ui::TouchEvent* event) { - if (g_current_capture && g_current_capture != this && - event->type() == ui::ET_TOUCH_PRESSED) { - DCHECK_EQ(ui::GetScaleFactorForNativeView(window()), - ui::GetScaleFactorForNativeView(g_current_capture->window())); - ConvertEventLocationToTargetWindowLocation( - g_current_capture->GetLocationOnScreenInPixels(), - GetLocationOnScreenInPixels(), event->AsLocatedEvent()); - g_current_capture->SendEventToSink(event); - } else { - SendEventToSink(event); - } -} - -void DesktopWindowTreeHostX11::DispatchKeyEvent(ui::KeyEvent* event) { - if (native_widget_delegate()->AsWidget()->IsActive()) - SendEventToSink(event); -} - void DesktopWindowTreeHostX11::ResetWindowRegion() { _XRegion* xregion = nullptr; if (!GetXWindow()->use_custom_shape() && !IsMaximized() && !IsFullscreen()) { @@ -535,17 +427,6 @@ WindowTreeHostPlatform::OnBoundsChanged(new_bounds); } -void DesktopWindowTreeHostX11::DispatchEvent(ui::Event* event) { - if (event->IsKeyEvent()) - DispatchKeyEvent(event->AsKeyEvent()); - else if (event->IsMouseEvent()) - DispatchMouseEvent(event->AsMouseEvent()); - else if (event->IsTouchEvent()) - DispatchTouchEvent(event->AsTouchEvent()); - else - SendEventToSink(event); -} - void DesktopWindowTreeHostX11::OnClosed() { open_windows().remove(GetAcceleratedWidget()); DesktopWindowTreeHostLinux::OnClosed(); @@ -626,7 +507,7 @@ case KeyPress: if (!ShouldDiscardKeyEvent(xev)) { ui::KeyEvent keydown_event(xev); - DispatchKeyEvent(&keydown_event); + DesktopWindowTreeHostLinux::DispatchEvent(&keydown_event); } break; case KeyRelease: @@ -638,7 +519,7 @@ if (!ShouldDiscardKeyEvent(xev)) { ui::KeyEvent keyup_event(xev); - DispatchKeyEvent(&keyup_event); + DesktopWindowTreeHostLinux::DispatchEvent(&keyup_event); } break; default:
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h index bef3c94..943f116d 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
@@ -33,9 +33,6 @@ namespace ui { enum class DomCode; -class KeyEvent; -class MouseEvent; -class TouchEvent; class X11Window; } // namespace ui @@ -97,7 +94,6 @@ std::string GetWorkspace() const override; void SetShape(std::unique_ptr<Widget::ShapeRects> native_shape) override; bool IsActive() const override; - bool HasCapture() const override; void SetVisibleOnAllWorkspaces(bool always_visible) override; bool IsVisibleOnAllWorkspaces() const override; Widget::MoveLoopResult RunMoveLoop( @@ -120,36 +116,18 @@ bool ShouldUseDesktopNativeCursorManager() const override; bool ShouldCreateVisibilityController() const override; - // Overridden from aura::WindowTreeHost: - void SetCapture() override; - void ReleaseCapture() override; - private: friend class DesktopWindowTreeHostX11HighDPITest; // Sets whether the window's borders are provided by the window manager. void SetUseNativeFrame(bool use_native_frame); - // Dispatches a mouse event, taking mouse capture into account. If a - // different host has capture, we translate the event to its coordinate space - // and dispatch it to that host instead. - void DispatchMouseEvent(ui::MouseEvent* event); - - // Dispatches a touch event, taking capture into account. If a different host - // has capture, then touch-press events are translated to its coordinate space - // and dispatched to that host instead. - void DispatchTouchEvent(ui::TouchEvent* event); - - // Dispatches a key event. - void DispatchKeyEvent(ui::KeyEvent* event); - // Resets the window region for the current widget bounds if necessary. void ResetWindowRegion(); // See comment for variable open_windows_. static std::list<XID>& open_windows(); - void DelayedChangeFrameType(Widget::FrameType new_type); // Enables event listening after closing |dialog|. @@ -164,7 +142,6 @@ // underlying DWTHPlatform and WTHPlatform. Eventually, these will be removed // from here as we progress in https://crbug.com/990756. void OnBoundsChanged(const gfx::Rect& new_bounds) override; - void DispatchEvent(ui::Event* event) override; void OnClosed() override; void OnWindowStateChanged(ui::PlatformWindowState new_state) override; void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) override; @@ -194,10 +171,6 @@ base::ObserverList<DesktopWindowTreeHostObserverX11>::Unchecked observer_list_; - // The current DesktopWindowTreeHostX11 which has capture. Set synchronously - // when capture is requested via SetCapture(). - static DesktopWindowTreeHostX11* g_current_capture; - // A list of all (top-level) windows that have been created but not yet // destroyed. static std::list<gfx::AcceleratedWidget>* open_windows_;
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc index 543ff68..f82417b 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
@@ -527,12 +527,6 @@ ~DesktopWindowTreeHostX11HighDPITest() override = default; void PretendCapture(views::Widget* capture_widget) { - DesktopWindowTreeHostX11* capture_host = nullptr; - if (capture_widget) { - capture_host = static_cast<DesktopWindowTreeHostX11*>( - capture_widget->GetNativeWindow()->GetHost()); - } - DesktopWindowTreeHostX11::g_current_capture = capture_host; if (capture_widget) capture_widget->GetNativeWindow()->SetCapture(); }
diff --git a/ui/views_content_client/views_content_client.h b/ui/views_content_client/views_content_client.h index e5799f23..78971231 100644 --- a/ui/views_content_client/views_content_client.h +++ b/ui/views_content_client/views_content_client.h
@@ -40,7 +40,8 @@ // ui::ViewsContentClient params(argc, argv); // #endif // -// params.set_task(base::Bind(&InitMyApp)); +// params.set_on_pre_main_message_loop_run_callback( +// base::BindOnce(&InitMyApp)); // return params.RunMain(); // } class VIEWS_CONTENT_CLIENT_EXPORT ViewsContentClient {