diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/content/public/common | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/content/public/common')
30 files changed, 410 insertions, 253 deletions
diff --git a/chromium/content/public/common/BUILD.gn b/chromium/content/public/common/BUILD.gn index 47b93531c4b..a85f429a0d1 100644 --- a/chromium/content/public/common/BUILD.gn +++ b/chromium/content/public/common/BUILD.gn @@ -7,6 +7,7 @@ import("//build/config/chromecast_build.gni") import("//build/config/features.gni") import("//build/config/jumbo.gni") import("//build/config/ui.gni") +import("//content/public/common/zygote/features.gni") import("//media/media_options.gni") import("//mojo/public/tools/bindings/mojom.gni") import("//ppapi/buildflags/buildflags.gni") @@ -202,6 +203,7 @@ jumbo_source_set("common_sources") { ":renderer_type", ":service_names", "//content/common", + "//content/public/common/zygote:buildflags", "//ipc", "//media/capture:capture_base", "//mojo/public/cpp/bindings", @@ -232,14 +234,13 @@ jumbo_source_set("common_sources") { "//services/network/public/cpp", "//services/service_manager/embedder:embedder_result_codes", "//services/service_manager/public/cpp", - "//services/service_manager/zygote:zygote_buildflags", "//skia", "//storage/common", "//third_party/blink/public/common", "//third_party/icu", "//ui/accessibility", "//ui/base", - "//ui/base/cursor", + "//ui/base/cursor:cursor_base", "//ui/gfx", "//ui/gfx/ipc", "//ui/gfx/ipc/color", @@ -255,12 +256,20 @@ jumbo_source_set("common_sources") { deps += [ "//content/public/android:jni" ] } + if (is_chromeos) { + public_deps += [ "//media/capture/video/chromeos/public" ] + } + if (is_linux) { - deps += [ "//services/service_manager/zygote" ] + sources += [ + "zygote/sandbox_support_linux.h", + "zygote/send_zygote_child_ping_linux.h", + "zygote/zygote_fork_delegate_linux.h", + ] } - if (is_chromeos) { - public_deps += [ "//media/capture/video/chromeos/public" ] + if (use_zygote_handle) { + sources += [ "zygote/zygote_handle.h" ] } if (rtc_use_pipewire) { @@ -305,6 +314,7 @@ mojom("interfaces") { "browser_controls_state.mojom", "drop_data.mojom", "fullscreen_video_element.mojom", + "performance_manager/v8_per_frame_memory.mojom", "resource_usage_reporter.mojom", "transferrable_url_loader.mojom", "was_activated_option.mojom", diff --git a/chromium/content/public/common/DEPS b/chromium/content/public/common/DEPS index 93053069e40..91e7360dbb7 100644 --- a/chromium/content/public/common/DEPS +++ b/chromium/content/public/common/DEPS @@ -9,7 +9,7 @@ specific_include_rules = { "+content/common", ], "simple_url_loader\.cc": [ - "-content/", + "-content", "+content/public/common/simple_url_loader\.h", "+content/public/common/resource_request\.h", "+content/public/common/resource_response\.h", diff --git a/chromium/content/public/common/common_param_traits_macros.h b/chromium/content/public/common/common_param_traits_macros.h index c7a871602f5..d67aa115c4e 100644 --- a/chromium/content/public/common/common_param_traits_macros.h +++ b/chromium/content/public/common/common_param_traits_macros.h @@ -17,12 +17,12 @@ #include "ipc/ipc_message_macros.h" #include "services/network/public/cpp/network_ipc_param_traits.h" #include "services/network/public/mojom/referrer_policy.mojom.h" +#include "third_party/blink/public/common/page/web_drag_operation.h" #include "third_party/blink/public/common/security/security_style.h" #include "third_party/blink/public/mojom/devtools/console_message.mojom.h" #include "third_party/blink/public/mojom/permissions/permission_status.mojom.h" #include "third_party/blink/public/mojom/renderer_preferences.mojom.h" #include "third_party/blink/public/mojom/window_features/window_features.mojom.h" -#include "third_party/blink/public/platform/web_drag_operation.h" #include "third_party/blink/public/platform/web_history_scroll_restoration_type.h" #include "third_party/blink/public/platform/web_rect.h" #include "third_party/blink/public/platform/web_url_request.h" @@ -77,7 +77,7 @@ IPC_ENUM_TRAITS_MIN_MAX_VALUE( content::AutoplayPolicy::kNoUserGestureRequired, content::AutoplayPolicy::kDocumentUserActivationRequired) IPC_ENUM_TRAITS_MIN_MAX_VALUE(blink::PreferredColorScheme, - blink::PreferredColorScheme::kNoPreference, + blink::PreferredColorScheme::kDark, blink::PreferredColorScheme::kMaxValue) IPC_STRUCT_TRAITS_BEGIN(blink::WebRect) @@ -142,7 +142,6 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) IPC_STRUCT_TRAITS_MEMBER(new_canvas_2d_api_enabled) IPC_STRUCT_TRAITS_MEMBER(antialiased_2d_canvas_disabled) IPC_STRUCT_TRAITS_MEMBER(antialiased_clips_2d_canvas_enabled) - IPC_STRUCT_TRAITS_MEMBER(accelerated_2d_canvas_msaa_sample_count) IPC_STRUCT_TRAITS_MEMBER(accelerated_filters_enabled) IPC_STRUCT_TRAITS_MEMBER(deferred_filters_enabled) IPC_STRUCT_TRAITS_MEMBER(container_culling_enabled) @@ -166,7 +165,6 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) IPC_STRUCT_TRAITS_MEMBER(primary_hover_type) IPC_STRUCT_TRAITS_MEMBER(barrel_button_for_drag_enabled) IPC_STRUCT_TRAITS_MEMBER(sync_xhr_in_documents_enabled) - IPC_STRUCT_TRAITS_MEMBER(should_respect_image_orientation) IPC_STRUCT_TRAITS_MEMBER(number_of_cpu_cores) IPC_STRUCT_TRAITS_MEMBER(editing_behavior) IPC_STRUCT_TRAITS_MEMBER(supports_multiple_windows) @@ -244,7 +242,6 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) IPC_STRUCT_TRAITS_MEMBER(picture_in_picture_enabled) IPC_STRUCT_TRAITS_MEMBER(translate_service_available) IPC_STRUCT_TRAITS_MEMBER(network_quality_estimator_web_holdback) - IPC_STRUCT_TRAITS_MEMBER(lazy_load_enabled) IPC_STRUCT_TRAITS_MEMBER(lazy_frame_loading_distance_thresholds_px) IPC_STRUCT_TRAITS_MEMBER(lazy_image_loading_distance_thresholds_px) IPC_STRUCT_TRAITS_MEMBER(lazy_image_first_k_fully_load) diff --git a/chromium/content/public/common/content_features.cc b/chromium/content/public/common/content_features.cc index cbe291d39b8..87b1ee17b48 100644 --- a/chromium/content/public/common/content_features.cc +++ b/chromium/content/public/common/content_features.cc @@ -110,11 +110,6 @@ const base::Feature kCacheStorageParallelOps{"CacheStorageParallelOps", const base::Feature kCacheStorageEagerReading{ "CacheStorageEagerReading", base::FEATURE_DISABLED_BY_DEFAULT}; -// Enables scheduling the operation at high priority when a cache.match() is -// initiated from a FetchEvent handler with a matching request URL. -const base::Feature kCacheStorageHighPriorityMatch{ - "CacheStorageHighPriorityMatch", base::FEATURE_ENABLED_BY_DEFAULT}; - // If Canvas2D Image Chromium is allowed, this feature controls whether it is // enabled. const base::Feature kCanvas2DImageChromium { @@ -130,6 +125,9 @@ const base::Feature kCanvas2DImageChromium { const base::Feature kCanvasOopRasterization{"CanvasOopRasterization", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kClickPointerEvent{"ClickPointerEvent", + base::FEATURE_DISABLED_BY_DEFAULT}; + // When enabled, code cache does not use a browsing_data filter for deletions. extern const base::Feature kCodeCacheDeletionWithoutFilter{ "CodeCacheDeletionWithoutFilter", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -265,21 +263,13 @@ const base::Feature kHistoryPreventSandboxedNavigation{ const base::Feature kIdleDetection{"IdleDetection", base::FEATURE_ENABLED_BY_DEFAULT}; -// This flag is used to set field parameters to choose predictor we use when -// kResamplingInputEvents is disabled. It's used for gatherig accuracy metrics -// on finch and also for choosing predictor type for predictedEvents API without -// enabling resampling. It does not have any effect when the resampling flag is -// enabled. -const base::Feature kInputPredictorTypeChoice{ - "InputPredictorTypeChoice", base::FEATURE_DISABLED_BY_DEFAULT}; - // Kill switch for the GetInstalledRelatedApps API. const base::Feature kInstalledApp{"InstalledApp", base::FEATURE_ENABLED_BY_DEFAULT}; // Allow Windows specific implementation for the GetInstalledRelatedApps API. const base::Feature kInstalledAppProvider{"InstalledAppProvider", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; // Show warning about clearing data from installed apps in the clear browsing // data flow. The warning will be shown in a second dialog. @@ -324,8 +314,14 @@ const base::Feature kLazyInitializeMediaControls{ const base::Feature kLegacyWindowsDWriteFontFallback{ "LegacyWindowsDWriteFontFallback", base::FEATURE_DISABLED_BY_DEFAULT}; -const base::Feature kLogJsConsoleMessages{"LogJsConsoleMessages", - base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kLogJsConsoleMessages { + "LogJsConsoleMessages", +#if defined(OS_ANDROID) + base::FEATURE_DISABLED_BY_DEFAULT +#else + base::FEATURE_ENABLED_BY_DEFAULT +#endif +}; // Enables lowering the priority of the resources in iframes. const base::Feature kLowPriorityIframes{"LowPriorityIframes", @@ -404,10 +400,6 @@ const base::Feature kOverscrollHistoryNavigation { #endif }; -// Whether ParkableStrings in blink can be written out to disk. -const base::Feature kParkableStringsToDisk{"ParkableStringsToDisk", - base::FEATURE_DISABLED_BY_DEFAULT}; - // Whether web apps can run periodic tasks upon network connectivity. const base::Feature kPeriodicBackgroundSync{"PeriodicBackgroundSync", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -506,9 +498,10 @@ const base::Feature kRenderDocument{"RenderDocument", const base::Feature kRequestUnbufferedDispatch{ "RequestUnbufferedDispatch", base::FEATURE_ENABLED_BY_DEFAULT}; -// Enables resampling input events on main thread. -const base::Feature kResamplingInputEvents{"ResamplingInputEvents", - base::FEATURE_DISABLED_BY_DEFAULT}; +// Respect the MacOS system setting for subpixel text anti-aliasing. +// https://crbug.com/1079418. +const base::Feature kRespectMacLCDTextSetting{ + "RespectMacLCDTextSetting", base::FEATURE_DISABLED_BY_DEFAULT}; // Run video capture service in the Browser process as opposed to a dedicated // utility process @@ -609,9 +602,19 @@ const base::Feature kSiteIsolationEnforcementForFileSystemApi{ const base::Feature kSpareRendererForSitePerProcess{ "SpareRendererForSitePerProcess", base::FEATURE_ENABLED_BY_DEFAULT}; +// Enables Storage Pressure Event. +const base::Feature kStoragePressureEvent{"StoragePressureEvent", + base::FEATURE_DISABLED_BY_DEFAULT}; + // Enables Storage Pressure notifications and settings pages. -const base::Feature kStoragePressureUI{"StoragePressureUI", - base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kStoragePressureUI { + "StoragePressureUI", +#if defined(OS_ANDROID) + base::FEATURE_DISABLED_BY_DEFAULT +#else + base::FEATURE_ENABLED_BY_DEFAULT +#endif +}; // Enables the out-of-process Storage Service. const base::Feature kStorageServiceOutOfProcess{ @@ -627,6 +630,10 @@ const base::Feature kStorageServiceSandbox{"StorageServiceSandbox", const base::Feature kStrictOriginIsolation{"StrictOriginIsolation", base::FEATURE_DISABLED_BY_DEFAULT}; +// Enables subresource loading with Web Bundles. +const base::Feature kSubresourceWebBundles{"SubresourceWebBundles", + base::FEATURE_DISABLED_BY_DEFAULT}; + // Dispatch touch events to "SyntheticGestureController" for events from // Devtool Protocol Input.dispatchTouchEvent to simulate touch events close to // real OS events. @@ -687,23 +694,13 @@ const base::Feature kUserAgentClientHint{"UserAgentClientHint", const base::Feature kVideoPlaybackQuality{"VideoPlaybackQuality", base::FEATURE_ENABLED_BY_DEFAULT}; -// Enables V8's low memory mode for subframes. This is used only -// in conjunction with the --site-per-process feature. -const base::Feature kV8LowMemoryModeForSubframes{ - "V8LowMemoryModeForSubframes", base::FEATURE_DISABLED_BY_DEFAULT}; - // Enables future V8 VM features const base::Feature kV8VmFuture{"V8VmFuture", base::FEATURE_DISABLED_BY_DEFAULT}; -// Enable WebAssembly baseline compilation and tier up. +// Enable WebAssembly baseline compilation (Liftoff). const base::Feature kWebAssemblyBaseline{"WebAssemblyBaseline", -#ifdef ARCH_CPU_X86_FAMILY - base::FEATURE_ENABLED_BY_DEFAULT -#else - base::FEATURE_DISABLED_BY_DEFAULT -#endif -}; + base::FEATURE_ENABLED_BY_DEFAULT}; // Enable WebAssembly lazy compilation (JIT on first call). const base::Feature kWebAssemblyLazyCompilation{ diff --git a/chromium/content/public/common/content_features.h b/chromium/content/public/common/content_features.h index 93139ce799c..5f69a8fb406 100644 --- a/chromium/content/public/common/content_features.h +++ b/chromium/content/public/common/content_features.h @@ -35,9 +35,9 @@ CONTENT_EXPORT extern const base::Feature kBrowserVerifiedUserActivationMouse; CONTENT_EXPORT extern const base::Feature kCacheInlineScriptCode; CONTENT_EXPORT extern const base::Feature kCacheStorageParallelOps; CONTENT_EXPORT extern const base::Feature kCacheStorageEagerReading; -CONTENT_EXPORT extern const base::Feature kCacheStorageHighPriorityMatch; CONTENT_EXPORT extern const base::Feature kCanvas2DImageChromium; CONTENT_EXPORT extern const base::Feature kCanvasOopRasterization; +CONTENT_EXPORT extern const base::Feature kClickPointerEvent; CONTENT_EXPORT extern const base::Feature kCodeCacheDeletionWithoutFilter; CONTENT_EXPORT extern const base::Feature kConsolidatedMovementXY; CONTENT_EXPORT extern const base::Feature kConversionMeasurement; @@ -66,7 +66,6 @@ CONTENT_EXPORT extern const base::Feature kFtpProtocol; CONTENT_EXPORT extern const base::Feature kHistoryManipulationIntervention; CONTENT_EXPORT extern const base::Feature kHistoryPreventSandboxedNavigation; CONTENT_EXPORT extern const base::Feature kIdleDetection; -CONTENT_EXPORT extern const base::Feature kInputPredictorTypeChoice; CONTENT_EXPORT extern const base::Feature kInstalledApp; CONTENT_EXPORT extern const base::Feature kInstalledAppProvider; CONTENT_EXPORT extern const base::Feature kInstalledAppsInCbd; @@ -93,7 +92,6 @@ CONTENT_EXPORT extern const base::Feature kNotificationTriggers; CONTENT_EXPORT extern const base::Feature kOriginIsolationHeader; CONTENT_EXPORT extern const base::Feature kOriginPolicy; CONTENT_EXPORT extern const base::Feature kOverscrollHistoryNavigation; -CONTENT_EXPORT extern const base::Feature kParkableStringsToDisk; CONTENT_EXPORT extern const base::Feature kPeriodicBackgroundSync; CONTENT_EXPORT extern const base::Feature kPepper3DImageChromium; CONTENT_EXPORT extern const base::Feature kPepperCrossOriginRedirectRestriction; @@ -110,7 +108,7 @@ CONTENT_EXPORT extern const base::Feature CONTENT_EXPORT extern const base::Feature kReloadHiddenTabsWithCrashedSubframes; CONTENT_EXPORT extern const base::Feature kRenderDocument; CONTENT_EXPORT extern const base::Feature kRequestUnbufferedDispatch; -CONTENT_EXPORT extern const base::Feature kResamplingInputEvents; +CONTENT_EXPORT extern const base::Feature kRespectMacLCDTextSetting; CONTENT_EXPORT extern const base::Feature kRunVideoCaptureServiceInBrowserProcess; CONTENT_EXPORT extern const base::Feature kSavePageAsWebBundle; @@ -133,10 +131,12 @@ CONTENT_EXPORT extern const base::Feature kSiteIsolationEnforcementForFileSystemApi; CONTENT_EXPORT extern const base::Feature kSmsReceiver; CONTENT_EXPORT extern const base::Feature kSpareRendererForSitePerProcess; +CONTENT_EXPORT extern const base::Feature kStoragePressureEvent; CONTENT_EXPORT extern const base::Feature kStoragePressureUI; CONTENT_EXPORT extern const base::Feature kStorageServiceOutOfProcess; CONTENT_EXPORT extern const base::Feature kStorageServiceSandbox; CONTENT_EXPORT extern const base::Feature kStrictOriginIsolation; +CONTENT_EXPORT extern const base::Feature kSubresourceWebBundles; CONTENT_EXPORT extern const base::Feature kSyntheticPointerActions; CONTENT_EXPORT extern const base::Feature kTimerThrottlingForHiddenFrames; CONTENT_EXPORT extern const base::Feature kTopLevelAwait; @@ -148,7 +148,6 @@ CONTENT_EXPORT extern const base::Feature kUserActivationPostMessageTransfer; CONTENT_EXPORT extern const base::Feature kUserActivationSameOriginVisibility; CONTENT_EXPORT extern const base::Feature kUserAgentClientHint; CONTENT_EXPORT extern const base::Feature kVideoPlaybackQuality; -CONTENT_EXPORT extern const base::Feature kV8LowMemoryModeForSubframes; CONTENT_EXPORT extern const base::Feature kV8VmFuture; CONTENT_EXPORT extern const base::Feature kWebAssemblyBaseline; CONTENT_EXPORT extern const base::Feature kWebAssemblyLazyCompilation; diff --git a/chromium/content/public/common/content_switch_dependent_feature_overrides.cc b/chromium/content/public/common/content_switch_dependent_feature_overrides.cc index c3f1d1658f3..61f09762672 100644 --- a/chromium/content/public/common/content_switch_dependent_feature_overrides.cc +++ b/chromium/content/public/common/content_switch_dependent_feature_overrides.cc @@ -9,7 +9,6 @@ #include "net/base/features.h" #include "services/network/public/cpp/features.h" #include "third_party/blink/public/common/features.h" -#include "ui/base/ui_base_features.h" namespace content { @@ -39,6 +38,9 @@ GetSwitchDependentFeatureOverrides(const base::CommandLine& command_line) { std::cref(network::features::kCrossOriginOpenerPolicyReporting), base::FeatureList::OVERRIDE_ENABLE_FEATURE}, {switches::kEnableExperimentalWebPlatformFeatures, + std::cref(network::features::kCrossOriginOpenerPolicyAccessReporting), + base::FeatureList::OVERRIDE_ENABLE_FEATURE}, + {switches::kEnableExperimentalWebPlatformFeatures, std::cref(network::features::kCrossOriginEmbedderPolicy), base::FeatureList::OVERRIDE_ENABLE_FEATURE}, {switches::kEnableExperimentalWebPlatformFeatures, @@ -57,11 +59,6 @@ GetSwitchDependentFeatureOverrides(const base::CommandLine& command_line) { std::cref(features::kOriginIsolationHeader), base::FeatureList::OVERRIDE_ENABLE_FEATURE}, - // Overrides for --use-legacy-form-controls. - {switches::kUseLegacyFormControls, - std::cref(features::kFormControlsRefresh), - base::FeatureList::OVERRIDE_DISABLE_FEATURE}, - // Overrides for --enable-experimental-cookie-features. {switches::kEnableExperimentalCookieFeatures, std::cref(features::kCookieDeprecationMessages), diff --git a/chromium/content/public/common/content_switches.cc b/chromium/content/public/common/content_switches.cc index 8e9eb3625f0..f24ff2313d2 100644 --- a/chromium/content/public/common/content_switches.cc +++ b/chromium/content/public/common/content_switches.cc @@ -9,10 +9,6 @@ namespace switches { -// The number of MSAA samples for canvas2D. Requires MSAA support by GPU to -// have an effect. 0 disables MSAA. -const char kAcceleratedCanvas2dMSAASampleCount[] = "canvas-msaa-sample-count"; - // Allows processing of input before a frame has been committed. // TODO(schenney): crbug.com/987626. Used by headless. Look for a way not // involving a command line switch. @@ -70,13 +66,6 @@ const char kBrowserTest[] = "browser-test"; // Causes the Conversion Measurement API to run without delays or noise. const char kConversionsDebugMode[] = "conversions-debug-mode"; -// Sets the tile size used by composited layers. -const char kDefaultTileWidth[] = "default-tile-width"; -const char kDefaultTileHeight[] = "default-tile-height"; - -// Sets the min tile height for GPU raster. -const char kMinHeightForGpuRasterTile[] = "min-height-for-gpu-raster-tile"; - // Disable antialiasing on 2d canvas. const char kDisable2dCanvasAntialiasing[] = "disable-canvas-aa"; @@ -176,19 +165,10 @@ const char kDisableGpuProcessCrashLimit[] = "disable-gpu-process-crash-limit"; const char kDisableSoftwareCompositingFallback[] = "disable-software-compositing-fallback"; -// When using CPU rasterizing disable low resolution tiling. This uses -// less power, particularly during animations, but more white may be seen -// during fast scrolling especially on slower devices. -const char kDisableLowResTiling[] = "disable-low-res-tiling"; - // Disable the thread that crashes the GPU process if it stops responding to // messages. const char kDisableGpuWatchdog[] = "disable-gpu-watchdog"; -// Disallow image animations to be reset to the beginning to avoid skipping -// many frames. Only effective if compositor image animations are enabled. -const char kDisableImageAnimationResync[] = "disable-image-animation-resync"; - // Disables the IPC flooding protection. // It is activated by default. Some javascript functions can be used to flood // the browser process with IPC. This protection limits the rate at which they @@ -229,10 +209,6 @@ const char kDisableNewContentRenderingTimeout[] = // Disables the Web Notification and the Push APIs. const char kDisableNotifications[] = "disable-notifications"; -// Disable partial raster in the renderer. Disabling this switch also disables -// the use of persistent gpu memory buffers. -const char kDisablePartialRaster[] = "disable-partial-raster"; - // Disable Pepper3D. const char kDisablePepper3d[] = "disable-pepper-3d"; @@ -255,9 +231,6 @@ const char kDisablePresentationAPI[] = "disable-presentation-api"; // Disables throttling of history.pushState/replaceState calls. const char kDisablePushStateThrottle[] = "disable-pushstate-throttle"; -// Disables RGBA_4444 textures. -const char kDisableRGBA4444Textures[] = "disable-rgba-4444-textures"; - // Taints all <canvas> elements, regardless of origin. const char kDisableReadingFromCanvas[] = "disable-reading-from-canvas"; @@ -315,9 +288,6 @@ const char kDisableWebGLImageChromium[] = "disable-webgl-image-chromium"; // Don't enforce the same-origin policy. (Used by people testing their sites.) const char kDisableWebSecurity[] = "disable-web-security"; -// Disable rasterizer that writes directly to GPU memory associated with tiles. -const char kDisableZeroCopy[] = "disable-zero-copy"; - // Disable the video decoder from drawing directly to a texture. const char kDisableZeroCopyDxgiVideo[] = "disable-zero-copy-dxgi-video"; @@ -389,18 +359,10 @@ const char kEnableFtp[] = "enable-ftp"; const char kDisableOriginTrialControlledBlinkFeatures[] = "disable-origin-trial-controlled-blink-features"; -// Specify that all compositor resources should be backed by GPU memory buffers. -const char kEnableGpuMemoryBufferCompositorResources[] = - "enable-gpu-memory-buffer-compositor-resources"; - // Enable GpuMemoryBuffer backed VideoFrames. const char kEnableGpuMemoryBufferVideoFrames[] = "enable-gpu-memory-buffer-video-frames"; -// When using CPU rasterizing generate low resolution tiling. Low res -// tiles may be displayed during fast scrolls especially on slower devices. -const char kEnableLowResTiling[] = "enable-low-res-tiling"; - // Force logging to be enabled. Logging is disabled by default in release // builds. const char kEnableLogging[] = "enable-logging"; @@ -424,9 +386,6 @@ const char kEnablePluginPlaceholderTesting[] = // also applys to workers. const char kEnablePreciseMemoryInfo[] = "enable-precise-memory-info"; -// Enables RGBA_4444 textures. -const char kEnableRGBA4444Textures[] = "enable-rgba-4444-textures"; - // Set options to cache V8 data. (off, preparse data, or code) const char kV8CacheOptions[] = "v8-cache-options"; @@ -478,6 +437,13 @@ const char kEnableViewport[] = "enable-viewport"; // Enable the Vtune profiler support. const char kEnableVtune[] = "enable-vtune-support"; +// Enable the WebAuthn Mojo Testing API. This is a way to interact with the +// virtual authenticator environment through a mojo interface and is supported +// only to run web-platform-tests on content shell. +// Removal of this deprecated API is blocked on crbug.com/937369. +const char kEnableWebAuthDeprecatedMojoTestingApi[] = + "enable-web-auth-deprecated-mojo-testing-api"; + // Enable WebGL2 Compute context. const char kEnableWebGL2ComputeContext[] = "enable-webgl2-compute-context"; @@ -487,9 +453,6 @@ const char kEnableWebGLDraftExtensions[] = "enable-webgl-draft-extensions"; // Enables WebGL rendering into a scanout buffer for overlay support. const char kEnableWebGLImageChromium[] = "enable-webgl-image-chromium"; -// Enable rasterizer that writes directly to GPU memory associated with tiles. -const char kEnableZeroCopy[] = "enable-zero-copy"; - // Handle to the shared memory segment containing field trial state that is to // be shared between processes. The argument to this switch is the handle id // (pointer on Windows) as a string, followed by a comma, then the size of the @@ -515,11 +478,6 @@ const char kEnableOopRasterization[] = "enable-oop-rasterization"; const char kForceLegacyDefaultReferrerPolicy[] = "force-legacy-default-referrer-policy"; -// The number of multisample antialiasing samples for GPU rasterization. -// Requires MSAA support on GPU to have an effect. 0 disables MSAA. -const char kGpuRasterizationMSAASampleCount[] = - "gpu-rasterization-msaa-sample-count"; - // Forces use of hardware overlay for fullscreen video playback. Useful for // testing the Android overlay fullscreen functionality on other platforms. const char kForceOverlayFullscreenVideo[] = "force-overlay-fullscreen-video"; @@ -606,10 +564,6 @@ const char kMaxActiveWebGLContexts[] = "max-active-webgl-contexts"; // Sets the maximium decoded image size limitation. const char kMaxDecodedImageSizeMb[] = "max-decoded-image-size-mb"; -// Sets the width and height above which a composited layer will get tiled. -const char kMaxUntiledLayerHeight[] = "max-untiled-layer-height"; -const char kMaxUntiledLayerWidth[] = "max-untiled-layer-width"; - // Indicates the utility process should run with a message loop type of UI. const char kMessageLoopTypeUi[] = "message-loop-type-ui"; @@ -617,6 +571,10 @@ const char kMessageLoopTypeUi[] = "message-loop-type-ui"; const char kMockCertVerifierDefaultResultForTesting[] = "mock-cert-verifier-default-result-for-testing"; +// Initializes Mojo Core from a shared library at the specified path, rather +// than using the version of Mojo Core embedded within the Content executable. +const char kMojoCoreLibraryPath[] = "mojo-core-library-path"; + // Use a Mojo-based LocalStorage implementation. const char kMojoLocalStorage[] = "mojo-local-storage"; @@ -752,14 +710,6 @@ const char kRunManualTestsFlag[] = "run-manual"; // Causes the process to run as a sandbox IPC subprocess. const char kSandboxIPCProcess[] = "sandbox-ipc"; -// Visibly render a border around layout shift rects in the web page to help -// debug and study layout shifts. -const char kShowLayoutShiftRegions[] = "show-layout-shift-regions"; - -// Visibly render a border around paint rects in the web page to help debug -// and study painting behavior. -const char kShowPaintRects[] = "show-paint-rects"; - // Runs the renderer and plugins in the same process as the browser const char kSingleProcess[] = "single-process"; @@ -887,6 +837,9 @@ const char kWebglAntialiasingMode[] = "webgl-antialiasing-mode"; // Set a default sample count for webgl if msaa is enabled. const char kWebglMSAASampleCount[] = "webgl-msaa-sample-count"; +// The prefix used when starting the zygote process. (i.e. 'gdb --args') +const char kZygoteCmdPrefix[] = "zygote-cmd-prefix"; + // Enables specified backend for the Web OTP API. const char kWebOtpBackend[] = "web-otp-backend"; @@ -967,16 +920,6 @@ const char kWebXrRuntimeOpenVr[] = "openvr"; const char kWebXrRuntimeOpenXr[] = "openxr"; const char kWebXrRuntimeWMR[] = "windows-mixed-reality"; -// This switch allows the Web Components v0 APIs to be re-enabled temporarily -// from M80 through M84. -// TODO(937746): Remove this after M84. -const char kWebComponentsV0Enabled[] = "web-components-v0-enabled"; - -// This switch allows the FormControlsRefresh feature to be disabled temporarily -// from M81 through M84. -// TODO(1034611): Remove this after M84. -const char kUseLegacyFormControls[] = "use-legacy-form-controls"; - // This switch disables the ScrollToTextFragment feature. const char kDisableScrollToTextFragment[] = "disable-scroll-to-text-fragment"; diff --git a/chromium/content/public/common/content_switches.h b/chromium/content/public/common/content_switches.h index 81c110d18ad..be727273b85 100644 --- a/chromium/content/public/common/content_switches.h +++ b/chromium/content/public/common/content_switches.h @@ -15,7 +15,6 @@ namespace switches { // All switches in alphabetical order. The switches should be documented // alongside the definition of their values in the .cc file. -CONTENT_EXPORT extern const char kAcceleratedCanvas2dMSAASampleCount[]; CONTENT_EXPORT extern const char kAllowPreCommitInput[]; CONTENT_EXPORT extern const char kAllowFileAccessFromFiles[]; CONTENT_EXPORT extern const char kAllowInsecureLocalhost[]; @@ -30,9 +29,6 @@ CONTENT_EXPORT extern const char kBrowserStartupDialog[]; CONTENT_EXPORT extern const char kBrowserSubprocessPath[]; CONTENT_EXPORT extern const char kBrowserTest[]; CONTENT_EXPORT extern const char kConversionsDebugMode[]; -CONTENT_EXPORT extern const char kDefaultTileWidth[]; -CONTENT_EXPORT extern const char kDefaultTileHeight[]; -CONTENT_EXPORT extern const char kMinHeightForGpuRasterTile[]; CONTENT_EXPORT extern const char kDisable2dCanvasAntialiasing[]; CONTENT_EXPORT extern const char kDisable2dCanvasImageChromium[]; CONTENT_EXPORT extern const char kDisable3DAPIs[]; @@ -62,11 +58,9 @@ CONTENT_EXPORT extern const char kDisableGpuMemoryBufferVideoFrames[]; extern const char kDisableGpuProcessCrashLimit[]; CONTENT_EXPORT extern const char kDisableSoftwareCompositingFallback[]; CONTENT_EXPORT extern const char kDisableGpuWatchdog[]; -CONTENT_EXPORT extern const char kDisableImageAnimationResync[]; CONTENT_EXPORT extern const char kDisableIpcFloodingProtection[]; CONTENT_EXPORT extern const char kDisableJavaScriptHarmonyShipping[]; CONTENT_EXPORT extern const char kDisableLowLatencyDxva[]; -CONTENT_EXPORT extern const char kDisableLowResTiling[]; CONTENT_EXPORT extern const char kDisableHangMonitor[]; extern const char kDisableHistogramCustomizer[]; CONTENT_EXPORT extern const char kDisableLCDText[]; @@ -77,14 +71,12 @@ CONTENT_EXPORT extern const char kDisableLogging[]; CONTENT_EXPORT extern const char kDisableNewContentRenderingTimeout[]; CONTENT_EXPORT extern const char kDisableNotifications[]; CONTENT_EXPORT extern const char kDisableOriginTrialControlledBlinkFeatures[]; -CONTENT_EXPORT extern const char kDisablePartialRaster[]; extern const char kDisablePepper3d[]; CONTENT_EXPORT extern const char kDisablePepper3DImageChromium[]; CONTENT_EXPORT extern const char kDisablePermissionsAPI[]; CONTENT_EXPORT extern const char kDisablePinch[]; CONTENT_EXPORT extern const char kDisablePresentationAPI[]; CONTENT_EXPORT extern const char kDisablePushStateThrottle[]; -CONTENT_EXPORT extern const char kDisableRGBA4444Textures[]; CONTENT_EXPORT extern const char kDisableReadingFromCanvas[]; extern const char kDisableRemoteFonts[]; CONTENT_EXPORT extern const char kDisableRemotePlaybackAPI[]; @@ -103,7 +95,6 @@ CONTENT_EXPORT extern const char kDisableThreadedScrolling[]; extern const char kDisableV8IdleTasks[]; CONTENT_EXPORT extern const char kDisableWebGLImageChromium[]; CONTENT_EXPORT extern const char kDisableWebSecurity[]; -CONTENT_EXPORT extern const char kDisableZeroCopy[]; CONTENT_EXPORT extern const char kDisableZeroCopyDxgiVideo[]; CONTENT_EXPORT extern const char kDomAutomationController[]; extern const char kDisable2dCanvasClipAntialiasing[]; @@ -119,10 +110,7 @@ CONTENT_EXPORT extern const char kEnableExperimentalCookieFeatures[]; CONTENT_EXPORT extern const char kEnableExperimentalWebAssemblyFeatures[]; CONTENT_EXPORT extern const char kEnableExperimentalWebPlatformFeatures[]; CONTENT_EXPORT extern const char kEnableFtp[]; -CONTENT_EXPORT extern const char kEnableGpuMemoryBufferCompositorResources[]; CONTENT_EXPORT extern const char kEnableGpuMemoryBufferVideoFrames[]; -CONTENT_EXPORT extern const char kGpuRasterizationMSAASampleCount[]; -CONTENT_EXPORT extern const char kEnableLowResTiling[]; CONTENT_EXPORT extern const char kEnableLCDText[]; CONTENT_EXPORT extern const char kEnableLogging[]; CONTENT_EXPORT extern const char kEnableNetworkInformationDownlinkMax[]; @@ -130,7 +118,6 @@ CONTENT_EXPORT extern const char kEnableNewCanvas2DAPI[]; CONTENT_EXPORT extern const char kDisableNv12DxgiVideo[]; CONTENT_EXPORT extern const char kEnablePluginPlaceholderTesting[]; CONTENT_EXPORT extern const char kEnablePreciseMemoryInfo[]; -CONTENT_EXPORT extern const char kEnableRGBA4444Textures[]; CONTENT_EXPORT extern const char kEnableServiceBinaryLauncher[]; extern const char kEnableSkiaBenchmarking[]; CONTENT_EXPORT extern const char kEnableSmoothScrolling[]; @@ -144,11 +131,11 @@ CONTENT_EXPORT extern const char kEnableUserMediaScreenCapturing[]; CONTENT_EXPORT extern const char kEnableUseZoomForDSF[]; CONTENT_EXPORT extern const char kEnableViewport[]; CONTENT_EXPORT extern const char kEnableVtune[]; +CONTENT_EXPORT extern const char kEnableWebAuthDeprecatedMojoTestingApi[]; CONTENT_EXPORT extern const char kEnableWebGL2ComputeContext[]; CONTENT_EXPORT extern const char kEnableWebGLDraftExtensions[]; CONTENT_EXPORT extern const char kEnableWebGLImageChromium[]; CONTENT_EXPORT extern const char kEnableWebVR[]; -CONTENT_EXPORT extern const char kEnableZeroCopy[]; CONTENT_EXPORT extern const char kFieldTrialHandle[]; CONTENT_EXPORT extern const char kFileUrlPathAlias[]; CONTENT_EXPORT extern const char kForceDisplayList2dCanvas[]; @@ -175,14 +162,13 @@ CONTENT_EXPORT extern const char kLoggingLevel[]; CONTENT_EXPORT extern const char kLogFile[]; CONTENT_EXPORT extern const char kMainFrameResizesAreOrientationChanges[]; extern const char kMaxActiveWebGLContexts[]; -extern const char kMaxDecodedImageSizeMb[]; -extern const char kMaxUntiledLayerHeight[]; -extern const char kMaxUntiledLayerWidth[]; +CONTENT_EXPORT extern const char kMaxDecodedImageSizeMb[]; CONTENT_EXPORT extern const char kMessageLoopTypeUi[]; CONTENT_EXPORT extern const char kMHTMLGeneratorOption[]; CONTENT_EXPORT extern const char kMHTMLSkipNostoreMain[]; CONTENT_EXPORT extern const char kMHTMLSkipNostoreAll[]; CONTENT_EXPORT extern const char kMockCertVerifierDefaultResultForTesting[]; +CONTENT_EXPORT extern const char kMojoCoreLibraryPath[]; CONTENT_EXPORT extern const char kMojoLocalStorage[]; CONTENT_EXPORT extern const char kNetworkQuietTimeout[]; CONTENT_EXPORT extern const char kNoZygote[]; @@ -211,8 +197,6 @@ CONTENT_EXPORT extern const char kRendererProcessLimit[]; CONTENT_EXPORT extern const char kRendererStartupDialog[]; CONTENT_EXPORT extern const char kRunManualTestsFlag[]; extern const char kSandboxIPCProcess[]; -extern const char kShowLayoutShiftRegions[]; -extern const char kShowPaintRects[]; CONTENT_EXPORT extern const char kSingleProcess[]; CONTENT_EXPORT extern const char kSitePerProcess[]; CONTENT_EXPORT extern const char kDisableSiteIsolation[]; @@ -239,8 +223,9 @@ CONTENT_EXPORT extern const char kUtilitySubType[]; CONTENT_EXPORT extern const char kV8CacheOptions[]; CONTENT_EXPORT extern const char kValidateInputEventStream[]; CONTENT_EXPORT extern const char kWaitForDebuggerChildren[]; -extern const char kWebglAntialiasingMode[]; -extern const char kWebglMSAASampleCount[]; +CONTENT_EXPORT extern const char kWebglAntialiasingMode[]; +CONTENT_EXPORT extern const char kWebglMSAASampleCount[]; +CONTENT_EXPORT extern const char kZygoteCmdPrefix[]; CONTENT_EXPORT extern const char kWebOtpBackend[]; CONTENT_EXPORT extern const char kWebOtpBackendSmsVerification[]; @@ -258,8 +243,6 @@ extern const char kWebRtcMaxCaptureFramerate[]; extern const char kWebRtcMaxCpuConsumptionPercentage[]; CONTENT_EXPORT extern const char kWebRtcStunProbeTrialParameter[]; CONTENT_EXPORT extern const char kWebRtcLocalEventLogging[]; -CONTENT_EXPORT extern const char kWebComponentsV0Enabled[]; -CONTENT_EXPORT extern const char kUseLegacyFormControls[]; CONTENT_EXPORT extern const char kDisableScrollToTextFragment[]; CONTENT_EXPORT extern const char kWebXrForceRuntime[]; diff --git a/chromium/content/public/common/drop_data.h b/chromium/content/public/common/drop_data.h index bbd24fa2ae9..e4a2cadfbc6 100644 --- a/chromium/content/public/common/drop_data.h +++ b/chromium/content/public/common/drop_data.h @@ -17,7 +17,7 @@ #include "base/files/file_path.h" #include "base/optional.h" -#include "base/strings/nullable_string16.h" +#include "base/strings/string16.h" #include "content/common/content_export.h" #include "ipc/ipc_message.h" #include "services/network/public/mojom/referrer_policy.mojom.h" @@ -103,12 +103,12 @@ struct CONTENT_EXPORT DropData { std::vector<FileSystemFileInfo> file_system_files; // User is dragging plain text into the webview. - base::NullableString16 text; + base::Optional<base::string16> text; // User is dragging text/html into the webview (e.g., out of Firefox). // |html_base_url| is the URL that the html fragment is taken from (used to // resolve relative links). It's ok for |html_base_url| to be empty. - base::NullableString16 html; + base::Optional<base::string16> html; GURL html_base_url; // User is dragging an image out of the WebView. diff --git a/chromium/content/public/common/performance_manager/OWNERS b/chromium/content/public/common/performance_manager/OWNERS new file mode 100644 index 00000000000..7e4c8d7e6b4 --- /dev/null +++ b/chromium/content/public/common/performance_manager/OWNERS @@ -0,0 +1,5 @@ +file://components/performance_manager/OWNERS + +# For IPC security review +per-file *.mojom=set noparent +per-file *.mojom=file://ipc/SECURITY_OWNERS diff --git a/chromium/content/public/common/performance_manager/v8_per_frame_memory.mojom b/chromium/content/public/common/performance_manager/v8_per_frame_memory.mojom new file mode 100644 index 00000000000..6e0d5a3e95a --- /dev/null +++ b/chromium/content/public/common/performance_manager/v8_per_frame_memory.mojom @@ -0,0 +1,62 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module performance_manager.mojom; + +import "mojo/public/mojom/base/unguessable_token.mojom"; + +// The amount of heap memory used by V8 in the context of a frame. +struct V8IsolatedWorldMemoryUsage { + // The number of v8 heap bytes used by a V8 isolated world. + uint64 bytes_used = 0; + + // An optional tag for this world that does not vary between browser sessions + // or between renderers, unlike the world ID which can be randomly assigned. + // + // The exact meaning depends on the embedder and the type of isolated world. + // For example Chrome extensions use the host ID, as per + // extensions::ScriptInjection::GetHostIdForIsolatedWorld. Some types of + // isolated world will not have a suitable tag so will leave this empty. + string stable_id; + + // An optional human readable name for the world, for debugging. Unlike + // stable_id this might not be unique. + string human_readable_name; +}; + +// Returns the number of bytes used by the v8 heap per frame. +struct PerFrameV8MemoryUsageData { + // The frame-unique token. + mojo_base.mojom.UnguessableToken frame_token; + + // The resources used by this frame, mapped on the isolated world ID. + // World ID 0 is the main world. + map<int64, V8IsolatedWorldMemoryUsage> associated_bytes; +}; + +// Returns the number of bytes used by the v8 heap in a process. +struct PerProcessV8MemoryUsageData { + // The number of v8 heap bytes that were not associated with a specific + // v8 context, most likely because they're shared objects. + uint64 unassociated_bytes_used; + + // The number of v8 contexts not associated with a frame, likely web + // application leaks, and their associated byte usage. At the present time + // (April 2020), it's expected and normal to see one unassociated context per + // renderer process accounting for ~70kB. + uint64 num_unassociated_contexts; + uint64 unassociated_context_bytes_used; + + // The V8 memory usage by individual frames in this process. + array<PerFrameV8MemoryUsageData> associated_memory; +}; + +// Allows a browser to query the resource usage of sub-processes. +interface V8PerFrameMemoryReporter { + // Requests a per-frame estimate of v8 heap byte usage on the next garbage + // collection. Note that this causes extra cost for the next garbage + // collection, which can be on the order of 10-20%. + GetPerFrameV8MemoryUsageData() => (PerProcessV8MemoryUsageData data); +}; + diff --git a/chromium/content/public/common/profiling.cc b/chromium/content/public/common/profiling.cc index d0835889baf..b304b3a136f 100644 --- a/chromium/content/public/common/profiling.cc +++ b/chromium/content/public/common/profiling.cc @@ -71,7 +71,7 @@ void FlushProfilingData(base::Thread* thread) { class ProfilingThreadControl { public: - ProfilingThreadControl() : thread_(NULL) {} + ProfilingThreadControl() : thread_(nullptr) {} void Start() { base::AutoLock locked(lock_); @@ -91,7 +91,7 @@ class ProfilingThreadControl { return; thread_->Stop(); delete thread_; - thread_ = NULL; + thread_ = nullptr; } private: diff --git a/chromium/content/public/common/referrer.cc b/chromium/content/public/common/referrer.cc index b73b4573fd9..d7221ea4718 100644 --- a/chromium/content/public/common/referrer.cc +++ b/chromium/content/public/common/referrer.cc @@ -12,8 +12,10 @@ #include "content/public/common/content_switches.h" #include "mojo/public/cpp/bindings/enum_utils.h" #include "net/base/features.h" +#include "net/url_request/url_request_job.h" #include "services/network/public/cpp/features.h" #include "services/network/public/cpp/resource_request.h" +#include "services/network/public/mojom/referrer_policy.mojom-shared.h" #include "third_party/blink/public/mojom/referrer.mojom.h" namespace content { @@ -55,81 +57,18 @@ Referrer Referrer::SanitizeForRequest(const GURL& request, blink::mojom::ReferrerPtr Referrer::SanitizeForRequest( const GURL& request, const blink::mojom::Referrer& referrer) { - blink::mojom::ReferrerPtr sanitized_referrer = blink::mojom::Referrer::New( - referrer.url.GetAsReferrer(), referrer.policy); - if (sanitized_referrer->policy == network::mojom::ReferrerPolicy::kDefault) { - sanitized_referrer->policy = - Referrer::NetReferrerPolicyToBlinkReferrerPolicy( - Referrer::GetDefaultReferrerPolicy()); + network::mojom::ReferrerPolicy effective_policy = referrer.policy; + if (effective_policy == network::mojom::ReferrerPolicy::kDefault) { + effective_policy = + NetReferrerPolicyToBlinkReferrerPolicy(GetDefaultReferrerPolicy()); } + DCHECK_NE(effective_policy, network::mojom::ReferrerPolicy::kDefault); - if (sanitized_referrer->policy < network::mojom::ReferrerPolicy::kMinValue || - sanitized_referrer->policy > network::mojom::ReferrerPolicy::kMaxValue) { - NOTREACHED(); - sanitized_referrer->policy = network::mojom::ReferrerPolicy::kNever; - } - - bool is_web_scheme = request.SchemeIsHTTPOrHTTPS() || request.IsAboutBlank(); - if (!is_web_scheme || !sanitized_referrer->url.SchemeIsValidForReferrer()) { - sanitized_referrer->url = GURL(); - return sanitized_referrer; - } - - bool is_downgrade = sanitized_referrer->url.SchemeIsCryptographic() && - !request.SchemeIsCryptographic(); - - switch (sanitized_referrer->policy) { - case network::mojom::ReferrerPolicy::kDefault: - NOTREACHED(); - break; - case network::mojom::ReferrerPolicy::kNoReferrerWhenDowngrade: - if (is_downgrade) - sanitized_referrer->url = GURL(); - break; - case network::mojom::ReferrerPolicy::kAlways: - break; - case network::mojom::ReferrerPolicy::kNever: - sanitized_referrer->url = GURL(); - break; - case network::mojom::ReferrerPolicy::kOrigin: - sanitized_referrer->url = sanitized_referrer->url.GetOrigin(); - break; - case network::mojom::ReferrerPolicy::kOriginWhenCrossOrigin: - if (request.GetOrigin() != sanitized_referrer->url.GetOrigin()) - sanitized_referrer->url = sanitized_referrer->url.GetOrigin(); - break; - case network::mojom::ReferrerPolicy::kStrictOrigin: - if (is_downgrade) { - sanitized_referrer->url = GURL(); - } else { - sanitized_referrer->url = sanitized_referrer->url.GetOrigin(); - } - break; - case network::mojom::ReferrerPolicy::kSameOrigin: - if (request.GetOrigin() != sanitized_referrer->url.GetOrigin()) - sanitized_referrer->url = GURL(); - break; - case network::mojom::ReferrerPolicy::kStrictOriginWhenCrossOrigin: - if (is_downgrade) { - sanitized_referrer->url = GURL(); - } else if (request.GetOrigin() != sanitized_referrer->url.GetOrigin()) { - sanitized_referrer->url = sanitized_referrer->url.GetOrigin(); - } - break; - } - - // We limit the `referer` header to 4k: see step of - // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer - // and https://github.com/whatwg/fetch/issues/903. - if (sanitized_referrer->url.spec().length() > 4096 || - (base::FeatureList::IsEnabled( - network::features::kCapReferrerToOriginOnCrossOrigin) && - !url::Origin::Create(sanitized_referrer->url) - .IsSameOriginWith(url::Origin::Create(request)))) { - sanitized_referrer->url = sanitized_referrer->url.GetOrigin(); - } - - return sanitized_referrer; + return blink::mojom::Referrer::New( + net::URLRequestJob::ComputeReferrerForPolicy( + ReferrerPolicyForUrlRequest(effective_policy), + referrer.url /* original_referrer */, request /* destination */), + effective_policy); } // static @@ -138,8 +77,8 @@ url::Origin Referrer::SanitizeOriginForRequest( const url::Origin& initiator, network::mojom::ReferrerPolicy policy) { Referrer fake_referrer(initiator.GetURL(), policy); - Referrer sanitizied_referrer = SanitizeForRequest(request, fake_referrer); - return url::Origin::Create(sanitizied_referrer.url); + Referrer sanitized_referrer = SanitizeForRequest(request, fake_referrer); + return url::Origin::Create(sanitized_referrer.url); } // static diff --git a/chromium/content/public/common/referrer.h b/chromium/content/public/common/referrer.h index e90313e5f9a..91dcc51508e 100644 --- a/chromium/content/public/common/referrer.h +++ b/chromium/content/public/common/referrer.h @@ -5,7 +5,6 @@ #ifndef CONTENT_PUBLIC_COMMON_REFERRER_H_ #define CONTENT_PUBLIC_COMMON_REFERRER_H_ -#include "base/logging.h" #include "content/common/content_export.h" #include "net/url_request/url_request.h" #include "services/network/public/mojom/referrer_policy.mojom-shared.h" diff --git a/chromium/content/public/common/sandboxed_process_launcher_delegate.cc b/chromium/content/public/common/sandboxed_process_launcher_delegate.cc index ee8e819d6da..f28909f5eb1 100644 --- a/chromium/content/public/common/sandboxed_process_launcher_delegate.cc +++ b/chromium/content/public/common/sandboxed_process_launcher_delegate.cc @@ -5,7 +5,7 @@ #include "content/public/common/sandboxed_process_launcher_delegate.h" #include "build/build_config.h" -#include "services/service_manager/zygote/common/zygote_buildflags.h" +#include "content/public/common/zygote/zygote_buildflags.h" namespace content { @@ -33,10 +33,10 @@ bool SandboxedProcessLauncherDelegate::ShouldLaunchElevated() { #endif // defined(OS_WIN) #if BUILDFLAG(USE_ZYGOTE_HANDLE) -service_manager::ZygoteHandle SandboxedProcessLauncherDelegate::GetZygote() { +ZygoteHandle SandboxedProcessLauncherDelegate::GetZygote() { // Default to the sandboxed zygote. If a more lax sandbox is needed, then the // child class should override this method and use the unsandboxed zygote. - return service_manager::GetGenericZygote(); + return GetGenericZygote(); } #endif // BUILDFLAG(USE_ZYGOTE_HANDLE) diff --git a/chromium/content/public/common/sandboxed_process_launcher_delegate.h b/chromium/content/public/common/sandboxed_process_launcher_delegate.h index 9d7fd9cf229..03336bc1708 100644 --- a/chromium/content/public/common/sandboxed_process_launcher_delegate.h +++ b/chromium/content/public/common/sandboxed_process_launcher_delegate.h @@ -10,12 +10,12 @@ #include "base/process/process.h" #include "build/build_config.h" #include "content/common/content_export.h" +#include "content/public/common/zygote/zygote_buildflags.h" #include "services/service_manager/sandbox/sandbox_delegate.h" #include "services/service_manager/sandbox/sandbox_type.h" -#include "services/service_manager/zygote/common/zygote_buildflags.h" #if BUILDFLAG(USE_ZYGOTE_HANDLE) -#include "services/service_manager/zygote/common/zygote_handle.h" // nogncheck +#include "content/public/common/zygote/zygote_handle.h" // nogncheck #endif // BUILDFLAG(USE_ZYGOTE_HANDLE) namespace content { @@ -43,7 +43,7 @@ class CONTENT_EXPORT SandboxedProcessLauncherDelegate #if BUILDFLAG(USE_ZYGOTE_HANDLE) // Returns the zygote used to launch the process. - virtual service_manager::ZygoteHandle GetZygote(); + virtual ZygoteHandle GetZygote(); #endif // BUILDFLAG(USE_ZYGOTE_HANDLE) #if defined(OS_POSIX) diff --git a/chromium/content/public/common/untrustworthy_context_menu_params.h b/chromium/content/public/common/untrustworthy_context_menu_params.h index dc333a40a91..0940ef2a3f6 100644 --- a/chromium/content/public/common/untrustworthy_context_menu_params.h +++ b/chromium/content/public/common/untrustworthy_context_menu_params.h @@ -137,9 +137,6 @@ struct CONTENT_EXPORT UntrustworthyContextMenuParams { ui::MenuSourceType source_type; - // Extra properties for the context menu. - std::map<std::string, std::string> properties; - // If this node is an input field, the type of that field. blink::ContextMenuDataInputFieldType input_field_type; diff --git a/chromium/content/public/common/url_constants.cc b/chromium/content/public/common/url_constants.cc index d954b9e581b..db7ce218c43 100644 --- a/chromium/content/public/common/url_constants.cc +++ b/chromium/content/public/common/url_constants.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "build/build_config.h" #include "content/public/common/url_constants.h" +#include "build/build_config.h" + namespace content { // Before adding new chrome schemes please check with security@chromium.org. @@ -36,6 +37,7 @@ const char kChromeUIProcessInternalsHost[] = "process-internals"; const char kChromeUIResourcesHost[] = "resources"; const char kChromeUIServiceWorkerInternalsHost[] = "serviceworker-internals"; const char kChromeUITracingHost[] = "tracing"; +const char kChromeUIUkmHost[] = "ukm"; const char kChromeUIWebRTCInternalsHost[] = "webrtc-internals"; const char kChromeUIBadCastCrashURL[] = "chrome://badcastcrash/"; @@ -60,6 +62,7 @@ const char kChromeUINetworkErrorsListingURL[] = "chrome://network-errors/"; const char kChromeUIPpapiFlashCrashURL[] = "chrome://ppapiflashcrash/"; const char kChromeUIPpapiFlashHangURL[] = "chrome://ppapiflashhang/"; const char kChromeUIProcessInternalsURL[] = "chrome://process-internals"; +const char kChromeUIUntrustedResourcesURL[] = "chrome-untrusted://resources/"; #if defined(OS_ANDROID) const char kChromeUIGpuJavaCrashURL[] = "chrome://gpu-java-crash/"; #endif diff --git a/chromium/content/public/common/url_constants.h b/chromium/content/public/common/url_constants.h index e09016439f5..e554270649d 100644 --- a/chromium/content/public/common/url_constants.h +++ b/chromium/content/public/common/url_constants.h @@ -5,7 +5,7 @@ #ifndef CONTENT_PUBLIC_COMMON_URL_CONSTANTS_H_ #define CONTENT_PUBLIC_COMMON_URL_CONSTANTS_H_ -#include "base/logging.h" +#include "base/check_op.h" #include "build/build_config.h" #include "content/common/content_export.h" #include "url/url_constants.h" @@ -48,6 +48,7 @@ CONTENT_EXPORT extern const char kChromeUIProcessInternalsHost[]; CONTENT_EXPORT extern const char kChromeUIResourcesHost[]; CONTENT_EXPORT extern const char kChromeUIServiceWorkerInternalsHost[]; CONTENT_EXPORT extern const char kChromeUITracingHost[]; +CONTENT_EXPORT extern const char kChromeUIUkmHost[]; CONTENT_EXPORT extern const char kChromeUIWebRTCInternalsHost[]; // Full about URLs (including schemes). @@ -71,6 +72,7 @@ CONTENT_EXPORT extern const char kChromeUINetworkErrorURL[]; CONTENT_EXPORT extern const char kChromeUIPpapiFlashCrashURL[]; CONTENT_EXPORT extern const char kChromeUIPpapiFlashHangURL[]; CONTENT_EXPORT extern const char kChromeUIProcessInternalsURL[]; +CONTENT_EXPORT extern const char kChromeUIUntrustedResourcesURL[]; #if defined(OS_ANDROID) CONTENT_EXPORT extern const char kChromeUIGpuJavaCrashURL[]; #endif diff --git a/chromium/content/public/common/url_utils.cc b/chromium/content/public/common/url_utils.cc index 16c6b998ad4..db318b6740f 100644 --- a/chromium/content/public/common/url_utils.cc +++ b/chromium/content/public/common/url_utils.cc @@ -23,8 +23,8 @@ namespace content { bool HasWebUIScheme(const GURL& url) { - return url.SchemeIs(kChromeDevToolsScheme) || - url.SchemeIs(kChromeUIScheme); + return url.SchemeIs(kChromeDevToolsScheme) || url.SchemeIs(kChromeUIScheme) || + url.SchemeIs(kChromeUIUntrustedScheme); } bool IsSavableURL(const GURL& url) { diff --git a/chromium/content/public/common/url_utils_unittest.cc b/chromium/content/public/common/url_utils_unittest.cc index f09740586a9..5efdae44661 100644 --- a/chromium/content/public/common/url_utils_unittest.cc +++ b/chromium/content/public/common/url_utils_unittest.cc @@ -17,6 +17,21 @@ GURL CreateValidURL(const std::string& str) { return url; } +TEST(UrlUtilsTest, HasWebUIScheme) { + EXPECT_TRUE(HasWebUIScheme(CreateValidURL("chrome://test"))); + EXPECT_TRUE(HasWebUIScheme(CreateValidURL("chrome-untrusted://test"))); + EXPECT_TRUE(HasWebUIScheme(CreateValidURL("devtools://test"))); + + // Other chromium schemes not considered WebUI schemes. + EXPECT_FALSE(HasWebUIScheme(CreateValidURL("chrome-error://test"))); + EXPECT_FALSE(HasWebUIScheme(CreateValidURL("chrome-guest://test"))); + EXPECT_FALSE(HasWebUIScheme(CreateValidURL("googlechrome://test"))); + + EXPECT_FALSE(HasWebUIScheme(CreateValidURL("http://foo/bar.html"))); + EXPECT_FALSE(HasWebUIScheme(CreateValidURL("https://foo/bar.html"))); + EXPECT_FALSE(HasWebUIScheme(CreateValidURL("data://foo"))); +} + TEST(UrlUtilsTest, IsURLHandledByNetworkStack) { EXPECT_TRUE( IsURLHandledByNetworkStack(CreateValidURL("http://foo/bar.html"))); @@ -24,6 +39,10 @@ TEST(UrlUtilsTest, IsURLHandledByNetworkStack) { IsURLHandledByNetworkStack(CreateValidURL("https://foo/bar.html"))); EXPECT_TRUE(IsURLHandledByNetworkStack(CreateValidURL("data://foo"))); EXPECT_TRUE(IsURLHandledByNetworkStack(CreateValidURL("cid:foo@bar"))); + EXPECT_TRUE(IsURLHandledByNetworkStack(CreateValidURL("chrome://test"))); + EXPECT_TRUE(IsURLHandledByNetworkStack(CreateValidURL("devtools://test"))); + EXPECT_TRUE( + IsURLHandledByNetworkStack(CreateValidURL("chrome-untrusted://test"))); EXPECT_FALSE(IsURLHandledByNetworkStack(CreateValidURL("about:blank"))); EXPECT_FALSE(IsURLHandledByNetworkStack(CreateValidURL("about:srcdoc"))); @@ -66,6 +85,12 @@ TEST(UrlUtilsTest, IsSafeRedirectTarget) { EXPECT_TRUE(IsSafeRedirectTarget(CreateValidURL("file:///foo/bar/"), CreateValidURL("http://foo/bar.html"))); + // WebUI schemes + EXPECT_FALSE(IsSafeRedirectTarget(GURL(), CreateValidURL("chrome://test"))); + EXPECT_FALSE(IsSafeRedirectTarget(GURL(), CreateValidURL("devtools://test"))); + EXPECT_FALSE( + IsSafeRedirectTarget(GURL(), CreateValidURL("chrome-untrusted://test"))); + // TODO(cmumford): Capturing current behavior, but should probably prevent // redirect to invalid URL. EXPECT_TRUE(IsSafeRedirectTarget(GURL(), GURL())); diff --git a/chromium/content/public/common/web_preferences.cc b/chromium/content/public/common/web_preferences.cc index eac2562c779..f85ad51fb34 100644 --- a/chromium/content/public/common/web_preferences.cc +++ b/chromium/content/public/common/web_preferences.cc @@ -102,7 +102,6 @@ WebPreferences::WebPreferences() accelerated_2d_canvas_enabled(false), antialiased_2d_canvas_disabled(false), antialiased_clips_2d_canvas_enabled(true), - accelerated_2d_canvas_msaa_sample_count(0), accelerated_filters_enabled(false), deferred_filters_enabled(false), container_culling_enabled(false), @@ -127,7 +126,6 @@ WebPreferences::WebPreferences() primary_hover_type(ui::HOVER_TYPE_NONE), dont_send_key_events_to_javascript(false), sync_xhr_in_documents_enabled(true), - should_respect_image_orientation(false), number_of_cpu_cores(1), #if defined(OS_MACOSX) editing_behavior(EDITING_BEHAVIOR_MAC), @@ -224,7 +222,6 @@ WebPreferences::WebPreferences() media_controls_enabled(true), do_not_update_selection_on_mutating_selection_range(false), autoplay_policy(AutoplayPolicy::kDocumentUserActivationRequired), - preferred_color_scheme(blink::PreferredColorScheme::kNoPreference), low_priority_iframes_threshold(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN), picture_in_picture_enabled(true), translate_service_available(false), diff --git a/chromium/content/public/common/web_preferences.h b/chromium/content/public/common/web_preferences.h index 4ba03d3a621..bf98747b7b3 100644 --- a/chromium/content/public/common/web_preferences.h +++ b/chromium/content/public/common/web_preferences.h @@ -126,7 +126,6 @@ struct CONTENT_EXPORT WebPreferences { bool new_canvas_2d_api_enabled; bool antialiased_2d_canvas_disabled; bool antialiased_clips_2d_canvas_enabled; - int accelerated_2d_canvas_msaa_sample_count; bool accelerated_filters_enabled; bool deferred_filters_enabled; bool container_culling_enabled; @@ -161,7 +160,6 @@ struct CONTENT_EXPORT WebPreferences { bool dont_send_key_events_to_javascript; bool barrel_button_for_drag_enabled = false; bool sync_xhr_in_documents_enabled; - bool should_respect_image_orientation; int number_of_cpu_cores; EditingBehavior editing_behavior; bool supports_multiple_windows; @@ -320,7 +318,7 @@ struct CONTENT_EXPORT WebPreferences { // evaluate the prefers-color-scheme media query and resolve UA color scheme // to be used based on the supported-color-schemes META tag and CSS property. blink::PreferredColorScheme preferred_color_scheme = - blink::PreferredColorScheme::kNoPreference; + blink::PreferredColorScheme::kLight; // Network quality threshold below which resources from iframes are assigned // either kVeryLow or kVeryLow Blink priority. diff --git a/chromium/content/public/common/zygote/BUILD.gn b/chromium/content/public/common/zygote/BUILD.gn new file mode 100644 index 00000000000..cb8c2f8197c --- /dev/null +++ b/chromium/content/public/common/zygote/BUILD.gn @@ -0,0 +1,11 @@ +# Copyright 2020 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/buildflag_header.gni") +import("//content/public/common/zygote/features.gni") + +buildflag_header("buildflags") { + header = "zygote_buildflags.h" + flags = [ "USE_ZYGOTE_HANDLE=$use_zygote_handle" ] +} diff --git a/chromium/content/public/common/zygote/OWNERS b/chromium/content/public/common/zygote/OWNERS new file mode 100644 index 00000000000..eb4b322bdf5 --- /dev/null +++ b/chromium/content/public/common/zygote/OWNERS @@ -0,0 +1,4 @@ +file://content/zygote/OWNERS + +# TEAM: security-dev@chromium.org +# COMPONENT: Internals>Sandbox diff --git a/chromium/content/public/common/zygote/features.gni b/chromium/content/public/common/zygote/features.gni new file mode 100644 index 00000000000..c7580b35ff3 --- /dev/null +++ b/chromium/content/public/common/zygote/features.gni @@ -0,0 +1,5 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +use_zygote_handle = is_posix && !is_android && !is_mac diff --git a/chromium/content/public/common/zygote/sandbox_support_linux.h b/chromium/content/public/common/zygote/sandbox_support_linux.h new file mode 100644 index 00000000000..279f983f3f8 --- /dev/null +++ b/chromium/content/public/common/zygote/sandbox_support_linux.h @@ -0,0 +1,42 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_PUBLIC_COMMON_ZYGOTE_SANDBOX_SUPPORT_LINUX_H_ +#define CONTENT_PUBLIC_COMMON_ZYGOTE_SANDBOX_SUPPORT_LINUX_H_ + +#include <stddef.h> + +#include "build/build_config.h" +#include "content/common/content_export.h" + +class NaClListener; + +namespace content { + +#if !defined(OS_NACL_NONSFI) +// TODO(crbug.com/982879): Remove this when NaCl is unshipped. +class CONTENT_EXPORT SharedMemoryIPCSupport { + private: + friend class ::NaClListener; + + // Returns a file descriptor for a shared memory segment. The + // executable flag indicates that the caller intends to use mprotect + // with PROT_EXEC after making a mapping, but not that it intends to + // mmap with PROT_EXEC in the first place. (Some systems, such as + // ChromeOS, disallow PROT_EXEC in mmap on /dev/shm files but do allow + // PROT_EXEC in mprotect on mappings from such files. This function + // can yield an object that has that constraint.) + static int MakeSharedMemorySegment(size_t length, bool executable); + + SharedMemoryIPCSupport() = delete; +}; +#endif + +// Gets the well-known file descriptor on which we expect to find the +// sandbox IPC channel. +CONTENT_EXPORT int GetSandboxFD(); + +} // namespace content + +#endif // CONTENT_PUBLIC_COMMON_ZYGOTE_SANDBOX_SUPPORT_LINUX_H_ diff --git a/chromium/content/public/common/zygote/send_zygote_child_ping_linux.h b/chromium/content/public/common/zygote/send_zygote_child_ping_linux.h new file mode 100644 index 00000000000..cc08f264e07 --- /dev/null +++ b/chromium/content/public/common/zygote/send_zygote_child_ping_linux.h @@ -0,0 +1,18 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_PUBLIC_COMMON_ZYGOTE_SEND_ZYGOTE_CHILD_PING_LINUX_H_ +#define CONTENT_PUBLIC_COMMON_ZYGOTE_SEND_ZYGOTE_CHILD_PING_LINUX_H_ + +#include "content/common/content_export.h" + +namespace content { + +// Sends a zygote child "ping" message to browser process via socket |fd|. +// Returns true on success. +CONTENT_EXPORT bool SendZygoteChildPing(int fd); + +} // namespace content + +#endif // CONTENT_PUBLIC_COMMON_ZYGOTE_SEND_ZYGOTE_CHILD_PING_LINUX_H_ diff --git a/chromium/content/public/common/zygote/zygote_fork_delegate_linux.h b/chromium/content/public/common/zygote/zygote_fork_delegate_linux.h new file mode 100644 index 00000000000..12f784b0f85 --- /dev/null +++ b/chromium/content/public/common/zygote/zygote_fork_delegate_linux.h @@ -0,0 +1,90 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_PUBLIC_COMMON_ZYGOTE_ZYGOTE_FORK_DELEGATE_LINUX_H_ +#define CONTENT_PUBLIC_COMMON_ZYGOTE_ZYGOTE_FORK_DELEGATE_LINUX_H_ + +#include <unistd.h> + +#include <string> +#include <vector> + +// TODO(jln) base::TerminationStatus should be forward declared when switching +// to C++11. +#include "base/process/kill.h" + +namespace content { + +// The ZygoteForkDelegate allows the Chrome Linux zygote to delegate +// fork operations to another class that knows how to do some +// specialized version of fork. +class ZygoteForkDelegate { + public: + // A ZygoteForkDelegate is created during Chrome linux zygote + // initialization, and provides "fork()" functionality as an + // alternative to forking the zygote. A new delegate is passed in + // as an argument to ZygoteMain(). + virtual ~ZygoteForkDelegate() {} + + // Initialization happens in the zygote after it has been + // started by ZygoteMain. + // If |enable_layer1_sandbox| is true, the delegate must enable a + // layer-1 sandbox such as the setuid sandbox. + virtual void Init(int sandboxdesc, bool enable_layer1_sandbox) = 0; + + // After Init, supply a UMA_HISTOGRAM_ENUMERATION the delegate would like + // reported to the browser process. (Note: Because these reports are + // piggy-backed onto fork responses that don't otherwise contain UMA reports, + // this method may not be called until much later.) + virtual void InitialUMA(std::string* uma_name, + int* uma_sample, + int* uma_boundary_value) = 0; + + // Returns 'true' if the delegate would like to handle a given fork + // request. Otherwise returns false. Optionally, fills in uma_name et al + // with a report the helper wants to make via UMA_HISTOGRAM_ENUMERATION. + virtual bool CanHelp(const std::string& process_type, + std::string* uma_name, + int* uma_sample, + int* uma_boundary_value) = 0; + + // Indexes of FDs in the vector passed to Fork(). + enum { + // Used to pass in the descriptor for talking to the Browser. + // Because the children use ChannelMojo, this is actually the Mojo fd. + kBrowserFDIndex, + // The PID oracle is used in the protocol for discovering the + // child process's real PID from within the SUID sandbox. + // The child process is required to write to the socket after + // successfully forking. + kPIDOracleFDIndex, + kNumPassedFDs // Number of FDs in the vector passed to Fork(). + }; + + // Delegate forks, returning a -1 on failure. Outside the + // suid sandbox, Fork() returns the Linux process ID. + // This method is not aware of any potential pid namespaces, so it'll + // return a raw pid just like fork() would. + // Delegate is responsible for communicating the channel ID to the + // newly created child process. + virtual pid_t Fork(const std::string& process_type, + const std::vector<int>& fds, + const std::string& channel_id) = 0; + + // The fork delegate must also assume the role of waiting for its children + // since the caller will not be their parents and cannot do it. |pid| here + // should be a pid that has been returned by the Fork() method. i.e. This + // method is completely unaware of eventual PID namespaces due to sandboxing. + // |known_dead| indicates that the process is already dead and that a + // blocking wait() should be performed. In this case, GetTerminationStatus() + // will send a SIGKILL to the target process first. + virtual bool GetTerminationStatus(pid_t pid, + bool known_dead, + base::TerminationStatus* status, + int* exit_code) = 0; +}; + +} // namespace content + +#endif // CONTENT_PUBLIC_COMMON_ZYGOTE_ZYGOTE_FORK_DELEGATE_LINUX_H_ diff --git a/chromium/content/public/common/zygote/zygote_handle.h b/chromium/content/public/common/zygote/zygote_handle.h new file mode 100644 index 00000000000..95a6e6113ec --- /dev/null +++ b/chromium/content/public/common/zygote/zygote_handle.h @@ -0,0 +1,34 @@ +// 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 CONTENT_PUBLIC_COMMON_ZYGOTE_ZYGOTE_HANDLE_H_ +#define CONTENT_PUBLIC_COMMON_ZYGOTE_ZYGOTE_HANDLE_H_ + +#include "base/callback.h" +#include "base/command_line.h" +#include "base/files/scoped_file.h" +#include "build/build_config.h" +#include "content/common/content_export.h" +#include "content/public/common/zygote/zygote_buildflags.h" + +#if !BUILDFLAG(USE_ZYGOTE_HANDLE) +#error "Can not use zygote handles without USE_ZYGOTE_HANDLE" +#endif + +namespace content { + +#if defined(OS_POSIX) +class ZygoteCommunication; +using ZygoteHandle = ZygoteCommunication*; +#else +// Perhaps other ports may USE_ZYGOTE_HANDLE here somdeday. +#error "Can not use zygote handles on this platform" +#endif // defined(OS_POSIX) + +// Gets the generic global zygote used to launch sandboxed children. +CONTENT_EXPORT ZygoteHandle GetGenericZygote(); + +} // namespace content + +#endif // CONTENT_PUBLIC_COMMON_ZYGOTE_ZYGOTE_HANDLE_H_ |