M126 stage 4
2
infra/hangout_services/README.md
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Google Hangouts Services Component Extension
|
||||
|
17
infra/hangout_services/background.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!--
|
||||
Copyright 2013 The Chromium Authors
|
||||
Use of this source code is governed by a BSD-style license that can be
|
||||
found in the LICENSE file.
|
||||
|
||||
We use an HTML page just to have access to the DOM, for URL
|
||||
parsing. An alternative would be to include a URL parsing JavaScript
|
||||
library with the extension but this approach is likely smaller and
|
||||
faster.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<script src="thunk.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
BIN
infra/hangout_services/icons/icon_128.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
infra/hangout_services/icons/icon_16.png
Normal file
After Width: | Height: | Size: 574 B |
BIN
infra/hangout_services/icons/icon_24.png
Normal file
After Width: | Height: | Size: 863 B |
BIN
infra/hangout_services/icons/icon_256.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
infra/hangout_services/icons/icon_32.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
infra/hangout_services/icons/icon_48.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
infra/hangout_services/icons/icon_64.png
Normal file
After Width: | Height: | Size: 2 KiB |
47
infra/hangout_services/manifest.json
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
// Manifest V3 version of the extension, otherwise equivalent to manifest_v2.json.
|
||||
// Only one of manifest_v2.json or manifest_v3.json will be loaded, chosen at
|
||||
// runtime based on the kHangoutsExtensionV3 base feature.
|
||||
|
||||
// Extension ID: nkeimhogjdpnpccoofpliimaahmaaome
|
||||
"key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDAQt2ZDdPfoSe/JI6ID5bgLHRCnCu9T36aYczmhw/tnv6QZB2I6WnOCMZXJZlRdqWc7w9jo4BWhYS50Vb4weMfh/I0On7VcRwJUgfAxW2cHB+EkmtI1v4v/OU24OqIa1Nmv9uRVeX0GjhQukdLNhAE6ACWooaf5kqKlCeK+1GOkQIDAQAB",
|
||||
|
||||
"name": "Google Hangouts Services",
|
||||
"description": "Hangout services is an internal Chromium extension that adds extra features to Google Hangouts",
|
||||
"homepage_url": "https://github.com/Alex313031/thorium/tree/main/infra/hangout_services/README.md",
|
||||
// Note: Always update the version number when this file is updated. Chrome
|
||||
// triggers extension preferences update on the version increase.
|
||||
"version": "1.4.1",
|
||||
"manifest_version": 3,
|
||||
"minimum_chrome_version": "91",
|
||||
"icons": {
|
||||
"16": "icons/icon_16.png",
|
||||
"24": "icons/icon_24.png",
|
||||
"32": "icons/icon_32.png",
|
||||
"48": "icons/icon_48.png",
|
||||
"64": "icons/icon_64.png",
|
||||
"128": "icons/icon_128.png",
|
||||
"256": "icons/icon_256.png"
|
||||
},
|
||||
"externally_connectable": {
|
||||
"matches": [
|
||||
"https://*.google.com/*"
|
||||
]
|
||||
},
|
||||
"background": {
|
||||
"service_worker": "thunk.js"
|
||||
},
|
||||
"incognito": "split",
|
||||
"permissions": [
|
||||
"desktopCapture",
|
||||
"enterprise.hardwarePlatform",
|
||||
"processes",
|
||||
"system.cpu",
|
||||
"webrtcAudioPrivate",
|
||||
"webrtcDesktopCapturePrivate",
|
||||
"webrtcLoggingPrivate"
|
||||
],
|
||||
"host_permissions": [
|
||||
"https://*.google.com/*"
|
||||
]
|
||||
}
|
249
infra/hangout_services/thunk.js
Normal file
|
@ -0,0 +1,249 @@
|
|||
// Copyright 2013 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
chrome.runtime.onMessageExternal.addListener(function(
|
||||
message, sender, sendResponse) {
|
||||
function doSendResponse(value, errorString) {
|
||||
let error = null;
|
||||
if (errorString) {
|
||||
error = {};
|
||||
error['name'] = 'ComponentExtensionError';
|
||||
error['message'] = errorString;
|
||||
}
|
||||
|
||||
const errorMessage = error || chrome.runtime.lastError;
|
||||
sendResponse({'value': value, 'error': errorMessage});
|
||||
}
|
||||
|
||||
function getHost(url) {
|
||||
if (!url) {
|
||||
return '';
|
||||
}
|
||||
const origin = new URL(url).origin;
|
||||
return `${origin}/`;
|
||||
}
|
||||
|
||||
try {
|
||||
const requestInfo = {};
|
||||
|
||||
// Set the tab ID. If it's passed in the message, use that.
|
||||
// Otherwise use the sender information.
|
||||
if (message['tabId']) {
|
||||
requestInfo['tabId'] = +message['tabId'];
|
||||
if (isNaN(requestInfo['tabId'])) {
|
||||
throw new Error(
|
||||
'Cannot convert tab ID string to integer: ' + message['tabId']);
|
||||
}
|
||||
} else if (sender.tab) {
|
||||
requestInfo['tabId'] = sender.tab.id;
|
||||
}
|
||||
|
||||
if (sender.guestProcessId) {
|
||||
requestInfo['guestProcessId'] = sender.guestProcessId;
|
||||
}
|
||||
|
||||
const method = message['method'];
|
||||
|
||||
// Set the origin. If a URL is passed in the message, use that.
|
||||
// Otherwise use the sender information.
|
||||
let origin;
|
||||
if (message['winUrl']) {
|
||||
origin = getHost(message['winUrl']);
|
||||
} else {
|
||||
origin = getHost(sender.url);
|
||||
}
|
||||
|
||||
if (method === 'cpu.getInfo') {
|
||||
chrome.system.cpu.getInfo(doSendResponse);
|
||||
return true;
|
||||
} else if (method === 'logging.setMetadata') {
|
||||
const metaData = message['metaData'];
|
||||
chrome.webrtcLoggingPrivate.setMetaData(
|
||||
requestInfo, origin, metaData, doSendResponse);
|
||||
return true;
|
||||
} else if (method === 'logging.start') {
|
||||
chrome.webrtcLoggingPrivate.start(requestInfo, origin, doSendResponse);
|
||||
return true;
|
||||
} else if (method === 'logging.uploadOnRenderClose') {
|
||||
chrome.webrtcLoggingPrivate.setUploadOnRenderClose(
|
||||
requestInfo, origin, true);
|
||||
doSendResponse();
|
||||
return false;
|
||||
} else if (method === 'logging.stop') {
|
||||
chrome.webrtcLoggingPrivate.stop(requestInfo, origin, doSendResponse);
|
||||
return true;
|
||||
} else if (method === 'logging.stopAndUpload') {
|
||||
// Stop everything and upload. This is allowed to be called even if
|
||||
// logs have already been stopped or not started. Therefore, ignore
|
||||
// any errors along the way, but store them, so that if upload fails
|
||||
// they are all reported back.
|
||||
const errors = [];
|
||||
chrome.webrtcLoggingPrivate.stop(requestInfo, origin, function() {
|
||||
appendLastErrorMessage(errors);
|
||||
chrome.webrtcLoggingPrivate.upload(
|
||||
requestInfo, origin, function(uploadValue) {
|
||||
let errorMessage = null;
|
||||
// If upload fails, report all previous errors.
|
||||
// Otherwise, throw them away.
|
||||
if (chrome.runtime.lastError !== undefined) {
|
||||
appendLastErrorMessage(errors);
|
||||
errorMessage = errors.join('; ');
|
||||
}
|
||||
doSendResponse(uploadValue, errorMessage);
|
||||
});
|
||||
});
|
||||
return true;
|
||||
} else if (method === 'logging.store') {
|
||||
const logId = message['logId'];
|
||||
chrome.webrtcLoggingPrivate.store(
|
||||
requestInfo, origin, logId, doSendResponse);
|
||||
return true;
|
||||
} else if (method === 'logging.discard') {
|
||||
chrome.webrtcLoggingPrivate.discard(requestInfo, origin, doSendResponse);
|
||||
return true;
|
||||
} else if (method === 'logging.startEventLogging') {
|
||||
const sessionId = message['sessionId'] || '';
|
||||
const maxLogSizeBytes = message['maxLogSizeBytes'] || 0;
|
||||
const outputPeriodMs = message['outputPeriodMs'] || -1;
|
||||
const webAppId = message['webAppId'] || 0;
|
||||
chrome.webrtcLoggingPrivate.startEventLogging(
|
||||
requestInfo, origin, sessionId, maxLogSizeBytes, outputPeriodMs,
|
||||
webAppId, doSendResponse);
|
||||
return true;
|
||||
} else if (method === 'getHardwarePlatformInfo') {
|
||||
chrome.enterprise.hardwarePlatform.getHardwarePlatformInfo(
|
||||
doSendResponse);
|
||||
return true;
|
||||
}
|
||||
|
||||
throw new Error('Unknown method: ' + method);
|
||||
} catch (e) {
|
||||
doSendResponse(null, e.name + ': ' + e.message);
|
||||
}
|
||||
});
|
||||
|
||||
// This is a one-time-use port for calling chooseDesktopMedia. The page
|
||||
// sends one message, identifying the requested source types, and the
|
||||
// extension sends a single reply, with the user's selected streamId. A port
|
||||
// is used so that if the page is closed before that message is sent, the
|
||||
// window picker dialog will be closed.
|
||||
function onChooseDesktopMediaPort(port) {
|
||||
function sendResponse(streamId) {
|
||||
port.postMessage({'value': {'streamId': streamId}});
|
||||
port.disconnect();
|
||||
}
|
||||
|
||||
port.onMessage.addListener(function(message) {
|
||||
const method = message['method'];
|
||||
if (method === 'chooseDesktopMedia') {
|
||||
const sources = message['sources'];
|
||||
|
||||
// Options that getDisplayMedia() also has, which are applied *before*
|
||||
// the user makes their choice, and which typically serve to shape
|
||||
// the choice offered to the user.
|
||||
const options = message['options'] ||
|
||||
{systemAudio: 'include', selfBrowserSurface: 'include'};
|
||||
|
||||
// For historical reasons, default to the common behavior of users
|
||||
// of the Hangouts Extension, but still allow users of this API
|
||||
// to explicitly set their own value.
|
||||
if (!('suppressLocalAudioPlaybackIntended' in options)) {
|
||||
options['suppressLocalAudioPlaybackIntended'] = true;
|
||||
}
|
||||
|
||||
let cancelId = null;
|
||||
const tab = port.sender.tab;
|
||||
if (tab) {
|
||||
// Per crbug.com/425344, in order to allow an <iframe> on a different
|
||||
// domain, to get desktop media, we need to set the tab.url to match
|
||||
// the <iframe>, even though it doesn't really load the new url.
|
||||
tab.url = port.sender.url;
|
||||
cancelId = chrome.desktopCapture.chooseDesktopMedia(
|
||||
sources, tab, options, sendResponse);
|
||||
} else {
|
||||
const requestInfo = {};
|
||||
requestInfo['guestProcessId'] = port.sender.guestProcessId || 0;
|
||||
requestInfo['guestRenderFrameId'] =
|
||||
port.sender.guestRenderFrameRoutingId || 0;
|
||||
// TODO(crbug.com/40226648): Plumb systemAudio, selfBrowserSurface and
|
||||
// other options here.
|
||||
cancelId = chrome.webrtcDesktopCapturePrivate.chooseDesktopMedia(
|
||||
sources, requestInfo, sendResponse);
|
||||
}
|
||||
port.onDisconnect.addListener(function() {
|
||||
// This method has no effect if called after the user has selected a
|
||||
// desktop media source, so it does not need to be conditional.
|
||||
if (tab) {
|
||||
chrome.desktopCapture.cancelChooseDesktopMedia(cancelId);
|
||||
} else {
|
||||
chrome.webrtcDesktopCapturePrivate.cancelChooseDesktopMedia(cancelId);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// A port for continuously reporting relevant CPU usage information to the page.
|
||||
function onProcessCpu(port) {
|
||||
let tabPid = port.sender.guestProcessId || undefined;
|
||||
function processListener(processes) {
|
||||
if (tabPid === undefined) {
|
||||
// getProcessIdForTab sometimes fails, and does not call the callback.
|
||||
// (Tracked at https://crbug.com/368855.)
|
||||
// This call retries it on each process update until it succeeds.
|
||||
chrome.processes.getProcessIdForTab(port.sender.tab.id, function(x) {
|
||||
tabPid = x;
|
||||
});
|
||||
return;
|
||||
}
|
||||
const tabProcess = processes[tabPid];
|
||||
if (!tabProcess) {
|
||||
return;
|
||||
}
|
||||
|
||||
let browserProcessCpu;
|
||||
let gpuProcessCpu;
|
||||
for (const pid in processes) {
|
||||
const process = processes[pid];
|
||||
if (process.type === 'browser') {
|
||||
browserProcessCpu = process.cpu;
|
||||
} else if (process.type === 'gpu') {
|
||||
gpuProcessCpu = process.cpu;
|
||||
}
|
||||
if (browserProcessCpu && gpuProcessCpu) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
port.postMessage({
|
||||
'browserCpuUsage': browserProcessCpu || 0,
|
||||
'gpuCpuUsage': gpuProcessCpu || 0,
|
||||
'tabCpuUsage': tabProcess.cpu,
|
||||
'tabJsMemoryAllocated': tabProcess.jsMemoryAllocated,
|
||||
'tabJsMemoryUsed': tabProcess.jsMemoryUsed,
|
||||
});
|
||||
}
|
||||
|
||||
chrome.processes.onUpdated.addListener(processListener);
|
||||
port.onDisconnect.addListener(function() {
|
||||
chrome.processes.onUpdated.removeListener(processListener);
|
||||
});
|
||||
}
|
||||
|
||||
function appendLastErrorMessage(errors) {
|
||||
if (chrome.runtime.lastError !== undefined) {
|
||||
errors.push(chrome.runtime.lastError.message);
|
||||
}
|
||||
}
|
||||
|
||||
chrome.runtime.onConnectExternal.addListener(function(port) {
|
||||
if (port.name === 'chooseDesktopMedia') {
|
||||
onChooseDesktopMediaPort(port);
|
||||
} else if (port.name === 'processCpu') {
|
||||
onProcessCpu(port);
|
||||
} else {
|
||||
// Unknown port type.
|
||||
port.disconnect();
|
||||
}
|
||||
});
|
22
src/BUILD.gn
|
@ -14,6 +14,7 @@ import("//build/config/compiler/compiler.gni")
|
|||
import("//build/config/cronet/config.gni")
|
||||
import("//build/config/dcheck_always_on.gni")
|
||||
import("//build/config/features.gni")
|
||||
import("//build/config/ios/config.gni")
|
||||
import("//build/config/rust.gni")
|
||||
import("//build/config/sanitizers/sanitizers.gni")
|
||||
import("//build/config/ui.gni")
|
||||
|
@ -306,7 +307,7 @@ group("gn_all") {
|
|||
if (enable_pdf) {
|
||||
deps += [
|
||||
"//pdf/pdfium/fuzzers",
|
||||
"//third_party/pdfium/samples:pdfium_test",
|
||||
"//third_party/pdfium/testing:pdfium_test",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -400,7 +401,7 @@ group("gn_all") {
|
|||
"//third_party/android_build_tools/lint:custom_lint_java",
|
||||
"//third_party/androidx_javascriptengine",
|
||||
"//third_party/catapult/devil",
|
||||
"//third_party/jni_zero/sample:jni_generator_tests",
|
||||
"//third_party/jni_zero:jni_zero_tests",
|
||||
"//third_party/r8:custom_d8_java",
|
||||
"//tools/android:android_tools",
|
||||
"//tools/android:memconsumer",
|
||||
|
@ -562,8 +563,6 @@ group("gn_all") {
|
|||
"//courgette:courgette_fuzz",
|
||||
"//courgette:courgette_minimal_tool",
|
||||
"//courgette:courgette_unittests",
|
||||
"//media/cast:generate_barcode_video",
|
||||
"//media/cast:generate_timecode_audio",
|
||||
"//net:crash_cache",
|
||||
"//net:net_watcher", # TODO(GYP): This should be conditional on
|
||||
# use_v8_in_net
|
||||
|
@ -622,8 +621,6 @@ group("gn_all") {
|
|||
if (is_linux || is_chromeos_lacros) {
|
||||
deps += [
|
||||
"//gpu/khronos_glcts_support:khronos_glcts_test",
|
||||
"//media/cast:cast_benchmarks",
|
||||
"//media/cast:tap_proxy",
|
||||
"//skia:filter_fuzz_stub",
|
||||
"//skia:image_operations_bench",
|
||||
"//ui/snapshot:snapshot_unittests",
|
||||
|
@ -743,7 +740,6 @@ group("gn_all") {
|
|||
"//components/constrained_window:unit_tests",
|
||||
"//components/metrics:serialization",
|
||||
"//components/sessions:unit_tests",
|
||||
"//media/cast:udp_proxy",
|
||||
"//storage/browser:dump_file_system",
|
||||
"//third_party/angle:libANGLE",
|
||||
"//third_party/angle:libEGL",
|
||||
|
@ -1130,20 +1126,24 @@ if (use_blink && !is_cronet_build) {
|
|||
"//third_party/blink/tools:wpt_tests_isolate",
|
||||
]
|
||||
}
|
||||
script_test("content_shell_wpt") {
|
||||
script_test("headless_shell_wpt") {
|
||||
script = "//third_party/blink/tools/run_wpt_tests.py"
|
||||
args = [
|
||||
"--test-type",
|
||||
"testharness",
|
||||
"reftest",
|
||||
"crashtest",
|
||||
"--product=content_shell",
|
||||
"print-reftest",
|
||||
"--product=headless_shell",
|
||||
"--no-virtual-tests",
|
||||
"--no-wpt-internal",
|
||||
"--no-show-results",
|
||||
"--zero-tests-executed-ok",
|
||||
]
|
||||
data_deps = [
|
||||
":blink_web_tests_expectations",
|
||||
":blink_web_tests_support_data",
|
||||
"//chrome:chrome",
|
||||
"//chrome/test/chromedriver:chromedriver_server",
|
||||
"//third_party/blink/tools:wpt_tests_isolate",
|
||||
]
|
||||
|
@ -1241,7 +1241,7 @@ if (use_blink && !is_cronet_build) {
|
|||
data_deps += [ "//build/win:copy_cdb_to_output" ]
|
||||
}
|
||||
|
||||
if (is_mac) {
|
||||
if (is_mac || (is_ios && target_environment == "simulator")) {
|
||||
data += [
|
||||
"//third_party/apache-mac/",
|
||||
"//third_party/apache-mac-arm64/",
|
||||
|
@ -1710,7 +1710,7 @@ if (!is_ios && !is_android && !is_castos && !is_cronet_build) {
|
|||
if (!is_chromeos_ash) {
|
||||
deps += [ "//v8:v8_shell($v8_snapshot_toolchain)" ]
|
||||
if (enable_pdf) {
|
||||
deps += [ "//third_party/pdfium/samples:pdfium_test" ]
|
||||
deps += [ "//third_party/pdfium/testing:pdfium_test" ]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2024 The Chromium Authors and Alex313031 and gz83
|
||||
# Copyright 2024 The Chromium Authors, Alex313031, and gz83
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
|
@ -234,7 +234,6 @@ def dev_list():
|
|||
"libsctp-dev",
|
||||
"libspeechd-dev",
|
||||
"libsqlite3-dev",
|
||||
"libssl-dev",
|
||||
"libsystemd-dev",
|
||||
"libudev-dev",
|
||||
"libva-dev",
|
||||
|
@ -328,13 +327,23 @@ def dev_list():
|
|||
elif package_exists("lib32gcc1"):
|
||||
packages.append("lib32gcc1")
|
||||
|
||||
# TODO(b/339091434): Remove this workaround once this bug is fixed. This
|
||||
# workaround ensures the newer libssl-dev is used to prevent package conficts.
|
||||
apt_cache_cmd = ["apt-cache", "show", "libssl-dev"]
|
||||
output = subprocess.check_output(apt_cache_cmd).decode()
|
||||
pattern = re.compile(r'^Version: (.+?)$', re.M)
|
||||
versions = re.findall(pattern, output)
|
||||
if set(versions) == {"3.2.1-3", "3.0.10-1"}:
|
||||
packages.append("libssl-dev=3.2.1-3")
|
||||
else:
|
||||
packages.append("libssl-dev")
|
||||
|
||||
return packages
|
||||
|
||||
|
||||
# List of required run-time libraries
|
||||
def lib_list():
|
||||
packages = [
|
||||
"libasound2",
|
||||
"libatk1.0-0",
|
||||
"libatspi2.0-0",
|
||||
"libc6",
|
||||
|
@ -380,8 +389,9 @@ def lib_list():
|
|||
"libxrender1",
|
||||
"libxtst6",
|
||||
"x11-utils",
|
||||
"xserver-xorg-core", # TODO(crbug.com/1417069): Experimental.
|
||||
"xserver-xorg-video-dummy", # TODO(crbug.com/1417069): Experimental.
|
||||
"x11-xserver-utils",
|
||||
"xserver-xorg-core", # TODO(crbug.com/40257169): Experimental.
|
||||
"xserver-xorg-video-dummy", # TODO(crbug.com/40257169): Experimental.
|
||||
"xvfb",
|
||||
"zlib1g",
|
||||
]
|
||||
|
@ -403,7 +413,10 @@ def lib_list():
|
|||
elif package_exists("libffi6"):
|
||||
packages.append("libffi6")
|
||||
|
||||
if package_exists("libpng16-16"):
|
||||
# Workaround for dependency On Ubuntu 24.04 LTS (noble)
|
||||
if distro_codename() == "noble":
|
||||
packages.append("libpng16-16t64")
|
||||
elif package_exists("libpng16-16"):
|
||||
packages.append("libpng16-16")
|
||||
else:
|
||||
packages.append("libpng12-0")
|
||||
|
@ -427,8 +440,10 @@ def lib_list():
|
|||
# Work around for dependency on Ubuntu 24.04 LTS (noble)
|
||||
if distro_codename() == "noble":
|
||||
packages.append("libncurses6")
|
||||
packages.append("libasound2t64")
|
||||
else:
|
||||
packages.append("libncurses5")
|
||||
packages.append("libasound2")
|
||||
|
||||
return packages
|
||||
|
||||
|
@ -716,7 +731,7 @@ def nacl_list(options):
|
|||
else:
|
||||
packages.append("libudev0:i386")
|
||||
|
||||
# Work around for nacl dependency on Ubuntu 24.04 LTS (noble)
|
||||
# Work around for NaCl dependency on Ubuntu 24.04 LTS (noble)
|
||||
if distro_codename() == "noble":
|
||||
packages.append("libncurses6:i386")
|
||||
packages.append("lib32ncurses-dev")
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// static
|
||||
void QuietNotificationPermissionUiState::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
// TODO(crbug.com/1001857): Consider making this syncable.
|
||||
// TODO(crbug.com/40097905): Consider making this syncable.
|
||||
registry->RegisterBooleanPref(prefs::kEnableQuietNotificationPermissionUi,
|
||||
/*default_value=*/true);
|
||||
registry->RegisterBooleanPref(prefs::kEnableQuietGeolocationPermissionUi,
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
@ -23,6 +24,7 @@
|
|||
#include "base/files/file_enumerator.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/files/safe_base_name.h"
|
||||
#include "base/i18n/file_util_icu.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ref_counted_memory.h"
|
||||
|
@ -31,6 +33,7 @@
|
|||
#include "base/posix/eintr_wrapper.h"
|
||||
#include "base/process/kill.h"
|
||||
#include "base/process/launch.h"
|
||||
#include "base/strings/strcat.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
|
@ -48,10 +51,12 @@
|
|||
#include "chrome/common/channel_info.h"
|
||||
#include "chrome/common/chrome_constants.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/grit/branded_strings.h"
|
||||
#include "chrome/grit/chrome_unscaled_resources.h"
|
||||
#include "components/version_info/version_info.h"
|
||||
#include "third_party/libxml/chromium/xml_writer.h"
|
||||
#include "third_party/re2/src/re2/re2.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
#include "ui/gfx/image/image_family.h"
|
||||
#include "ui/ozone/public/ozone_platform.h"
|
||||
|
@ -503,28 +508,33 @@ bool GetExistingShortcutContents(base::Environment* env,
|
|||
return false;
|
||||
}
|
||||
|
||||
base::FilePath GetWebShortcutFilename(const GURL& url) {
|
||||
std::optional<base::SafeBaseName> GetUniqueWebShortcutFilename(
|
||||
const std::string& name) {
|
||||
// Use a prefix, because xdg-desktop-menu requires it.
|
||||
std::string filename =
|
||||
std::string(chrome::kBrowserProcessExecutableName) + "-" + url.spec();
|
||||
base::StrCat({chrome::kBrowserProcessExecutableName, "-", name});
|
||||
base::i18n::ReplaceIllegalCharactersInPath(&filename, '_');
|
||||
base::ReplaceChars(filename, " \n\r", "_", &filename);
|
||||
std::optional<base::SafeBaseName> opt_base_name_no_extension =
|
||||
base::SafeBaseName::Create(filename);
|
||||
// There should never be any path separators, as
|
||||
// `ReplaceIllegalCharactersInPath` removes them.
|
||||
CHECK(opt_base_name_no_extension);
|
||||
base::FilePath base_name_no_extension = opt_base_name_no_extension->path();
|
||||
|
||||
base::FilePath desktop_path;
|
||||
if (!base::PathService::Get(base::DIR_USER_DESKTOP, &desktop_path))
|
||||
return base::FilePath();
|
||||
|
||||
base::FilePath filepath = desktop_path.Append(filename);
|
||||
base::FilePath alternative_filepath(filepath.value() + ".desktop");
|
||||
for (size_t i = 1; i < 100; ++i) {
|
||||
if (base::PathExists(base::FilePath(alternative_filepath))) {
|
||||
alternative_filepath = base::FilePath(
|
||||
filepath.value() + "_" + base::NumberToString(i) + ".desktop");
|
||||
} else {
|
||||
return base::FilePath(alternative_filepath).BaseName();
|
||||
}
|
||||
if (!base::PathService::Get(base::DIR_USER_DESKTOP, &desktop_path)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return base::FilePath();
|
||||
// Using DCHECK because this is a slightly expensive check. This should be
|
||||
// guaranteed by `ReplaceIllegalCharactersInPath`.
|
||||
DCHECK(base::i18n::IsFilenameLegal(base_name_no_extension.AsUTF16Unsafe()));
|
||||
|
||||
base::FilePath filepath =
|
||||
desktop_path.Append(base_name_no_extension.AddExtension(".desktop"));
|
||||
return base::SafeBaseName::Create(
|
||||
base::GetUniquePathWithSuffixFormat(filepath, "_%d"));
|
||||
}
|
||||
|
||||
std::vector<base::FilePath> GetExistingProfileShortcutFilenames(
|
||||
|
@ -679,6 +689,76 @@ std::string GetDesktopFileContentsForCommand(
|
|||
#endif
|
||||
}
|
||||
|
||||
std::string GetDesktopFileContentsForUrlShortcut(
|
||||
const std::string& title,
|
||||
const GURL& url,
|
||||
const base::FilePath& icon_path,
|
||||
const base::FilePath& profile_path) {
|
||||
CHECK(url.is_valid());
|
||||
CHECK(!profile_path.empty());
|
||||
CHECK(!icon_path.empty());
|
||||
#if defined(USE_GLIB)
|
||||
base::FilePath chrome_exe_path =
|
||||
shell_integration_linux::internal::GetChromeExePath();
|
||||
base::CommandLine command_line =
|
||||
shell_integration::CommandLineArgsForUrlShortcut(chrome_exe_path,
|
||||
profile_path, url);
|
||||
|
||||
// Although not required by the spec, Nautilus on Ubuntu Karmic creates its
|
||||
// launchers with an xdg-open shebang. Follow that convention.
|
||||
std::string output_buffer = std::string(kXdgOpenShebang) + "\n";
|
||||
|
||||
// See http://standards.freedesktop.org/desktop-entry-spec/latest/
|
||||
GKeyFile* key_file = g_key_file_new();
|
||||
|
||||
// Set keys with fixed values.
|
||||
g_key_file_set_string(key_file, kDesktopEntry, "Version", "1.0");
|
||||
g_key_file_set_string(key_file, kDesktopEntry, "Type", "Application");
|
||||
|
||||
std::string final_title;
|
||||
// Make sure no endline characters can slip in and possibly introduce
|
||||
// additional lines (like Exec, which makes it a security risk).
|
||||
base::ReplaceChars(title, "\n\r", "", &final_title);
|
||||
if (final_title.empty()) {
|
||||
final_title = url.spec();
|
||||
}
|
||||
g_key_file_set_string(key_file, kDesktopEntry, "Name", final_title.c_str());
|
||||
|
||||
std::string final_path = QuoteCommandLineForDesktopFileExec(command_line);
|
||||
g_key_file_set_string(key_file, kDesktopEntry, "Exec", final_path.c_str());
|
||||
|
||||
// Set the "Icon" key.
|
||||
g_key_file_set_string(key_file, kDesktopEntry, "Icon",
|
||||
icon_path.value().c_str());
|
||||
|
||||
g_key_file_set_string(key_file, kDesktopEntry, "URL", url.spec().c_str());
|
||||
|
||||
std::string comment = l10n_util::GetStringFUTF8(
|
||||
IDS_DESKTOP_SHORTCUT_COMMENT, base::UTF8ToUTF16(url.spec()));
|
||||
g_key_file_set_string(key_file, kDesktopEntry, "Comment", comment.c_str());
|
||||
|
||||
gsize length = 0;
|
||||
gchar* data_dump = g_key_file_to_data(key_file, &length, nullptr);
|
||||
if (data_dump) {
|
||||
std::string_view contents(data_dump, length);
|
||||
if (contents.starts_with('\n')) {
|
||||
// Older versions of glib produce a leading newline. If this is the case,
|
||||
// remove it to avoid double-newline after the shebang.
|
||||
output_buffer += contents.substr(1);
|
||||
} else {
|
||||
output_buffer += contents;
|
||||
}
|
||||
g_free(data_dump);
|
||||
}
|
||||
|
||||
g_key_file_free(key_file);
|
||||
return output_buffer;
|
||||
#else
|
||||
NOTREACHED_NORETURN();
|
||||
return std::string();
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string GetDirectoryFileContents(const std::u16string& title,
|
||||
const std::string& icon_name) {
|
||||
#if defined(USE_GLIB)
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
@ -74,10 +75,10 @@
|
|||
#include "chrome/browser/ash/login/demo_mode/demo_setup_controller.h"
|
||||
#include "chrome/browser/ash/login/wizard_controller.h"
|
||||
#include "chrome/browser/browser_process_platform_part_ash.h"
|
||||
#include "chrome/browser/component_updater/cros_component_manager.h"
|
||||
#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
|
||||
#include "chrome/common/webui_url_constants.h"
|
||||
#include "chromeos/ash/components/system/statistics_provider.h"
|
||||
#include "components/component_updater/ash/component_manager_ash.h"
|
||||
#include "components/language/core/common/locale_util.h"
|
||||
#include "third_party/cros_system_api/dbus/service_constants.h"
|
||||
#include "third_party/zlib/google/compression_utils.h"
|
||||
|
@ -522,8 +523,8 @@ std::string ChromeURLs(content::BrowserContext* browser_context) {
|
|||
if (is_lacros_primary) {
|
||||
auto* WebUiControllerFactory = ChromeWebUIControllerFactory::GetInstance();
|
||||
for (const std::string& host : hosts) {
|
||||
// TODO(crbug/1271718): The refactor should make sure that the provided
|
||||
// list can be shown as is without filtering.
|
||||
// TODO(crbug.com/40805730): The refactor should make sure that the
|
||||
// provided list can be shown as is without filtering.
|
||||
if (WebUiControllerFactory->CanHandleUrl(GURL("os://" + host)) ||
|
||||
WebUiControllerFactory->CanHandleUrl(GURL("chrome://" + host))) {
|
||||
html +=
|
||||
|
@ -573,8 +574,8 @@ std::string ChromeURLs(content::BrowserContext* browser_context) {
|
|||
if (is_lacros_primary) {
|
||||
auto* WebUiControllerFactory = ChromeWebUIControllerFactory::GetInstance();
|
||||
for (size_t i = 0; i < chrome::kNumberOfChromeDebugURLs; i++) {
|
||||
// TODO(crbug/1271718): The refactor should make sure that the provided
|
||||
// list can be shown as is without filtering.
|
||||
// TODO(crbug.com/40805730): The refactor should make sure that the
|
||||
// provided list can be shown as is without filtering.
|
||||
const std::string host = GURL(chrome::kChromeDebugURLs[i]).host();
|
||||
if (WebUiControllerFactory->CanHandleUrl(GURL("os://" + host)) ||
|
||||
WebUiControllerFactory->CanHandleUrl(GURL("chrome://" + host))) {
|
||||
|
@ -630,7 +631,8 @@ void AboutUIHTMLSource::StartDataRequest(
|
|||
const GURL& url,
|
||||
const content::WebContents::Getter& wc_getter,
|
||||
content::URLDataSource::GotDataCallback callback) {
|
||||
// TODO(crbug/1009127): Simplify usages of |path| since |url| is available.
|
||||
// TODO(crbug.com/40050262): Simplify usages of |path| since |url| is
|
||||
// available.
|
||||
const std::string path = content::URLDataSource::URLToRequestPath(url);
|
||||
std::string response;
|
||||
// Add your data source here, in alphabetical order.
|
||||
|
@ -703,7 +705,7 @@ void AboutUIHTMLSource::FinishDataRequest(
|
|||
}
|
||||
|
||||
std::string AboutUIHTMLSource::GetMimeType(const GURL& url) {
|
||||
const base::StringPiece path = url.path_piece().substr(1);
|
||||
const std::string_view path = url.path_piece().substr(1);
|
||||
if (path == kCreditsJsPath || path == kStatsJsPath ||
|
||||
path == kStringsJsPath) {
|
||||
return "application/javascript";
|
||||
|
|
|
@ -7,11 +7,10 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include "base/environment.h"
|
||||
#include "base/notreached.h"
|
||||
#include "base/strings/strcat.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
|
@ -36,8 +35,8 @@ struct ChannelState {
|
|||
ChannelState GetChannelImpl() {
|
||||
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
const char* const env = getenv("CHROME_VERSION_EXTRA");
|
||||
const base::StringPiece env_str =
|
||||
env ? base::StringPiece(env) : base::StringPiece();
|
||||
const std::string_view env_str =
|
||||
env ? std::string_view(env) : std::string_view();
|
||||
|
||||
// Ordered by decreasing expected population size.
|
||||
if (env_str == "stable")
|
||||
|
@ -48,6 +47,9 @@ ChannelState GetChannelImpl() {
|
|||
return {version_info::Channel::BETA, /*is_extended_stable=*/false};
|
||||
if (env_str == "unstable") // linux version of "dev"
|
||||
return {version_info::Channel::DEV, /*is_extended_stable=*/false};
|
||||
if (env_str == "canary") {
|
||||
return {version_info::Channel::CANARY, /*is_extended_stable=*/false};
|
||||
}
|
||||
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
|
||||
return {version_info::Channel::UNKNOWN, /*is_extended_stable=*/false};
|
||||
|
@ -62,8 +64,7 @@ std::string GetChannelName(WithExtendedStable with_extended_stable) {
|
|||
case version_info::Channel::UNKNOWN:
|
||||
return "unknown";
|
||||
case version_info::Channel::CANARY:
|
||||
NOTREACHED();
|
||||
return "unknown";
|
||||
return "canary";
|
||||
case version_info::Channel::DEV:
|
||||
return "dev";
|
||||
case version_info::Channel::BETA:
|
||||
|
@ -75,7 +76,7 @@ std::string GetChannelName(WithExtendedStable with_extended_stable) {
|
|||
}
|
||||
#else // BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
const char* const env = getenv("CHROME_VERSION_EXTRA");
|
||||
return env ? std::string(base::StringPiece(env)) : std::string();
|
||||
return env ? std::string(std::string_view(env)) : std::string();
|
||||
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
}
|
||||
|
||||
|
@ -97,6 +98,8 @@ std::string GetChannelSuffixForExtraFlagsEnvVarName() {
|
|||
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
const auto channel_state = GetChannelImpl();
|
||||
switch (channel_state.channel) {
|
||||
case version_info::Channel::CANARY:
|
||||
return "_CANARY";
|
||||
case version_info::Channel::DEV:
|
||||
return "_DEV";
|
||||
case version_info::Channel::BETA:
|
||||
|
@ -110,13 +113,13 @@ std::string GetChannelSuffixForExtraFlagsEnvVarName() {
|
|||
const char* const channel_name = getenv("CHROME_VERSION_EXTRA");
|
||||
return channel_name
|
||||
? base::StrCat(
|
||||
{"_", base::ToUpperASCII(base::StringPiece(channel_name))})
|
||||
{"_", base::ToUpperASCII(std::string_view(channel_name))})
|
||||
: std::string();
|
||||
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
}
|
||||
#endif // BUILDFLAG(IS_LINUX)
|
||||
|
||||
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
|
||||
// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
|
||||
// of lacros-chrome is complete.
|
||||
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
std::string GetDesktopName(base::Environment* env) {
|
||||
|
|
|
@ -36,7 +36,7 @@ declare_args() {
|
|||
|
||||
config("mini_installer_compiler_flags") {
|
||||
# Disable buffer security checking.
|
||||
cflags = [ "/GS-" ]
|
||||
cflags = [ "/GS-", "/clang:-O3" ]
|
||||
}
|
||||
|
||||
source_set("lib") {
|
||||
|
@ -183,7 +183,7 @@ action("mini_installer_archive") {
|
|||
#'--diff_algorithm=COURGETTE',
|
||||
|
||||
# Optional argument for verbose archiving output.
|
||||
#"--verbose",
|
||||
"--verbose",
|
||||
]
|
||||
|
||||
deps = [
|
||||
|
@ -232,7 +232,8 @@ action("mini_installer_archive") {
|
|||
if (use_v8_context_snapshot) {
|
||||
inputs += [ "$root_out_dir/$v8_context_snapshot_filename" ]
|
||||
deps += [ "//tools/v8_context_snapshot" ]
|
||||
} else {
|
||||
}
|
||||
if (!use_v8_context_snapshot || include_both_v8_snapshots) {
|
||||
inputs += [ "$root_out_dir/snapshot_blob.bin" ]
|
||||
args += [ "--include_snapshotblob=1" ]
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/functional/callback_helpers.h"
|
||||
#include "base/hash/md5.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/logging.h"
|
||||
|
@ -68,6 +67,7 @@
|
|||
#include "chrome/installer/util/util_constants.h"
|
||||
#include "chrome/installer/util/work_item.h"
|
||||
#include "components/base32/base32.h"
|
||||
#include "third_party/abseil-cpp/absl/cleanup/cleanup.h"
|
||||
|
||||
using base::win::RegKey;
|
||||
|
||||
|
@ -1348,9 +1348,9 @@ bool RegisterChromeBrowserImpl(const base::FilePath& chrome_exe,
|
|||
|
||||
// Ensure that the shell is notified of the mutations below. Specific exit
|
||||
// points may disable this if no mutations are made.
|
||||
base::ScopedClosureRunner notify_on_exit(base::BindOnce([] {
|
||||
absl::Cleanup notify_on_exit = [] {
|
||||
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nullptr, nullptr);
|
||||
}));
|
||||
};
|
||||
|
||||
// Do the full registration at user-level or if the user is an admin.
|
||||
if (root == HKEY_CURRENT_USER || IsUserAnAdmin()) {
|
||||
|
@ -1371,7 +1371,7 @@ bool RegisterChromeBrowserImpl(const base::FilePath& chrome_exe,
|
|||
// localization issues (see https://crbug.com/717913#c18). It likely is not,
|
||||
// so return success to allow Chrome to be made default.
|
||||
if (!user_level) {
|
||||
notify_on_exit.Release().Reset();
|
||||
std::move(notify_on_exit).Cancel();
|
||||
return true;
|
||||
}
|
||||
// Try to elevate and register if requested for per-user installs if the user
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
#include "base/containers/contains.h"
|
||||
|
@ -18,7 +19,6 @@
|
|||
#include "base/metrics/field_trial_params.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/strings/strcat.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/strings/string_tokenizer.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
|
@ -175,7 +175,7 @@ std::vector<std::string> TokenizeOriginList(const std::string& value) {
|
|||
base::StringTokenizer tokenizer(input, delimiters);
|
||||
std::vector<std::string> origin_strings;
|
||||
while (tokenizer.GetNext()) {
|
||||
base::StringPiece token = tokenizer.token_piece();
|
||||
std::string_view token = tokenizer.token_piece();
|
||||
DCHECK(!token.empty());
|
||||
const GURL url(token);
|
||||
if (!url.is_valid() ||
|
||||
|
@ -514,9 +514,9 @@ void FlagsState::RemoveFlagsSwitches(
|
|||
const std::string& existing_value_utf8 = existing_value;
|
||||
#endif
|
||||
|
||||
std::vector<base::StringPiece> features =
|
||||
std::vector<std::string_view> features =
|
||||
base::FeatureList::SplitFeatureListString(existing_value_utf8);
|
||||
std::vector<base::StringPiece> remaining_features;
|
||||
std::vector<std::string_view> remaining_features;
|
||||
// For any featrue name in |features| that is not in |switch_added_values| -
|
||||
// i.e. it wasn't added by about_flags code, add it to |remaining_features|.
|
||||
for (const auto& feature : features) {
|
||||
|
@ -845,7 +845,7 @@ void FlagsState::MergeFeatureCommandLineSwitch(
|
|||
base::CommandLine* command_line) {
|
||||
std::string original_switch_value =
|
||||
command_line->GetSwitchValueASCII(switch_name);
|
||||
std::vector<base::StringPiece> features =
|
||||
std::vector<std::string_view> features =
|
||||
base::FeatureList::SplitFeatureListString(original_switch_value);
|
||||
// Only add features that don't already exist in the lists.
|
||||
// Note: The base::Contains() call results in O(n^2) performance, but in
|
||||
|
|
|
@ -187,7 +187,7 @@ IN_PROC_BROWSER_TEST_F(LaunchAsMojoClientBrowserTest, LaunchAndBindInterface) {
|
|||
#endif // !BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
|
||||
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
||||
// TODO(crbug.com/1259557): This test implementation fundamentally conflicts
|
||||
// TODO(crbug.com/40057593): This test implementation fundamentally conflicts
|
||||
// with a fix for the linked bug because it causes a browser process to behave
|
||||
// partially as a broker and partially as a non-broker. This can be re-enabled
|
||||
// when we migrate away from the current Mojo implementation. It's OK to disable
|
||||
|
|
|
@ -15,6 +15,7 @@ import("//gpu/vulkan/features.gni")
|
|||
import("//media/media_options.gni")
|
||||
import("//mojo/public/tools/bindings/mojom.gni")
|
||||
import("//ppapi/buildflags/buildflags.gni")
|
||||
import("//third_party/inspector_protocol/inspector_protocol.gni")
|
||||
import("//tools/grit/grit_rule.gni")
|
||||
import("//tools/grit/repack.gni")
|
||||
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
|
||||
|
@ -47,24 +48,6 @@ declare_args() {
|
|||
content_shell_major_version = "999"
|
||||
}
|
||||
|
||||
template("extension2_bundle_data") {
|
||||
assert(defined(invoker.extension_target),
|
||||
"extension_target must be defined for $target_name")
|
||||
|
||||
_extension_name = get_label_info(invoker.extension_target, "name") + ".appex"
|
||||
if (defined(invoker.extension_name)) {
|
||||
_extension_name = invoker.extension_name
|
||||
}
|
||||
|
||||
bundle_data(target_name) {
|
||||
testonly = true
|
||||
public_deps = [ invoker.extension_target ]
|
||||
outputs = [ "{{bundle_contents_dir}}/Extensions/{{source_file_part}}" ]
|
||||
sources = [ get_label_info(invoker.extension_target, "root_out_dir") +
|
||||
"/$_extension_name" ]
|
||||
}
|
||||
}
|
||||
|
||||
config("content_shell_lib_warnings") {
|
||||
if (is_clang) {
|
||||
# TODO(thakis): Remove this once http://crbug.com/383820 is figured out
|
||||
|
@ -150,9 +133,40 @@ static_library("content_shell_app") {
|
|||
]
|
||||
}
|
||||
|
||||
inspector_protocol_generate("protocol_sources") {
|
||||
visibility = [ ":content_shell_lib" ]
|
||||
deps = [ "//third_party/blink/public/devtools_protocol:protocol_version" ]
|
||||
_blink_protocol_path = rebase_path(
|
||||
"$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
|
||||
root_build_dir)
|
||||
|
||||
inspector_protocol_dir = "//third_party/inspector_protocol"
|
||||
out_dir = "$target_gen_dir/browser"
|
||||
config_file = "browser/protocol_config.json"
|
||||
config_values = [ "protocol.path=$_blink_protocol_path" ]
|
||||
use_embedder_types = true
|
||||
|
||||
inputs = [
|
||||
"$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
|
||||
config_file,
|
||||
]
|
||||
|
||||
# These are relative to $target_gen_dir.
|
||||
outputs = [
|
||||
"protocol/browser.cc",
|
||||
"protocol/browser.h",
|
||||
"protocol/protocol.h",
|
||||
]
|
||||
}
|
||||
|
||||
static_library("content_shell_lib") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"browser/protocol/browser_handler.cc",
|
||||
"browser/protocol/browser_handler.h",
|
||||
"browser/protocol/domain_handler.h",
|
||||
"browser/protocol/shell_devtools_session.cc",
|
||||
"browser/protocol/shell_devtools_session.h",
|
||||
"browser/shell.cc",
|
||||
"browser/shell.h",
|
||||
"browser/shell_browser_context.cc",
|
||||
|
@ -210,6 +224,8 @@ static_library("content_shell_lib") {
|
|||
"utility/shell_content_utility_client.h",
|
||||
]
|
||||
|
||||
sources += get_target_outputs(":protocol_sources")
|
||||
|
||||
if (is_android) {
|
||||
sources += [
|
||||
"android/shell_manager.cc",
|
||||
|
@ -292,11 +308,11 @@ static_library("content_shell_lib") {
|
|||
]
|
||||
deps = [
|
||||
":content_browsertests_mojom",
|
||||
":protocol_sources",
|
||||
":resources",
|
||||
":shell_controller_mojom",
|
||||
"//base",
|
||||
"//base:base_static",
|
||||
"//base/third_party/dynamic_annotations",
|
||||
"//build:chromeos_buildflags",
|
||||
"//cc/base",
|
||||
"//components/cdm/renderer",
|
||||
|
@ -340,6 +356,7 @@ static_library("content_shell_lib") {
|
|||
"//third_party/blink/public:resources",
|
||||
"//third_party/blink/public/strings",
|
||||
"//third_party/blink/public/strings:accessibility_strings",
|
||||
"//third_party/inspector_protocol:crdtp",
|
||||
"//ui/base",
|
||||
"//ui/base/clipboard",
|
||||
"//ui/base/ime/init",
|
||||
|
@ -636,7 +653,7 @@ if (is_android) {
|
|||
# Path to an entitlements file used in ios_content_shell. Can be overridden
|
||||
# to provide an alternative.
|
||||
ios_content_shell_entitlements_path =
|
||||
"//content/shell/app/ios/content_shell.entitlements"
|
||||
"//content/app/ios/appex/app.entitlements"
|
||||
}
|
||||
|
||||
ios_app_bundle("content_shell") {
|
||||
|
@ -649,6 +666,7 @@ if (is_android) {
|
|||
":content_process_bundle",
|
||||
":content_shell_app",
|
||||
":content_shell_lib",
|
||||
":gpu_process_bundle",
|
||||
":network_process_bundle",
|
||||
"//base",
|
||||
"//build:ios_buildflags",
|
||||
|
@ -664,16 +682,27 @@ if (is_android) {
|
|||
|
||||
if (current_toolchain == default_toolchain) {
|
||||
_extension_toolchain = "${current_toolchain}_blink_app_ext"
|
||||
extension2_bundle_data("content_process_bundle") {
|
||||
extension_bundle_data("content_process_bundle") {
|
||||
testonly = true
|
||||
extension_dir = "Extensions"
|
||||
extension_name = "content_process.appex"
|
||||
extension_target =
|
||||
"//content/shell/app/ios:content_process(${_extension_toolchain})"
|
||||
}
|
||||
extension2_bundle_data("network_process_bundle") {
|
||||
extension_bundle_data("network_process_bundle") {
|
||||
testonly = true
|
||||
extension_dir = "Extensions"
|
||||
extension_name = "network_process.appex"
|
||||
extension_target =
|
||||
"//content/shell/app/ios:network_process(${_extension_toolchain})"
|
||||
}
|
||||
extension_bundle_data("gpu_process_bundle") {
|
||||
testonly = true
|
||||
extension_dir = "Extensions"
|
||||
extension_name = "gpu_process.appex"
|
||||
extension_target =
|
||||
"//content/shell/app/ios:gpu_process(${_extension_toolchain})"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
executable("thorium_shell") {
|
||||
|
@ -782,7 +811,8 @@ if (is_apple) {
|
|||
if (use_v8_context_snapshot) {
|
||||
sources += [ "$root_out_dir/$v8_context_snapshot_filename" ]
|
||||
public_deps += [ "//tools/v8_context_snapshot" ]
|
||||
} else {
|
||||
}
|
||||
if (!use_v8_context_snapshot || include_both_v8_snapshots) {
|
||||
sources += [ "$root_out_dir/snapshot_blob.bin" ]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ content_shell_apk_tmpl("content_shell_test_apk") {
|
|||
|
||||
additional_apks = [ "//net/android:net_test_support_apk" ]
|
||||
|
||||
# TODO(crbug.com/1099536): Fix tests that break when this is increased.
|
||||
# TODO(crbug.com/40137544): Fix tests that break when this is increased.
|
||||
target_sdk_version = 24
|
||||
}
|
||||
|
||||
|
|
|
@ -75,9 +75,9 @@
|
|||
#endif // BUILDFLAG(IS_MAC)
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include <initguid.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include <initguid.h>
|
||||
#include "base/logging_win.h"
|
||||
#include "base/win/scoped_handle.h"
|
||||
#include "base/win/win_util.h"
|
||||
|
@ -176,9 +176,7 @@ void InitLogging(const base::CommandLine& command_line) {
|
|||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
if (dest == LoggingDest::kFile) {
|
||||
settings.log_file_path = log_filename.value().c_str();
|
||||
} else {
|
||||
settings.log_file_path = nullptr;
|
||||
settings.log_file_path = log_filename.value();
|
||||
}
|
||||
|
||||
if (dest == LoggingDest::kStderr) {
|
||||
|
@ -272,7 +270,7 @@ void ShellMainDelegate::PreSandboxStartup() {
|
|||
|
||||
// Disable platform crash handling and initialize the crash reporter, if
|
||||
// requested.
|
||||
// TODO(crbug.com/1226159): Implement crash reporter integration for Fuchsia.
|
||||
// TODO(crbug.com/40188745): Implement crash reporter integration for Fuchsia.
|
||||
#if !BUILDFLAG(IS_FUCHSIA)
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kEnableCrashReporter)) {
|
||||
|
@ -385,7 +383,7 @@ void ShellMainDelegate::InitializeResourceBundle() {
|
|||
global_descriptors->Set(kShellPakDescriptor, pak_fd, pak_region);
|
||||
}
|
||||
DCHECK_GE(pak_fd, 0);
|
||||
// TODO(crbug.com/330930): A better way to prevent fdsan error from a double
|
||||
// TODO(crbug.com/40346051): A better way to prevent fdsan error from a double
|
||||
// close is to refactor GlobalDescriptors.{Get,MaybeGet} to return
|
||||
// "const base::File&" rather than fd itself.
|
||||
base::File android_pak_file(pak_fd);
|
||||
|
@ -436,7 +434,7 @@ std::optional<int> ShellMainDelegate::PostEarlyInitialization(
|
|||
// PoissonAllocationSampler in the ContentShell. Therefore, enforce inclusion
|
||||
// at the moment.
|
||||
//
|
||||
// TODO(https://crbug.com/1411454): Clarify which users of
|
||||
// TODO(crbug.com/40062835): Clarify which users of
|
||||
// PoissonAllocationSampler we have in the ContentShell. Do we really need to
|
||||
// enforce it?
|
||||
memory_system::Initializer()
|
||||
|
|
|
@ -116,7 +116,7 @@ class ShellView : public views::BoxLayoutView,
|
|||
|
||||
// Resize the widget, keeping the same origin.
|
||||
gfx::Rect bounds = GetWidget()->GetWindowBoundsInScreen();
|
||||
bounds.set_size(GetWidget()->GetRootView()->GetPreferredSize());
|
||||
bounds.set_size(GetWidget()->GetRootView()->GetPreferredSize({}));
|
||||
GetWidget()->SetBounds(bounds);
|
||||
|
||||
// Resizing a widget on chromeos doesn't automatically resize the root, need
|
||||
|
@ -144,7 +144,7 @@ class ShellView : public views::BoxLayoutView,
|
|||
void InitShellWindow() {
|
||||
auto toolbar_button_rule = [](const views::View* view,
|
||||
const views::SizeBounds& size_bounds) {
|
||||
gfx::Size preferred_size = view->GetPreferredSize();
|
||||
gfx::Size preferred_size = view->GetPreferredSize({});
|
||||
if (size_bounds != views::SizeBounds() &&
|
||||
size_bounds.width().is_bounded()) {
|
||||
preferred_size.set_width(std::max(
|
||||
|
|
|
@ -35,6 +35,7 @@ if (is_android) {
|
|||
|
||||
if (is_ios) {
|
||||
import("//build/config/ios/bundle_data_from_filelist.gni")
|
||||
import("//build/ios/extension_bundle_data.gni")
|
||||
}
|
||||
|
||||
# Use a static library here because many test binaries depend on this but don't
|
||||
|
@ -49,16 +50,15 @@ static_library("test_support") {
|
|||
}
|
||||
|
||||
sources = [
|
||||
"../browser/accessibility/test_browser_accessibility_delegate.cc",
|
||||
"../browser/accessibility/test_browser_accessibility_delegate.h",
|
||||
"../browser/aggregation_service/aggregation_service_test_utils.cc",
|
||||
"../browser/aggregation_service/aggregation_service_test_utils.h",
|
||||
"../browser/attribution_reporting/attribution_interop_parser.cc",
|
||||
"../browser/attribution_reporting/attribution_interop_parser.h",
|
||||
"../browser/attribution_reporting/attribution_interop_runner.cc",
|
||||
"../browser/attribution_reporting/attribution_interop_runner.h",
|
||||
"../browser/aggregation_service/public_key.h",
|
||||
"../browser/attribution_reporting/attribution_test_utils.cc",
|
||||
"../browser/attribution_reporting/attribution_test_utils.h",
|
||||
"../browser/attribution_reporting/interop/parser.cc",
|
||||
"../browser/attribution_reporting/interop/parser.h",
|
||||
"../browser/attribution_reporting/interop/runner.cc",
|
||||
"../browser/attribution_reporting/interop/runner.h",
|
||||
"../browser/attribution_reporting/test/configurable_storage_delegate.cc",
|
||||
"../browser/attribution_reporting/test/configurable_storage_delegate.h",
|
||||
"../browser/attribution_reporting/test/mock_attribution_data_host_manager.cc",
|
||||
|
@ -119,6 +119,10 @@ static_library("test_support") {
|
|||
"../browser/renderer_host/document_service_echo_impl.h",
|
||||
"../browser/renderer_host/input/mock_input_router.cc",
|
||||
"../browser/renderer_host/input/mock_input_router.h",
|
||||
"../browser/renderer_host/media/fake_video_capture_device_launcher.cc",
|
||||
"../browser/renderer_host/media/fake_video_capture_device_launcher.h",
|
||||
"../browser/renderer_host/media/fake_video_capture_provider.cc",
|
||||
"../browser/renderer_host/media/fake_video_capture_provider.h",
|
||||
"../browser/renderer_host/mock_render_widget_host.cc",
|
||||
"../browser/renderer_host/mock_render_widget_host.h",
|
||||
"../browser/screen_details/screen_details_test_utils.cc",
|
||||
|
@ -173,6 +177,8 @@ static_library("test_support") {
|
|||
"../public/test/browsing_data_remover_test_util.h",
|
||||
"../public/test/browsing_topics_test_util.cc",
|
||||
"../public/test/browsing_topics_test_util.h",
|
||||
"../public/test/captured_surface_test_utils.cc",
|
||||
"../public/test/captured_surface_test_utils.h",
|
||||
"../public/test/commit_message_delayer.cc",
|
||||
"../public/test/commit_message_delayer.h",
|
||||
"../public/test/content_mock_cert_verifier.cc",
|
||||
|
@ -257,6 +263,8 @@ static_library("test_support") {
|
|||
"../public/test/navigation_handle_observer.cc",
|
||||
"../public/test/navigation_handle_observer.h",
|
||||
"../public/test/navigation_simulator.h",
|
||||
"../public/test/navigation_transition_test_utils.cc",
|
||||
"../public/test/navigation_transition_test_utils.h",
|
||||
"../public/test/network_connection_change_simulator.cc",
|
||||
"../public/test/network_connection_change_simulator.h",
|
||||
"../public/test/network_service_test_helper.cc",
|
||||
|
@ -520,7 +528,6 @@ static_library("test_support") {
|
|||
deps = [
|
||||
":content_test_mojo_bindings",
|
||||
":web_ui_mojo_test_resources",
|
||||
"//base/third_party/dynamic_annotations",
|
||||
"//build:chromeos_buildflags",
|
||||
"//cc:test_support",
|
||||
"//components/attribution_reporting:mojom",
|
||||
|
@ -644,6 +651,14 @@ static_library("test_support") {
|
|||
"../public/test/mock_captured_surface_controller.cc",
|
||||
"../public/test/mock_captured_surface_controller.h",
|
||||
]
|
||||
|
||||
if (!is_fuchsia) {
|
||||
sources += [
|
||||
"../browser/speech/fake_speech_recognition_manager_delegate.cc",
|
||||
"../browser/speech/fake_speech_recognition_manager_delegate.h",
|
||||
]
|
||||
deps += [ "//components/soda:soda" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (is_chromeos_ash) {
|
||||
|
@ -827,9 +842,9 @@ static_library("test_support") {
|
|||
# Fuchsia performance tests on smart displays use web_engine and a browser
|
||||
# like shell instead of an actual browser, so Fuchsia needs a separate target.
|
||||
if (is_fuchsia) {
|
||||
# TODO(crbug.com/1310086): Split this test suite into chrome/WebEngine
|
||||
# TODO(crbug.com/40830160): Split this test suite into chrome/WebEngine
|
||||
# versions.
|
||||
# TODO(crbug.com/1309686): Move WebEngine-specific suites to //fuchsia_web/webengine/
|
||||
# TODO(crbug.com/40829930): Move WebEngine-specific suites to //fuchsia_web/webengine/
|
||||
group("performance_web_engine_test_suite") {
|
||||
testonly = true
|
||||
data = [ "//content/test/gpu/run_telemetry_benchmark_fuchsia.py" ]
|
||||
|
@ -885,7 +900,6 @@ group("telemetry_gpu_integration_test_support") {
|
|||
# ability to dedupe tasks.
|
||||
"//tools/perf/page_sets/maps_perf_test/config.js",
|
||||
"//tools/perf/page_sets/maps_perf_test/load_dataset",
|
||||
"//tools/perf/page_sets/maps_perf_test/load_dataset.sha1",
|
||||
"//tools/perf/page_sets/maps_perf_test/performance.html",
|
||||
"//tools/perf/page_sets/maps_perf_test/tracked.js",
|
||||
"//tools/perf/page_sets/maps_perf_test/worker.js",
|
||||
|
@ -989,6 +1003,7 @@ source_set("default_content_test_launcher") {
|
|||
deps = [
|
||||
":browsertest_support",
|
||||
":test_support",
|
||||
"//build:ios_buildflags",
|
||||
"//content/shell:content_shell_lib",
|
||||
]
|
||||
}
|
||||
|
@ -1023,6 +1038,8 @@ static_library("browsertest_support") {
|
|||
"../public/test/content_cert_verifier_browser_test.h",
|
||||
"../public/test/resource_load_observer.cc",
|
||||
"../public/test/resource_load_observer.h",
|
||||
"content_browser_test_base.cc",
|
||||
"content_browser_test_base.h",
|
||||
"content_browser_test_utils_internal.cc",
|
||||
"content_browser_test_utils_internal.h",
|
||||
]
|
||||
|
@ -1049,6 +1066,7 @@ static_library("browsertest_support") {
|
|||
"//content/shell:content_shell_lib",
|
||||
"//gin",
|
||||
"//media",
|
||||
"//mojo/public/cpp/test_support:test_utils",
|
||||
"//net",
|
||||
"//net:test_support",
|
||||
"//ui/accessibility:ax_enums_mojo",
|
||||
|
@ -1373,15 +1391,14 @@ test("content_browsertests") {
|
|||
"../browser/child_process_security_policy_browsertest.cc",
|
||||
"../browser/closewatcher/close_listener_host_browsertest.cc",
|
||||
"../browser/code_cache/generated_code_cache_browsertest.cc",
|
||||
"../browser/compute_pressure/compute_pressure_origin_trial_browsertest.cc",
|
||||
"../browser/compute_pressure/pressure_service_browsertest.cc",
|
||||
"../browser/content_index/content_index_browsertest.cc",
|
||||
"../browser/content_security_policy_browsertest.cc",
|
||||
"../browser/cookie_deprecation_label/cookie_deprecation_label_browsertest.cc",
|
||||
"../browser/cross_origin_opener_policy_browsertest.cc",
|
||||
"../browser/cross_site_transfer_browsertest.cc",
|
||||
"../browser/data_decoder_browsertest.cc",
|
||||
"../browser/database_browsertest.cc",
|
||||
"../browser/device_posture/foldable_apis_origin_trial_browsertest.cc",
|
||||
"../browser/device_sensors/device_sensor_browsertest.cc",
|
||||
"../browser/devtools/devtools_issue_storage_browsertest.cc",
|
||||
"../browser/devtools/devtools_trust_token_browsertest.cc",
|
||||
|
@ -1494,6 +1511,7 @@ test("content_browsertests") {
|
|||
"../browser/power_monitor_browsertest.cc",
|
||||
"../browser/preloading/anchor_element_interaction_browsertest.cc",
|
||||
"../browser/preloading/prefetch/contamination_delay_browsertest.cc",
|
||||
"../browser/preloading/prefetch/nav_prefetch_browsertest.cc",
|
||||
"../browser/preloading/preloading_decider_browsertest.cc",
|
||||
"../browser/preloading/prerender/prerender_browsertest.cc",
|
||||
"../browser/private_aggregation/private_aggregation_internals_browsertest.cc",
|
||||
|
@ -1540,7 +1558,6 @@ test("content_browsertests") {
|
|||
"../browser/renderer_host/page_impl_browsertest.cc",
|
||||
"../browser/renderer_host/page_lifecycle_state_manager_browsertest.cc",
|
||||
"../browser/renderer_host/panel_rotation_browsertest.cc",
|
||||
"../browser/renderer_host/pending_beacon_browsertest.cc",
|
||||
"../browser/renderer_host/policy_container_host_browsertest.cc",
|
||||
"../browser/renderer_host/private_network_access_browsertest.cc",
|
||||
"../browser/renderer_host/proactively_swap_browsing_instances_browsertest.cc",
|
||||
|
@ -1562,6 +1579,7 @@ test("content_browsertests") {
|
|||
"../browser/resource_loading_browsertest.cc",
|
||||
"../browser/screen_details/screen_details_browsertest.cc",
|
||||
"../browser/screen_orientation/screen_orientation_browsertest.cc",
|
||||
"../browser/security/coop/cross_origin_opener_policy_browsertest.cc",
|
||||
"../browser/security_exploit_browsertest.cc",
|
||||
"../browser/service_process_host_browsertest.cc",
|
||||
"../browser/service_worker/service_worker_auth_browsertest.cc",
|
||||
|
@ -1577,6 +1595,7 @@ test("content_browsertests") {
|
|||
"../browser/session_history_browsertest.cc",
|
||||
"../browser/shape_detection/shape_detection_browsertest.cc",
|
||||
"../browser/shared_storage/shared_storage_browsertest.cc",
|
||||
"../browser/site_instance_group_browsertest.cc",
|
||||
"../browser/site_per_process_browsertest.cc",
|
||||
"../browser/site_per_process_browsertest.h",
|
||||
"../browser/site_per_process_hit_test_browsertest.cc",
|
||||
|
@ -1677,7 +1696,7 @@ test("content_browsertests") {
|
|||
"../browser/navigation_transitions/back_forward_transition_animation_manager_android_browsertest.cc",
|
||||
"../browser/network/quic_connection_migration_android_browsertest.cc",
|
||||
|
||||
# TODO(https://crbug.com/1442929): move out of Android once we can capture
|
||||
# TODO(crbug.com/40267166): move out of Android once we can capture
|
||||
# for other platforms.
|
||||
"../browser/renderer_host/navigation_transitions/navigation_entry_screenshot_browsertest.cc",
|
||||
]
|
||||
|
@ -1688,9 +1707,7 @@ test("content_browsertests") {
|
|||
}
|
||||
|
||||
if (enable_reporting) {
|
||||
sources += [
|
||||
"../browser/network/cross_origin_opener_policy_reporting_browsertest.cc",
|
||||
]
|
||||
sources += [ "../browser/security/coop/cross_origin_opener_policy_reporting_browsertest.cc" ]
|
||||
}
|
||||
|
||||
if (use_viz_debugger) {
|
||||
|
@ -1727,6 +1744,7 @@ test("content_browsertests") {
|
|||
"//components/discardable_memory/service",
|
||||
"//components/favicon/content",
|
||||
"//components/network_session_configurator/common",
|
||||
"//components/os_crypt/async/browser:key_provider_interface",
|
||||
"//components/os_crypt/async/browser:test_support",
|
||||
"//components/payments/mojom",
|
||||
"//components/performance_manager",
|
||||
|
@ -1853,9 +1871,13 @@ test("content_browsertests") {
|
|||
]
|
||||
|
||||
if (is_ios) {
|
||||
entitlements_path = "//content/app/ios/appex/app.entitlements"
|
||||
bundle_deps = [
|
||||
":content_process_bundle",
|
||||
":content_test_bundle_data",
|
||||
":content_test_perfetto_bundle_data",
|
||||
":gpu_process_bundle",
|
||||
":network_process_bundle",
|
||||
"//media/test:media_bundle_data",
|
||||
"//testing/buildbot/filters:content_browsertests_filter_bundle_data",
|
||||
]
|
||||
|
@ -1996,7 +2018,10 @@ test("content_browsertests") {
|
|||
|
||||
data_deps += [ "//services/test/echo:echo_preload_library" ]
|
||||
|
||||
libs = [ "uiautomationcore.lib" ]
|
||||
libs = [
|
||||
"dbghelp.lib",
|
||||
"uiautomationcore.lib",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_linux || is_chromeos) {
|
||||
|
@ -2086,9 +2111,15 @@ test("content_browsertests") {
|
|||
"../browser/zoom_browsertest.cc",
|
||||
]
|
||||
deps += [
|
||||
"//components/soda:utils",
|
||||
"//content/public/browser:proto",
|
||||
"//ui/base/clipboard:clipboard_test_support",
|
||||
]
|
||||
|
||||
if (is_chromeos_ash) {
|
||||
deps += [ "//ash/constants:constants" ]
|
||||
}
|
||||
|
||||
if (!is_ios) {
|
||||
data += [ "//content/test/data/clipboard/" ]
|
||||
}
|
||||
|
@ -2181,7 +2212,7 @@ test("content_browsertests") {
|
|||
"//mojo/public/mojom/base",
|
||||
]
|
||||
data_deps += [
|
||||
"//content/shell:thorium_shell",
|
||||
"//content/shell:content_shell",
|
||||
"//mojo/core:shared_library",
|
||||
]
|
||||
if (use_ozone) {
|
||||
|
@ -2243,7 +2274,7 @@ test("content_browsertests") {
|
|||
}
|
||||
|
||||
# KeyboardLock is currently not supported in Android, Fuchsia and
|
||||
# Chromecast builds. TODO(crbug.com/1414160): Re-enable on Fuchsia
|
||||
# Chromecast builds. TODO(crbug.com/40891949): Re-enable on Fuchsia
|
||||
# once its platform support is available.
|
||||
if (is_android || is_fuchsia || is_castos) {
|
||||
sources -= [ "../browser/keyboard_lock_browsertest.cc" ]
|
||||
|
@ -2333,8 +2364,6 @@ test("content_unittests") {
|
|||
"../browser/attribution_reporting/attribution_data_host_manager_impl_unittest.cc",
|
||||
"../browser/attribution_reporting/attribution_debug_report_unittest.cc",
|
||||
"../browser/attribution_reporting/attribution_host_unittest.cc",
|
||||
"../browser/attribution_reporting/attribution_interop_parser_unittest.cc",
|
||||
"../browser/attribution_reporting/attribution_interop_unittest.cc",
|
||||
"../browser/attribution_reporting/attribution_manager_impl_unittest.cc",
|
||||
"../browser/attribution_reporting/attribution_report_network_sender_unittest.cc",
|
||||
"../browser/attribution_reporting/attribution_report_unittest.cc",
|
||||
|
@ -2343,6 +2372,8 @@ test("content_unittests") {
|
|||
"../browser/attribution_reporting/attribution_storage_sql_unittest.cc",
|
||||
"../browser/attribution_reporting/attribution_storage_unittest.cc",
|
||||
"../browser/attribution_reporting/attribution_suitable_context_unittest.cc",
|
||||
"../browser/attribution_reporting/interop/interop_unittest.cc",
|
||||
"../browser/attribution_reporting/interop/parser_unittest.cc",
|
||||
"../browser/attribution_reporting/rate_limit_table_unittest.cc",
|
||||
"../browser/background_fetch/background_fetch_cross_origin_filter_unittest.cc",
|
||||
"../browser/background_fetch/background_fetch_data_manager_unittest.cc",
|
||||
|
@ -2409,6 +2440,7 @@ test("content_unittests") {
|
|||
"../browser/devtools/devtools_video_consumer_unittest.cc",
|
||||
"../browser/devtools/protocol/tracing_handler_unittest.cc",
|
||||
"../browser/devtools/protocol_unittest.cc",
|
||||
"../browser/devtools/request_body_collector_unittest.cc",
|
||||
"../browser/devtools/shared_storage_worklet_devtools_agent_host_unittest.cc",
|
||||
"../browser/dom_storage/dom_storage_context_wrapper_unittest.cc",
|
||||
"../browser/download/download_manager_impl_unittest.cc",
|
||||
|
@ -2458,6 +2490,7 @@ test("content_unittests") {
|
|||
"../browser/interest_group/auction_url_loader_factory_proxy_unittest.cc",
|
||||
"../browser/interest_group/auction_worklet_manager_unittest.cc",
|
||||
"../browser/interest_group/bidding_and_auction_response_unittest.cc",
|
||||
"../browser/interest_group/bidding_and_auction_serializer_unittest.cc",
|
||||
"../browser/interest_group/bidding_and_auction_server_key_fetcher_unittest.cc",
|
||||
"../browser/interest_group/header_direct_from_seller_signals_unittest.cc",
|
||||
"../browser/interest_group/interest_group_auction_reporter_unittest.cc",
|
||||
|
@ -2467,6 +2500,7 @@ test("content_unittests") {
|
|||
"../browser/interest_group/interest_group_permissions_cache_unittest.cc",
|
||||
"../browser/interest_group/interest_group_permissions_checker_unittest.cc",
|
||||
"../browser/interest_group/interest_group_priority_util_unittest.cc",
|
||||
"../browser/interest_group/interest_group_real_time_report_util_unittest.cc",
|
||||
"../browser/interest_group/interest_group_storage_unittest.cc",
|
||||
"../browser/interest_group/mock_auction_process_manager.cc",
|
||||
"../browser/interest_group/mock_auction_process_manager.h",
|
||||
|
@ -2513,7 +2547,6 @@ test("content_unittests") {
|
|||
"../browser/mojo_binder_policy_applier_unittest.cc",
|
||||
"../browser/mojo_binder_policy_map_impl_unittest.cc",
|
||||
"../browser/network/cross_origin_embedder_policy_reporter_unittest.cc",
|
||||
"../browser/network/cross_origin_opener_policy_reporter_unittest.cc",
|
||||
"../browser/network/network_quality_observer_impl_unittest.cc",
|
||||
"../browser/network/socket_broker_impl_unittest.cc",
|
||||
"../browser/network_context_client_base_impl_unittest.cc",
|
||||
|
@ -2581,7 +2614,6 @@ test("content_unittests") {
|
|||
"../browser/renderer_host/browsing_context_group_swap_unittest.cc",
|
||||
"../browser/renderer_host/clipboard_host_impl_unittest.cc",
|
||||
"../browser/renderer_host/commit_deferring_condition_runner_unittest.cc",
|
||||
"../browser/renderer_host/cross_origin_opener_policy_status_unittest.cc",
|
||||
"../browser/renderer_host/cursor_manager_unittest.cc",
|
||||
"../browser/renderer_host/display_feature_unittest.cc",
|
||||
"../browser/renderer_host/document_service_unittest.cc",
|
||||
|
@ -2606,10 +2638,6 @@ test("content_unittests") {
|
|||
"../browser/renderer_host/media/audio_output_authorization_handler_unittest.cc",
|
||||
"../browser/renderer_host/media/audio_service_listener_unittest.cc",
|
||||
"../browser/renderer_host/media/capture_handle_manager_unittest.cc",
|
||||
"../browser/renderer_host/media/fake_video_capture_device_launcher.cc",
|
||||
"../browser/renderer_host/media/fake_video_capture_device_launcher.h",
|
||||
"../browser/renderer_host/media/fake_video_capture_provider.cc",
|
||||
"../browser/renderer_host/media/fake_video_capture_provider.h",
|
||||
"../browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc",
|
||||
"../browser/renderer_host/media/media_devices_manager_unittest.cc",
|
||||
"../browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc",
|
||||
|
@ -2635,7 +2663,6 @@ test("content_unittests") {
|
|||
"../browser/renderer_host/navigation_transitions/navigation_entry_screenshot_cache_unittest.cc",
|
||||
"../browser/renderer_host/navigator_unittest.cc",
|
||||
"../browser/renderer_host/overscroll_controller_unittest.cc",
|
||||
"../browser/renderer_host/pending_beacon_host_unittest.cc",
|
||||
"../browser/renderer_host/policy_container_host_unittest.cc",
|
||||
"../browser/renderer_host/private_network_access_util_unittest.cc",
|
||||
"../browser/renderer_host/recently_destroyed_hosts_unittest.cc",
|
||||
|
@ -2662,6 +2689,8 @@ test("content_unittests") {
|
|||
"../browser/scheduler/responsiveness/watcher_unittest.cc",
|
||||
"../browser/screen_orientation/screen_orientation_provider_unittest.cc",
|
||||
"../browser/screenlock_monitor/screenlock_monitor_unittest.cc",
|
||||
"../browser/security/coop/cross_origin_opener_policy_reporter_unittest.cc",
|
||||
"../browser/security/coop/cross_origin_opener_policy_status_unittest.cc",
|
||||
"../browser/service_worker/embedded_worker_instance_unittest.cc",
|
||||
"../browser/service_worker/service_worker_cache_writer_unittest.cc",
|
||||
"../browser/service_worker/service_worker_container_host_unittest.cc",
|
||||
|
@ -2726,6 +2755,7 @@ test("content_unittests") {
|
|||
"../browser/web_package/signed_exchange_signature_header_field_unittest.cc",
|
||||
"../browser/web_package/signed_exchange_signature_verifier_unittest.cc",
|
||||
"../browser/web_package/signed_exchange_utils_unittest.cc",
|
||||
"../browser/webid/digital_credentials/digital_identity_request_impl_unittest.cc",
|
||||
"../browser/webid/federated_auth_disconnect_request_unittest.cc",
|
||||
"../browser/webid/federated_auth_request_impl_multiple_frames_unittest.cc",
|
||||
"../browser/webid/federated_auth_request_impl_registry_unittest.cc",
|
||||
|
@ -2875,7 +2905,7 @@ test("content_unittests") {
|
|||
additional_manifest_fragments = [
|
||||
"//build/config/fuchsia/test/fonts.shard.test-cml",
|
||||
|
||||
# TODO(https://crbug.com/1185811): Investigate removing the requirement
|
||||
# TODO(crbug.com/40055105): Investigate removing the requirement
|
||||
# for VmexResource.
|
||||
"//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
|
||||
"//build/config/fuchsia/test/network.shard.test-cml",
|
||||
|
@ -2941,7 +2971,6 @@ test("content_unittests") {
|
|||
"//base/allocator:buildflags",
|
||||
"//base/test:proto_test_support",
|
||||
"//base/test:test_support",
|
||||
"//base/third_party/dynamic_annotations",
|
||||
"//build:chromecast_buildflags",
|
||||
"//build:chromeos_buildflags",
|
||||
"//cc",
|
||||
|
@ -3235,6 +3264,7 @@ test("content_unittests") {
|
|||
}
|
||||
if (is_mac) {
|
||||
deps += [
|
||||
"//crypto:test_support",
|
||||
"//device/fido:icloud_keychain_test_support",
|
||||
"//sandbox/mac:seatbelt",
|
||||
"//third_party/ocmock",
|
||||
|
@ -3321,6 +3351,23 @@ test("content_unittests") {
|
|||
"../browser/tracing/tracing_ui_unittest.cc",
|
||||
]
|
||||
deps += [ "//components/speech:speech" ]
|
||||
|
||||
if (!is_fuchsia) {
|
||||
sources += [
|
||||
"../browser/speech/soda_speech_recognition_engine_impl_unittest.cc",
|
||||
"../browser/speech/speech_recognition_manager_impl_unittest.cc",
|
||||
]
|
||||
deps += [
|
||||
"//components/soda:constants",
|
||||
"//components/soda:utils",
|
||||
"//content/test:test_support",
|
||||
"//media/mojo/mojom:speech_recognition",
|
||||
]
|
||||
|
||||
if (is_chromeos_ash) {
|
||||
deps += [ "//ash/constants:constants" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# HID support is not available without udev.
|
||||
|
@ -3412,6 +3459,29 @@ if (is_ios) {
|
|||
testonly = true
|
||||
filelist_name = "content_test_bundle_data.filelist"
|
||||
}
|
||||
|
||||
if (current_toolchain == default_toolchain) {
|
||||
_extension_toolchain = "${current_toolchain}_blink_app_ext"
|
||||
extension_bundle_data("content_process_bundle") {
|
||||
testonly = true
|
||||
extension_dir = "Extensions"
|
||||
extension_name = "test_content_process.appex"
|
||||
extension_target = "//content/test/ios/appex:test_content_process(${_extension_toolchain})"
|
||||
}
|
||||
extension_bundle_data("network_process_bundle") {
|
||||
testonly = true
|
||||
extension_dir = "Extensions"
|
||||
extension_name = "test_network_process.appex"
|
||||
extension_target = "//content/test/ios/appex:test_network_process(${_extension_toolchain})"
|
||||
}
|
||||
extension_bundle_data("gpu_process_bundle") {
|
||||
testonly = true
|
||||
extension_dir = "Extensions"
|
||||
extension_name = "test_gpu_process.appex"
|
||||
extension_target =
|
||||
"//content/test/ios/appex:test_gpu_process(${_extension_toolchain})"
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_apple) {
|
||||
bundle_data("content_test_perfetto_bundle_data") {
|
||||
|
@ -3440,7 +3510,7 @@ group("fuzzers") {
|
|||
# test_buildbucket_api_gpu_cases.py on bots. This also tells the build system
|
||||
# when the tests should be re-run - when one of the dependent files changes.
|
||||
#
|
||||
# TODO(crbug.com/1080749): Remove once power testing is migrated to perf waterfall.
|
||||
# TODO(crbug.com/40130215): Remove once power testing is migrated to perf waterfall.
|
||||
group("test_buildbucket_api_gpu_use_cases") {
|
||||
data = [
|
||||
# The test runner and its dependencies.
|
||||
|
|
|
@ -31,6 +31,7 @@ buildflag_header("buildflags") {
|
|||
header = "buildflags.h"
|
||||
flags = [
|
||||
"USE_V8_CONTEXT_SNAPSHOT=$use_v8_context_snapshot",
|
||||
"INCLUDE_BOTH_V8_SNAPSHOTS=$include_both_v8_snapshots",
|
||||
"V8_CONTEXT_SNAPSHOT_FILENAME=\"$v8_context_snapshot_filename\"",
|
||||
]
|
||||
}
|
||||
|
@ -112,7 +113,7 @@ if (use_v8_context_snapshot) {
|
|||
ldflags = [ "/OPT:NOICF" ] # link.exe, but also lld-link.exe.
|
||||
} else if (is_apple && !use_lld) {
|
||||
ldflags = [ "-Wl,-no_deduplicate" ] # ld64.
|
||||
} else if (use_gold || use_lld) {
|
||||
} else if (use_lld) {
|
||||
ldflags = [ "-Wl,--icf=none" ]
|
||||
}
|
||||
}
|
||||
|
|