chore: remove mips64el patches as they've largely been upstreamed (#18628)
This commit is contained in:
parent
a45afddb75
commit
4b9da4dd0e
112 changed files with 10 additions and 73370 deletions
|
@ -1,2 +0,0 @@
|
|||
expose_ripemd160.patch
|
||||
expose_aes-cfb.patch
|
|
@ -1,80 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Fri, 18 Jan 2019 14:23:28 -0800
|
||||
Subject: expose aes-{128,256}-cfb
|
||||
|
||||
|
||||
diff --git a/crypto/cipher_extra/cipher_extra.c b/crypto/cipher_extra/cipher_extra.c
|
||||
index b132265bc103658dba3de6e0c3dc50d3634da5b0..588a4773437c311877f275bf3679f9688cda3c46 100644
|
||||
--- a/crypto/cipher_extra/cipher_extra.c
|
||||
+++ b/crypto/cipher_extra/cipher_extra.c
|
||||
@@ -101,10 +101,14 @@ const EVP_CIPHER *EVP_get_cipherbyname(const char *name) {
|
||||
return EVP_des_ede3_cbc();
|
||||
} else if (OPENSSL_strcasecmp(name, "aes-128-cbc") == 0) {
|
||||
return EVP_aes_128_cbc();
|
||||
+ } else if (OPENSSL_strcasecmp(name, "aes-128-cfb") == 0) {
|
||||
+ return EVP_aes_128_cfb128();
|
||||
} else if (OPENSSL_strcasecmp(name, "aes-192-cbc") == 0) {
|
||||
return EVP_aes_192_cbc();
|
||||
} else if (OPENSSL_strcasecmp(name, "aes-256-cbc") == 0) {
|
||||
return EVP_aes_256_cbc();
|
||||
+ } else if (OPENSSL_strcasecmp(name, "aes-256-cfb") == 0) {
|
||||
+ return EVP_aes_256_cfb128();
|
||||
} else if (OPENSSL_strcasecmp(name, "aes-128-ctr") == 0) {
|
||||
return EVP_aes_128_ctr();
|
||||
} else if (OPENSSL_strcasecmp(name, "aes-192-ctr") == 0) {
|
||||
diff --git a/decrepit/cfb/cfb.c b/decrepit/cfb/cfb.c
|
||||
index d3a176163303a202baeb1f95727c6ed3525439d6..21d108a7b73d454aa6b0e324df4b67088d60302a 100644
|
||||
--- a/decrepit/cfb/cfb.c
|
||||
+++ b/decrepit/cfb/cfb.c
|
||||
@@ -57,4 +57,12 @@ static const EVP_CIPHER aes_128_cfb128 = {
|
||||
NULL /* cleanup */, NULL /* ctrl */,
|
||||
};
|
||||
|
||||
+static const EVP_CIPHER aes_256_cfb128 = {
|
||||
+ NID_aes_128_cfb128, 1 /* block_size */, 32 /* key_size */,
|
||||
+ 16 /* iv_len */, sizeof(EVP_CFB_CTX), EVP_CIPH_CFB_MODE,
|
||||
+ NULL /* app_data */, aes_cfb_init_key, aes_cfb128_cipher,
|
||||
+ NULL /* cleanup */, NULL /* ctrl */,
|
||||
+};
|
||||
+
|
||||
const EVP_CIPHER *EVP_aes_128_cfb128(void) { return &aes_128_cfb128; }
|
||||
+const EVP_CIPHER *EVP_aes_256_cfb128(void) { return &aes_256_cfb128; }
|
||||
diff --git a/decrepit/evp/evp_do_all.c b/decrepit/evp/evp_do_all.c
|
||||
index 53cb9d2dc8f1962a70dc12b648d27c32be8aca4b..84af06fc56e4aa72d4d48801d7c037add0221747 100644
|
||||
--- a/decrepit/evp/evp_do_all.c
|
||||
+++ b/decrepit/evp/evp_do_all.c
|
||||
@@ -20,8 +20,10 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
|
||||
const char *unused, void *arg),
|
||||
void *arg) {
|
||||
callback(EVP_aes_128_cbc(), "AES-128-CBC", NULL, arg);
|
||||
+ callback(EVP_aes_128_cfb128(), "AES-128-CFB", NULL, arg);
|
||||
callback(EVP_aes_192_cbc(), "AES-192-CBC", NULL, arg);
|
||||
callback(EVP_aes_256_cbc(), "AES-256-CBC", NULL, arg);
|
||||
+ callback(EVP_aes_256_cfb128(), "AES-256-CFB", NULL, arg);
|
||||
callback(EVP_aes_128_ctr(), "AES-128-CTR", NULL, arg);
|
||||
callback(EVP_aes_192_ctr(), "AES-192-CTR", NULL, arg);
|
||||
callback(EVP_aes_256_ctr(), "AES-256-CTR", NULL, arg);
|
||||
@@ -44,8 +46,10 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
|
||||
|
||||
// OpenSSL returns everything twice, the second time in lower case.
|
||||
callback(EVP_aes_128_cbc(), "aes-128-cbc", NULL, arg);
|
||||
+ callback(EVP_aes_128_cfb128(), "aes-128-cfb", NULL, arg);
|
||||
callback(EVP_aes_192_cbc(), "aes-192-cbc", NULL, arg);
|
||||
callback(EVP_aes_256_cbc(), "aes-256-cbc", NULL, arg);
|
||||
+ callback(EVP_aes_256_cfb128(), "aes-256-cfb", NULL, arg);
|
||||
callback(EVP_aes_128_ctr(), "aes-128-ctr", NULL, arg);
|
||||
callback(EVP_aes_192_ctr(), "aes-192-ctr", NULL, arg);
|
||||
callback(EVP_aes_256_ctr(), "aes-256-ctr", NULL, arg);
|
||||
diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h
|
||||
index ea7a940ab3003f6919322ef1c4b7caaa9dea8588..5320d5d84c10c6396eb869dc1767b31afeeac4ef 100644
|
||||
--- a/include/openssl/cipher.h
|
||||
+++ b/include/openssl/cipher.h
|
||||
@@ -424,6 +424,7 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void);
|
||||
|
||||
// EVP_aes_128_cfb128 is only available in decrepit.
|
||||
OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_cfb128(void);
|
||||
+OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_256_cfb128(void);
|
||||
|
||||
// EVP_bf_ecb is Blowfish in ECB mode and is only available in decrepit.
|
||||
OPENSSL_EXPORT const EVP_CIPHER *EVP_bf_ecb(void);
|
|
@ -1,95 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Fri, 18 Jan 2019 13:56:52 -0800
|
||||
Subject: expose ripemd160
|
||||
|
||||
This adds references to the decrepit/ module from non-decrepit source,
|
||||
which is not allowed in upstream. Until upstream has a way to interface
|
||||
with node.js that allows exposing additional digests without patching,
|
||||
this patch is required to provide ripemd160 support in the nodejs crypto
|
||||
module.
|
||||
|
||||
diff --git a/crypto/digest_extra/digest_extra.c b/crypto/digest_extra/digest_extra.c
|
||||
index 4b4bb38135e6089eaf6f47afda0199567a2397ef..43b7eca808b82a032055f56ce726ce4f38c5f2c5 100644
|
||||
--- a/crypto/digest_extra/digest_extra.c
|
||||
+++ b/crypto/digest_extra/digest_extra.c
|
||||
@@ -81,6 +81,7 @@ static const struct nid_to_digest nid_to_digest_mapping[] = {
|
||||
{NID_sha384, EVP_sha384, SN_sha384, LN_sha384},
|
||||
{NID_sha512, EVP_sha512, SN_sha512, LN_sha512},
|
||||
{NID_md5_sha1, EVP_md5_sha1, SN_md5_sha1, LN_md5_sha1},
|
||||
+ {NID_ripemd160, EVP_ripemd160, SN_ripemd160, LN_ripemd160},
|
||||
// As a remnant of signing |EVP_MD|s, OpenSSL returned the corresponding
|
||||
// hash function when given a signature OID. To avoid unintended lax parsing
|
||||
// of hash OIDs, this is no longer supported for lookup by OID or NID.
|
||||
diff --git a/crypto/fipsmodule/digest/digests.c b/crypto/fipsmodule/digest/digests.c
|
||||
index f2fa349c2b32ae88766624af3109ece4b1d69909..bcaed59c5401bef071acba9b9919d9069e3ccd4d 100644
|
||||
--- a/crypto/fipsmodule/digest/digests.c
|
||||
+++ b/crypto/fipsmodule/digest/digests.c
|
||||
@@ -63,6 +63,7 @@
|
||||
#include <openssl/md5.h>
|
||||
#include <openssl/nid.h>
|
||||
#include <openssl/sha.h>
|
||||
+#include <openssl/ripemd.h>
|
||||
|
||||
#include "internal.h"
|
||||
#include "../delocate.h"
|
||||
@@ -277,4 +278,27 @@ DEFINE_METHOD_FUNCTION(EVP_MD, EVP_md5_sha1) {
|
||||
out->ctx_size = sizeof(MD5_SHA1_CTX);
|
||||
}
|
||||
|
||||
+static void ripemd160_init(EVP_MD_CTX *ctx) {
|
||||
+ CHECK(RIPEMD160_Init(ctx->md_data));
|
||||
+}
|
||||
+
|
||||
+static void ripemd160_update(EVP_MD_CTX *ctx, const void *data, size_t count) {
|
||||
+ CHECK(RIPEMD160_Update(ctx->md_data, data, count));
|
||||
+}
|
||||
+
|
||||
+static void ripemd160_final(EVP_MD_CTX *ctx, uint8_t *md) {
|
||||
+ CHECK(RIPEMD160_Final(md, ctx->md_data));
|
||||
+}
|
||||
+
|
||||
+DEFINE_METHOD_FUNCTION(EVP_MD, EVP_ripemd160) {
|
||||
+ out->type = NID_ripemd160;
|
||||
+ out->md_size = RIPEMD160_DIGEST_LENGTH;
|
||||
+ out->flags = 0;
|
||||
+ out->init = ripemd160_init;
|
||||
+ out->update = ripemd160_update;
|
||||
+ out->final = ripemd160_final;
|
||||
+ out->block_size = 64;
|
||||
+ out->ctx_size = sizeof(RIPEMD160_CTX);
|
||||
+}
|
||||
+
|
||||
#undef CHECK
|
||||
diff --git a/decrepit/evp/evp_do_all.c b/decrepit/evp/evp_do_all.c
|
||||
index d540144b293297791c087e0b968a47d368a73695..53cb9d2dc8f1962a70dc12b648d27c32be8aca4b 100644
|
||||
--- a/decrepit/evp/evp_do_all.c
|
||||
+++ b/decrepit/evp/evp_do_all.c
|
||||
@@ -78,6 +78,7 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher,
|
||||
callback(EVP_sha256(), "SHA256", NULL, arg);
|
||||
callback(EVP_sha384(), "SHA384", NULL, arg);
|
||||
callback(EVP_sha512(), "SHA512", NULL, arg);
|
||||
+ callback(EVP_ripemd160(), "RIPEMD160", NULL, arg);
|
||||
|
||||
callback(EVP_md4(), "md4", NULL, arg);
|
||||
callback(EVP_md5(), "md5", NULL, arg);
|
||||
@@ -86,4 +87,5 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher,
|
||||
callback(EVP_sha256(), "sha256", NULL, arg);
|
||||
callback(EVP_sha384(), "sha384", NULL, arg);
|
||||
callback(EVP_sha512(), "sha512", NULL, arg);
|
||||
+ callback(EVP_ripemd160(), "ripemd160", NULL, arg);
|
||||
}
|
||||
diff --git a/include/openssl/digest.h b/include/openssl/digest.h
|
||||
index 1a1ca29732afae317c8e8740c629e8922fc83093..48ebdd1eb93b3febecddbc2545b7aae583f21525 100644
|
||||
--- a/include/openssl/digest.h
|
||||
+++ b/include/openssl/digest.h
|
||||
@@ -88,6 +88,9 @@ OPENSSL_EXPORT const EVP_MD *EVP_sha512(void);
|
||||
// MD5 and SHA-1, as used in TLS 1.1 and below.
|
||||
OPENSSL_EXPORT const EVP_MD *EVP_md5_sha1(void);
|
||||
|
||||
+// EVP_ripemd160 is in decrepit and not available by default.
|
||||
+OPENSSL_EXPORT const EVP_MD *EVP_ripemd160(void);
|
||||
+
|
||||
// EVP_get_digestbynid returns an |EVP_MD| for the given NID, or NULL if no
|
||||
// such digest is known.
|
||||
OPENSSL_EXPORT const EVP_MD *EVP_get_digestbynid(int nid);
|
|
@ -1,80 +0,0 @@
|
|||
add_realloc.patch
|
||||
build_gn.patch
|
||||
dcheck.patch
|
||||
accelerator.patch
|
||||
blink_file_path.patch
|
||||
blink_local_frame.patch
|
||||
blink_world_context.patch
|
||||
browser_compositor_mac.patch
|
||||
can_create_window.patch
|
||||
disable_hidden.patch
|
||||
dom_storage_limits.patch
|
||||
out_of_process_instance.patch
|
||||
render_widget_host_view_base.patch
|
||||
render_widget_host_view_mac.patch
|
||||
thread_capabilities.patch
|
||||
web_contents.patch
|
||||
webview_cross_drag.patch
|
||||
disable_user_gesture_requirement_for_beforeunload_dialogs.patch
|
||||
gin_enable_disable_v8_platform.patch
|
||||
blink-worker-enable-csp-in-file-scheme.patch
|
||||
disable-redraw-lock.patch
|
||||
v8_context_snapshot_generator.patch
|
||||
boringssl_build_gn.patch
|
||||
pepper_flash.patch
|
||||
no_cache_storage_check.patch
|
||||
blink_fix_prototype_assert.patch
|
||||
libgtkui_export.patch
|
||||
gtk_visibility.patch
|
||||
sysroot.patch
|
||||
mas_blink_no_private_api.patch
|
||||
mas_no_private_api.patch
|
||||
resource_file_conflict.patch
|
||||
scroll_bounce_flag.patch
|
||||
mas-cfisobjc.patch
|
||||
mas-cgdisplayusesforcetogray.patch
|
||||
mas-audiodeviceduck.patch
|
||||
mas-lssetapplicationlaunchservicesserverconnectionstatus.patch
|
||||
allow_webview_file_url.patch
|
||||
ignore_rc_check.patch
|
||||
enable_widevine.patch
|
||||
chrome_key_systems.patch
|
||||
allow_nested_error_trackers.patch
|
||||
blink_initialization_order.patch
|
||||
disable_detach_webview_frame.patch
|
||||
ssl_security_state_tab_helper.patch
|
||||
exclude-a-few-test-files-from-build.patch
|
||||
expose-net-observer-api.patch
|
||||
desktop_media_list.patch
|
||||
proxy_config_monitor.patch
|
||||
gritsettings_resource_ids.patch
|
||||
isolate_holder.patch
|
||||
notification_provenance.patch
|
||||
content_browser_main_loop.patch
|
||||
dump_syms.patch
|
||||
command-ismediakey.patch
|
||||
tts.patch
|
||||
printing.patch
|
||||
verbose_generate_breakpad_symbols.patch
|
||||
content_allow_embedder_to_prevent_locking_scheme_registry.patch
|
||||
support_mixed_sandbox_with_zygote.patch
|
||||
disable_color_correct_rendering.patch
|
||||
autofill_size_calculation.patch
|
||||
revert_build_swiftshader_for_arm32.patch
|
||||
fix_disable_usage_of_abort_report_np_in_mas_builds.patch
|
||||
fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch
|
||||
fix_disable_usage_of_setapplicationisdaemon_and.patch
|
||||
ipc_message_start.patch
|
||||
disable_network_services_by_default.patch
|
||||
unsandboxed_ppapi_processes_skip_zygote.patch
|
||||
patch_the_ensure_gn_version_py_script_to_work_on_mac_ci.patch
|
||||
partially_revert_fb4ab3be3fc0024d00358d5b7816d3215a8ff20c.patch
|
||||
build_add_electron_tracing_category.patch
|
||||
add_contentgpuclient_precreatemessageloop_callback.patch
|
||||
disable_custom_libcxx_on_windows.patch
|
||||
feat_offscreen_rendering_with_viz_compositor.patch
|
||||
worker_context_will_destroy.patch
|
||||
fix_breakpad_symbol_generation_on_linux_arm.patch
|
||||
frame_host_manager.patch
|
||||
cross_site_document_resource_handler.patch
|
||||
woa_compiler_workaround.patch
|
|
@ -1,86 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 4 Oct 2018 14:57:02 -0700
|
||||
Subject: accelerator.patch
|
||||
|
||||
This patch makes three changes to Accelerator::GetShortcutText to improve shortcut display text in menus:
|
||||
|
||||
1. Ctrl-Alt-<Key> accelerators show as Ctrl-Alt-<Key> instead of as Ctrl-<Key>
|
||||
2. F2-F24 accelerators show up as such
|
||||
3. Ctrl-Shift-= should show as Ctrl-+
|
||||
|
||||
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
|
||||
index dadc140e9429c166ecd4c653c9ef5d0d4c4db2a4..bc93a9ecb28ff6973fc4d15f67a17d545c169a89 100644
|
||||
--- a/ui/base/accelerators/accelerator.cc
|
||||
+++ b/ui/base/accelerators/accelerator.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/strcat.h"
|
||||
#include "base/strings/string_util.h"
|
||||
+#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
@@ -22,9 +23,7 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
-#if !defined(OS_WIN) && (defined(USE_AURA) || defined(OS_MACOSX))
|
||||
#include "ui/events/keycodes/keyboard_code_conversion.h"
|
||||
-#endif
|
||||
|
||||
namespace ui {
|
||||
|
||||
@@ -150,7 +149,15 @@ base::string16 Accelerator::GetShortcutText() const {
|
||||
shortcut = KeyCodeToName(key_code_);
|
||||
#endif
|
||||
|
||||
+ unsigned int flags = 0;
|
||||
if (shortcut.empty()) {
|
||||
+ const uint16_t c = DomCodeToUsLayoutCharacter(
|
||||
+ UsLayoutKeyboardCodeToDomCode(key_code_), flags);
|
||||
+ if (c != 0) {
|
||||
+ shortcut =
|
||||
+ static_cast<base::string16::value_type>(
|
||||
+ base::ToUpperASCII(static_cast<base::char16>(c)));
|
||||
+ }
|
||||
#if defined(OS_WIN)
|
||||
// Our fallback is to try translate the key code to a regular character
|
||||
// unless it is one of digits (VK_0 to VK_9). Some keyboard
|
||||
@@ -159,21 +166,14 @@ base::string16 Accelerator::GetShortcutText() const {
|
||||
// accent' for '0'). For display in the menu (e.g. Ctrl-0 for the
|
||||
// default zoom level), we leave VK_[0-9] alone without translation.
|
||||
wchar_t key;
|
||||
- if (base::IsAsciiDigit(key_code_))
|
||||
+ if (base::IsAsciiDigit(key_code_)) {
|
||||
key = static_cast<wchar_t>(key_code_);
|
||||
- else
|
||||
- key = LOWORD(::MapVirtualKeyW(key_code_, MAPVK_VK_TO_CHAR));
|
||||
- // If there is no translation for the given |key_code_| (e.g.
|
||||
- // VKEY_UNKNOWN), |::MapVirtualKeyW| returns 0.
|
||||
- if (key != 0)
|
||||
- shortcut += key;
|
||||
-#elif defined(USE_AURA) || defined(OS_MACOSX) || defined(OS_ANDROID)
|
||||
- const uint16_t c = DomCodeToUsLayoutCharacter(
|
||||
- UsLayoutKeyboardCodeToDomCode(key_code_), false);
|
||||
- if (c != 0)
|
||||
- shortcut +=
|
||||
- static_cast<base::string16::value_type>(base::ToUpperASCII(c));
|
||||
+ shortcut = key;
|
||||
+ }
|
||||
#endif
|
||||
+ if (key_code_ > VKEY_F1 && key_code_ <= VKEY_F24)
|
||||
+ shortcut = base::UTF8ToUTF16(
|
||||
+ base::StringPrintf("F%d", key_code_ - VKEY_F1 + 1));
|
||||
}
|
||||
|
||||
// Checking whether the character used for the accelerator is alphanumeric.
|
||||
@@ -237,7 +237,7 @@ base::string16 Accelerator::ApplyLongFormModifiers(
|
||||
// more information.
|
||||
if (IsCtrlDown())
|
||||
shortcut = ApplyModifierToAcceleratorString(shortcut, IDS_APP_CTRL_KEY);
|
||||
- else if (IsAltDown())
|
||||
+ if (IsAltDown())
|
||||
shortcut = ApplyModifierToAcceleratorString(shortcut, IDS_APP_ALT_KEY);
|
||||
|
||||
if (IsCmdDown()) {
|
|
@ -1,48 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Milan Burda <milan.burda@gmail.com>
|
||||
Date: Thu, 11 Apr 2019 14:49:20 +0200
|
||||
Subject: Add ContentGpuClient::PreCreateMessageLoop() callback
|
||||
|
||||
Invoke in GpuMain after SetErrorMode, before starting the message loop.
|
||||
Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
|
||||
|
||||
This should be upstreamed
|
||||
|
||||
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
|
||||
index 82f0c4f62be2f210db2c3ed1169c2a816c59cf1f..20dcb7dd1ee1172cfbf263f14724dd4701fa6eae 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -234,6 +234,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
|
||||
logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
|
||||
|
||||
+ auto* client = GetContentClient()->gpu();
|
||||
+ if (client)
|
||||
+ client->PreCreateMessageLoop();
|
||||
+
|
||||
// We are experiencing what appear to be memory-stomp issues in the GPU
|
||||
// process. These issues seem to be impacting the message loop and listeners
|
||||
// registered to it. Create the message loop on the heap to guard against
|
||||
@@ -335,7 +339,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
|
||||
GpuProcess gpu_process(io_thread_priority);
|
||||
|
||||
- auto* client = GetContentClient()->gpu();
|
||||
if (client)
|
||||
client->PostIOThreadCreated(gpu_process.io_task_runner());
|
||||
|
||||
diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h
|
||||
index 20e31e1bd96395cb4350aa6ae84cc16c4ca2116b..d89af81ef9426c197a62027b514011afd10ea3ce 100644
|
||||
--- a/content/public/gpu/content_gpu_client.h
|
||||
+++ b/content/public/gpu/content_gpu_client.h
|
||||
@@ -35,6 +35,10 @@ class CONTENT_EXPORT ContentGpuClient {
|
||||
public:
|
||||
virtual ~ContentGpuClient() {}
|
||||
|
||||
+ // Allows the embedder to perform platform-specific initialization before
|
||||
+ // creating the message loop.
|
||||
+ virtual void PreCreateMessageLoop() {}
|
||||
+
|
||||
// Initializes the registry. |registry| will be passed to a ConnectionFilter
|
||||
// (which lives on the IO thread). Unlike other childthreads, the client must
|
||||
// register additional interfaces on this registry rather than just creating
|
|
@ -1,83 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:44:26 -0700
|
||||
Subject: add_realloc.patch
|
||||
|
||||
Blink overrides ArrayBuffer's allocator with its own one, while Node simply
|
||||
uses malloc and free, so we need to use v8's allocator in Node. As part of the
|
||||
10.6.0 upgrade, we needed to make SerializerDelegate accept an allocator
|
||||
argument in its constructor, and override ReallocateBufferMemory and
|
||||
FreeBufferMemory to use the allocator. We cannot simply allocate and then memcpy
|
||||
when we override ReallocateBufferMemory, so we therefore need to implement
|
||||
Realloc on the v8 side and correspondingly in gin.
|
||||
|
||||
diff --git a/gin/array_buffer.cc b/gin/array_buffer.cc
|
||||
index a02797e94f61e8c71428633a4585a625dc5aadbd..305b7d307d233af699e3f495f85de0f8097ff311 100644
|
||||
--- a/gin/array_buffer.cc
|
||||
+++ b/gin/array_buffer.cc
|
||||
@@ -43,6 +43,10 @@ void* ArrayBufferAllocator::AllocateUninitialized(size_t length) {
|
||||
return malloc(length);
|
||||
}
|
||||
|
||||
+void* ArrayBufferAllocator::Realloc(void* data, size_t length) {
|
||||
+ return realloc(data, length);
|
||||
+}
|
||||
+
|
||||
void ArrayBufferAllocator::Free(void* data, size_t length) {
|
||||
free(data);
|
||||
}
|
||||
diff --git a/gin/array_buffer.h b/gin/array_buffer.h
|
||||
index 2aef366ac8194aa261cbca6abc051f7da8a988d3..3c7d66c81032636abcca4f1538ce9b7f4ddb2de2 100644
|
||||
--- a/gin/array_buffer.h
|
||||
+++ b/gin/array_buffer.h
|
||||
@@ -21,6 +21,7 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
||||
public:
|
||||
void* Allocate(size_t length) override;
|
||||
void* AllocateUninitialized(size_t length) override;
|
||||
+ void* Realloc(void* data, size_t length) override;
|
||||
void Free(void* data, size_t length) override;
|
||||
|
||||
GIN_EXPORT static ArrayBufferAllocator* SharedInstance();
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
index 1f3f5e263585fbec3844b45116797084483006cb..8e13c4edbf98f380ddacad6447c4e0656fcb0bb2 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
@@ -553,6 +553,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
||||
size, WTF::ArrayBufferContents::kDontInitialize);
|
||||
}
|
||||
|
||||
+ void* Realloc(void* data, size_t size) override {
|
||||
+ return WTF::ArrayBufferContents::Realloc(data, size);
|
||||
+ }
|
||||
+
|
||||
void Free(void* data, size_t size) override {
|
||||
WTF::ArrayBufferContents::FreeMemory(data);
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc
|
||||
index 0031242152ce5190b0dfc77b53af2d984e5fad82..a6370ec793ce6c38eb7dab189583ea11cca51c1f 100644
|
||||
--- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc
|
||||
+++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc
|
||||
@@ -130,6 +130,11 @@ void* ArrayBufferContents::AllocateMemoryOrNull(size_t size,
|
||||
return AllocateMemoryWithFlags(size, policy, base::PartitionAllocReturnNull);
|
||||
}
|
||||
|
||||
+void* ArrayBufferContents::Realloc(void* data, size_t size) {
|
||||
+ return Partitions::ArrayBufferPartition()->Realloc(data, size,
|
||||
+ WTF_HEAP_PROFILER_TYPE_NAME(ArrayBufferContents));
|
||||
+}
|
||||
+
|
||||
void ArrayBufferContents::FreeMemory(void* data) {
|
||||
Partitions::ArrayBufferPartition()->Free(data);
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
|
||||
index 98bda6647e7b1516ab6114ebc63f5c60da3ebbb7..37dacadc262e15714f8e3e090b780c8abf22283e 100644
|
||||
--- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
|
||||
+++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
|
||||
@@ -135,6 +135,7 @@ class WTF_EXPORT ArrayBufferContents {
|
||||
void CopyTo(ArrayBufferContents& other);
|
||||
|
||||
static void* AllocateMemoryOrNull(size_t, InitializationPolicy);
|
||||
+ static void* Realloc(void* data, size_t);
|
||||
static void FreeMemory(void*);
|
||||
static DataHandle CreateDataHandle(size_t, InitializationPolicy);
|
||||
static void Initialize(
|
|
@ -1,34 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Charles Kerr <charles@charleskerr.com>
|
||||
Date: Thu, 20 Sep 2018 17:50:17 -0700
|
||||
Subject: allow_nested_error_trackers.patch
|
||||
|
||||
Only one X11ErrorTracker should exist at a time, but upstream has a bug
|
||||
where two can exist if running in headless mode --
|
||||
ui::(anonymous namespace)::SupportsEWMH() [inner tracker is created]
|
||||
ui::WmSupportsHint()
|
||||
ui::IsX11WindowFullScreen()
|
||||
ui::ScreensaverWindowFinder::IsScreensaverWindow()
|
||||
ui::ScreensaverWindowFinder::ShouldStopIterating()
|
||||
ui::EnumerateTopLevelWindows()
|
||||
ui::ScreensaverWindowFinder::ScreensaverWindowExists() [outer tracker created]
|
||||
ui::CheckIdleStateIsLocked()
|
||||
ui::CalculateIdleState()
|
||||
Removal of either tracker could have side-effects in some code paths,
|
||||
so this is probably better handled upstream. This patch tries to do the
|
||||
least harm in the interim by removing the check that prevents more than
|
||||
one tracker from existing at a time.
|
||||
|
||||
diff --git a/ui/gfx/x/x11_error_tracker.cc b/ui/gfx/x/x11_error_tracker.cc
|
||||
index af031de356c5e0938fd3b84a494e48dc9a0e0476..2a5c18dc473a4f88fc0427bec69142917159bbd9 100644
|
||||
--- a/ui/gfx/x/x11_error_tracker.cc
|
||||
+++ b/ui/gfx/x/x11_error_tracker.cc
|
||||
@@ -24,7 +24,7 @@ namespace gfx {
|
||||
X11ErrorTracker::X11ErrorTracker() {
|
||||
// This is a non-exhaustive check for incorrect usage. It disallows nested
|
||||
// X11ErrorTracker instances on the same thread.
|
||||
- DCHECK(g_handler == NULL);
|
||||
+ // DCHECK(g_handler == NULL);
|
||||
g_handler = this;
|
||||
XSync(GetXDisplay(), False);
|
||||
old_handler_ = XSetErrorHandler(X11ErrorHandler);
|
|
@ -1,20 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:49:42 -0700
|
||||
Subject: allow_webview_file_url.patch
|
||||
|
||||
Allow webview to load non-web URLs.
|
||||
|
||||
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
|
||||
index 89e10f6eba87d08a9e2c6f921aab7d30ed6c4b2b..4cae5745aca6993c82a4a331107bf4d820a6c0a7 100644
|
||||
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
|
||||
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
|
||||
@@ -1429,6 +1429,8 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
|
||||
!policy->IsWebSafeScheme(info.common_params.url.scheme()) &&
|
||||
!is_external_protocol;
|
||||
|
||||
+ non_web_url_in_guest = false;
|
||||
+
|
||||
if (is_shutdown_ || non_web_url_in_guest) {
|
||||
url_loader_client->OnComplete(
|
||||
network::URLLoaderCompletionStatus(net::ERR_ABORTED));
|
|
@ -1,51 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Heilig Benedek <benecene@gmail.com>
|
||||
Date: Wed, 30 Jan 2019 17:04:33 +0100
|
||||
Subject: don't call into chrome internals for autofill popup size calculations
|
||||
|
||||
The default GetWindowBounds calls into chrome internal functions to
|
||||
find out the size of the window - this can be overridden but even
|
||||
then some methods call into the original. Let's just return an empty
|
||||
gfx::Rect and do the actual job in the subclass.
|
||||
|
||||
diff --git a/chrome/browser/ui/autofill/popup_view_common.cc b/chrome/browser/ui/autofill/popup_view_common.cc
|
||||
index 25e2cfce4999bdf6a94d61aae4558470d18f89ed..c9880bcd639eb59ae52c38dbdabbd86ebac3b530 100644
|
||||
--- a/chrome/browser/ui/autofill/popup_view_common.cc
|
||||
+++ b/chrome/browser/ui/autofill/popup_view_common.cc
|
||||
@@ -8,15 +8,19 @@
|
||||
#include <utility>
|
||||
|
||||
#include "build/build_config.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/platform_util.h"
|
||||
+#endif
|
||||
#include "ui/gfx/geometry/vector2d.h"
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
#include "ui/android/view_android.h"
|
||||
#include "ui/android/window_android.h"
|
||||
#else // defined(OS_ANDROID)
|
||||
+#if 0
|
||||
#include "chrome/browser/ui/browser_finder.h"
|
||||
#include "chrome/browser/ui/browser_window.h"
|
||||
+#endif
|
||||
#include "ui/views/widget/widget.h"
|
||||
#endif // !defined(OS_ANDROID)
|
||||
|
||||
@@ -176,14 +180,14 @@ gfx::Rect PopupViewCommon::GetWindowBounds(gfx::NativeView container_view) {
|
||||
views::Widget::GetTopLevelWidgetForNativeView(container_view);
|
||||
if (widget)
|
||||
return widget->GetWindowBoundsInScreen();
|
||||
-
|
||||
+#if 0
|
||||
// If the widget is null, try to get these bounds from a browser window. This
|
||||
// is common on Mac when the window is drawn using Cocoa.
|
||||
gfx::NativeWindow window = platform_util::GetTopLevel(container_view);
|
||||
Browser* browser = chrome::FindBrowserWithWindow(window);
|
||||
if (browser)
|
||||
return browser->window()->GetBounds();
|
||||
-
|
||||
+#endif
|
||||
// If the browser is null, simply return an empty rect. The most common reason
|
||||
// to end up here is that the NativeView has been destroyed externally, which
|
||||
// can happen at any time. This happens fairly commonly on Windows (e.g., at
|
|
@ -1,18 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:47:47 -0700
|
||||
Subject: blink-worker-enable-csp-in-file-scheme.patch
|
||||
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
|
||||
index eeeaa47777df0cab00e1c14f60a0d1e26432c538..608ba10174a9c313bb17ab6d5f68053ce37a0435 100644
|
||||
--- a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
|
||||
+++ b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
|
||||
@@ -307,7 +307,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy(
|
||||
// document (which is implemented in WorkerMessagingProxy, and
|
||||
// m_contentSecurityPolicy should be left as nullptr to inherit the policy).
|
||||
if (!response.CurrentRequestUrl().ProtocolIs("blob") &&
|
||||
- !response.CurrentRequestUrl().ProtocolIs("file") &&
|
||||
!response.CurrentRequestUrl().ProtocolIs("filesystem")) {
|
||||
content_security_policy_ = MakeGarbageCollected<ContentSecurityPolicy>();
|
||||
content_security_policy_->SetOverrideURLForSelf(
|
|
@ -1,34 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:45:00 -0700
|
||||
Subject: blink_file_path.patch
|
||||
|
||||
This is used by editors to obtain the filesystem path from a dragged file. See
|
||||
documentation at https://electronjs.org/docs/api/file-object
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/fileapi/file.h b/third_party/blink/renderer/core/fileapi/file.h
|
||||
index 05e05fb1631851009897f3789d3e770475ce1363..e2ad5fef884532847d035430c14c25e042e2ab24 100644
|
||||
--- a/third_party/blink/renderer/core/fileapi/file.h
|
||||
+++ b/third_party/blink/renderer/core/fileapi/file.h
|
||||
@@ -201,6 +201,9 @@ class CORE_EXPORT File final : public Blob {
|
||||
}
|
||||
const String& name() const { return name_; }
|
||||
|
||||
+ // Getter for the path IDL attribute.
|
||||
+ const String& path() const { return GetPath(); }
|
||||
+
|
||||
// Getter for the lastModified IDL attribute,
|
||||
// http://dev.w3.org/2006/webapi/FileAPI/#file-attrs
|
||||
int64_t lastModified() const;
|
||||
diff --git a/third_party/blink/renderer/core/fileapi/file.idl b/third_party/blink/renderer/core/fileapi/file.idl
|
||||
index 41b8183e858b6d955bacbb72281a08e750b6b29f..0db894ecfae63795724335d914f9f992c0755fd1 100644
|
||||
--- a/third_party/blink/renderer/core/fileapi/file.idl
|
||||
+++ b/third_party/blink/renderer/core/fileapi/file.idl
|
||||
@@ -32,6 +32,7 @@
|
||||
Serializable
|
||||
] interface File : Blob {
|
||||
readonly attribute DOMString name;
|
||||
+ readonly attribute DOMString path;
|
||||
readonly attribute long long lastModified;
|
||||
|
||||
// Non-standard APIs
|
|
@ -1,29 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:48:19 -0700
|
||||
Subject: blink_fix_prototype_assert.patch
|
||||
|
||||
A recent Chromium change has accidentally added assertion for the case when
|
||||
a new window object may not have a prototype attached. In Electron it may
|
||||
happen when preventDefault for a native new-window event.
|
||||
https://chromium.googlesource.com/chromium/src/+/f47b361887a31cccf42a6e21a82bccf28372bdaa%5E%21
|
||||
In the long term we should investigate why it happened, and take a more
|
||||
formal fix. But for now I'm just make this assertion silently pass away.
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc b/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc
|
||||
index e1378ffcd7e061aae635ad25078ee23674542786..6b07828930a9d5691609da394c192b9b5f531b5a 100644
|
||||
--- a/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc
|
||||
+++ b/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc
|
||||
@@ -98,8 +98,10 @@ v8::Local<v8::Function> V8ObjectConstructor::CreateInterfaceObject(
|
||||
bool get_prototype_value =
|
||||
interface_object->Get(context, V8AtomicString(isolate, "prototype"))
|
||||
.ToLocal(&prototype_value);
|
||||
- CHECK(get_prototype_value);
|
||||
- CHECK(prototype_value->IsObject());
|
||||
+ // CHECK(get_prototype_value);
|
||||
+ // CHECK(prototype_value->IsObject());
|
||||
+ if (!get_prototype_value || !prototype_value->IsObject())
|
||||
+ return v8::Local<v8::Function>();
|
||||
|
||||
prototype_object = prototype_value.As<v8::Object>();
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <samuel.r.attard@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:50:24 -0700
|
||||
Subject: blink_initialization_order.patch
|
||||
|
||||
Backport of https://chromium-review.googlesource.com/c/chromium/src/+/1030530
|
||||
to fix the order of V8 and Blink initialization. Also fixes order
|
||||
of DidCreateScriptContext notification with initialization of window globals
|
||||
to fix electron/electron#13787. The backport landed in Chromium 67 but the
|
||||
DidCreateScriptContext re-ordering needs to be upstreamed or kept indefinitely
|
||||
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
index 59af62ece264de7f392f8b13ae373700d6aafc56..2d547910eaef8ba2194a012f8a6c9a444b7de741 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
@@ -191,11 +191,10 @@ void LocalWindowProxy::Initialize() {
|
||||
GetFrame()->IsMainFrame());
|
||||
MainThreadDebugger::Instance()->ContextCreated(script_state_, GetFrame(),
|
||||
origin);
|
||||
+ InstallConditionalFeatures();
|
||||
GetFrame()->Client()->DidCreateScriptContext(context, world_->GetWorldId());
|
||||
}
|
||||
|
||||
- InstallConditionalFeatures();
|
||||
-
|
||||
// This needs to go after everything else since it accesses the window object.
|
||||
InitializeV8ExtrasBinding(script_state_);
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:45:03 -0700
|
||||
Subject: blink_local_frame.patch
|
||||
|
||||
According to electron/electron#3699, it is unreliable to use |unload|
|
||||
event for process.exit('exit'), so we have to do that in
|
||||
willReleaseScriptContext.
|
||||
|
||||
However Chromium then disallowed scripting in willReleaseScriptContext
|
||||
in https://codereview.chromium.org/1657583002, and crash will happen
|
||||
when there is code doing that.
|
||||
|
||||
This patch reverts the change to fix the crash in Electron.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index 06f9c9f62dc94bd093942d9ee523a4279203a177..3ee1caa9ad92cfedd326b364817ce9b5e8db800e 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -393,10 +393,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
}
|
||||
CHECK(!view_ || !view_->IsAttached());
|
||||
|
||||
- // This is the earliest that scripting can be disabled:
|
||||
- // - FrameLoader::Detach() can fire XHR abort events
|
||||
- // - Document::Shutdown() can dispose plugins which can run script.
|
||||
- ScriptForbiddenScope forbid_script;
|
||||
if (!Client())
|
||||
return;
|
||||
|
||||
@@ -414,6 +410,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
// Notify ScriptController that the frame is closing, since its cleanup ends
|
||||
// up calling back to LocalFrameClient via WindowProxy.
|
||||
GetScriptController().ClearForClose();
|
||||
+ // This is the earliest that scripting can be disabled:
|
||||
+ // - FrameLoader::Detach() can fire XHR abort events
|
||||
+ // - Document::Shutdown() can dispose plugins which can run script.
|
||||
+ ScriptForbiddenScope forbid_script;
|
||||
|
||||
// TODO(crbug.com/729196): Trace why LocalFrameView::DetachFromLayout crashes.
|
||||
CHECK(!view_->IsAttached());
|
|
@ -1,51 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Anonymous <anonymous@electronjs.org>
|
||||
Date: Thu, 20 Sep 2018 17:45:11 -0700
|
||||
Subject: blink_world_context.patch
|
||||
|
||||
|
||||
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
|
||||
index 82fb3fdfe6bfa8c8d885ee133270b6f2564325a8..f3bad71eab608d3b9ac0e08446c9e520f47e9b10 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame.h
|
||||
@@ -355,6 +355,9 @@ class WebLocalFrame : public WebFrame {
|
||||
// be calling this API.
|
||||
virtual v8::Local<v8::Context> MainWorldScriptContext() const = 0;
|
||||
|
||||
+ virtual v8::Local<v8::Context> WorldScriptContext(
|
||||
+ v8::Isolate* isolate, int world_id) const = 0;
|
||||
+
|
||||
// Executes script in the context of the current page and returns the value
|
||||
// that the script evaluated to with callback. Script execution can be
|
||||
// suspend.
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
index ce93c3ba0fc4255999fed2bb01dfbb4161faa0dd..305ed843db5dd095a4cd9e8784e3025a1370a491 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
@@ -873,6 +873,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
|
||||
return MainWorldScriptContext()->Global();
|
||||
}
|
||||
|
||||
+v8::Local<v8::Context> WebLocalFrameImpl::WorldScriptContext(
|
||||
+ v8::Isolate* isolate, int world_id) const {
|
||||
+ scoped_refptr<DOMWrapperWorld> world = DOMWrapperWorld::EnsureIsolatedWorld(
|
||||
+ isolate, world_id);
|
||||
+ return ToScriptState(GetFrame(), *world)->GetContext();
|
||||
+}
|
||||
+
|
||||
bool WebFrame::ScriptCanAccess(WebFrame* target) {
|
||||
return BindingSecurity::ShouldAllowAccessToFrame(
|
||||
CurrentDOMWindow(V8PerIsolateData::MainThreadIsolate()),
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
index b503bf7cef554dfb35c2123cba51c0fba7402c7e..2d38c4cebcd4040bbd417d4ae9189da954d9cfce 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
@@ -146,6 +146,8 @@ class CORE_EXPORT WebLocalFrameImpl final
|
||||
int argc,
|
||||
v8::Local<v8::Value> argv[]) override;
|
||||
v8::Local<v8::Context> MainWorldScriptContext() const override;
|
||||
+ v8::Local<v8::Context> WorldScriptContext(
|
||||
+ v8::Isolate* isolate, int world_id) const override;
|
||||
v8::Local<v8::Object> GlobalProxy() const override;
|
||||
void StartReload(WebFrameLoadType) override;
|
||||
void ReloadImage(const WebNode&) override;
|
|
@ -1,31 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Thu, 20 Sep 2018 17:48:05 -0700
|
||||
Subject: boringssl BUILD.gn
|
||||
|
||||
Build BoringSSL with some extra functions that nodejs needs.
|
||||
|
||||
diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn
|
||||
index 250ed854247a6f2f17690ffb95524eb57c72598b..6399d955196fb2d79f18dfcf7cbb2dbd5bd0bcae 100644
|
||||
--- a/third_party/boringssl/BUILD.gn
|
||||
+++ b/third_party/boringssl/BUILD.gn
|
||||
@@ -45,6 +45,19 @@ config("no_asm_config") {
|
||||
|
||||
all_sources = crypto_sources + ssl_sources
|
||||
all_headers = crypto_headers + ssl_headers
|
||||
+if (is_electron_build) {
|
||||
+ # Needed to build a nodejs-compatible boringssl.
|
||||
+ all_sources += [
|
||||
+ "src/decrepit/evp/evp_do_all.c",
|
||||
+ "src/decrepit/xts/xts.c",
|
||||
+ ]
|
||||
+
|
||||
+ all_sources += [
|
||||
+ "src/decrepit/ripemd/internal.h",
|
||||
+ "src/decrepit/ripemd/ripemd.c",
|
||||
+ "src/decrepit/cfb/cfb.c",
|
||||
+ ]
|
||||
+}
|
||||
|
||||
# Windows' assembly is built with NASM. The other platforms use the platform
|
||||
# assembler. Exclude Windows ARM64 because NASM targets x86 and x64 only.
|
|
@ -1,44 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:45:14 -0700
|
||||
Subject: browser_compositor_mac.patch
|
||||
|
||||
|
||||
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.h b/content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
index de89d291e5cbc0981cf06170ed35502a1239136d..656f6c38d55d9f9af569bc772254ca13c279eeab 100644
|
||||
--- a/content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
+++ b/content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
@@ -60,6 +60,8 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient,
|
||||
// These will not return nullptr until Destroy is called.
|
||||
DelegatedFrameHost* GetDelegatedFrameHost();
|
||||
|
||||
+ ui::Layer* GetRootLayer() { return root_layer_.get(); }
|
||||
+
|
||||
// Force a new surface id to be allocated. Returns true if the
|
||||
// RenderWidgetHostImpl sent the resulting surface id to the renderer.
|
||||
bool ForceNewSurfaceId();
|
||||
@@ -68,6 +70,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient,
|
||||
// no valid frame is available.
|
||||
const gfx::CALayerParams* GetLastCALayerParams() const;
|
||||
|
||||
+ ui::Compositor* GetCompositor();
|
||||
void DidCreateNewRendererCompositorFrameSink(
|
||||
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink);
|
||||
void OnDidNotProduceFrame(const viz::BeginFrameAck& ack);
|
||||
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
index 4b3f3c7e97e73ad6d0166ad114f4168d9ed00e11..59e58d693c971742951434f6582140d9179235f2 100644
|
||||
--- a/content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
@@ -80,6 +80,12 @@
|
||||
DCHECK_EQ(1u, num_erased);
|
||||
}
|
||||
|
||||
+ui::Compositor* BrowserCompositorMac::GetCompositor() {
|
||||
+ if (recyclable_compositor_)
|
||||
+ return recyclable_compositor_->compositor();
|
||||
+ return nullptr;
|
||||
+}
|
||||
+
|
||||
DelegatedFrameHost* BrowserCompositorMac::GetDelegatedFrameHost() {
|
||||
DCHECK(delegated_frame_host_);
|
||||
return delegated_frame_host_.get();
|
|
@ -1,21 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@slack-corp.com>
|
||||
Date: Tue, 23 Apr 2019 09:51:43 -0700
|
||||
Subject: build: add electron tracing category
|
||||
|
||||
All TRACE events in Chromium use a static assert to ensure that the
|
||||
categories in use are known / declared. This patch is required for us
|
||||
to introduce a new Electron category.
|
||||
|
||||
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
|
||||
index 97055b4bdaf0dc38b8d248fefddfcf8c68c123b9..6dbe407151dfc5a9168df77f42932e51b802377f 100644
|
||||
--- a/base/trace_event/builtin_categories.h
|
||||
+++ b/base/trace_event/builtin_categories.h
|
||||
@@ -61,6 +61,7 @@
|
||||
X("dwrite") \
|
||||
X("DXVA Decoding") \
|
||||
X("EarlyJava") \
|
||||
+ X("electron") \
|
||||
X("evdev") \
|
||||
X("event") \
|
||||
X("exo") \
|
|
@ -1,28 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ales Pergl <alpergl@microsoft.com>
|
||||
Date: Thu, 20 Sep 2018 17:44:29 -0700
|
||||
Subject: build_gn.patch
|
||||
|
||||
|
||||
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
|
||||
index 7063da0f26c5691f01214c2dc014128d7c8c5e09..b45c5adade6f68d5ba90ddbdf39755b53431b6f6 100644
|
||||
--- a/build/config/BUILDCONFIG.gn
|
||||
+++ b/build/config/BUILDCONFIG.gn
|
||||
@@ -123,6 +123,9 @@ if (current_os == "") {
|
||||
# even if the value is overridden, which is wasteful. See first bullet.
|
||||
|
||||
declare_args() {
|
||||
+ is_electron_build = false
|
||||
+ is_mas_build = false
|
||||
+
|
||||
# Set to enable the official build level of optimization. This has nothing
|
||||
# to do with branding, but enables an additional level of optimization above
|
||||
# release (!is_debug). This might be better expressed as a tri-state
|
||||
@@ -437,6 +440,7 @@ default_compiler_configs = [
|
||||
"//build/config/compiler:thin_archive",
|
||||
"//build/config/coverage:default_coverage",
|
||||
"//build/config/sanitizers:default_sanitizer_flags",
|
||||
+ "//electron/build/config:mas_build",
|
||||
]
|
||||
|
||||
if (is_win) {
|
|
@ -1,114 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:45:32 -0700
|
||||
Subject: can_create_window.patch
|
||||
|
||||
|
||||
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
index 387831a4615746339f4fe16b2b1bf405f7364b54..37d8be6076b9e98ca68acb5f7dc024b0d018879e 100644
|
||||
--- a/content/browser/frame_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
@@ -3719,6 +3719,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
last_committed_origin_, params->window_container_type,
|
||||
params->target_url, params->referrer.To<Referrer>(),
|
||||
params->frame_name, params->disposition, *params->features,
|
||||
+ params->additional_features, params->body,
|
||||
effective_transient_activation_state, params->opener_suppressed,
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
|
||||
index 82882159b0bac6d47d678c485de0aacc7db06c2d..dd2299094b79d82da7ec1cd8f559050b6f0e2af5 100644
|
||||
--- a/content/common/frame.mojom
|
||||
+++ b/content/common/frame.mojom
|
||||
@@ -291,6 +291,10 @@ struct CreateNewWindowParams {
|
||||
|
||||
// The window features to use for the new window.
|
||||
blink.mojom.WindowFeatures features;
|
||||
+
|
||||
+ // Extra fields added by Electron.
|
||||
+ array<string> additional_features;
|
||||
+ network.mojom.URLRequestBody? body;
|
||||
};
|
||||
|
||||
// Operation result when the renderer asks the browser to create a new window.
|
||||
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
||||
index f4c61acba134daf907a1b9afaaf0327a183287e4..d15061de5254fd4f248fed92f47a1b1fcf34cd68 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -519,6 +519,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
+ const std::vector<std::string>& additional_features,
|
||||
+ const scoped_refptr<network::ResourceRequestBody>& body,
|
||||
bool user_gesture,
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access) {
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 6ab15079fe2e1234aca140dfebd5287d8701c147..8ceccd96c4e143921ace8db69685a9631e168dd2 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -177,6 +177,7 @@ class RenderFrameHost;
|
||||
class RenderProcessHost;
|
||||
class RenderViewHost;
|
||||
class ResourceContext;
|
||||
+class ResourceRequestBody;
|
||||
class SerialDelegate;
|
||||
class SiteInstance;
|
||||
class SpeechRecognitionManagerDelegate;
|
||||
@@ -805,6 +806,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
+ const std::vector<std::string>& additional_features,
|
||||
+ const scoped_refptr<network::ResourceRequestBody>& body,
|
||||
bool user_gesture,
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access);
|
||||
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
||||
index 1aa52af90279e16f667cb07677c11141d2efce01..3cb0f9b3e24fb79e43b724d7ad5e6ad99cb7450f 100644
|
||||
--- a/content/renderer/render_view_impl.cc
|
||||
+++ b/content/renderer/render_view_impl.cc
|
||||
@@ -76,6 +76,7 @@
|
||||
#include "content/renderer/ime_event_guard.h"
|
||||
#include "content/renderer/internal_document_state_data.h"
|
||||
#include "content/renderer/loader/request_extra_data.h"
|
||||
+#include "content/renderer/loader/web_url_request_util.h"
|
||||
#include "content/renderer/media/audio/audio_device_factory.h"
|
||||
#include "content/renderer/media/stream/media_stream_device_observer.h"
|
||||
#include "content/renderer/media/video_capture/video_capture_impl_manager.h"
|
||||
@@ -1356,6 +1357,8 @@ WebView* RenderViewImpl::CreateView(
|
||||
}
|
||||
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
|
||||
|
||||
+ params->body = GetRequestBodyForWebURLRequest(request);
|
||||
+
|
||||
// We preserve this information before sending the message since |params| is
|
||||
// moved on send.
|
||||
bool is_background_tab =
|
||||
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.cc b/content/shell/browser/web_test/web_test_content_browser_client.cc
|
||||
index 0c8320a60fcfe0bb9353587afcd9e057206fea18..7ae8aec1f042e275ea27911039c18663f22620ea 100644
|
||||
--- a/content/shell/browser/web_test/web_test_content_browser_client.cc
|
||||
+++ b/content/shell/browser/web_test/web_test_content_browser_client.cc
|
||||
@@ -304,6 +304,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
+ const std::vector<std::string>& additional_features,
|
||||
+ const scoped_refptr<network::ResourceRequestBody>& body,
|
||||
bool user_gesture,
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access) {
|
||||
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.h b/content/shell/browser/web_test/web_test_content_browser_client.h
|
||||
index c07734ff32037fe4de7a5082d3409ee99ae19870..f0b47cc56ba5565d142e5b38efcefe333ce89e2f 100644
|
||||
--- a/content/shell/browser/web_test/web_test_content_browser_client.h
|
||||
+++ b/content/shell/browser/web_test/web_test_content_browser_client.h
|
||||
@@ -69,6 +69,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
+ const std::vector<std::string>& additional_features,
|
||||
+ const scoped_refptr<network::ResourceRequestBody>& body,
|
||||
bool user_gesture,
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access) override;
|
|
@ -1,37 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:50:13 -0700
|
||||
Subject: chrome_key_systems.patch
|
||||
|
||||
Disable persiste licence support check for widevine cdm,
|
||||
as its not supported in the current version of chrome.
|
||||
|
||||
diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc
|
||||
index 0ef05eceaa0e42710c6cfa8acb2174cf930f6114..e0356f615f8bae10b5030f038057be027491f96c 100644
|
||||
--- a/chrome/renderer/media/chrome_key_systems.cc
|
||||
+++ b/chrome/renderer/media/chrome_key_systems.cc
|
||||
@@ -15,7 +15,9 @@
|
||||
#include "base/strings/string_split.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
+#if 0
|
||||
#include "chrome/renderer/chrome_render_thread_observer.h"
|
||||
+#endif
|
||||
#include "components/cdm/renderer/external_clear_key_key_system_properties.h"
|
||||
#include "components/cdm/renderer/widevine_key_system_properties.h"
|
||||
#include "content/public/renderer/render_thread.h"
|
||||
@@ -194,12 +196,14 @@ static SupportedCodecs GetSupportedCodecs(
|
||||
// Returns persistent-license session support.
|
||||
static EmeSessionTypeSupport GetPersistentLicenseSupport(
|
||||
bool supported_by_the_cdm) {
|
||||
+#if 0
|
||||
// Do not support persistent-license if the process cannot persist data.
|
||||
// TODO(crbug.com/457487): Have a better plan on this. See bug for details.
|
||||
if (ChromeRenderThreadObserver::is_incognito_process()) {
|
||||
DVLOG(2) << __func__ << ": Not supported in incognito process.";
|
||||
return EmeSessionTypeSupport::NOT_SUPPORTED;
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (!supported_by_the_cdm) {
|
||||
DVLOG(2) << __func__ << ": Not supported by the CDM.";
|
|
@ -1,118 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <jeremya@chromium.org>
|
||||
Date: Wed, 10 Oct 2018 15:07:34 -0700
|
||||
Subject: define Command::IsMediaKey on mac
|
||||
|
||||
the definition is copied from //chrome/common/extensions/command.cc,
|
||||
which also defines a bunch of other stuff that depends on extensions.
|
||||
since we only need IsMediaKey, and we don't want the extensions stuff
|
||||
(and aren't compiling command.cc), it's safe to duplicate the
|
||||
definition. A candidate for upstreaming would be to move the IsMediaKey
|
||||
function into //ui.
|
||||
|
||||
Also apply electron/electron@0f67b1866a9f00b852370e721affa4efda623f3a
|
||||
and electron/electron@d2368d2d3b3de9eec4cc32b6aaf035cc89921bf1 as
|
||||
patches.
|
||||
|
||||
diff --git a/chrome/browser/extensions/global_shortcut_listener_mac.mm b/chrome/browser/extensions/global_shortcut_listener_mac.mm
|
||||
index befe726af9c10b1563a7fc0bb77cc55f65943d5c..46c6fe08bab8471007f78d3ef227e5195bfdf0e1 100644
|
||||
--- a/chrome/browser/extensions/global_shortcut_listener_mac.mm
|
||||
+++ b/chrome/browser/extensions/global_shortcut_listener_mac.mm
|
||||
@@ -21,6 +21,26 @@
|
||||
|
||||
namespace extensions {
|
||||
|
||||
+// NOTE: this is defined in command.cc, but command.cc is full of
|
||||
+// chrome-extensions-specific logic that we don't want to depend on.
|
||||
+// Since we don't build command.cc in Electron, it's safe to re-define this
|
||||
+// function here. Ideally, though, `IsMediaKey` would be the responsibility of
|
||||
+// `ui::Accelerator`, rather than `extensions::Command`.
|
||||
+
|
||||
+// static
|
||||
+bool Command::IsMediaKey(const ui::Accelerator& accelerator) {
|
||||
+ if (accelerator.modifiers() != 0)
|
||||
+ return false;
|
||||
+
|
||||
+ return (accelerator.key_code() == ui::VKEY_MEDIA_NEXT_TRACK ||
|
||||
+ accelerator.key_code() == ui::VKEY_MEDIA_PREV_TRACK ||
|
||||
+ accelerator.key_code() == ui::VKEY_MEDIA_PLAY_PAUSE ||
|
||||
+ accelerator.key_code() == ui::VKEY_MEDIA_STOP ||
|
||||
+ accelerator.key_code() == ui::VKEY_VOLUME_UP ||
|
||||
+ accelerator.key_code() == ui::VKEY_VOLUME_DOWN ||
|
||||
+ accelerator.key_code() == ui::VKEY_VOLUME_MUTE);
|
||||
+}
|
||||
+
|
||||
// static
|
||||
GlobalShortcutListener* GlobalShortcutListener::GetInstance() {
|
||||
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
diff --git a/chrome/browser/extensions/global_shortcut_listener_win.cc b/chrome/browser/extensions/global_shortcut_listener_win.cc
|
||||
index c5125495b4d178ffb18be4d2d9670f7556412cbd..cddb321abb938c667a4a2089f87eab999510e9b1 100644
|
||||
--- a/chrome/browser/extensions/global_shortcut_listener_win.cc
|
||||
+++ b/chrome/browser/extensions/global_shortcut_listener_win.cc
|
||||
@@ -62,6 +62,8 @@ void GlobalShortcutListenerWin::OnWndProc(HWND hwnd,
|
||||
modifiers |= (LOWORD(lparam) & MOD_SHIFT) ? ui::EF_SHIFT_DOWN : 0;
|
||||
modifiers |= (LOWORD(lparam) & MOD_ALT) ? ui::EF_ALT_DOWN : 0;
|
||||
modifiers |= (LOWORD(lparam) & MOD_CONTROL) ? ui::EF_CONTROL_DOWN : 0;
|
||||
+ modifiers |= (LOWORD(lparam) & MOD_WIN) ? ui::EF_COMMAND_DOWN : 0;
|
||||
+
|
||||
ui::Accelerator accelerator(
|
||||
ui::KeyboardCodeForWindowsKeyCode(key_code), modifiers);
|
||||
|
||||
@@ -92,6 +94,7 @@ bool GlobalShortcutListenerWin::RegisterAcceleratorImpl(
|
||||
modifiers |= accelerator.IsShiftDown() ? MOD_SHIFT : 0;
|
||||
modifiers |= accelerator.IsCtrlDown() ? MOD_CONTROL : 0;
|
||||
modifiers |= accelerator.IsAltDown() ? MOD_ALT : 0;
|
||||
+ modifiers |= accelerator.IsCmdDown() ? MOD_WIN : 0;
|
||||
|
||||
// Create an observer that registers a hot key for |accelerator|.
|
||||
std::unique_ptr<gfx::SingletonHwndHotKeyObserver> observer =
|
||||
diff --git a/chrome/browser/extensions/global_shortcut_listener_x11.cc b/chrome/browser/extensions/global_shortcut_listener_x11.cc
|
||||
index 392cf3d58c64c088596e8d321a2ce37b0ec60b6e..43e30f47240dc10a3a9b950255d4e48792cc4159 100644
|
||||
--- a/chrome/browser/extensions/global_shortcut_listener_x11.cc
|
||||
+++ b/chrome/browser/extensions/global_shortcut_listener_x11.cc
|
||||
@@ -38,6 +38,7 @@ int GetNativeModifiers(const ui::Accelerator& accelerator) {
|
||||
modifiers |= accelerator.IsShiftDown() ? ShiftMask : 0;
|
||||
modifiers |= accelerator.IsCtrlDown() ? ControlMask : 0;
|
||||
modifiers |= accelerator.IsAltDown() ? Mod1Mask : 0;
|
||||
+ modifiers |= accelerator.IsCmdDown() ? Mod4Mask : 0;
|
||||
|
||||
return modifiers;
|
||||
}
|
||||
@@ -151,6 +152,8 @@ void GlobalShortcutListenerX11::OnXKeyPressEvent(::XEvent* x_event) {
|
||||
modifiers |= (x_event->xkey.state & ShiftMask) ? ui::EF_SHIFT_DOWN : 0;
|
||||
modifiers |= (x_event->xkey.state & ControlMask) ? ui::EF_CONTROL_DOWN : 0;
|
||||
modifiers |= (x_event->xkey.state & Mod1Mask) ? ui::EF_ALT_DOWN : 0;
|
||||
+ // For Windows key
|
||||
+ modifiers |= (x_event->xkey.state & Mod4Mask) ? ui::EF_COMMAND_DOWN: 0;
|
||||
|
||||
ui::Accelerator accelerator(
|
||||
ui::KeyboardCodeFromXKeyEvent(x_event), modifiers);
|
||||
diff --git a/ui/base/accelerators/media_keys_listener_mac.mm b/ui/base/accelerators/media_keys_listener_mac.mm
|
||||
index 71b417ee8b64aa2ff7f1b2390851668ec1dcd7cf..1768af408d4cc3075e5bae046649e4955cc400b3 100644
|
||||
--- a/ui/base/accelerators/media_keys_listener_mac.mm
|
||||
+++ b/ui/base/accelerators/media_keys_listener_mac.mm
|
||||
@@ -33,6 +33,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) {
|
||||
case NX_KEYTYPE_NEXT:
|
||||
case NX_KEYTYPE_FAST:
|
||||
return VKEY_MEDIA_NEXT_TRACK;
|
||||
+ case NX_KEYTYPE_SOUND_UP:
|
||||
+ return VKEY_VOLUME_UP;
|
||||
+ case NX_KEYTYPE_SOUND_DOWN:
|
||||
+ return VKEY_VOLUME_DOWN;
|
||||
+ case NX_KEYTYPE_MUTE:
|
||||
+ return VKEY_VOLUME_MUTE;
|
||||
}
|
||||
return VKEY_UNKNOWN;
|
||||
}
|
||||
@@ -192,7 +198,10 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy,
|
||||
int key_code = (data1 & 0xFFFF0000) >> 16;
|
||||
if (key_code != NX_KEYTYPE_PLAY && key_code != NX_KEYTYPE_NEXT &&
|
||||
key_code != NX_KEYTYPE_PREVIOUS && key_code != NX_KEYTYPE_FAST &&
|
||||
- key_code != NX_KEYTYPE_REWIND) {
|
||||
+ key_code != NX_KEYTYPE_REWIND &&
|
||||
+ key_code != NX_KEYTYPE_SOUND_UP &&
|
||||
+ key_code != NX_KEYTYPE_SOUND_DOWN &&
|
||||
+ key_code != NX_KEYTYPE_MUTE) {
|
||||
return event;
|
||||
}
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Wed, 21 Nov 2018 14:31:34 -0800
|
||||
Subject: content: allow embedder to prevent locking scheme registry
|
||||
|
||||
The //content layer requires all schemes to be registered during startup,
|
||||
because Add*Scheme aren't threadsafe. However, Electron exposes the option to
|
||||
register additional schemes via JavaScript in the main process before the app
|
||||
is ready, but after the //content layer has already locked the registry.
|
||||
|
||||
Without this patch, calling `registerStandardSchemes` during initialization
|
||||
when in debug mode will cause a DCHECK to fire.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index a388e279e9ef62d4484182bdde02de264a263186..4e8c72ad1602f576014ea5c8bb1d572e1490a8ff 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -752,7 +752,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
|
||||
#endif
|
||||
|
||||
RegisterPathProvider();
|
||||
- RegisterContentSchemes(true);
|
||||
+ RegisterContentSchemes(delegate_->ShouldLockSchemeRegistry());
|
||||
|
||||
#if defined(OS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE)
|
||||
int icudata_fd = g_fds->MaybeGet(kAndroidICUDataDescriptor);
|
||||
diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc
|
||||
index 456df421598153bde006ad0ecb0f1031360bb543..af06d78b91fa30e5daf993ad2c65c2c5e35a17a5 100644
|
||||
--- a/content/public/app/content_main_delegate.cc
|
||||
+++ b/content/public/app/content_main_delegate.cc
|
||||
@@ -55,6 +55,10 @@ int ContentMainDelegate::TerminateForFatalInitializationError() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+bool ContentMainDelegate::ShouldLockSchemeRegistry() {
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
service_manager::ProcessType ContentMainDelegate::OverrideProcessType() {
|
||||
return service_manager::ProcessType::kDefault;
|
||||
}
|
||||
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h
|
||||
index d4f3b8097c6aba8e15616c6d00070565064b1e9c..5672f4f1c328d30bb04dd8aaf4af63c51d52b3e6 100644
|
||||
--- a/content/public/app/content_main_delegate.h
|
||||
+++ b/content/public/app/content_main_delegate.h
|
||||
@@ -88,6 +88,9 @@ class CONTENT_EXPORT ContentMainDelegate {
|
||||
virtual void ZygoteForked() {}
|
||||
#endif // defined(OS_LINUX)
|
||||
|
||||
+ // Allows the embedder to prevent locking the scheme registry.
|
||||
+ virtual bool ShouldLockSchemeRegistry();
|
||||
+
|
||||
// Fatal errors during initialization are reported by this function, so that
|
||||
// the embedder can implement graceful exit by displaying some message and
|
||||
// returning initialization error code. Default behavior is CHECK(false).
|
|
@ -1,22 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Thu, 18 Oct 2018 17:07:42 -0700
|
||||
Subject: content_browser_main_loop.patch
|
||||
|
||||
Pass idle quit closure for main message loop, so that pending tasks are
|
||||
run before shutdown. This is required to cleanup WebContents asynchronously
|
||||
in atom::CommonWebContentsDelegate::ResetManageWebContents.
|
||||
|
||||
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
|
||||
index dc34314c001aae412b44196805ad202694c180ef..9fd749dcd26555d84bc43aa3df3e8593371330c1 100644
|
||||
--- a/content/browser/browser_main_loop.cc
|
||||
+++ b/content/browser/browser_main_loop.cc
|
||||
@@ -1529,7 +1529,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
|
||||
}
|
||||
|
||||
base::RunLoop run_loop;
|
||||
- parts_->PreDefaultMainMessageLoopRun(run_loop.QuitClosure());
|
||||
+ parts_->PreDefaultMainMessageLoopRun(run_loop.QuitWhenIdleClosure());
|
||||
run_loop.Run();
|
||||
#endif
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Mon, 3 Jun 2019 14:07:40 -0700
|
||||
Subject: cross_site_document_resource_handler.patch
|
||||
|
||||
Add a content layer hook to disable CORB for a renderer process,
|
||||
this patch can be removed once we switch to network service,
|
||||
where the embedders have a chance to design their URLLoaders.
|
||||
|
||||
diff --git a/content/browser/loader/cross_site_document_resource_handler.cc b/content/browser/loader/cross_site_document_resource_handler.cc
|
||||
index d514c10160dd12f225c42e927977660cacbc9c43..49345f1d4d75c8b96efe485202d89774a05b6e34 100644
|
||||
--- a/content/browser/loader/cross_site_document_resource_handler.cc
|
||||
+++ b/content/browser/loader/cross_site_document_resource_handler.cc
|
||||
@@ -671,6 +671,9 @@ bool CrossSiteDocumentResourceHandler::ShouldBlockBasedOnHeaders(
|
||||
return false;
|
||||
}
|
||||
|
||||
+ if (GetContentClient()->browser()->ShouldBypassCORB(info->GetChildID()))
|
||||
+ return false;
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
||||
index 62d5e17f0599a78d679495d6fa674939d237602e..f40a4ff5f08e906e62dd838eb5af63ade92037d2 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -71,6 +71,10 @@ std::unique_ptr<BrowserMainParts> ContentBrowserClient::CreateBrowserMainParts(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
+bool ContentBrowserClient::ShouldBypassCORB(int render_process_id) const {
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
void ContentBrowserClient::PostAfterStartupTask(
|
||||
const base::Location& from_here,
|
||||
const scoped_refptr<base::TaskRunner>& task_runner,
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 136df7edaaaaaa1eb121ef7cf80aebc47969dc8d..5b889fec05ee9017f5f149fab70c4feab39c86dc 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -252,6 +252,9 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
virtual std::unique_ptr<BrowserMainParts> CreateBrowserMainParts(
|
||||
const MainFunctionParams& parameters);
|
||||
|
||||
+ // Electron: Allows bypassing CORB checks for a renderer process.
|
||||
+ virtual bool ShouldBypassCORB(int render_process_id) const;
|
||||
+
|
||||
// Allows the embedder to change the default behavior of
|
||||
// BrowserThread::PostAfterStartupTask to better match whatever
|
||||
// definition of "startup" the embedder has in mind. This may be
|
|
@ -1,63 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:44:38 -0700
|
||||
Subject: dcheck.patch
|
||||
|
||||
This disables some debug checks which currently fail when running the Electron
|
||||
test suite. In general there should be sustained effort to have all debug checks
|
||||
enabled. If you want to help, choose one of the diffs below and remove it. Then
|
||||
build Electron (debug configuration) and make sure all tests pass on the CI
|
||||
systems. Unfortunately the tests don't always cover the check failures, so it's
|
||||
good to also run some non-trivial Electron app to verify.
|
||||
|
||||
Apart from getting rid of a whole diff, you may also be able to replace one diff
|
||||
with another which enables at least some of the previously disabled checks. For
|
||||
example, the checks might be disabled for a whole build target, but actually
|
||||
only one or two specific checks fail. Then it's better to simply comment out the
|
||||
failing checks and allow the rest of the target to have them enabled.
|
||||
|
||||
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
|
||||
index f50c1283c195a9fdffbf737a0368cf4ffe3940d5..c57cda2907fa68d1d8c6095d1bbd7ffb69db7d26 100644
|
||||
--- a/content/browser/frame_host/navigation_controller_impl.cc
|
||||
+++ b/content/browser/frame_host/navigation_controller_impl.cc
|
||||
@@ -1242,8 +1242,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
|
||||
return NAVIGATION_TYPE_NEW_SUBFRAME;
|
||||
}
|
||||
|
||||
- // We only clear the session history when navigating to a new page.
|
||||
- DCHECK(!params.history_list_was_cleared);
|
||||
+ // Electron does its own book keeping of navigation entries and we
|
||||
+ // expect content to not track any, by clearing history list for
|
||||
+ // all navigations.
|
||||
+ // DCHECK(!params.history_list_was_cleared);
|
||||
|
||||
if (rfh->GetParent()) {
|
||||
// All manual subframes would be did_create_new_entry and handled above, so
|
||||
@@ -1486,7 +1488,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
|
||||
new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon();
|
||||
}
|
||||
|
||||
- DCHECK(!params.history_list_was_cleared || !replace_entry);
|
||||
+ // Electron does its own book keeping of navigation entries and we
|
||||
+ // expect content to not track any, by clearing history list for
|
||||
+ // all navigations.
|
||||
+ // DCHECK(!params.history_list_was_cleared || !replace_entry);
|
||||
// The browser requested to clear the session history when it initiated the
|
||||
// navigation. Now we know that the renderer has updated its state accordingly
|
||||
// and it is safe to also clear the browser side history.
|
||||
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
|
||||
index 17dee835d3d473a37e18c5a111426a3899a6ced2..ae01e88dbfbbfe34bb76e4234c17e95d06737663 100644
|
||||
--- a/ui/base/clipboard/clipboard_win.cc
|
||||
+++ b/ui/base/clipboard/clipboard_win.cc
|
||||
@@ -729,9 +729,9 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
|
||||
}
|
||||
|
||||
void ClipboardWin::WriteToClipboard(unsigned int format, HANDLE handle) {
|
||||
- DCHECK(clipboard_owner_->hwnd() != NULL);
|
||||
+ // DCHECK(clipboard_owner_->hwnd() != NULL);
|
||||
if (handle && !::SetClipboardData(format, handle)) {
|
||||
- DCHECK(ERROR_CLIPBOARD_NOT_OPEN != GetLastError());
|
||||
+ // DCHECK(ERROR_CLIPBOARD_NOT_OPEN != GetLastError());
|
||||
FreeData(format, handle);
|
||||
}
|
||||
}
|
|
@ -1,155 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Thu, 18 Oct 2018 17:07:01 -0700
|
||||
Subject: desktop_media_list.patch
|
||||
|
||||
* Adds a new observer method to DesktopMediaListObserver for
|
||||
desktop capture api.
|
||||
* Backports https://chromium-review.googlesource.com/c/chromium/src/+/1199806
|
||||
that fixes crash with screen capturer, can be removed in 71.0.3539.0
|
||||
|
||||
diff --git a/chrome/browser/media/webrtc/desktop_media_list.h b/chrome/browser/media/webrtc/desktop_media_list.h
|
||||
index 8e02a8a95eb07516162eacdf5b361231d3a02975..3497b85428a52c6019cfb5d30229071f99ecfb20 100644
|
||||
--- a/chrome/browser/media/webrtc/desktop_media_list.h
|
||||
+++ b/chrome/browser/media/webrtc/desktop_media_list.h
|
||||
@@ -32,6 +32,9 @@ class DesktopMediaList {
|
||||
|
||||
virtual ~DesktopMediaList() {}
|
||||
|
||||
+ // Allows listening to notifications generated by the model.
|
||||
+ virtual void AddObserver(DesktopMediaListObserver* observer) = 0;
|
||||
+
|
||||
// Sets time interval between updates. By default list of sources and their
|
||||
// thumbnail are updated once per second. If called after StartUpdating() then
|
||||
// it will take effect only after the next update.
|
||||
@@ -51,10 +54,11 @@ class DesktopMediaList {
|
||||
// enumerated. After the initial enumeration the model will be refreshed based
|
||||
// on the update period, and notifications generated only for changes in the
|
||||
// model.
|
||||
- virtual void StartUpdating(DesktopMediaListObserver* observer) = 0;
|
||||
+ virtual void StartUpdating() = 0;
|
||||
|
||||
virtual int GetSourceCount() const = 0;
|
||||
virtual const Source& GetSource(int index) const = 0;
|
||||
+ virtual const std::vector<Source>& GetSources() const = 0;
|
||||
|
||||
virtual content::DesktopMediaID::Type GetMediaListType() const = 0;
|
||||
};
|
||||
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.cc b/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
index a68d5d774489fe95968046001b8540d74f36dc97..ca1077801ae18862618964a9675a4101b9c3a393 100644
|
||||
--- a/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
@@ -21,6 +21,11 @@ DesktopMediaListBase::DesktopMediaListBase(base::TimeDelta update_period)
|
||||
|
||||
DesktopMediaListBase::~DesktopMediaListBase() {}
|
||||
|
||||
+void DesktopMediaListBase::AddObserver(DesktopMediaListObserver* observer) {
|
||||
+ DCHECK(!observer_);
|
||||
+ observer_ = observer;
|
||||
+}
|
||||
+
|
||||
void DesktopMediaListBase::SetUpdatePeriod(base::TimeDelta period) {
|
||||
DCHECK(!observer_);
|
||||
update_period_ = period;
|
||||
@@ -34,10 +39,7 @@ void DesktopMediaListBase::SetViewDialogWindowId(DesktopMediaID dialog_id) {
|
||||
view_dialog_id_ = dialog_id;
|
||||
}
|
||||
|
||||
-void DesktopMediaListBase::StartUpdating(DesktopMediaListObserver* observer) {
|
||||
- DCHECK(!observer_);
|
||||
-
|
||||
- observer_ = observer;
|
||||
+void DesktopMediaListBase::StartUpdating() {
|
||||
Refresh();
|
||||
}
|
||||
|
||||
@@ -52,6 +54,11 @@ const DesktopMediaList::Source& DesktopMediaListBase::GetSource(
|
||||
return sources_[index];
|
||||
}
|
||||
|
||||
+const std::vector<DesktopMediaList::Source>& DesktopMediaListBase::GetSources()
|
||||
+ const {
|
||||
+ return sources_;
|
||||
+}
|
||||
+
|
||||
DesktopMediaID::Type DesktopMediaListBase::GetMediaListType() const {
|
||||
return type_;
|
||||
}
|
||||
@@ -63,6 +70,12 @@ DesktopMediaListBase::SourceDescription::SourceDescription(
|
||||
|
||||
void DesktopMediaListBase::UpdateSourcesList(
|
||||
const std::vector<SourceDescription>& new_sources) {
|
||||
+ // Notify observer when there was no new source captured.
|
||||
+ if (new_sources.empty()) {
|
||||
+ observer_->OnSourceUnchanged(this);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
typedef std::set<DesktopMediaID> SourceSet;
|
||||
SourceSet new_source_set;
|
||||
for (size_t i = 0; i < new_sources.size(); ++i) {
|
||||
@@ -135,6 +148,8 @@ void DesktopMediaListBase::UpdateSourceThumbnail(DesktopMediaID id,
|
||||
}
|
||||
|
||||
void DesktopMediaListBase::ScheduleNextRefresh() {
|
||||
+ if (!observer_->ShouldScheduleNextRefresh(this))
|
||||
+ return;
|
||||
base::PostDelayedTaskWithTraits(FROM_HERE, {BrowserThread::UI},
|
||||
base::BindOnce(&DesktopMediaListBase::Refresh,
|
||||
weak_factory_.GetWeakPtr()),
|
||||
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.h b/chrome/browser/media/webrtc/desktop_media_list_base.h
|
||||
index 746df1210aa92af5c9d4703112b4bd6c09b94fdf..461e0edf8509569d05c86f466c02b5035183d0df 100644
|
||||
--- a/chrome/browser/media/webrtc/desktop_media_list_base.h
|
||||
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.h
|
||||
@@ -24,12 +24,14 @@ class DesktopMediaListBase : public DesktopMediaList {
|
||||
~DesktopMediaListBase() override;
|
||||
|
||||
// DesktopMediaList interface.
|
||||
+ void AddObserver(DesktopMediaListObserver* observer) override;
|
||||
void SetUpdatePeriod(base::TimeDelta period) override;
|
||||
void SetThumbnailSize(const gfx::Size& thumbnail_size) override;
|
||||
void SetViewDialogWindowId(content::DesktopMediaID dialog_id) override;
|
||||
- void StartUpdating(DesktopMediaListObserver* observer) override;
|
||||
+ void StartUpdating() override;
|
||||
int GetSourceCount() const override;
|
||||
const Source& GetSource(int index) const override;
|
||||
+ const std::vector<Source>& GetSources() const override;
|
||||
content::DesktopMediaID::Type GetMediaListType() const override;
|
||||
|
||||
static uint32_t GetImageHash(const gfx::Image& image);
|
||||
diff --git a/chrome/browser/media/webrtc/desktop_media_list_observer.h b/chrome/browser/media/webrtc/desktop_media_list_observer.h
|
||||
index 47401abc984e6fe26c7f4c5399aa565c687060b0..ca6a527ffac877c27aac94337ec5a7b546e09768 100644
|
||||
--- a/chrome/browser/media/webrtc/desktop_media_list_observer.h
|
||||
+++ b/chrome/browser/media/webrtc/desktop_media_list_observer.h
|
||||
@@ -18,6 +18,10 @@ class DesktopMediaListObserver {
|
||||
int new_index) = 0;
|
||||
virtual void OnSourceNameChanged(DesktopMediaList* list, int index) = 0;
|
||||
virtual void OnSourceThumbnailChanged(DesktopMediaList* list, int index) = 0;
|
||||
+ virtual void OnSourceUnchanged(DesktopMediaList* list) = 0;
|
||||
+ // Return value indicates whether the observer should continue listening
|
||||
+ // for capture updates.
|
||||
+ virtual bool ShouldScheduleNextRefresh(DesktopMediaList* list) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~DesktopMediaListObserver() {}
|
||||
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
index b060eb31d194e44c6c89e2cbf990323802c1aa5f..514325c3d6cb11b69b0d43e72d851c49f0ef6824 100644
|
||||
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
@@ -7,14 +7,15 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/hash/hash.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
+#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/post_task.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/media/webrtc/desktop_media_list_observer.h"
|
||||
-#include "chrome/grit/generated_resources.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
#include "media/base/video_util.h"
|
||||
#include "third_party/libyuv/include/libyuv/scale_argb.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
|
@ -1,76 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Heilig Benedek <benecene@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:47:54 -0700
|
||||
Subject: disable-redraw-lock.patch
|
||||
|
||||
Chromium uses a custom window titlebar implementation on Windows when DWM
|
||||
is disabled (Windows 7 and earlier, non Aero theme). The native titlebar
|
||||
sometimes painted over this custom titlebar, so a workaround was put in
|
||||
place to lock redraws in reaction to certain events if DWM is disabled,
|
||||
since the code assumes that in that case, the custom titlebar is painted.
|
||||
Electron forces the use of the native titlebar, which the workaround doesn't
|
||||
take into account, and still locks redraws, causing weird repainting issues
|
||||
in electron (and other applications). This patch provides a way to disable
|
||||
the redraw locking mechanism, which fixes these issues. The electron issue
|
||||
can be found at https://github.com/electron/electron/issues/1821
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index de88c769b5be6b7f568d999d8bb92792e0e0ae19..ba47d52fd467e01c3d36db48d3b546bfa8468ed5 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -286,6 +286,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
|
||||
|
||||
} // namespace
|
||||
|
||||
+bool HWNDMessageHandlerDelegate::HasNativeFrame() const {
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
// A scoping class that prevents a window from being able to redraw in response
|
||||
// to invalidations that may occur within it for the lifetime of the object.
|
||||
//
|
||||
@@ -337,6 +341,7 @@ class HWNDMessageHandler::ScopedRedrawLock {
|
||||
cancel_unlock_(false),
|
||||
should_lock_(owner_->IsVisible() && !owner->HasChildRenderingWindow() &&
|
||||
::IsWindow(hwnd_) &&
|
||||
+ !owner_->HasNativeFrame() &&
|
||||
(!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) ||
|
||||
!ui::win::IsAeroGlassEnabled())) {
|
||||
if (should_lock_)
|
||||
@@ -937,6 +942,10 @@ bool HWNDMessageHandler::HasChildRenderingWindow() {
|
||||
hwnd());
|
||||
}
|
||||
|
||||
+bool HWNDMessageHandler::HasNativeFrame() {
|
||||
+ return delegate_->HasNativeFrame();
|
||||
+}
|
||||
+
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// HWNDMessageHandler, gfx::WindowImpl overrides:
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
|
||||
index 060aa2dc02a27d76005657d92a62b466c07f8fce..6f93c637489e64c2e76b48147fc28063aecbe1c6 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.h
|
||||
+++ b/ui/views/win/hwnd_message_handler.h
|
||||
@@ -192,6 +192,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
|
||||
using TouchIDs = std::set<DWORD>;
|
||||
enum class DwmFrameState { OFF, ON };
|
||||
|
||||
+ bool HasNativeFrame();
|
||||
+
|
||||
// Overridden from WindowImpl:
|
||||
HICON GetDefaultWindowIcon() const override;
|
||||
HICON GetSmallWindowIcon() const override;
|
||||
diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
|
||||
index 45c4e5b29d05ea0323596fa2c5034c2e30a68f70..e25aac69b09954fbc267309beba98ec0877fa2ac 100644
|
||||
--- a/ui/views/win/hwnd_message_handler_delegate.h
|
||||
+++ b/ui/views/win/hwnd_message_handler_delegate.h
|
||||
@@ -46,6 +46,8 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
|
||||
// True if the widget associated with this window has a non-client view.
|
||||
virtual bool HasNonClientView() const = 0;
|
||||
|
||||
+ virtual bool HasNativeFrame() const;
|
||||
+
|
||||
// Returns who we want to be drawing the frame. Either the system (Windows)
|
||||
// will handle it or Chrome will custom draw it.
|
||||
virtual FrameMode GetFrameMode() const = 0;
|
|
@ -1,315 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Birunthan Mohanathas <birunthan@mohanathas.com>
|
||||
Date: Fri, 30 Nov 2018 12:44:12 +0200
|
||||
Subject: Add --disable-color-correct-rendering switch
|
||||
|
||||
In Electron 2.0, `--disable-features=ColorCorrectRendering` could be
|
||||
used to make the app use the display color space (e.g. P3 on Macs)
|
||||
instead of color correcting to sRGB. Because color correct rendering is
|
||||
always enabled on Chromium 62 and later and because
|
||||
`--force-color-profile` has no effect on macOS, apps that need e.g. P3
|
||||
colors are currently stuck on Electron 2.0.
|
||||
|
||||
This restores the functionality removed in
|
||||
https://chromium-review.googlesource.com/698347 in the form of the
|
||||
`--disable-color-correct-rendering` switch.
|
||||
|
||||
This can be removed once web content (including WebGL) learn how
|
||||
to deal with color spaces. That is being tracked at
|
||||
https://crbug.com/634542 and https://crbug.com/711107.
|
||||
|
||||
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
|
||||
index 092fb1b7ea3626b7649472c35ec20bf1a6aaf4cd..fed8dd322faba387ebd0508228f847766a76011e 100644
|
||||
--- a/cc/trees/layer_tree_settings.h
|
||||
+++ b/cc/trees/layer_tree_settings.h
|
||||
@@ -99,6 +99,8 @@ class CC_EXPORT LayerTreeSettings {
|
||||
|
||||
bool enable_mask_tiling = true;
|
||||
|
||||
+ bool enable_color_correct_rendering = true;
|
||||
+
|
||||
// If set to true, the compositor may selectively defer image decodes to the
|
||||
// Image Decode Service and raster tiles without images until the decode is
|
||||
// ready.
|
||||
diff --git a/components/viz/common/display/renderer_settings.h b/components/viz/common/display/renderer_settings.h
|
||||
index 78041fcb9647f740c6a142ec65f2418712c6286c..04e75ac40c38a38bdec634d1aa645854cb1a80d6 100644
|
||||
--- a/components/viz/common/display/renderer_settings.h
|
||||
+++ b/components/viz/common/display/renderer_settings.h
|
||||
@@ -23,6 +23,7 @@ class VIZ_COMMON_EXPORT RendererSettings {
|
||||
RendererSettings(const RendererSettings& other);
|
||||
~RendererSettings();
|
||||
|
||||
+ bool enable_color_correct_rendering = true;
|
||||
bool allow_antialiasing = true;
|
||||
bool force_antialiasing = false;
|
||||
bool force_blending_with_shaders = false;
|
||||
diff --git a/components/viz/host/renderer_settings_creation.cc b/components/viz/host/renderer_settings_creation.cc
|
||||
index 78a6b5739caed8c3925f303c52ed107be8e4ccfe..ddbf660e594c1a991d4e758fa11b1b2ecf603b55 100644
|
||||
--- a/components/viz/host/renderer_settings_creation.cc
|
||||
+++ b/components/viz/host/renderer_settings_creation.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "components/viz/common/display/renderer_settings.h"
|
||||
#include "components/viz/common/features.h"
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
+#include "ui/gfx/switches.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#include "ui/base/cocoa/remote_layer_api.h"
|
||||
@@ -49,6 +50,8 @@ bool GetSwitchValueAsInt(const base::CommandLine* command_line,
|
||||
RendererSettings CreateRendererSettings() {
|
||||
RendererSettings renderer_settings;
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
+ renderer_settings.enable_color_correct_rendering =
|
||||
+ !command_line->HasSwitch(switches::kDisableColorCorrectRendering);
|
||||
renderer_settings.partial_swap_enabled =
|
||||
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
|
||||
#if defined(OS_WIN)
|
||||
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
|
||||
index b7a65f6dae8f2fcba0ba127cb50f0f338a26b9d0..bc1d0d3dd92d1adc6c94803755a23c28ff47771a 100644
|
||||
--- a/components/viz/service/display/gl_renderer.cc
|
||||
+++ b/components/viz/service/display/gl_renderer.cc
|
||||
@@ -80,6 +80,9 @@
|
||||
|
||||
using gpu::gles2::GLES2Interface;
|
||||
|
||||
+#define PATCH_CS(color_space) \
|
||||
+ (settings_->enable_color_correct_rendering ? color_space : gfx::ColorSpace())
|
||||
+
|
||||
namespace viz {
|
||||
namespace {
|
||||
|
||||
@@ -554,8 +557,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
|
||||
void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) {
|
||||
SetBlendEnabled(quad->ShouldDrawWithBlending());
|
||||
|
||||
- SetUseProgram(ProgramKey::DebugBorder(), gfx::ColorSpace::CreateSRGB(),
|
||||
- current_frame()->current_render_pass->color_space);
|
||||
+ SetUseProgram(ProgramKey::DebugBorder(),
|
||||
+ PATCH_CS(gfx::ColorSpace::CreateSRGB()),
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space));
|
||||
|
||||
// Use the full quad_rect for debug quads to not move the edges based on
|
||||
// partial swaps.
|
||||
@@ -1353,7 +1357,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
params->use_aa ? USE_AA : NO_AA, mask_mode, mask_for_background,
|
||||
params->use_color_matrix, tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(params->quad)),
|
||||
- params->contents_and_bypass_color_space, target_color_space);
|
||||
+ PATCH_CS(params->contents_and_bypass_color_space),
|
||||
+ PATCH_CS(target_color_space));
|
||||
}
|
||||
|
||||
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
|
||||
@@ -1824,8 +1829,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
- quad_color_space,
|
||||
- current_frame()->current_render_pass->color_space);
|
||||
+ PATCH_CS(quad_color_space),
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space));
|
||||
SetShaderColor(color, opacity);
|
||||
if (current_program_->rounded_corner_rect_location() != -1) {
|
||||
SetShaderRoundedCorner(
|
||||
@@ -1980,8 +1985,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
: NON_PREMULTIPLIED_ALPHA,
|
||||
false, false, tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
- quad_resource_lock.color_space(),
|
||||
- current_frame()->current_render_pass->color_space);
|
||||
+ PATCH_CS(quad_resource_lock.color_space()),
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space));
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2077,8 +2082,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
- quad_resource_lock.color_space(),
|
||||
- current_frame()->current_render_pass->color_space);
|
||||
+ PATCH_CS(quad_resource_lock.color_space()),
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space));
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2181,7 +2186,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
|
||||
|
||||
gfx::ColorSpace dst_color_space =
|
||||
- current_frame()->current_render_pass->color_space;
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space);
|
||||
// Force sRGB output on Windows for overlay candidate video quads to match
|
||||
// DirectComposition behavior in case these switch between overlays and
|
||||
// compositing. See https://crbug.com/811118 for details.
|
||||
@@ -2337,8 +2342,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
|
||||
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
- lock.color_space(),
|
||||
- current_frame()->current_render_pass->color_space);
|
||||
+ PATCH_CS(lock.color_space()),
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space));
|
||||
|
||||
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
|
||||
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
|
||||
@@ -2395,8 +2400,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
|
||||
|
||||
// Bind the program to the GL state.
|
||||
- SetUseProgram(draw_cache_.program_key, locked_quad.color_space(),
|
||||
- current_frame()->current_render_pass->color_space);
|
||||
+ SetUseProgram(draw_cache_.program_key, PATCH_CS(locked_quad.color_space()),
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space));
|
||||
|
||||
if (current_program_->rounded_corner_rect_location() != -1) {
|
||||
SetShaderRoundedCorner(
|
||||
@@ -3089,7 +3094,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
|
||||
void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
|
||||
const gfx::ColorSpace& src_color_space,
|
||||
const gfx::ColorSpace& dst_color_space) {
|
||||
- DCHECK(dst_color_space.IsValid());
|
||||
+ if (settings_->enable_color_correct_rendering) {
|
||||
+ DCHECK(dst_color_space.IsValid());
|
||||
+ }
|
||||
|
||||
ProgramKey program_key = program_key_no_color;
|
||||
const gfx::ColorTransform* color_transform =
|
||||
@@ -3443,7 +3450,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
|
||||
*overlay_texture = FindOrCreateOverlayTexture(
|
||||
params.quad->render_pass_id, iosurface_width, iosurface_height,
|
||||
- current_frame()->root_render_pass->color_space);
|
||||
+ PATCH_CS(current_frame()->root_render_pass->color_space));
|
||||
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
|
||||
gfx::SizeF((*overlay_texture)->texture.size()));
|
||||
|
||||
@@ -3647,8 +3654,9 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
|
||||
PrepareGeometry(SHARED_BINDING);
|
||||
|
||||
- SetUseProgram(ProgramKey::DebugBorder(), gfx::ColorSpace::CreateSRGB(),
|
||||
- current_frame()->root_render_pass->color_space);
|
||||
+ SetUseProgram(ProgramKey::DebugBorder(),
|
||||
+ PATCH_CS(gfx::ColorSpace::CreateSRGB()),
|
||||
+ PATCH_CS(current_frame()->root_render_pass->color_space));
|
||||
|
||||
gfx::Transform render_matrix;
|
||||
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
|
||||
@@ -3808,3 +3816,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
|
||||
}
|
||||
|
||||
} // namespace viz
|
||||
+
|
||||
+#undef PATCH_CS
|
||||
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
|
||||
index f34cfb51693648a7b342d21a61c601090209355a..b488efc71edf5d79e16c25d3d7be2d8ea9fa2ec8 100644
|
||||
--- a/content/browser/gpu/gpu_process_host.cc
|
||||
+++ b/content/browser/gpu/gpu_process_host.cc
|
||||
@@ -191,6 +191,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
|
||||
|
||||
// Command-line switches to propagate to the GPU process.
|
||||
static const char* const kSwitchNames[] = {
|
||||
+ switches::kDisableColorCorrectRendering,
|
||||
service_manager::switches::kDisableSeccompFilterSandbox,
|
||||
service_manager::switches::kGpuSandboxAllowSysVShm,
|
||||
service_manager::switches::kGpuSandboxFailuresFatal,
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 4b8c6d7b1a2676df8ef63117785c1aed8341d12e..6930799c5fc0def1248b46884a3da18290e49671 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -216,6 +216,7 @@
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
#include "ui/base/ui_base_switches_util.h"
|
||||
#include "ui/display/display_switches.h"
|
||||
+#include "ui/gfx/switches.h"
|
||||
#include "ui/gl/gl_switches.h"
|
||||
#include "ui/native_theme/native_theme_features.h"
|
||||
|
||||
@@ -2908,6 +2909,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
||||
// Propagate the following switches to the renderer command line (along
|
||||
// with any associated values) if present in the browser command line.
|
||||
static const char* const kSwitchNames[] = {
|
||||
+ switches::kDisableColorCorrectRendering,
|
||||
network::switches::kNoReferrers,
|
||||
network::switches::kExplicitlyAllowedPorts,
|
||||
service_manager::switches::kDisableInProcessStackTraces,
|
||||
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
||||
index 33817ba20ae6cbfec8a28313092df9c10b1bf966..ea1a574c1f6d2a0f880391b21397c2cb342cbc77 100644
|
||||
--- a/content/renderer/render_widget.cc
|
||||
+++ b/content/renderer/render_widget.cc
|
||||
@@ -2810,6 +2810,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
|
||||
settings.main_frame_before_activation_enabled =
|
||||
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);
|
||||
|
||||
+ settings.enable_color_correct_rendering =
|
||||
+ !cmd.HasSwitch(switches::kDisableColorCorrectRendering);
|
||||
+
|
||||
// Checkerimaging is not supported for synchronous single-threaded mode, which
|
||||
// is what the renderer uses if its not threaded.
|
||||
settings.enable_checker_imaging =
|
||||
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
|
||||
index 88ec94963569588ed2882193a28197879dcb1090..eae37577bc9b1872c0162f55de218553eed61587 100644
|
||||
--- a/ui/gfx/mac/io_surface.cc
|
||||
+++ b/ui/gfx/mac/io_surface.cc
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "ui/gfx/buffer_format_util.h"
|
||||
#include "ui/gfx/icc_profile.h"
|
||||
+#include "ui/gfx/switches.h"
|
||||
|
||||
namespace gfx {
|
||||
|
||||
@@ -189,6 +190,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
|
||||
|
||||
// Ensure that all IOSurfaces start as sRGB.
|
||||
CGColorSpaceRef color_space = base::mac::GetSRGBColorSpace();
|
||||
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
|
||||
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
|
||||
+ color_space = base::mac::GetSystemColorSpace();
|
||||
+ }
|
||||
+
|
||||
base::ScopedCFTypeRef<CFDataRef> color_space_icc(
|
||||
CGColorSpaceCopyICCProfile(color_space));
|
||||
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
|
||||
@@ -200,6 +206,14 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
|
||||
|
||||
void IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
|
||||
const ColorSpace& color_space) {
|
||||
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
|
||||
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
|
||||
+ base::ScopedCFTypeRef<CFDataRef> system_icc(
|
||||
+ CGColorSpaceCopyICCProfile(base::mac::GetSystemColorSpace()));
|
||||
+ IOSurfaceSetValue(io_surface, CFSTR("IOSurfaceColorSpace"), system_icc);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
// Special-case sRGB.
|
||||
if (color_space == ColorSpace::CreateSRGB()) {
|
||||
base::ScopedCFTypeRef<CFDataRef> srgb_icc(
|
||||
diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
|
||||
index 189e147e908fdab38972f4f9b0ce212347a4ec2e..2a0a480d8513abc609b82f3d1eb24695d4f2146f 100644
|
||||
--- a/ui/gfx/switches.cc
|
||||
+++ b/ui/gfx/switches.cc
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
namespace switches {
|
||||
|
||||
+const char kDisableColorCorrectRendering[] = "disable-color-correct-rendering";
|
||||
+
|
||||
// Force disables font subpixel positioning. This affects the character glyph
|
||||
// sharpness, kerning, hinting and layout.
|
||||
const char kDisableFontSubpixelPositioning[] =
|
||||
diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h
|
||||
index c95989ae7da12585fc417a680aef6c55e4b7a8d7..9e180a6decd72e510cecfec1f43fd1ac70e8b8f7 100644
|
||||
--- a/ui/gfx/switches.h
|
||||
+++ b/ui/gfx/switches.h
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
namespace switches {
|
||||
|
||||
+GFX_SWITCHES_EXPORT extern const char kDisableColorCorrectRendering[];
|
||||
+
|
||||
GFX_SWITCHES_EXPORT extern const char kDisableFontSubpixelPositioning[];
|
||||
|
||||
GFX_SWITCHES_EXPORT extern const char kHeadless[];
|
|
@ -1,20 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nitish Sakhawalkar <nitsakh@icloud.com>
|
||||
Date: Mon, 13 May 2019 15:48:36 -0700
|
||||
Subject: Disable custom libcxx on windows
|
||||
|
||||
|
||||
diff --git a/build/config/c++/c++.gni b/build/config/c++/c++.gni
|
||||
index b639ca7793c2a5d97df0a02efc462c476c3640d0..c6d543d781fe30574f671ee22e84ab0b95a50ccb 100644
|
||||
--- a/build/config/c++/c++.gni
|
||||
+++ b/build/config/c++/c++.gni
|
||||
@@ -12,7 +12,8 @@ declare_args() {
|
||||
# is not supported.
|
||||
use_custom_libcxx =
|
||||
is_fuchsia || is_android || is_mac || (is_ios && !use_xcode_clang) ||
|
||||
- (is_win && is_clang) ||
|
||||
+ # Do not use custom libcxx on windows
|
||||
+ #(is_win && is_clang) ||
|
||||
(is_linux &&
|
||||
(!is_chromeos || default_toolchain != "//build/toolchain/cros:target"))
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: zcbenz <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:50:27 -0700
|
||||
Subject: disable_detach_webview_frame.patch
|
||||
|
||||
Don't detach the frame for webview, we will manage the WebContents
|
||||
manually.
|
||||
This is part of the fixes for https://github.com/electron/electron/issues/14211.
|
||||
We should revisit this bug after upgrading to newer versions of Chrome,
|
||||
this patch was introduced in Chrome 66.
|
||||
|
||||
Update(zcbenz): The bug is still in Chrome 72.
|
||||
|
||||
diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc
|
||||
index a28f80496b26f5a833060c88bd25b1e652ca3420..434edc879af6a09dd45630551de8f7b5cc8a3a7e 100644
|
||||
--- a/content/browser/frame_host/render_frame_proxy_host.cc
|
||||
+++ b/content/browser/frame_host/render_frame_proxy_host.cc
|
||||
@@ -268,6 +268,12 @@ void RenderFrameProxyHost::BubbleLogicalScroll(
|
||||
|
||||
void RenderFrameProxyHost::OnDetach() {
|
||||
if (frame_tree_node_->render_manager()->IsMainFrameForInnerDelegate()) {
|
||||
+ // Don't detach the frame for webview, we will manage the WebContents
|
||||
+ // manually.
|
||||
+ // We should revisit this bug after upgrading to newer versions of Chrome,
|
||||
+ // this patch was introduced in Chrome 66.
|
||||
+ return;
|
||||
+
|
||||
frame_tree_node_->render_manager()->RemoveOuterDelegateFrame();
|
||||
return;
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:45:47 -0700
|
||||
Subject: disable_hidden.patch
|
||||
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index d1cf894d19b1cfa5e11dd44844ff15ed6a42dd58..553167fa07a3acee25434cfd71a968a112d56752 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -672,6 +672,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
if (is_hidden_)
|
||||
return;
|
||||
|
||||
+ if (disable_hidden_)
|
||||
+ return;
|
||||
+
|
||||
RejectMouseLockOrUnlockIfNecessary();
|
||||
|
||||
TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::WasHidden");
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
index 654c60e7bdecf009f2b837e38e9db50f3409978d..65fb1c070196b814edc6d94012150fa496897577 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
@@ -155,6 +155,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
// RenderWidgetHostImpl.
|
||||
static RenderWidgetHostImpl* From(RenderWidgetHost* rwh);
|
||||
|
||||
+ // Electron: Prevents the widget from getting hidden.
|
||||
+ bool disable_hidden_ = false;
|
||||
+
|
||||
void set_hung_renderer_delay(const base::TimeDelta& delay) {
|
||||
hung_renderer_delay_ = delay;
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Tue, 9 Apr 2019 14:57:02 -0700
|
||||
Subject: disable_network_services_by_default.patch
|
||||
|
||||
Disable NetworkService by default.
|
||||
|
||||
This allows us to enable NetworkService with command line flags, which makes it
|
||||
easier to work on NetworkService migration.
|
||||
|
||||
We should remove this patch after all Electron's code has been migrated to the
|
||||
NetworkService.
|
||||
|
||||
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
|
||||
index 6d52910b8a248519a5eedad42d4f081840db92e7..89635931c4d45447f82156974a3145394098ef68 100644
|
||||
--- a/services/network/public/cpp/features.cc
|
||||
+++ b/services/network/public/cpp/features.cc
|
||||
@@ -18,7 +18,7 @@ const base::Feature kNetworkErrorLogging{"NetworkErrorLogging",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
// Enables the network service.
|
||||
const base::Feature kNetworkService{"NetworkService",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
// Out of Blink CORS
|
||||
const base::Feature kOutOfBlinkCors{"OutOfBlinkCors",
|
|
@ -1,22 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksei Kuzmin <alkuzmin@microsoft.com>
|
||||
Date: Thu, 20 Sep 2018 17:47:33 -0700
|
||||
Subject: disable_user_gesture_requirement_for_beforeunload_dialogs.patch
|
||||
|
||||
See https://github.com/electron/electron/issues/10754
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
|
||||
index 7be135720a40d819bf19afddce77670d721cfe59..1ceaf378636e16d5e93f5acc6ff42019fc87f680 100644
|
||||
--- a/third_party/blink/renderer/core/dom/document.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/document.cc
|
||||
@@ -3653,7 +3653,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
|
||||
"frame that never had a user gesture since its load. "
|
||||
"https://www.chromestatus.com/feature/5082396709879808";
|
||||
Intervention::GenerateReport(frame_, "BeforeUnloadNoGesture", message);
|
||||
- return true;
|
||||
+ // TODO(alexeykuzmin): Uncomment `return true` when Electron tests are fixed.
|
||||
+ // See https://github.com/electron/electron/issues/10754
|
||||
+ // return true;
|
||||
}
|
||||
|
||||
if (did_allow_navigation) {
|
|
@ -1,97 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jacob Quant <jacobq@gmail.com>
|
||||
Date: Tue, 6 Nov 2018 15:26:00 -0600
|
||||
Subject: dom_storage_limits.patch
|
||||
|
||||
This patch circumvents the restriction on DOM storage objects,
|
||||
namely `localStorage` and `sessionStorage`, which chromium otherwise
|
||||
limits to approximately 10MiB.
|
||||
|
||||
That restriction originates from a recommendation
|
||||
[in the Web Storage API specification](https://html.spec.whatwg.org/multipage/webstorage.html#disk-space-2)
|
||||
that is motivated by the concern that hostile code could abuse this
|
||||
feature to exhaust available storage capacity.
|
||||
However, in the case of Electron, where the application developers
|
||||
have control over all of the code being executed,
|
||||
this safety precaution becomes a hindrance that does not add much value.
|
||||
For example, if a malicious developer wanted to consume disk space
|
||||
on a victim's machine they could do so via Node's native file system API.
|
||||
|
||||
By disabling this restriction or increasing the quota,
|
||||
electron application developers can use `localStorage`
|
||||
as their application's "back end", without being having
|
||||
to limit the amount of data stored to 10MiB.
|
||||
|
||||
There may still be some benefit to keeping this restriction for applications that load remote content.
|
||||
Although all remote data should be from a trusted source and transferred using
|
||||
a secure channel, it is nevertheless advisable to include additional layers of protection
|
||||
to mitigate risks associated with potential compromise of those other technologies.
|
||||
With that in mind, an acceptable alternative to disabling the limit at compile-time
|
||||
(as this patch currently does) would be to instead allow it to be disabled at run-time
|
||||
for a given `BrowserWindow` via a `webPreferences` option,
|
||||
similar to [`nodeIntegration`](https://electronjs.org/docs/tutorial/security#2-disable-nodejs-integration-for-remote-content).
|
||||
|
||||
diff --git a/content/common/dom_storage/dom_storage_map.cc b/content/common/dom_storage/dom_storage_map.cc
|
||||
index fd088fb170bead6452ded14016f21f0c29659e03..b90b6cf9132d16bc3b2076c3fa313916e2b5ea7d 100644
|
||||
--- a/content/common/dom_storage/dom_storage_map.cc
|
||||
+++ b/content/common/dom_storage/dom_storage_map.cc
|
||||
@@ -185,10 +185,12 @@ bool DOMStorageMap::SetItemInternal(MapType* map_type,
|
||||
size_t new_item_size = size_in_storage(key, value);
|
||||
size_t new_storage_used = storage_used_ - old_item_size + new_item_size;
|
||||
|
||||
+#if 0
|
||||
// Only check quota if the size is increasing, this allows
|
||||
// shrinking changes to pre-existing files that are over budget.
|
||||
if (new_item_size > old_item_size && new_storage_used > quota_)
|
||||
return false;
|
||||
+#endif
|
||||
|
||||
(*map_type)[key] = value;
|
||||
ResetKeyIterator();
|
||||
diff --git a/content/common/dom_storage/dom_storage_types.h b/content/common/dom_storage/dom_storage_types.h
|
||||
index e87afe5b8ee07f7038a7cc9c40832b6cd27884da..61c9a0dfff60f79c7b36ff5c7d741c06dca03ada 100644
|
||||
--- a/content/common/dom_storage/dom_storage_types.h
|
||||
+++ b/content/common/dom_storage/dom_storage_types.h
|
||||
@@ -21,6 +21,7 @@ typedef std::map<base::string16, base::NullableString16> DOMStorageValuesMap;
|
||||
|
||||
// The quota for each storage area.
|
||||
// This value is enforced in renderer processes and the browser process.
|
||||
+// However, Electron's dom_storage_limits.patch removes the code that checks this limit.
|
||||
const size_t kPerStorageAreaQuota = 10 * 1024 * 1024;
|
||||
|
||||
// In the browser process we allow some overage to
|
||||
diff --git a/third_party/blink/renderer/modules/storage/cached_storage_area.cc b/third_party/blink/renderer/modules/storage/cached_storage_area.cc
|
||||
index 6a3a3718443aebf24fd60e00f8f01ba76575ebfa..fb8250553164ebaf1a5ccae4a1c8e2f660ea6e14 100644
|
||||
--- a/third_party/blink/renderer/modules/storage/cached_storage_area.cc
|
||||
+++ b/third_party/blink/renderer/modules/storage/cached_storage_area.cc
|
||||
@@ -106,11 +106,13 @@ bool CachedStorageArea::SetItem(const String& key,
|
||||
Source* source) {
|
||||
DCHECK(areas_->Contains(source));
|
||||
|
||||
+#if 0
|
||||
// A quick check to reject obviously overbudget items to avoid priming the
|
||||
// cache.
|
||||
if ((key.length() + value.length()) * 2 >
|
||||
mojom::blink::StorageArea::kPerStorageAreaQuota)
|
||||
return false;
|
||||
+#endif
|
||||
|
||||
EnsureLoaded();
|
||||
String old_value;
|
||||
diff --git a/third_party/blink/renderer/modules/storage/storage_area_map.cc b/third_party/blink/renderer/modules/storage/storage_area_map.cc
|
||||
index 0da8a1e891edad60355792c40b7d15e90c1086e8..df71418d598d5bdf41e9a8a4340999d9d277aeef 100644
|
||||
--- a/third_party/blink/renderer/modules/storage/storage_area_map.cc
|
||||
+++ b/third_party/blink/renderer/modules/storage/storage_area_map.cc
|
||||
@@ -113,10 +113,12 @@ bool StorageAreaMap::SetItemInternal(const String& key,
|
||||
size_t new_quota_used = quota_used_ - old_item_size + new_item_size;
|
||||
size_t new_memory_used = memory_used_ - old_item_memory + new_item_memory;
|
||||
|
||||
+#if 0
|
||||
// Only check quota if the size is increasing, this allows
|
||||
// shrinking changes to pre-existing files that are over budget.
|
||||
if (check_quota && new_item_size > old_item_size && new_quota_used > quota_)
|
||||
return false;
|
||||
+#endif
|
||||
|
||||
keys_values_.Set(key, value);
|
||||
ResetKeyIterator();
|
|
@ -1,22 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <samuel.r.attard@gmail.com>
|
||||
Date: Thu, 18 Oct 2018 17:07:47 -0700
|
||||
Subject: dump_syms.patch
|
||||
|
||||
dylib currently fails to resolve Squirrel.framework on OSX, we need to fix
|
||||
this but it is not a blocker for releasing Electron. This patch removes
|
||||
the hard fail on dylib resolve failure from dump_syms
|
||||
|
||||
diff --git a/components/crash/content/tools/generate_breakpad_symbols.py b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
index 937548cc0303d67402f42a6910cfc57bf0e53d64..dce68b1bd1ef58a5dfddb2bbdb56930ed943ad1d 100755
|
||||
--- a/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
+++ b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
@@ -175,7 +175,7 @@ def GetSharedLibraryDependenciesMac(binary, exe_path):
|
||||
'ERROR: failed to resolve %s, exe_path %s, loader_path %s, '
|
||||
'rpaths %s' % (m.group(1), exe_path, loader_path,
|
||||
', '.join(rpaths)))
|
||||
- sys.exit(1)
|
||||
+ # sys.exit(1)
|
||||
return deps
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksei Kuzmin <alkuzmin@microsoft.com>
|
||||
Date: Thu, 20 Sep 2018 17:50:03 -0700
|
||||
Subject: enable_widevine.patch
|
||||
|
||||
Turns `enable_widevine` flag on by default on Mac and Windows.
|
||||
Electron needs that flag to be enabled on those paltforms,
|
||||
but there's no way to conditionally set it during a `gn gen` call.
|
||||
|
||||
diff --git a/third_party/widevine/cdm/widevine.gni b/third_party/widevine/cdm/widevine.gni
|
||||
index 1fe47e92ffb1442159ead7b696884bc8cc4bda83..72b39b83789cd1f67e10c743a3e729420c9b72ed 100644
|
||||
--- a/third_party/widevine/cdm/widevine.gni
|
||||
+++ b/third_party/widevine/cdm/widevine.gni
|
||||
@@ -10,7 +10,7 @@ declare_args() {
|
||||
# on Android.
|
||||
# Can be optionally enabled in Chromium on non-Android platforms. Please see
|
||||
# //src/third_party/widevine/LICENSE file for details.
|
||||
- enable_widevine = is_chrome_branded || is_android
|
||||
+ enable_widevine = is_chrome_branded || is_android || is_mac || is_win
|
||||
}
|
||||
|
||||
# Widevine CDM is available as a library CDM on the following platforms and
|
|
@ -1,21 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksei Kuzmin <alkuzmin@microsoft.com>
|
||||
Date: Thu, 20 Sep 2018 17:50:45 -0700
|
||||
Subject: exclude-a-few-test-files-from-build.patch
|
||||
|
||||
Compilation of those files fails with the Chromium 68.
|
||||
Remove the patch during the Chromium 69 upgrade.
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
|
||||
index 070fd58b25aee470a861bd79c27f66470e80a271..ae07383907664394544bf4643044b2b43171a029 100644
|
||||
--- a/third_party/blink/renderer/platform/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/platform/BUILD.gn
|
||||
@@ -1713,7 +1713,7 @@ jumbo_source_set("blink_platform_unittests_sources") {
|
||||
"graphics/paint/drawing_display_item_test.cc",
|
||||
"graphics/paint/drawing_recorder_test.cc",
|
||||
"graphics/paint/float_clip_rect_test.cc",
|
||||
- "graphics/paint/geometry_mapper_test.cc",
|
||||
+ #"graphics/paint/geometry_mapper_test.cc",
|
||||
"graphics/paint/geometry_mapper_transform_cache_test.cc",
|
||||
"graphics/paint/paint_chunk_test.cc",
|
||||
"graphics/paint/paint_chunker_test.cc",
|
|
@ -1,29 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <jeremya@chromium.org>
|
||||
Date: Thu, 18 Oct 2018 17:06:56 -0700
|
||||
Subject: expose-net-observer-api.patch
|
||||
|
||||
Expose URLRequestContextGetter::{Add,Remove}Observer.
|
||||
This patch should be removed once we switch to using the net service (cc @robo)
|
||||
|
||||
diff --git a/net/url_request/url_request_context_getter.h b/net/url_request/url_request_context_getter.h
|
||||
index def76d3902f30ae1384ae5f629fa116b3975fa86..e5ee0bfa93f497f18bdb3ad7cd51a6726dc87f3e 100644
|
||||
--- a/net/url_request/url_request_context_getter.h
|
||||
+++ b/net/url_request/url_request_context_getter.h
|
||||
@@ -79,11 +79,16 @@ class NET_EXPORT URLRequestContextGetter
|
||||
friend class web::NetworkContextOwner;
|
||||
#endif // defined(OS_IOS)
|
||||
|
||||
+ // NOTE(nornagon/robo): electron currently depends on this deprecated API
|
||||
+ // from net/, but will be removing it soon when we switch to using the
|
||||
+ // network service.
|
||||
+ public:
|
||||
// Adds / removes an observer to watch for shutdown of |this|'s context. Must
|
||||
// only be called on network thread. May not be called once
|
||||
// GetURLRequestContext() starts returning nullptr.
|
||||
void AddObserver(URLRequestContextGetterObserver* observer);
|
||||
void RemoveObserver(URLRequestContextGetterObserver* observer);
|
||||
+ private:
|
||||
|
||||
// OnDestruct is used to ensure deletion on the thread on which the request
|
||||
// IO happens.
|
|
@ -1,640 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Heilig Benedek <benecene@gmail.com>
|
||||
Date: Wed, 20 Mar 2019 20:30:44 +0100
|
||||
Subject: feat: offscreen rendering with viz compositor
|
||||
|
||||
|
||||
diff --git a/components/viz/host/host_display_client.cc b/components/viz/host/host_display_client.cc
|
||||
index f5e18df4e06e24d3bdd51308abde48e217444848..41017d9d53b1c0d563ea0901f5cae407c6cf1560 100644
|
||||
--- a/components/viz/host/host_display_client.cc
|
||||
+++ b/components/viz/host/host_display_client.cc
|
||||
@@ -18,6 +18,10 @@
|
||||
|
||||
namespace viz {
|
||||
|
||||
+void HostDisplayClient::IsOffscreen(IsOffscreenCallback callback) {
|
||||
+ std::move(callback).Run(false);
|
||||
+}
|
||||
+
|
||||
HostDisplayClient::HostDisplayClient(gfx::AcceleratedWidget widget)
|
||||
: binding_(this) {
|
||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||
@@ -46,9 +50,9 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams(
|
||||
}
|
||||
#endif
|
||||
|
||||
-#if defined(OS_WIN)
|
||||
void HostDisplayClient::CreateLayeredWindowUpdater(
|
||||
mojom::LayeredWindowUpdaterRequest request) {
|
||||
+#if defined(OS_WIN)
|
||||
if (!NeedsToUseLayerWindow(widget_)) {
|
||||
DLOG(ERROR) << "HWND shouldn't be using a layered window";
|
||||
return;
|
||||
@@ -56,8 +60,12 @@ void HostDisplayClient::CreateLayeredWindowUpdater(
|
||||
|
||||
layered_window_updater_ =
|
||||
std::make_unique<LayeredWindowUpdaterImpl>(widget_, std::move(request));
|
||||
-}
|
||||
+#else
|
||||
+ CHECK(false) << "Chromium is calling CreateLayeredWindowUpdater for non-OSR "
|
||||
+ "windows on POSIX platforms, something is wrong with "
|
||||
+ "Electron's OSR implementation.";
|
||||
#endif
|
||||
+}
|
||||
|
||||
#if defined(USE_X11)
|
||||
void HostDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) {
|
||||
diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h
|
||||
index 5e5c5da4a3cfc927df3fb120fcab647e927271c1..8c6ec95f309660fb83012a13c7b9bb64b782e7d9 100644
|
||||
--- a/components/viz/host/host_display_client.h
|
||||
+++ b/components/viz/host/host_display_client.h
|
||||
@@ -30,17 +30,17 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
|
||||
mojom::DisplayClientPtr GetBoundPtr(
|
||||
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
|
||||
|
||||
- private:
|
||||
+ protected:
|
||||
// mojom::DisplayClient implementation:
|
||||
#if defined(OS_MACOSX)
|
||||
void OnDisplayReceivedCALayerParams(
|
||||
const gfx::CALayerParams& ca_layer_params) override;
|
||||
#endif
|
||||
|
||||
-#if defined(OS_WIN)
|
||||
+ void IsOffscreen(IsOffscreenCallback callback) override;
|
||||
+
|
||||
void CreateLayeredWindowUpdater(
|
||||
mojom::LayeredWindowUpdaterRequest request) override;
|
||||
-#endif
|
||||
|
||||
#if defined(USE_X11)
|
||||
void DidCompleteSwapWithNewSize(const gfx::Size& size) override;
|
||||
diff --git a/components/viz/host/layered_window_updater_impl.cc b/components/viz/host/layered_window_updater_impl.cc
|
||||
index d3a49ed8be8dc11b86af67cdd600b05ddc0fc486..88bf86f3938b8267d731b52c8c3baa35d3128c7a 100644
|
||||
--- a/components/viz/host/layered_window_updater_impl.cc
|
||||
+++ b/components/viz/host/layered_window_updater_impl.cc
|
||||
@@ -47,7 +47,9 @@ void LayeredWindowUpdaterImpl::OnAllocatedSharedMemory(
|
||||
shm_handle.Close();
|
||||
}
|
||||
|
||||
-void LayeredWindowUpdaterImpl::Draw(DrawCallback draw_callback) {
|
||||
+void LayeredWindowUpdaterImpl::Draw(
|
||||
+ const gfx::Rect& damage_rect,
|
||||
+ DrawCallback draw_callback) {
|
||||
TRACE_EVENT0("viz", "LayeredWindowUpdaterImpl::Draw");
|
||||
|
||||
if (!canvas_) {
|
||||
diff --git a/components/viz/host/layered_window_updater_impl.h b/components/viz/host/layered_window_updater_impl.h
|
||||
index 93c52d2b928cba6e98723e19b005fb7bd7089a58..4dc645e770a2a039ed8e4ff4de555767fee34a3a 100644
|
||||
--- a/components/viz/host/layered_window_updater_impl.h
|
||||
+++ b/components/viz/host/layered_window_updater_impl.h
|
||||
@@ -33,7 +33,7 @@ class VIZ_HOST_EXPORT LayeredWindowUpdaterImpl
|
||||
void OnAllocatedSharedMemory(
|
||||
const gfx::Size& pixel_size,
|
||||
mojo::ScopedSharedBufferHandle scoped_buffer_handle) override;
|
||||
- void Draw(DrawCallback draw_callback) override;
|
||||
+ void Draw(const gfx::Rect& damage_rect, DrawCallback draw_callback) override;
|
||||
|
||||
private:
|
||||
const HWND hwnd_;
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index f17983a5cc70f8ab1e5c531de8e26fdec04a079b..16aefe38f0c674d97a89d3e511dc104ae0670f26 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -117,6 +117,8 @@ viz_component("service") {
|
||||
"display_embedder/output_surface_provider_impl.h",
|
||||
"display_embedder/server_shared_bitmap_manager.cc",
|
||||
"display_embedder/server_shared_bitmap_manager.h",
|
||||
+ "display_embedder/software_output_device_proxy.cc",
|
||||
+ "display_embedder/software_output_device_proxy.h",
|
||||
"display_embedder/software_output_surface.cc",
|
||||
"display_embedder/software_output_surface.h",
|
||||
"display_embedder/viz_process_context_provider.cc",
|
||||
diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.cc b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
index 8fe397588eb47224d48a8642b814583d11cc9c09..a7072c8e16434d3b15db1599f43d8fab5a97bdf3 100644
|
||||
--- a/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
+++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h"
|
||||
#include "components/viz/service/display_embedder/skia_output_surface_impl.h"
|
||||
#include "components/viz/service/display_embedder/skia_output_surface_impl_non_ddl.h"
|
||||
+#include "components/viz/service/display_embedder/software_output_device_proxy.h"
|
||||
#include "components/viz/service/display_embedder/software_output_surface.h"
|
||||
#include "components/viz/service/display_embedder/viz_process_context_provider.h"
|
||||
#include "components/viz/service/gl/gpu_service_impl.h"
|
||||
@@ -243,6 +244,19 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
|
||||
if (headless_)
|
||||
return std::make_unique<SoftwareOutputDevice>();
|
||||
|
||||
+#if !defined(OS_MACOSX)
|
||||
+ DCHECK(display_client);
|
||||
+ bool offscreen = false;
|
||||
+ if (display_client->IsOffscreen(&offscreen) && offscreen) {
|
||||
+ mojom::LayeredWindowUpdaterPtr layered_window_updater;
|
||||
+ display_client->CreateLayeredWindowUpdater(
|
||||
+ mojo::MakeRequest(&layered_window_updater));
|
||||
+
|
||||
+ return std::make_unique<SoftwareOutputDeviceProxy>(
|
||||
+ std::move(layered_window_updater));
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
#if defined(OS_WIN)
|
||||
return CreateSoftwareOutputDeviceWin(surface_handle, &output_device_backing_,
|
||||
display_client);
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc
|
||||
index b9357082293cc55650144ccbc8bada8fe6d1cac4..b4cb07e26d1504719f80e5835c1cb5f138b9f1ab 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_mac.cc
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_mac.cc
|
||||
@@ -102,6 +102,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage(
|
||||
|
||||
SkCanvas* SoftwareOutputDeviceMac::BeginPaint(
|
||||
const gfx::Rect& new_damage_rect) {
|
||||
+ last_damage = new_damage_rect;
|
||||
+
|
||||
// Record the previous paint buffer.
|
||||
Buffer* previous_paint_buffer =
|
||||
buffer_queue_.empty() ? nullptr : buffer_queue_.back().get();
|
||||
@@ -184,6 +186,7 @@ void SoftwareOutputDeviceMac::EndPaint() {
|
||||
ca_layer_params.is_empty = false;
|
||||
ca_layer_params.scale_factor = scale_factor_;
|
||||
ca_layer_params.pixel_size = pixel_size_;
|
||||
+ ca_layer_params.damage = last_damage;
|
||||
ca_layer_params.io_surface_mach_port.reset(
|
||||
IOSurfaceCreateMachPort(current_paint_buffer_->io_surface));
|
||||
client_->SoftwareDeviceUpdatedCALayerParams(ca_layer_params);
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_mac.h b/components/viz/service/display_embedder/software_output_device_mac.h
|
||||
index f3867356e3d641416e00e6d115ae9ae2a0be90ab..b1d192d2b20ccb63fba07093101d745e5ffe86dd 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_mac.h
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_mac.h
|
||||
@@ -56,6 +56,7 @@ class VIZ_SERVICE_EXPORT SoftwareOutputDeviceMac : public SoftwareOutputDevice {
|
||||
void UpdateAndCopyBufferDamage(Buffer* previous_paint_buffer,
|
||||
const SkRegion& new_damage_rect);
|
||||
|
||||
+ gfx::Rect last_damage;
|
||||
gfx::Size pixel_size_;
|
||||
float scale_factor_ = 1;
|
||||
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_proxy.cc b/components/viz/service/display_embedder/software_output_device_proxy.cc
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..bbca3a43b5ba8bcf1e3a4dab4509b903b7117f36
|
||||
--- /dev/null
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_proxy.cc
|
||||
@@ -0,0 +1,168 @@
|
||||
+// 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.
|
||||
+
|
||||
+#include "components/viz/service/display_embedder/software_output_device_proxy.h"
|
||||
+
|
||||
+#include "base/memory/shared_memory.h"
|
||||
+#include "base/threading/thread_checker.h"
|
||||
+#include "components/viz/common/resources/resource_sizes.h"
|
||||
+#include "components/viz/service/display_embedder/output_device_backing.h"
|
||||
+#include "mojo/public/cpp/system/platform_handle.h"
|
||||
+#include "services/viz/privileged/interfaces/compositing/layered_window_updater.mojom.h"
|
||||
+#include "skia/ext/platform_canvas.h"
|
||||
+#include "third_party/skia/include/core/SkCanvas.h"
|
||||
+#include "ui/gfx/skia_util.h"
|
||||
+
|
||||
+#if defined(OS_WIN)
|
||||
+#include "skia/ext/skia_utils_win.h"
|
||||
+#include "ui/gfx/gdi_util.h"
|
||||
+#include "ui/gfx/win/hwnd_util.h"
|
||||
+#else
|
||||
+#include "mojo/public/cpp/base/shared_memory_utils.h"
|
||||
+#endif
|
||||
+
|
||||
+namespace viz {
|
||||
+
|
||||
+SoftwareOutputDeviceBase::~SoftwareOutputDeviceBase() {
|
||||
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
+ DCHECK(!in_paint_);
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceBase::Resize(const gfx::Size& viewport_pixel_size,
|
||||
+ float scale_factor) {
|
||||
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
+ DCHECK(!in_paint_);
|
||||
+
|
||||
+ if (viewport_pixel_size_ == viewport_pixel_size)
|
||||
+ return;
|
||||
+
|
||||
+ viewport_pixel_size_ = viewport_pixel_size;
|
||||
+ ResizeDelegated();
|
||||
+}
|
||||
+
|
||||
+SkCanvas* SoftwareOutputDeviceBase::BeginPaint(
|
||||
+ const gfx::Rect& damage_rect) {
|
||||
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
+ DCHECK(!in_paint_);
|
||||
+
|
||||
+ damage_rect_ = damage_rect;
|
||||
+ in_paint_ = true;
|
||||
+ return BeginPaintDelegated();
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceBase::EndPaint() {
|
||||
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
+ DCHECK(in_paint_);
|
||||
+
|
||||
+ in_paint_ = false;
|
||||
+
|
||||
+ gfx::Rect intersected_damage_rect = damage_rect_;
|
||||
+ intersected_damage_rect.Intersect(gfx::Rect(viewport_pixel_size_));
|
||||
+ if (intersected_damage_rect.IsEmpty())
|
||||
+ return;
|
||||
+
|
||||
+ EndPaintDelegated(intersected_damage_rect);
|
||||
+}
|
||||
+
|
||||
+SoftwareOutputDeviceProxy::~SoftwareOutputDeviceProxy() = default;
|
||||
+
|
||||
+SoftwareOutputDeviceProxy::SoftwareOutputDeviceProxy(
|
||||
+ mojom::LayeredWindowUpdaterPtr layered_window_updater)
|
||||
+ : layered_window_updater_(std::move(layered_window_updater)) {
|
||||
+ DCHECK(layered_window_updater_.is_bound());
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceProxy::OnSwapBuffers(
|
||||
+ SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback) {
|
||||
+ DCHECK(swap_ack_callback_.is_null());
|
||||
+
|
||||
+ // We aren't waiting on DrawAck() and can immediately run the callback.
|
||||
+ if (!waiting_on_draw_ack_) {
|
||||
+ task_runner_->PostTask(FROM_HERE,
|
||||
+ base::BindOnce(std::move(swap_ack_callback), viewport_pixel_size_));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ swap_ack_callback_ = std::move(swap_ack_callback);
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceProxy::ResizeDelegated() {
|
||||
+ canvas_.reset();
|
||||
+
|
||||
+ size_t required_bytes;
|
||||
+ if (!ResourceSizes::MaybeSizeInBytes(
|
||||
+ viewport_pixel_size_, ResourceFormat::RGBA_8888, &required_bytes)) {
|
||||
+ DLOG(ERROR) << "Invalid viewport size " << viewport_pixel_size_.ToString();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ #if defined(WIN32)
|
||||
+ base::SharedMemory shm;
|
||||
+ if (!shm.CreateAnonymous(required_bytes)) {
|
||||
+ DLOG(ERROR) << "Failed to allocate " << required_bytes << " bytes";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ canvas_ = skia::CreatePlatformCanvasWithSharedSection(
|
||||
+ viewport_pixel_size_.width(), viewport_pixel_size_.height(), false,
|
||||
+ shm.handle().GetHandle(), skia::CRASH_ON_FAILURE);
|
||||
+
|
||||
+ // Transfer handle ownership to the browser process.
|
||||
+ mojo::ScopedSharedBufferHandle scoped_handle = mojo::WrapSharedMemoryHandle(
|
||||
+ shm.TakeHandle(), required_bytes,
|
||||
+ mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite);
|
||||
+ #else
|
||||
+ auto shm = mojo::CreateWritableSharedMemoryRegion(required_bytes);
|
||||
+ if (!shm.IsValid()) {
|
||||
+ DLOG(ERROR) << "Failed to allocate " << required_bytes << " bytes";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ shm_mapping_ = shm.Map();
|
||||
+ if (!shm_mapping_.IsValid()) {
|
||||
+ DLOG(ERROR) << "Failed to map " << required_bytes << " bytes";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ canvas_ = skia::CreatePlatformCanvasWithPixels(
|
||||
+ viewport_pixel_size_.width(), viewport_pixel_size_.height(), false,
|
||||
+ static_cast<uint8_t*>(shm_mapping_.memory()), skia::CRASH_ON_FAILURE);
|
||||
+
|
||||
+ mojo::ScopedSharedBufferHandle scoped_handle =
|
||||
+ mojo::WrapWritableSharedMemoryRegion(std::move(shm));
|
||||
+ #endif
|
||||
+
|
||||
+ layered_window_updater_->OnAllocatedSharedMemory(viewport_pixel_size_,
|
||||
+ std::move(scoped_handle));
|
||||
+}
|
||||
+
|
||||
+SkCanvas* SoftwareOutputDeviceProxy::BeginPaintDelegated() {
|
||||
+ return canvas_.get();
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceProxy::EndPaintDelegated(
|
||||
+ const gfx::Rect& damage_rect) {
|
||||
+ DCHECK(!waiting_on_draw_ack_);
|
||||
+
|
||||
+ if (!canvas_)
|
||||
+ return;
|
||||
+
|
||||
+ layered_window_updater_->Draw(damage_rect, base::BindOnce(
|
||||
+ &SoftwareOutputDeviceProxy::DrawAck, base::Unretained(this)));
|
||||
+ waiting_on_draw_ack_ = true;
|
||||
+
|
||||
+ TRACE_EVENT_ASYNC_BEGIN0("viz", "SoftwareOutputDeviceProxy::Draw", this);
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceProxy::DrawAck() {
|
||||
+ DCHECK(waiting_on_draw_ack_);
|
||||
+ DCHECK(!swap_ack_callback_.is_null());
|
||||
+
|
||||
+ TRACE_EVENT_ASYNC_END0("viz", "SoftwareOutputDeviceProxy::Draw", this);
|
||||
+
|
||||
+ waiting_on_draw_ack_ = false;
|
||||
+ std::move(swap_ack_callback_).Run(viewport_pixel_size_);
|
||||
+}
|
||||
+
|
||||
+} // namespace viz
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_proxy.h b/components/viz/service/display_embedder/software_output_device_proxy.h
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ff3c0217812a8370a20aa528f117e928fd1b95f4
|
||||
--- /dev/null
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_proxy.h
|
||||
@@ -0,0 +1,88 @@
|
||||
+// 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 COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
|
||||
+#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
|
||||
+
|
||||
+#if defined(OS_WIN)
|
||||
+#include <windows.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <memory>
|
||||
+
|
||||
+#include "components/viz/host/host_display_client.h"
|
||||
+#include "components/viz/service/display/software_output_device.h"
|
||||
+#include "components/viz/service/viz_service_export.h"
|
||||
+#include "services/viz/privileged/interfaces/compositing/display_private.mojom.h"
|
||||
+#include "services/viz/privileged/interfaces/compositing/layered_window_updater.mojom.h"
|
||||
+
|
||||
+namespace viz {
|
||||
+
|
||||
+// Shared base class for SoftwareOutputDevice implementations.
|
||||
+class SoftwareOutputDeviceBase : public SoftwareOutputDevice {
|
||||
+ public:
|
||||
+ SoftwareOutputDeviceBase() = default;
|
||||
+ ~SoftwareOutputDeviceBase() override;
|
||||
+
|
||||
+ // SoftwareOutputDevice implementation.
|
||||
+ void Resize(const gfx::Size& viewport_pixel_size,
|
||||
+ float scale_factor) override;
|
||||
+ SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override;
|
||||
+ void EndPaint() override;
|
||||
+
|
||||
+ // Called from Resize() if |viewport_pixel_size_| has changed.
|
||||
+ virtual void ResizeDelegated() = 0;
|
||||
+
|
||||
+ // Called from BeginPaint() and should return an SkCanvas.
|
||||
+ virtual SkCanvas* BeginPaintDelegated() = 0;
|
||||
+
|
||||
+ // Called from EndPaint() if there is damage.
|
||||
+ virtual void EndPaintDelegated(const gfx::Rect& damage_rect) = 0;
|
||||
+
|
||||
+ private:
|
||||
+ bool in_paint_ = false;
|
||||
+
|
||||
+ THREAD_CHECKER(thread_checker_);
|
||||
+
|
||||
+ DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceBase);
|
||||
+};
|
||||
+
|
||||
+// SoftwareOutputDevice implementation that draws indirectly. An implementation
|
||||
+// of mojom::LayeredWindowUpdater in the browser process handles the actual
|
||||
+// drawing. Pixel backing is in SharedMemory so no copying between processes
|
||||
+// is required.
|
||||
+class SoftwareOutputDeviceProxy : public SoftwareOutputDeviceBase {
|
||||
+ public:
|
||||
+ explicit SoftwareOutputDeviceProxy(
|
||||
+ mojom::LayeredWindowUpdaterPtr layered_window_updater);
|
||||
+ ~SoftwareOutputDeviceProxy() override;
|
||||
+
|
||||
+ // SoftwareOutputDevice implementation.
|
||||
+ void OnSwapBuffers(SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback) override;
|
||||
+
|
||||
+ // SoftwareOutputDeviceBase implementation.
|
||||
+ void ResizeDelegated() override;
|
||||
+ SkCanvas* BeginPaintDelegated() override;
|
||||
+ void EndPaintDelegated(const gfx::Rect& rect) override;
|
||||
+
|
||||
+ private:
|
||||
+ // Runs |swap_ack_callback_| after draw has happened.
|
||||
+ void DrawAck();
|
||||
+
|
||||
+ mojom::LayeredWindowUpdaterPtr layered_window_updater_;
|
||||
+
|
||||
+ std::unique_ptr<SkCanvas> canvas_;
|
||||
+ bool waiting_on_draw_ack_ = false;
|
||||
+ SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback_;
|
||||
+
|
||||
+#if !defined(WIN32)
|
||||
+ base::WritableSharedMemoryMapping shm_mapping_;
|
||||
+#endif
|
||||
+
|
||||
+ DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceProxy);
|
||||
+};
|
||||
+
|
||||
+} // namespace viz
|
||||
+
|
||||
+#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
index 4e3f0255d5fe4991004a50768932c36c42d999ff..bf352091cef00482e3cec74cd523e469e1bffa0d 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "components/viz/common/display/use_layered_window.h"
|
||||
#include "components/viz/common/resources/resource_sizes.h"
|
||||
#include "components/viz/service/display_embedder/output_device_backing.h"
|
||||
+#include "components/viz/service/display_embedder/software_output_device_proxy.h"
|
||||
#include "mojo/public/cpp/system/platform_handle.h"
|
||||
#include "services/viz/privileged/interfaces/compositing/layered_window_updater.mojom.h"
|
||||
#include "skia/ext/platform_canvas.h"
|
||||
@@ -268,7 +269,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
|
||||
if (!canvas_)
|
||||
return;
|
||||
|
||||
- layered_window_updater_->Draw(base::BindOnce(
|
||||
+ layered_window_updater_->Draw(damage_rect, base::BindOnce(
|
||||
&SoftwareOutputDeviceWinProxy::DrawAck, base::Unretained(this)));
|
||||
waiting_on_draw_ack_ = true;
|
||||
|
||||
@@ -300,8 +301,13 @@ std::unique_ptr<SoftwareOutputDevice> CreateSoftwareOutputDeviceWin(
|
||||
display_client->CreateLayeredWindowUpdater(
|
||||
mojo::MakeRequest(&layered_window_updater));
|
||||
|
||||
- return std::make_unique<SoftwareOutputDeviceWinProxy>(
|
||||
- hwnd, std::move(layered_window_updater));
|
||||
+ bool offscreen = false;
|
||||
+ if (display_client->IsOffscreen(&offscreen) && offscreen)
|
||||
+ return std::make_unique<SoftwareOutputDeviceProxy>(
|
||||
+ std::move(layered_window_updater));
|
||||
+ else
|
||||
+ return std::make_unique<SoftwareOutputDeviceWinProxy>(
|
||||
+ hwnd, std::move(layered_window_updater));
|
||||
} else {
|
||||
return std::make_unique<SoftwareOutputDeviceWinDirect>(hwnd, backing);
|
||||
}
|
||||
diff --git a/services/viz/privileged/interfaces/compositing/display_private.mojom b/services/viz/privileged/interfaces/compositing/display_private.mojom
|
||||
index deb327b7705462d2cc07edb9d37528035377af8b..bc6958aa7e4dc14d3e0cf040299642825194e2fc 100644
|
||||
--- a/services/viz/privileged/interfaces/compositing/display_private.mojom
|
||||
+++ b/services/viz/privileged/interfaces/compositing/display_private.mojom
|
||||
@@ -77,12 +77,14 @@ interface DisplayPrivate {
|
||||
};
|
||||
|
||||
interface DisplayClient {
|
||||
+ [Sync]
|
||||
+ IsOffscreen() => (bool success);
|
||||
+
|
||||
[EnableIf=is_mac]
|
||||
OnDisplayReceivedCALayerParams(gfx.mojom.CALayerParams ca_layer_params);
|
||||
|
||||
// Creates a LayeredWindowUpdater implementation to draw into a layered
|
||||
// window.
|
||||
- [EnableIf=is_win]
|
||||
CreateLayeredWindowUpdater(LayeredWindowUpdater& layered_window_updater);
|
||||
|
||||
// Notifies that a swap has occurred and provides information about the pixel
|
||||
diff --git a/services/viz/privileged/interfaces/compositing/layered_window_updater.mojom b/services/viz/privileged/interfaces/compositing/layered_window_updater.mojom
|
||||
index 360cab3eee4c5189a55269d76daa1d78a98ed3d3..6834242f23d27fd6d428c2cd6040206a79d5097b 100644
|
||||
--- a/services/viz/privileged/interfaces/compositing/layered_window_updater.mojom
|
||||
+++ b/services/viz/privileged/interfaces/compositing/layered_window_updater.mojom
|
||||
@@ -22,5 +22,5 @@ interface LayeredWindowUpdater {
|
||||
// Draws to the HWND by copying pixels from shared memory. Callback must be
|
||||
// called after draw operation is complete to signal shared memory can be
|
||||
// modified.
|
||||
- Draw() => ();
|
||||
+ Draw(gfx.mojom.Rect damage_rect) => ();
|
||||
};
|
||||
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
|
||||
index 494241c374b7ffac0fa89549dc1b8a30359eb17f..5ac7c707374ebcb5510c76017edfcceee97b599e 100644
|
||||
--- a/ui/compositor/compositor.h
|
||||
+++ b/ui/compositor/compositor.h
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "cc/trees/layer_tree_host_single_thread_client.h"
|
||||
#include "components/viz/common/frame_sinks/begin_frame_args.h"
|
||||
#include "components/viz/common/surfaces/frame_sink_id.h"
|
||||
+#include "components/viz/host/host_display_client.h"
|
||||
#include "components/viz/host/host_frame_sink_client.h"
|
||||
#include "services/viz/privileged/interfaces/compositing/vsync_parameter_observer.mojom-forward.h"
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
@@ -199,6 +200,15 @@ class COMPOSITOR_EXPORT ContextFactory {
|
||||
virtual bool SyncTokensRequiredForDisplayCompositor() = 0;
|
||||
};
|
||||
|
||||
+class COMPOSITOR_EXPORT CompositorDelegate {
|
||||
+ public:
|
||||
+ virtual std::unique_ptr<viz::HostDisplayClient> CreateHostDisplayClient(
|
||||
+ ui::Compositor* compositor) = 0;
|
||||
+
|
||||
+ protected:
|
||||
+ virtual ~CompositorDelegate() {}
|
||||
+};
|
||||
+
|
||||
// Compositor object to take care of GPU painting.
|
||||
// A Browser compositor object is responsible for generating the final
|
||||
// displayable form of pixels comprising a single widget's contents. It draws an
|
||||
@@ -238,6 +248,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
// Schedules a redraw of the layer tree associated with this compositor.
|
||||
void ScheduleDraw();
|
||||
|
||||
+ CompositorDelegate* delegate() const { return delegate_; }
|
||||
+ void SetDelegate(CompositorDelegate* delegate) { delegate_ = delegate; }
|
||||
+
|
||||
// Sets the root of the layer tree drawn by this Compositor. The root layer
|
||||
// must have no parent. The compositor's root layer is reset if the root layer
|
||||
// is destroyed. NULL can be passed to reset the root layer, in which case the
|
||||
@@ -454,6 +467,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
ui::ContextFactory* context_factory_;
|
||||
ui::ContextFactoryPrivate* context_factory_private_;
|
||||
|
||||
+ CompositorDelegate* delegate_ = nullptr;
|
||||
+
|
||||
// The root of the Layer tree drawn by this compositor.
|
||||
Layer* root_layer_ = nullptr;
|
||||
|
||||
diff --git a/ui/compositor/host/host_context_factory_private.cc b/ui/compositor/host/host_context_factory_private.cc
|
||||
index 0ff1e05244e0e64bc2456dc3d53dd2378dce1a3c..7ca7f5e0cb73c8f6560ff9730d3880a07befe663 100644
|
||||
--- a/ui/compositor/host/host_context_factory_private.cc
|
||||
+++ b/ui/compositor/host/host_context_factory_private.cc
|
||||
@@ -99,8 +99,12 @@ void HostContextFactoryPrivate::ConfigureCompositor(
|
||||
mojo::MakeRequest(&root_params->compositor_frame_sink_client);
|
||||
root_params->display_private =
|
||||
mojo::MakeRequest(&compositor_data.display_private);
|
||||
- compositor_data.display_client =
|
||||
- std::make_unique<HostDisplayClient>(compositor);
|
||||
+ if (compositor->delegate())
|
||||
+ compositor_data.display_client = compositor->delegate()->CreateHostDisplayClient(
|
||||
+ compositor);
|
||||
+ else
|
||||
+ compositor_data.display_client =
|
||||
+ std::make_unique<HostDisplayClient>(compositor);
|
||||
root_params->display_client =
|
||||
compositor_data.display_client->GetBoundPtr(resize_task_runner_)
|
||||
.PassInterface();
|
||||
diff --git a/ui/gfx/ca_layer_params.h b/ui/gfx/ca_layer_params.h
|
||||
index 4014e64a75da88cf66c02e8adb71171c2666cab7..25e57784e1a1ffc546b003daa4cd0059c468432f 100644
|
||||
--- a/ui/gfx/ca_layer_params.h
|
||||
+++ b/ui/gfx/ca_layer_params.h
|
||||
@@ -6,6 +6,7 @@
|
||||
#define UI_GFX_CA_LAYER_PARAMS_H_
|
||||
|
||||
#include "build/build_config.h"
|
||||
+#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/gfx/geometry/size.h"
|
||||
#include "ui/gfx/gfx_export.h"
|
||||
|
||||
@@ -41,6 +42,8 @@ struct GFX_EXPORT CALayerParams {
|
||||
gfx::ScopedRefCountedIOSurfaceMachPort io_surface_mach_port;
|
||||
#endif
|
||||
|
||||
+ gfx::Rect damage;
|
||||
+
|
||||
// The geometry of the frame.
|
||||
gfx::Size pixel_size;
|
||||
float scale_factor = 1.f;
|
||||
diff --git a/ui/gfx/mojo/ca_layer_params.mojom b/ui/gfx/mojo/ca_layer_params.mojom
|
||||
index 7bf735643541b18bafffe645d3ff37e96caa4dea..f7eaf10ffd665789f10a587142fac0c0c79b9798 100644
|
||||
--- a/ui/gfx/mojo/ca_layer_params.mojom
|
||||
+++ b/ui/gfx/mojo/ca_layer_params.mojom
|
||||
@@ -18,5 +18,6 @@ struct CALayerParams {
|
||||
bool is_empty;
|
||||
CALayerContent content;
|
||||
gfx.mojom.Size pixel_size;
|
||||
+ gfx.mojom.Rect damage;
|
||||
float scale_factor;
|
||||
};
|
||||
diff --git a/ui/gfx/mojo/ca_layer_params_struct_traits.cc b/ui/gfx/mojo/ca_layer_params_struct_traits.cc
|
||||
index dd553996b5c6ff5ec0c210a020a18a6a843b8aae..26d1e0bda2640052d42ea4e691c3df73074dea08 100644
|
||||
--- a/ui/gfx/mojo/ca_layer_params_struct_traits.cc
|
||||
+++ b/ui/gfx/mojo/ca_layer_params_struct_traits.cc
|
||||
@@ -52,6 +52,9 @@ bool StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams>::Read(
|
||||
if (!data.ReadPixelSize(&out->pixel_size))
|
||||
return false;
|
||||
|
||||
+ if (!data.ReadDamage(&out->damage))
|
||||
+ return false;
|
||||
+
|
||||
out->scale_factor = data.scale_factor();
|
||||
return true;
|
||||
}
|
||||
diff --git a/ui/gfx/mojo/ca_layer_params_struct_traits.h b/ui/gfx/mojo/ca_layer_params_struct_traits.h
|
||||
index 94127a0d5b50b052318e9e5a360755fe771f87e9..348fa26c5c95a13d1ddd0ff2545aca3a35841a77 100644
|
||||
--- a/ui/gfx/mojo/ca_layer_params_struct_traits.h
|
||||
+++ b/ui/gfx/mojo/ca_layer_params_struct_traits.h
|
||||
@@ -20,6 +20,10 @@ struct StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams> {
|
||||
return ca_layer_params.pixel_size;
|
||||
}
|
||||
|
||||
+ static gfx::Rect damage(const gfx::CALayerParams& ca_layer_params) {
|
||||
+ return ca_layer_params.damage;
|
||||
+ }
|
||||
+
|
||||
static float scale_factor(const gfx::CALayerParams& ca_layer_params) {
|
||||
return ca_layer_params.scale_factor;
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Tue, 28 May 2019 18:12:17 -0700
|
||||
Subject: fix: breakpad symbol generation on linux arm
|
||||
|
||||
Fixes broken Linux ARM breakpad symbol generation by patching
|
||||
out an `ldd`-related call that was throwing.
|
||||
|
||||
diff --git a/components/crash/content/tools/generate_breakpad_symbols.py b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
index 4249d7b26f9037b60a40e073f56037f9ff036138..0ad9ff9b9bc7dd535655b37013270ad504aa6a34 100755
|
||||
--- a/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
+++ b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
@@ -67,7 +67,8 @@ def GetSharedLibraryDependenciesLinux(binary, options):
|
||||
"""Return absolute paths to all shared library dependencies of the binary.
|
||||
|
||||
This implementation assumes that we're running on a Linux system."""
|
||||
- ldd = subprocess.check_output(['ldd', binary])
|
||||
+ p = subprocess.Popen(['ldd', binary], stdout=subprocess.PIPE)
|
||||
+ ldd = p.communicate()[0]
|
||||
lib_re = re.compile('\t.* => (.+) \(.*\)$')
|
||||
result = []
|
||||
for line in ldd.splitlines():
|
|
@ -1,36 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@slack-corp.com>
|
||||
Date: Mon, 4 Mar 2019 14:43:36 -0800
|
||||
Subject: fix: disable usage of abort_report_np in MAS builds
|
||||
|
||||
|
||||
diff --git a/sandbox/mac/sandbox_logging.cc b/sandbox/mac/sandbox_logging.cc
|
||||
index 4eebcea13d17093a685cc79b8a8f61fb3894c71b..d704dced154f1d5db097e566a9c681438f94475d 100644
|
||||
--- a/sandbox/mac/sandbox_logging.cc
|
||||
+++ b/sandbox/mac/sandbox_logging.cc
|
||||
@@ -22,9 +22,11 @@
|
||||
__builtin_unreachable(); \
|
||||
}
|
||||
|
||||
+#if !defined(MAS_BUILD)
|
||||
extern "C" {
|
||||
void abort_report_np(const char*, ...);
|
||||
}
|
||||
+#endif
|
||||
|
||||
namespace sandbox {
|
||||
|
||||
@@ -94,11 +96,13 @@ void SendAslLog(Level level, const char* message) {
|
||||
asl_set(asl_message.get(), ASL_KEY_MSG, message);
|
||||
asl_send(asl_client.get(), asl_message.get());
|
||||
|
||||
+ #if !defined(MAS_BUILD)
|
||||
if (__builtin_available(macOS 10.11, *)) {
|
||||
if (level == Level::FATAL) {
|
||||
abort_report_np(message);
|
||||
}
|
||||
}
|
||||
+ #endif
|
||||
}
|
||||
|
||||
// |error| is strerror(errno) when a P* logging function is called. Pass
|
|
@ -1,53 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@slack-corp.com>
|
||||
Date: Mon, 4 Mar 2019 14:46:48 -0800
|
||||
Subject: fix: disable usage of pthread_fchdir_np and pthread_chdir_np in MAS
|
||||
builds
|
||||
|
||||
diff --git a/base/process/launch_mac.cc b/base/process/launch_mac.cc
|
||||
index c6d5cbbd5417a1b18a6cf94a681de6c671089e35..92d683619e8de505d5172a8ae09e6e67f28da96f 100644
|
||||
--- a/base/process/launch_mac.cc
|
||||
+++ b/base/process/launch_mac.cc
|
||||
@@ -25,10 +25,12 @@
|
||||
// descriptor. libpthread only exposes a syscall wrapper starting in
|
||||
// macOS 10.12, but the system call dates back to macOS 10.5. On older OSes,
|
||||
// the syscall is issued directly.
|
||||
+#if !defined(MAS_BUILD)
|
||||
extern "C" {
|
||||
int pthread_chdir_np(const char*) API_AVAILABLE(macosx(10.12));
|
||||
int pthread_fchdir_np(int fd) API_AVAILABLE(macosx(10.12));
|
||||
}
|
||||
+#endif
|
||||
|
||||
namespace base {
|
||||
|
||||
@@ -95,21 +97,29 @@ class PosixSpawnFileActions {
|
||||
};
|
||||
|
||||
int ChangeCurrentThreadDirectory(const char* path) {
|
||||
+ #if defined(MAS_BUILD)
|
||||
+ return syscall(SYS___pthread_chdir, path);
|
||||
+ #else
|
||||
if (__builtin_available(macOS 10.12, *)) {
|
||||
return pthread_chdir_np(path);
|
||||
} else {
|
||||
return syscall(SYS___pthread_chdir, path);
|
||||
}
|
||||
+ #endif
|
||||
}
|
||||
|
||||
// The recommended way to unset a per-thread cwd is to set a new value to an
|
||||
// invalid file descriptor, per libpthread-218.1.3/private/private.h.
|
||||
int ResetCurrentThreadDirectory() {
|
||||
+ #if defined(MAS_BUILD)
|
||||
+ return syscall(SYS___pthread_fchdir, -1);
|
||||
+ #else
|
||||
if (__builtin_available(macOS 10.12, *)) {
|
||||
return pthread_fchdir_np(-1);
|
||||
} else {
|
||||
return syscall(SYS___pthread_fchdir, -1);
|
||||
}
|
||||
+ #endif
|
||||
}
|
||||
|
||||
struct GetAppOutputOptions {
|
|
@ -1,51 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@slack-corp.com>
|
||||
Date: Mon, 4 Mar 2019 14:51:45 -0800
|
||||
Subject: fix: disable usage of SetApplicationIsDaemon and
|
||||
_LSSetApplicationLaunchServicesServerConnectionStatus in MAS builds
|
||||
|
||||
diff --git a/content/utility/utility_service_factory.cc b/content/utility/utility_service_factory.cc
|
||||
index 2e098ff3c2d0052984a96ffc72e393a20418b445..bf07ae34c286f03225535f6082a9151f12a3a5f2 100644
|
||||
--- a/content/utility/utility_service_factory.cc
|
||||
+++ b/content/utility/utility_service_factory.cc
|
||||
@@ -207,7 +207,7 @@ void UtilityServiceFactory::RunService(
|
||||
std::unique_ptr<service_manager::Service>
|
||||
UtilityServiceFactory::CreateAudioService(
|
||||
mojo::PendingReceiver<service_manager::mojom::Service> receiver) {
|
||||
-#if defined(OS_MACOSX)
|
||||
+#if defined(OS_MACOSX) && !defined(MAS_BUILD)
|
||||
// Don't connect to launch services when running sandboxed
|
||||
// (https://crbug.com/874785).
|
||||
if (base::FeatureList::IsEnabled(
|
||||
diff --git a/sandbox/mac/system_services.cc b/sandbox/mac/system_services.cc
|
||||
index caa30bb378b30331f90057fe7ce3aec724104bf8..a766daa808495f7872051e129c6ad9f76f54e4fe 100644
|
||||
--- a/sandbox/mac/system_services.cc
|
||||
+++ b/sandbox/mac/system_services.cc
|
||||
@@ -9,16 +9,19 @@
|
||||
|
||||
#include "base/mac/mac_logging.h"
|
||||
|
||||
+#if !defined(MAS_BUILD)
|
||||
extern "C" {
|
||||
OSStatus SetApplicationIsDaemon(Boolean isDaemon);
|
||||
void _LSSetApplicationLaunchServicesServerConnectionStatus(
|
||||
uint64_t flags,
|
||||
bool (^connection_allowed)(CFDictionaryRef options));
|
||||
} // extern "C"
|
||||
+#endif
|
||||
|
||||
namespace sandbox {
|
||||
|
||||
void DisableLaunchServices() {
|
||||
+ #if !defined(MAS_BUILD)
|
||||
// Allow the process to continue without a LaunchServices ASN. The
|
||||
// INIT_Process function in HIServices will abort if it cannot connect to
|
||||
// launchservicesd to get an ASN. By setting this flag, HIServices skips
|
||||
@@ -32,6 +35,7 @@ void DisableLaunchServices() {
|
||||
0, ^bool(CFDictionaryRef options) {
|
||||
return false;
|
||||
});
|
||||
+ #endif
|
||||
}
|
||||
|
||||
} // namespace sandbox
|
|
@ -1,267 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Mon, 3 Jun 2019 14:20:05 -0700
|
||||
Subject: frame_host_manager.patch
|
||||
|
||||
Allows embedder to intercept site instances chosen by chromium
|
||||
and respond with custom instance. Also allows for us to at-runtime
|
||||
enable or disable this patch.
|
||||
|
||||
diff --git a/content/browser/browsing_instance.cc b/content/browser/browsing_instance.cc
|
||||
index 12e1c5cff95aa6d0a907a249208e23371cf29785..3bc26b7870ff3bf6a69cb1e123fb372f763442ee 100644
|
||||
--- a/content/browser/browsing_instance.cc
|
||||
+++ b/content/browser/browsing_instance.cc
|
||||
@@ -79,6 +79,13 @@ scoped_refptr<SiteInstanceImpl> BrowsingInstance::GetSiteInstanceForURL(
|
||||
return instance;
|
||||
}
|
||||
|
||||
+scoped_refptr<SiteInstanceImpl> BrowsingInstance::CreateSiteInstanceForURL(
|
||||
+ const GURL& url) {
|
||||
+ scoped_refptr<SiteInstanceImpl> instance = new SiteInstanceImpl(this);
|
||||
+ instance->SetSite(url);
|
||||
+ return instance;
|
||||
+}
|
||||
+
|
||||
void BrowsingInstance::GetSiteAndLockForURL(const GURL& url,
|
||||
bool allow_default_instance,
|
||||
GURL* site_url,
|
||||
diff --git a/content/browser/browsing_instance.h b/content/browser/browsing_instance.h
|
||||
index 775b64a8d20f89845812852a2904a1e6875c2b4a..5235b57bbf44fc7b30ca6943c43a290f07f003bf 100644
|
||||
--- a/content/browser/browsing_instance.h
|
||||
+++ b/content/browser/browsing_instance.h
|
||||
@@ -136,6 +136,11 @@ class CONTENT_EXPORT BrowsingInstance final
|
||||
const GURL& url,
|
||||
bool allow_default_instance);
|
||||
|
||||
+ // Create a new SiteInstance for the given URL bound the current
|
||||
+ // BrowsingInstance.
|
||||
+ scoped_refptr<SiteInstanceImpl> CreateSiteInstanceForURL(
|
||||
+ const GURL& url);
|
||||
+
|
||||
// Adds the given SiteInstance to our map, to ensure that we do not create
|
||||
// another SiteInstance for the same site.
|
||||
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
|
||||
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
|
||||
index 297b61198dd46114b3d8c89488a71ed01aa299c4..40b848a8b448bed2d167bf5f6c0f25971b603ed2 100644
|
||||
--- a/content/browser/frame_host/render_frame_host_manager.cc
|
||||
+++ b/content/browser/frame_host/render_frame_host_manager.cc
|
||||
@@ -2127,6 +2127,20 @@ bool RenderFrameHostManager::InitRenderView(
|
||||
scoped_refptr<SiteInstance>
|
||||
RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
const NavigationRequest& request) {
|
||||
+ BrowserContext* browser_context = nullptr;
|
||||
+ scoped_refptr<SiteInstance> candidate_site_instance;
|
||||
+ if (!GetContentClient()->browser()->CanUseCustomSiteInstance()) {
|
||||
+ browser_context =
|
||||
+ delegate_->GetControllerForRenderManager().GetBrowserContext();
|
||||
+ // If the navigation can swap SiteInstances, compute the SiteInstance it
|
||||
+ // should use.
|
||||
+ // TODO(clamy): We should also consider as a candidate SiteInstance the
|
||||
+ // speculative SiteInstance that was computed on redirects.
|
||||
+ candidate_site_instance =
|
||||
+ speculative_render_frame_host_
|
||||
+ ? speculative_render_frame_host_->GetSiteInstance()
|
||||
+ : nullptr;
|
||||
+ }
|
||||
// First, check if the navigation can switch SiteInstances. If not, the
|
||||
// navigation should use the current SiteInstance.
|
||||
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
|
||||
@@ -2158,6 +2172,53 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
request.common_params().url);
|
||||
no_renderer_swap_allowed |=
|
||||
request.from_begin_navigation() && !can_renderer_initiate_transfer;
|
||||
+
|
||||
+ if (!GetContentClient()->browser()->CanUseCustomSiteInstance()) {
|
||||
+ bool has_response_started =
|
||||
+ (request.state() == NavigationRequest::RESPONSE_STARTED ||
|
||||
+ request.state() == NavigationRequest::FAILED) &&
|
||||
+ !speculative_render_frame_host_;
|
||||
+ // Gives user a chance to choose a custom site instance.
|
||||
+ SiteInstance* affinity_site_instance = nullptr;
|
||||
+ scoped_refptr<SiteInstance> overriden_site_instance;
|
||||
+ ContentBrowserClient::SiteInstanceForNavigationType siteInstanceType =
|
||||
+ GetContentClient()->browser()->ShouldOverrideSiteInstanceForNavigation(
|
||||
+ current_frame_host(), speculative_frame_host(), browser_context,
|
||||
+ request.common_params().url, has_response_started,
|
||||
+ &affinity_site_instance);
|
||||
+ switch (siteInstanceType) {
|
||||
+ case ContentBrowserClient::SiteInstanceForNavigationType::
|
||||
+ FORCE_CANDIDATE_OR_NEW:
|
||||
+ overriden_site_instance =
|
||||
+ candidate_site_instance
|
||||
+ ? candidate_site_instance
|
||||
+ : current_site_instance->CreateRelatedSiteInstance(
|
||||
+ request.common_params().url);
|
||||
+ break;
|
||||
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_CURRENT:
|
||||
+ overriden_site_instance = render_frame_host_->GetSiteInstance();
|
||||
+ break;
|
||||
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_AFFINITY:
|
||||
+ DCHECK(affinity_site_instance);
|
||||
+ overriden_site_instance =
|
||||
+ scoped_refptr<SiteInstance>(affinity_site_instance);
|
||||
+ break;
|
||||
+ case ContentBrowserClient::SiteInstanceForNavigationType::ASK_CHROMIUM:
|
||||
+ DCHECK(!affinity_site_instance);
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+ if (overriden_site_instance) {
|
||||
+ if (siteInstanceType ==
|
||||
+ ContentBrowserClient::SiteInstanceForNavigationType::
|
||||
+ FORCE_CANDIDATE_OR_NEW) {
|
||||
+ GetContentClient()->browser()->RegisterPendingSiteInstance(
|
||||
+ render_frame_host_.get(), overriden_site_instance.get());
|
||||
+ }
|
||||
+ return overriden_site_instance;
|
||||
+ }
|
||||
+ }
|
||||
} else {
|
||||
// Subframe navigations will use the current renderer, unless specifically
|
||||
// allowed to swap processes.
|
||||
@@ -2169,23 +2230,28 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
if (no_renderer_swap_allowed && !should_swap_for_error_isolation)
|
||||
return scoped_refptr<SiteInstance>(current_site_instance);
|
||||
|
||||
+ if (GetContentClient()->browser()->CanUseCustomSiteInstance()) {
|
||||
// If the navigation can swap SiteInstances, compute the SiteInstance it
|
||||
// should use.
|
||||
// TODO(clamy): We should also consider as a candidate SiteInstance the
|
||||
// speculative SiteInstance that was computed on redirects.
|
||||
- SiteInstance* candidate_site_instance =
|
||||
+ candidate_site_instance =
|
||||
speculative_render_frame_host_
|
||||
? speculative_render_frame_host_->GetSiteInstance()
|
||||
: nullptr;
|
||||
+ }
|
||||
|
||||
scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation(
|
||||
request.common_params().url, request.source_site_instance(),
|
||||
- request.dest_site_instance(), candidate_site_instance,
|
||||
+ request.dest_site_instance(), candidate_site_instance.get(),
|
||||
request.common_params().transition,
|
||||
request.state() == NavigationRequest::FAILED,
|
||||
request.restore_type() != RestoreType::NONE, request.is_view_source(),
|
||||
was_server_redirect);
|
||||
|
||||
+ GetContentClient()->browser()->RegisterPendingSiteInstance(
|
||||
+ render_frame_host_.get(), dest_site_instance.get());
|
||||
+
|
||||
return dest_site_instance;
|
||||
}
|
||||
|
||||
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
|
||||
index fd184108a7993094c29be3f7ebde658e259ede2c..75aa4a6b7d58a1bebe34efc923953c69348428a9 100644
|
||||
--- a/content/browser/site_instance_impl.cc
|
||||
+++ b/content/browser/site_instance_impl.cc
|
||||
@@ -342,6 +342,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
|
||||
return browsing_instance_->HasSiteInstance(url);
|
||||
}
|
||||
|
||||
+scoped_refptr<SiteInstance> SiteInstanceImpl::CreateRelatedSiteInstance(const GURL& url) {
|
||||
+ return browsing_instance_->CreateSiteInstanceForURL(url);
|
||||
+}
|
||||
+
|
||||
scoped_refptr<SiteInstance> SiteInstanceImpl::GetRelatedSiteInstance(
|
||||
const GURL& url) {
|
||||
return browsing_instance_->GetSiteInstanceForURL(
|
||||
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h
|
||||
index a46901055bdf17b6b0dab14edf753b234dc04a12..113660b6eeff81d56a0415b0fa16211efd8d8e14 100644
|
||||
--- a/content/browser/site_instance_impl.h
|
||||
+++ b/content/browser/site_instance_impl.h
|
||||
@@ -83,6 +83,7 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
|
||||
BrowserContext* GetBrowserContext() override;
|
||||
const GURL& GetSiteURL() override;
|
||||
scoped_refptr<SiteInstance> GetRelatedSiteInstance(const GURL& url) override;
|
||||
+ scoped_refptr<SiteInstance> CreateRelatedSiteInstance(const GURL& url) override;
|
||||
bool IsRelatedSiteInstance(const SiteInstance* instance) override;
|
||||
size_t GetRelatedActiveContentsCount() override;
|
||||
bool RequiresDedicatedProcess() override;
|
||||
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
||||
index d15061de5254fd4f248fed92f47a1b1fcf34cd68..62d5e17f0599a78d679495d6fa674939d237602e 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -52,6 +52,20 @@ void OverrideOnBindInterface(const service_manager::BindSourceInfo& remote_info,
|
||||
handle);
|
||||
}
|
||||
|
||||
+bool ContentBrowserClient::CanUseCustomSiteInstance() {
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+ContentBrowserClient::SiteInstanceForNavigationType ContentBrowserClient::ShouldOverrideSiteInstanceForNavigation(
|
||||
+ content::RenderFrameHost* current_rfh,
|
||||
+ content::RenderFrameHost* speculative_rfh,
|
||||
+ content::BrowserContext* browser_context,
|
||||
+ const GURL& url,
|
||||
+ bool has_request_started,
|
||||
+ content::SiteInstance** affinity_site_instance) const {
|
||||
+ return SiteInstanceForNavigationType::ASK_CHROMIUM;
|
||||
+}
|
||||
+
|
||||
std::unique_ptr<BrowserMainParts> ContentBrowserClient::CreateBrowserMainParts(
|
||||
const MainFunctionParams& parameters) {
|
||||
return nullptr;
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 8ceccd96c4e143921ace8db69685a9631e168dd2..136df7edaaaaaa1eb121ef7cf80aebc47969dc8d 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -211,8 +211,41 @@ CONTENT_EXPORT void OverrideOnBindInterface(
|
||||
// the observer interfaces.)
|
||||
class CONTENT_EXPORT ContentBrowserClient {
|
||||
public:
|
||||
+ // Identifies the type of site instance to use for a navigation.
|
||||
+ enum SiteInstanceForNavigationType {
|
||||
+ // Use either the candidate site instance or, if it doesn't exist
|
||||
+ // a new, unrelated site instance for the navigation.
|
||||
+ FORCE_CANDIDATE_OR_NEW = 0,
|
||||
+
|
||||
+ // Use the current site instance for the navigation.
|
||||
+ FORCE_CURRENT,
|
||||
+
|
||||
+ // Use the provided affinity site instance for the navigation.
|
||||
+ FORCE_AFFINITY,
|
||||
+
|
||||
+ // Delegate the site instance creation to Chromium.
|
||||
+ ASK_CHROMIUM
|
||||
+ };
|
||||
+
|
||||
virtual ~ContentBrowserClient() {}
|
||||
|
||||
+ // Electron: Allows disabling the below ShouldOverride patch
|
||||
+ virtual bool CanUseCustomSiteInstance();
|
||||
+
|
||||
+ // Electron: Allows overriding the SiteInstance when navigating.
|
||||
+ virtual SiteInstanceForNavigationType ShouldOverrideSiteInstanceForNavigation(
|
||||
+ content::RenderFrameHost* current_rfh,
|
||||
+ content::RenderFrameHost* speculative_rfh,
|
||||
+ content::BrowserContext* browser_context,
|
||||
+ const GURL& url,
|
||||
+ bool has_request_started,
|
||||
+ content::SiteInstance** affinity_site_instance) const;
|
||||
+
|
||||
+ // Electron: Registers a pending site instance during a navigation.
|
||||
+ virtual void RegisterPendingSiteInstance(
|
||||
+ content::RenderFrameHost* rfh,
|
||||
+ content::SiteInstance* pending_site_instance) {}
|
||||
+
|
||||
// Allows the embedder to set any number of custom BrowserMainParts
|
||||
// implementations for the browser startup code. See comments in
|
||||
// browser_main_parts.h.
|
||||
diff --git a/content/public/browser/site_instance.h b/content/public/browser/site_instance.h
|
||||
index a3e880e20e51d988175f0e8e2c42e7f5c1740104..faadd39d01530092f4f31a896ecb60f235e7f63f 100644
|
||||
--- a/content/public/browser/site_instance.h
|
||||
+++ b/content/public/browser/site_instance.h
|
||||
@@ -121,6 +121,11 @@ class CONTENT_EXPORT SiteInstance : public base::RefCounted<SiteInstance> {
|
||||
// corresponds to a site URL with the host "example.com".
|
||||
virtual const GURL& GetSiteURL() = 0;
|
||||
|
||||
+ // Create a SiteInstance for the given URL that shares the current
|
||||
+ // BrowsingInstance.
|
||||
+ virtual scoped_refptr<SiteInstance> CreateRelatedSiteInstance(
|
||||
+ const GURL& url) = 0;
|
||||
+
|
||||
// Gets a SiteInstance for the given URL that shares the current
|
||||
// BrowsingInstance, creating a new SiteInstance if necessary. This ensures
|
||||
// that a BrowsingInstance only has one SiteInstance per site, so that pages
|
|
@ -1,72 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:47:44 -0700
|
||||
Subject: gin_enable_disable_v8_platform.patch
|
||||
|
||||
|
||||
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
|
||||
index 5f8aea7105a188846fd48d199bb4e0ca2017a0ab..2514f591208372d6654ff9c5be50a51a39a881cb 100644
|
||||
--- a/gin/isolate_holder.cc
|
||||
+++ b/gin/isolate_holder.cc
|
||||
@@ -98,9 +98,10 @@ IsolateHolder::~IsolateHolder() {
|
||||
// static
|
||||
void IsolateHolder::Initialize(ScriptMode mode,
|
||||
v8::ArrayBuffer::Allocator* allocator,
|
||||
- const intptr_t* reference_table) {
|
||||
+ const intptr_t* reference_table,
|
||||
+ bool create_v8_platform) {
|
||||
CHECK(allocator);
|
||||
- V8Initializer::Initialize(mode);
|
||||
+ V8Initializer::Initialize(mode, create_v8_platform);
|
||||
g_array_buffer_allocator = allocator;
|
||||
g_reference_table = reference_table;
|
||||
}
|
||||
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
|
||||
index 413e6c5bcc74cd01730c5d4dc66eb92aaf7df8de..6c5d101fef97e880bee20d2f76e4b339a624eb6f 100644
|
||||
--- a/gin/public/isolate_holder.h
|
||||
+++ b/gin/public/isolate_holder.h
|
||||
@@ -91,7 +91,8 @@ class GIN_EXPORT IsolateHolder {
|
||||
// reference pointers. Otherwise, it can be nullptr.
|
||||
static void Initialize(ScriptMode mode,
|
||||
v8::ArrayBuffer::Allocator* allocator,
|
||||
- const intptr_t* reference_table = nullptr);
|
||||
+ const intptr_t* reference_table = nullptr,
|
||||
+ bool create_v8_platform = true);
|
||||
|
||||
v8::Isolate* isolate() { return isolate_; }
|
||||
|
||||
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
||||
index 770f3cb52990e2a4160050234e474889daab751c..ea9817bf4c0ab5d84ca21abcc573956e9f09b5d3 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -204,12 +204,14 @@ enum LoadV8FileResult {
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
-void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) {
|
||||
+void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
||||
+ bool create_v8_platform) {
|
||||
static bool v8_is_initialized = false;
|
||||
if (v8_is_initialized)
|
||||
return;
|
||||
|
||||
- v8::V8::InitializePlatform(V8Platform::Get());
|
||||
+ if (create_v8_platform)
|
||||
+ v8::V8::InitializePlatform(V8Platform::Get());
|
||||
|
||||
if (!base::FeatureList::IsEnabled(features::kV8OptimizeJavascript)) {
|
||||
// We avoid explicitly passing --opt if kV8OptimizeJavascript is enabled
|
||||
diff --git a/gin/v8_initializer.h b/gin/v8_initializer.h
|
||||
index aa3863abe0ea71fc26222564425f54ff80077719..fbf84c00174cc081d71aff8a16d51d2211614ec7 100644
|
||||
--- a/gin/v8_initializer.h
|
||||
+++ b/gin/v8_initializer.h
|
||||
@@ -20,7 +20,8 @@ namespace gin {
|
||||
class GIN_EXPORT V8Initializer {
|
||||
public:
|
||||
// This should be called by IsolateHolder::Initialize().
|
||||
- static void Initialize(IsolateHolder::ScriptMode mode);
|
||||
+ static void Initialize(IsolateHolder::ScriptMode mode,
|
||||
+ bool create_v8_platform = true);
|
||||
|
||||
// Get address and size information for currently loaded snapshot.
|
||||
// If no snapshot is loaded, the return values are null for addresses
|
|
@ -1,23 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Thu, 18 Oct 2018 17:07:17 -0700
|
||||
Subject: gritsettings_resource_ids.patch
|
||||
|
||||
Add electron resources file to the list of resource ids generation.
|
||||
|
||||
diff --git a/tools/gritsettings/resource_ids b/tools/gritsettings/resource_ids
|
||||
index 2a7cb2dcb562781310062bc93af3a3d2f5f57fa2..8948459732b4a9ba35a394b4c26be566484c2830 100644
|
||||
--- a/tools/gritsettings/resource_ids
|
||||
+++ b/tools/gritsettings/resource_ids
|
||||
@@ -452,6 +452,11 @@
|
||||
"includes": [28880],
|
||||
},
|
||||
|
||||
+ "electron/electron_resources.grd": {
|
||||
+ "messages": [31750],
|
||||
+ "includes": [31950],
|
||||
+ },
|
||||
+
|
||||
# END "everything else" section.
|
||||
# Everything but chrome/, components/, content/, and ios/
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Thu, 20 Sep 2018 17:48:38 -0700
|
||||
Subject: gtk_visibility.patch
|
||||
|
||||
Allow electron to depend on GTK in the GN build.
|
||||
|
||||
diff --git a/build/config/linux/gtk/BUILD.gn b/build/config/linux/gtk/BUILD.gn
|
||||
index d78f7407c179fe44180800a234e9461c56849402..dae8fa63037803ebaf2e04fb2b9547d2db7ba29c 100644
|
||||
--- a/build/config/linux/gtk/BUILD.gn
|
||||
+++ b/build/config/linux/gtk/BUILD.gn
|
||||
@@ -26,6 +26,7 @@ group("gtk") {
|
||||
visibility = [
|
||||
"//chrome/test:interactive_ui_tests",
|
||||
"//chrome/test:unit_tests",
|
||||
+ "//electron:*",
|
||||
"//examples:peerconnection_client",
|
||||
"//gpu/gles2_conform_support:gles2_conform_test_windowless",
|
||||
"//remoting/host/linux",
|
|
@ -1,25 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zac Walker <zac.walker@microsoft.com>
|
||||
Date: Thu, 20 Sep 2018 17:49:55 -0700
|
||||
Subject: ignore_rc_check.patch
|
||||
|
||||
Dont compare RC.exe and RC.py output.
|
||||
FIXME: It has to be reverted once the script is fixed.
|
||||
|
||||
diff --git a/build/toolchain/win/tool_wrapper.py b/build/toolchain/win/tool_wrapper.py
|
||||
index 926086670dac3ccf85f4085b513740aec1ebe9e5..cbb32f1143420d47af23f1ad92ee8656543a93e0 100644
|
||||
--- a/build/toolchain/win/tool_wrapper.py
|
||||
+++ b/build/toolchain/win/tool_wrapper.py
|
||||
@@ -224,7 +224,11 @@ class WinTool(object):
|
||||
if rc_exe_exit_code == 0:
|
||||
import filecmp
|
||||
# Strip "/fo" prefix.
|
||||
- assert filecmp.cmp(rc_res_output[3:], rcpy_res_output[3:])
|
||||
+ # ------
|
||||
+ # Temporarily ignore compares
|
||||
+ # Nightly builds use very large version numbers that fail this check
|
||||
+ # FIXME(zacwalk): Enable the assert.
|
||||
+ # assert filecmp.cmp(rc_res_output[3:], rcpy_res_output[3:])
|
||||
return rc_exe_exit_code
|
||||
|
||||
def ExecActionWrapper(self, arch, rspfile, *dirname):
|
|
@ -1,23 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Fri, 5 Apr 2019 12:49:24 +0530
|
||||
Subject: Define ipc identifier for legacy Electron ipc messages
|
||||
|
||||
Electron ipc messages used to piggy back on ShellMsgStart for ipc
|
||||
identifier. But its not available after
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/1525181.
|
||||
This patch can be removed once legacy ipc messages are no longer
|
||||
used.
|
||||
|
||||
diff --git a/ipc/ipc_message_start.h b/ipc/ipc_message_start.h
|
||||
index 4d83cdf93aef66d3479c9a325e8241592d85359e..a03af8a4b9d370ae849d4fe61c805ecb525fe394 100644
|
||||
--- a/ipc/ipc_message_start.h
|
||||
+++ b/ipc/ipc_message_start.h
|
||||
@@ -69,6 +69,7 @@ enum IPCMessageStart {
|
||||
ExtensionWorkerMsgStart,
|
||||
SubresourceFilterMsgStart,
|
||||
ChromeAppsMsgStart,
|
||||
+ ElectronMsgStart,
|
||||
LastIPCMsgStart // Must come last.
|
||||
};
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <samuel.r.attard@gmail.com>
|
||||
Date: Thu, 18 Oct 2018 17:07:27 -0700
|
||||
Subject: isolate_holder.patch
|
||||
|
||||
Pass pre allocated isolate for initialization, node platform
|
||||
needs to register on an isolate so that it can be used later
|
||||
down in the initialization process of an isolate.
|
||||
|
||||
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
|
||||
index 2514f591208372d6654ff9c5be50a51a39a881cb..4dd48f6a871cccb374c58adacb8ad9a80da89a5a 100644
|
||||
--- a/gin/isolate_holder.cc
|
||||
+++ b/gin/isolate_holder.cc
|
||||
@@ -52,7 +52,8 @@ IsolateHolder::IsolateHolder(
|
||||
AccessMode access_mode,
|
||||
AllowAtomicsWaitMode atomics_wait_mode,
|
||||
IsolateType isolate_type,
|
||||
- IsolateCreationMode isolate_creation_mode)
|
||||
+ IsolateCreationMode isolate_creation_mode,
|
||||
+ v8::Isolate* isolate)
|
||||
: access_mode_(access_mode), isolate_type_(isolate_type) {
|
||||
DCHECK(task_runner);
|
||||
DCHECK(task_runner->BelongsToCurrentThread());
|
||||
@@ -60,7 +61,11 @@ IsolateHolder::IsolateHolder(
|
||||
v8::ArrayBuffer::Allocator* allocator = g_array_buffer_allocator;
|
||||
CHECK(allocator) << "You need to invoke gin::IsolateHolder::Initialize first";
|
||||
|
||||
- isolate_ = v8::Isolate::Allocate();
|
||||
+ if (!isolate) {
|
||||
+ isolate_ = v8::Isolate::Allocate();
|
||||
+ } else {
|
||||
+ isolate_ = isolate;
|
||||
+ }
|
||||
isolate_data_.reset(
|
||||
new PerIsolateData(isolate_, allocator, access_mode_, task_runner));
|
||||
if (isolate_creation_mode == IsolateCreationMode::kCreateSnapshot) {
|
||||
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
|
||||
index 6c5d101fef97e880bee20d2f76e4b339a624eb6f..576086de0de0a6fea9e2f2077af3aff18fd3138a 100644
|
||||
--- a/gin/public/isolate_holder.h
|
||||
+++ b/gin/public/isolate_holder.h
|
||||
@@ -75,7 +75,8 @@ class GIN_EXPORT IsolateHolder {
|
||||
AccessMode access_mode,
|
||||
AllowAtomicsWaitMode atomics_wait_mode,
|
||||
IsolateType isolate_type,
|
||||
- IsolateCreationMode isolate_creation_mode = IsolateCreationMode::kNormal);
|
||||
+ IsolateCreationMode isolate_creation_mode = IsolateCreationMode::kNormal,
|
||||
+ v8::Isolate* isolate = nullptr);
|
||||
~IsolateHolder();
|
||||
|
||||
// Should be invoked once before creating IsolateHolder instances to
|
|
@ -1,108 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Thu, 20 Sep 2018 17:48:31 -0700
|
||||
Subject: libgtkui_export.patch
|
||||
|
||||
Export libgtkui symbols for the GN component build.
|
||||
|
||||
diff --git a/chrome/browser/ui/libgtkui/gtk_util.h b/chrome/browser/ui/libgtkui/gtk_util.h
|
||||
index adea4a859d96e219acc92c9178574f089a57944c..df615a91c00d22cabafffebe151728010fe9c1c4 100644
|
||||
--- a/chrome/browser/ui/libgtkui/gtk_util.h
|
||||
+++ b/chrome/browser/ui/libgtkui/gtk_util.h
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "ui/base/glib/scoped_gobject.h"
|
||||
#include "ui/native_theme/native_theme.h"
|
||||
#include "ui/views/window/frame_buttons.h"
|
||||
+#include "chrome/browser/ui/libgtkui/libgtkui_export.h"
|
||||
|
||||
namespace aura {
|
||||
class Window;
|
||||
@@ -33,10 +34,10 @@ namespace libgtkui {
|
||||
|
||||
extern const color_utils::HSL kDefaultTintFrameIncognito;
|
||||
|
||||
-void GtkInitFromCommandLine(const base::CommandLine& command_line);
|
||||
+LIBGTKUI_EXPORT void GtkInitFromCommandLine(const base::CommandLine& command_line);
|
||||
|
||||
// Returns the name of the ".desktop" file associated with our running process.
|
||||
-std::string GetDesktopName(base::Environment* env);
|
||||
+LIBGTKUI_EXPORT std::string GetDesktopName(base::Environment* env);
|
||||
|
||||
guint GetGdkKeyCodeForAccelerator(const ui::Accelerator& accelerator);
|
||||
|
||||
@@ -51,7 +52,7 @@ void TurnButtonBlue(GtkWidget* button);
|
||||
|
||||
// Sets |dialog| as transient for |parent|, which will keep it on top and center
|
||||
// it above |parent|. Do nothing if |parent| is nullptr.
|
||||
-void SetGtkTransientForAura(GtkWidget* dialog, aura::Window* parent);
|
||||
+LIBGTKUI_EXPORT void SetGtkTransientForAura(GtkWidget* dialog, aura::Window* parent);
|
||||
|
||||
// Gets the transient parent aura window for |dialog|.
|
||||
aura::Window* GetAuraTransientParent(GtkWidget* dialog);
|
||||
@@ -157,7 +158,7 @@ void ApplyCssToContext(GtkStyleContext* context, const std::string& css);
|
||||
|
||||
// Get the 'color' property from the style context created by
|
||||
// GetStyleContextFromCss(|css_selector|).
|
||||
-SkColor GetFgColor(const std::string& css_selector);
|
||||
+LIBGTKUI_EXPORT SkColor GetFgColor(const std::string& css_selector);
|
||||
|
||||
ScopedCssProvider GetCssProvider(const std::string& css);
|
||||
|
||||
@@ -170,7 +171,7 @@ void RenderBackground(const gfx::Size& size,
|
||||
// Renders a background from the style context created by
|
||||
// GetStyleContextFromCss(|css_selector|) into a 24x24 bitmap and
|
||||
// returns the average color.
|
||||
-SkColor GetBgColor(const std::string& css_selector);
|
||||
+LIBGTKUI_EXPORT SkColor GetBgColor(const std::string& css_selector);
|
||||
|
||||
// Renders the border from the style context created by
|
||||
// GetStyleContextFromCss(|css_selector|) into a 24x24 bitmap and
|
||||
diff --git a/chrome/browser/ui/libgtkui/skia_utils_gtk.h b/chrome/browser/ui/libgtkui/skia_utils_gtk.h
|
||||
index bd6ed68a11b0b6c08962f688c799bd0f6b8a8d0e..b1184475e0ab9f381dc3c78b1092e2e0ec59d60b 100644
|
||||
--- a/chrome/browser/ui/libgtkui/skia_utils_gtk.h
|
||||
+++ b/chrome/browser/ui/libgtkui/skia_utils_gtk.h
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdint.h>
|
||||
|
||||
+#include "chrome/browser/ui/libgtkui/libgtkui_export.h"
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
|
||||
#if !GTK_CHECK_VERSION(3, 90, 0)
|
||||
@@ -48,7 +49,7 @@ const SkBitmap GdkPixbufToImageSkia(GdkPixbuf* pixbuf);
|
||||
// Convert and copy a SkBitmap to a GdkPixbuf. NOTE: this uses BGRAToRGBA, so
|
||||
// it is an expensive operation. The returned GdkPixbuf will have a refcount of
|
||||
// 1, and the caller is responsible for unrefing it when done.
|
||||
-GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap& bitmap);
|
||||
+LIBGTKUI_EXPORT GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap& bitmap);
|
||||
|
||||
} // namespace libgtkui
|
||||
|
||||
diff --git a/chrome/browser/ui/libgtkui/unity_service.h b/chrome/browser/ui/libgtkui/unity_service.h
|
||||
index 8d67e1460837c7f8adb151adea131cc6440659a3..95fbb27b6a81e4d73d239e94f5105078a936b5af 100644
|
||||
--- a/chrome/browser/ui/libgtkui/unity_service.h
|
||||
+++ b/chrome/browser/ui/libgtkui/unity_service.h
|
||||
@@ -5,18 +5,20 @@
|
||||
#ifndef CHROME_BROWSER_UI_LIBGTKUI_UNITY_SERVICE_H_
|
||||
#define CHROME_BROWSER_UI_LIBGTKUI_UNITY_SERVICE_H_
|
||||
|
||||
+#include "chrome/browser/ui/libgtkui/libgtkui_export.h"
|
||||
+
|
||||
namespace unity {
|
||||
|
||||
// Returns whether unity is currently running.
|
||||
-bool IsRunning();
|
||||
+LIBGTKUI_EXPORT bool IsRunning();
|
||||
|
||||
// If unity is running, sets the download counter in the dock icon. Any value
|
||||
// other than 0 displays the badge.
|
||||
-void SetDownloadCount(int count);
|
||||
+LIBGTKUI_EXPORT void SetDownloadCount(int count);
|
||||
|
||||
// If unity is running, sets the download progress bar in the dock icon. Any
|
||||
// value between 0.0 and 1.0 (exclusive) shows the progress bar.
|
||||
-void SetProgressFraction(float percentage);
|
||||
+LIBGTKUI_EXPORT void SetProgressFraction(float percentage);
|
||||
|
||||
} // namespace unity
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Thu, 20 Sep 2018 17:49:31 -0700
|
||||
Subject: mas-audiodeviceduck.patch
|
||||
|
||||
Removes usage of the AudioDeviceDuck private API.
|
||||
|
||||
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
|
||||
index b8e4e68e9b8f6ac040939a97bdf040c3351efa13..abff176679f7dde30a65528be7e9a2568f68972a 100644
|
||||
--- a/media/audio/mac/audio_low_latency_input_mac.cc
|
||||
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
|
||||
@@ -33,19 +33,23 @@
|
||||
|
||||
namespace {
|
||||
extern "C" {
|
||||
+#ifndef MAS_BUILD
|
||||
// See:
|
||||
// https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/PAL/pal/spi/cf/CoreAudioSPI.h?rev=228264
|
||||
OSStatus AudioDeviceDuck(AudioDeviceID inDevice,
|
||||
Float32 inDuckedLevel,
|
||||
const AudioTimeStamp* __nullable inStartTime,
|
||||
Float32 inRampDuration) __attribute__((weak_import));
|
||||
+#endif
|
||||
}
|
||||
|
||||
void UndoDucking(AudioDeviceID output_device_id) {
|
||||
+#ifndef MAS_BUILD
|
||||
if (AudioDeviceDuck != nullptr) {
|
||||
// Ramp the volume back up over half a second.
|
||||
AudioDeviceDuck(output_device_id, 1.0, nullptr, 0.5);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace
|
|
@ -1,39 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Thu, 20 Sep 2018 17:49:20 -0700
|
||||
Subject: mas-cfisobjc.patch
|
||||
|
||||
Removes usage of the _CFIsObjC private API.
|
||||
|
||||
diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
|
||||
index 8b20ebc678c39b722bd5b03930ce89847e8cc73a..dca8c939e757003aafc1528ec7bbb739bf971fa6 100644
|
||||
--- a/base/mac/foundation_util.mm
|
||||
+++ b/base/mac/foundation_util.mm
|
||||
@@ -26,7 +26,6 @@
|
||||
#if !defined(OS_IOS)
|
||||
CFTypeID SecACLGetTypeID();
|
||||
CFTypeID SecTrustedApplicationGetTypeID();
|
||||
-Boolean _CFIsObjC(CFTypeID typeID, CFTypeRef obj);
|
||||
#endif
|
||||
} // extern "C"
|
||||
|
||||
@@ -315,8 +314,7 @@ void SetBaseBundleID(const char* new_base_bundle_id) {
|
||||
const_cast<NSFont*>(reinterpret_cast<const NSFont*>(cf_val));
|
||||
DCHECK(!cf_val ||
|
||||
CTFontGetTypeID() == CFGetTypeID(cf_val) ||
|
||||
- (_CFIsObjC(CTFontGetTypeID(), cf_val) &&
|
||||
- [ns_val isKindOfClass:[NSFont class]]));
|
||||
+ ([ns_val isKindOfClass:[NSFont class]]));
|
||||
return ns_val;
|
||||
}
|
||||
|
||||
@@ -384,9 +382,6 @@ CTFontRef NSToCFCast(NSFont* ns_val) {
|
||||
return (CTFontRef)(cf_val);
|
||||
}
|
||||
|
||||
- if (!_CFIsObjC(CTFontGetTypeID(), cf_val))
|
||||
- return NULL;
|
||||
-
|
||||
id<NSObject> ns_val = reinterpret_cast<id>(const_cast<void*>(cf_val));
|
||||
if ([ns_val isKindOfClass:[NSFont class]]) {
|
||||
return (CTFontRef)(cf_val);
|
|
@ -1,29 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Thu, 20 Sep 2018 17:49:24 -0700
|
||||
Subject: mas-cgdisplayusesforcetogray.patch
|
||||
|
||||
Removes usage of the CGDisplayUsesForceToGray private API.
|
||||
|
||||
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
|
||||
index 4d5b83a1a4b0c1d03378ab1aae8ef43935c387d3..463ff7105ac329cafed793fd87cfc8423e0a0ed7 100644
|
||||
--- a/ui/display/mac/screen_mac.mm
|
||||
+++ b/ui/display/mac/screen_mac.mm
|
||||
@@ -107,7 +107,17 @@ Display BuildDisplayForScreen(NSScreen* screen) {
|
||||
|
||||
display.set_color_depth(NSBitsPerPixelFromDepth([screen depth]));
|
||||
display.set_depth_per_component(NSBitsPerSampleFromDepth([screen depth]));
|
||||
+#ifdef MAS_BUILD
|
||||
+ // This is equivalent to the CGDisplayUsesForceToGray() API as at 2018-08-06,
|
||||
+ // but avoids usage of the private API.
|
||||
+ CFStringRef app = CFSTR("com.apple.CoreGraphics");
|
||||
+ CFStringRef key = CFSTR("DisplayUseForcedGray");
|
||||
+ Boolean key_valid = false;
|
||||
+ display.set_is_monochrome(
|
||||
+ CFPreferencesGetAppBooleanValue(key, app, &key_valid));
|
||||
+#else
|
||||
display.set_is_monochrome(CGDisplayUsesForceToGray());
|
||||
+#endif
|
||||
|
||||
// CGDisplayRotation returns a double. Display::SetRotationAsDegree will
|
||||
// handle the unexpected situations were the angle is not a multiple of 90.
|
|
@ -1,23 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Thu, 20 Sep 2018 17:49:34 -0700
|
||||
Subject: mas-lssetapplicationlaunchservicesserverconnectionstatus.patch
|
||||
|
||||
Removes usage of the _LSSetApplicationLaunchServicesServerConnectionStatus
|
||||
private API.
|
||||
|
||||
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
|
||||
index f0d320c6772acb67752a997f507c96844e3549b8..82f0c4f62be2f210db2c3ed1169c2a816c59cf1f 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -283,8 +283,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
std::make_unique<base::SingleThreadTaskExecutor>(
|
||||
base::MessagePump::Type::NS_RUNLOOP);
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
// Tell LaunchServices to continue without a connection to the daemon.
|
||||
_LSSetApplicationLaunchServicesServerConnectionStatus(0, nullptr);
|
||||
+#endif
|
||||
#else
|
||||
main_thread_task_executor =
|
||||
std::make_unique<base::SingleThreadTaskExecutor>(
|
|
@ -1,120 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:48:49 -0700
|
||||
Subject: mas_blink_no_private_api.patch
|
||||
|
||||
Guard usages in chromium code of private Mac APIs by MAS_BUILD, so they can
|
||||
be excluded for people who want to submit their apps to the Mac App store.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/editing/kill_ring_mac.mm b/third_party/blink/renderer/core/editing/kill_ring_mac.mm
|
||||
index 94afefcee81b87c05bf9b1199d90d3d4b5ea84a6..2ec7f04c71824b47de1ddbf1f0e8625d33e833a8 100644
|
||||
--- a/third_party/blink/renderer/core/editing/kill_ring_mac.mm
|
||||
+++ b/third_party/blink/renderer/core/editing/kill_ring_mac.mm
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
namespace blink {
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
extern "C" {
|
||||
|
||||
// Kill ring calls. Would be better to use NSKillRing.h, but that's not
|
||||
@@ -39,38 +40,53 @@
|
||||
void _NSNewKillRingSequence();
|
||||
void _NSSetKillRingToYankedState();
|
||||
}
|
||||
+#endif
|
||||
|
||||
static void InitializeKillRingIfNeeded() {
|
||||
static bool initialized_kill_ring = false;
|
||||
if (!initialized_kill_ring) {
|
||||
initialized_kill_ring = true;
|
||||
+#ifndef MAS_BUILD
|
||||
_NSInitializeKillRing();
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
|
||||
void KillRing::Append(const String& string) {
|
||||
InitializeKillRingIfNeeded();
|
||||
+#ifndef MAS_BUILD
|
||||
_NSAppendToKillRing(string);
|
||||
+#endif
|
||||
}
|
||||
|
||||
void KillRing::Prepend(const String& string) {
|
||||
InitializeKillRingIfNeeded();
|
||||
+#ifndef MAS_BUILD
|
||||
_NSPrependToKillRing(string);
|
||||
+#endif
|
||||
}
|
||||
|
||||
String KillRing::Yank() {
|
||||
InitializeKillRingIfNeeded();
|
||||
+#ifndef MAS_BUILD
|
||||
return _NSYankFromKillRing();
|
||||
+#else
|
||||
+ return "";
|
||||
+#endif
|
||||
}
|
||||
|
||||
void KillRing::StartNewSequence() {
|
||||
InitializeKillRingIfNeeded();
|
||||
+#ifndef MAS_BUILD
|
||||
_NSNewKillRingSequence();
|
||||
+#endif
|
||||
}
|
||||
|
||||
void KillRing::SetToYankedState() {
|
||||
InitializeKillRingIfNeeded();
|
||||
+#ifndef MAS_BUILD
|
||||
_NSSetKillRingToYankedState();
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
diff --git a/third_party/blink/renderer/core/paint/theme_painter_mac.mm b/third_party/blink/renderer/core/paint/theme_painter_mac.mm
|
||||
index e965faf9fd8d5ec3572d769421f149907d66c67f..b2d0bbd80994fdf9607009d9e27bf4c3629fe402 100644
|
||||
--- a/third_party/blink/renderer/core/paint/theme_painter_mac.mm
|
||||
+++ b/third_party/blink/renderer/core/paint/theme_painter_mac.mm
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
// The methods in this file are specific to the Mac OS X platform.
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
// Forward declare Mac SPIs.
|
||||
extern "C" {
|
||||
void _NSDrawCarbonThemeBezel(NSRect frame, BOOL enabled, BOOL flipped);
|
||||
@@ -50,6 +51,7 @@ void _NSDrawCarbonThemeListBox(NSRect frame,
|
||||
BOOL flipped,
|
||||
BOOL always_yes);
|
||||
}
|
||||
+#endif
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -72,10 +74,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame,
|
||||
// behavior change while remaining a fragile solution.
|
||||
// https://bugs.chromium.org/p/chromium/issues/detail?id=658085#c3
|
||||
if (!use_ns_text_field_cell) {
|
||||
+#ifndef MAS_BUILD
|
||||
_NSDrawCarbonThemeBezel(
|
||||
CGRect(r),
|
||||
LayoutTheme::IsEnabled(node) && !LayoutTheme::IsReadOnlyControl(node),
|
||||
YES);
|
||||
+#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -161,10 +165,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame,
|
||||
const PaintInfo& paint_info,
|
||||
const IntRect& r) {
|
||||
LocalCurrentGraphicsContext local_context(paint_info.context, r);
|
||||
+#ifndef MAS_BUILD
|
||||
_NSDrawCarbonThemeListBox(
|
||||
CGRect(r),
|
||||
LayoutTheme::IsEnabled(node) && !LayoutTheme::IsReadOnlyControl(node),
|
||||
YES, YES);
|
||||
+#endif
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1,420 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Tue, 9 Oct 2018 10:36:20 -0700
|
||||
Subject: mas_no_private_api.patch
|
||||
|
||||
Guard usages in blink of private Mac APIs by MAS_BUILD, so they can be
|
||||
excluded for people who want to submit their apps to the Mac App store.
|
||||
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h
|
||||
index 743d1364bcd13e24ecbe5ced730161d15b8c3e93..a7e81072194c00baa0aa3159a6bfe374aaffa54f 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_cocoa.h
|
||||
+++ b/content/browser/accessibility/browser_accessibility_cocoa.h
|
||||
@@ -109,7 +109,9 @@ struct AXTextEdit {
|
||||
@property(nonatomic, readonly) NSNumber* enabled;
|
||||
// Returns a text marker that points to the last character in the document that
|
||||
// can be selected with Voiceover.
|
||||
+#ifndef MAS_BUILD
|
||||
@property(nonatomic, readonly) id endTextMarker;
|
||||
+#endif
|
||||
@property(nonatomic, readonly) NSNumber* expanded;
|
||||
@property(nonatomic, readonly) NSNumber* focused;
|
||||
@property(nonatomic, readonly) NSNumber* grabbed;
|
||||
@@ -145,12 +147,16 @@ struct AXTextEdit {
|
||||
@property(nonatomic, readonly) NSArray* selectedChildren;
|
||||
@property(nonatomic, readonly) NSString* selectedText;
|
||||
@property(nonatomic, readonly) NSValue* selectedTextRange;
|
||||
+#ifndef MAS_BUILD
|
||||
@property(nonatomic, readonly) id selectedTextMarkerRange;
|
||||
+#endif
|
||||
@property(nonatomic, readonly) NSValue* size;
|
||||
@property(nonatomic, readonly) NSString* sortDirection;
|
||||
// Returns a text marker that points to the first character in the document that
|
||||
// can be selected with Voiceover.
|
||||
+#ifndef MAS_BUILD
|
||||
@property(nonatomic, readonly) id startTextMarker;
|
||||
+#endif
|
||||
// A string indicating the subrole of this object as far as accessibility
|
||||
// is concerned.
|
||||
@property(nonatomic, readonly) NSString* subrole;
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
index 237b07caa5ed7626c3b5b538cbb77f582f884203..cc4cb1ce9308ba8aecd6cc138954a1b5e04e6d29 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
@@ -141,6 +141,7 @@
|
||||
// VoiceOver uses -1 to mean "no limit" for AXResultsLimit.
|
||||
const int kAXResultsLimitNoLimit = -1;
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
extern "C" {
|
||||
|
||||
// The following are private accessibility APIs required for cursor navigation
|
||||
@@ -346,6 +347,7 @@ void AddMisspelledTextAttributes(
|
||||
AddMisspelledTextAttributes(text_only_objects, attributed_text);
|
||||
return [attributed_text attributedSubstringFromRange:range];
|
||||
}
|
||||
+#endif
|
||||
|
||||
// Returns an autoreleased copy of the AXNodeData's attribute.
|
||||
NSString* NSStringForStringAttribute(BrowserAccessibility* browserAccessibility,
|
||||
@@ -613,7 +615,9 @@ + (void)initialize {
|
||||
{NSAccessibilityEditableAncestorAttribute, @"editableAncestor"},
|
||||
{NSAccessibilityElementBusyAttribute, @"elementBusy"},
|
||||
{NSAccessibilityEnabledAttribute, @"enabled"},
|
||||
+#ifndef MAS_BUILD
|
||||
{NSAccessibilityEndTextMarkerAttribute, @"endTextMarker"},
|
||||
+#endif
|
||||
{NSAccessibilityExpandedAttribute, @"expanded"},
|
||||
{NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"},
|
||||
{NSAccessibilityFocusedAttribute, @"focused"},
|
||||
@@ -648,13 +652,17 @@ + (void)initialize {
|
||||
{NSAccessibilityRowsAttribute, @"rows"},
|
||||
// TODO(aboxhall): expose
|
||||
// NSAccessibilityServesAsTitleForUIElementsAttribute
|
||||
+#ifndef MAS_BUILD
|
||||
{NSAccessibilityStartTextMarkerAttribute, @"startTextMarker"},
|
||||
+#endif
|
||||
{NSAccessibilitySelectedAttribute, @"selected"},
|
||||
{NSAccessibilitySelectedChildrenAttribute, @"selectedChildren"},
|
||||
{NSAccessibilitySelectedTextAttribute, @"selectedText"},
|
||||
{NSAccessibilitySelectedTextRangeAttribute, @"selectedTextRange"},
|
||||
+#ifndef MAS_BUILD
|
||||
{NSAccessibilitySelectedTextMarkerRangeAttribute,
|
||||
@"selectedTextMarkerRange"},
|
||||
+#endif
|
||||
{NSAccessibilitySizeAttribute, @"size"},
|
||||
{NSAccessibilitySortDirectionAttribute, @"sortDirection"},
|
||||
{NSAccessibilitySubroleAttribute, @"subrole"},
|
||||
@@ -1145,6 +1153,7 @@ - (NSNumber*)enabled {
|
||||
ax::mojom::Restriction::kDisabled];
|
||||
}
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
// Returns a text marker that points to the last character in the document that
|
||||
// can be selected with VoiceOver.
|
||||
- (id)endTextMarker {
|
||||
@@ -1155,6 +1164,7 @@ - (id)endTextMarker {
|
||||
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
|
||||
return CreateTextMarker(position->CreatePositionAtEndOfAnchor());
|
||||
}
|
||||
+#endif
|
||||
|
||||
- (NSNumber*)expanded {
|
||||
if (![self instanceActive])
|
||||
@@ -2033,6 +2043,7 @@ - (NSValue*)selectedTextRange {
|
||||
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
|
||||
}
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
- (id)selectedTextMarkerRange {
|
||||
if (![self instanceActive])
|
||||
return nil;
|
||||
@@ -2065,6 +2076,7 @@ - (id)selectedTextMarkerRange {
|
||||
anchorAffinity, *focusObject,
|
||||
focusOffset, focusAffinity));
|
||||
}
|
||||
+#endif
|
||||
|
||||
- (NSValue*)size {
|
||||
if (![self instanceActive])
|
||||
@@ -2097,6 +2109,7 @@ - (NSString*)sortDirection {
|
||||
return nil;
|
||||
}
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
// Returns a text marker that points to the first character in the document that
|
||||
// can be selected with VoiceOver.
|
||||
- (id)startTextMarker {
|
||||
@@ -2107,6 +2120,7 @@ - (id)startTextMarker {
|
||||
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
|
||||
return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
|
||||
}
|
||||
+#endif
|
||||
|
||||
// Returns a subrole based upon the role.
|
||||
- (NSString*)subrole {
|
||||
@@ -2407,12 +2421,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
|
||||
NSMutableAttributedString* attributedValue =
|
||||
[[[NSMutableAttributedString alloc] initWithString:value] autorelease];
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
if (!owner_->IsTextOnlyObject()) {
|
||||
std::vector<const BrowserAccessibility*> textOnlyObjects =
|
||||
BrowserAccessibilityManager::FindTextOnlyObjectsInRange(*owner_,
|
||||
*owner_);
|
||||
AddMisspelledTextAttributes(textOnlyObjects, attributedValue);
|
||||
}
|
||||
+#endif
|
||||
|
||||
return [attributedValue attributedSubstringFromRange:range];
|
||||
}
|
||||
@@ -2495,6 +2511,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
return ToBrowserAccessibilityCocoa(cell);
|
||||
}
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
if ([attribute isEqualToString:@"AXUIElementForTextMarker"]) {
|
||||
BrowserAccessibilityPositionInstance position =
|
||||
CreatePositionFromTextMarker(parameter);
|
||||
@@ -2672,6 +2689,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
NSString* text = GetTextForTextMarkerRange(parameter);
|
||||
return [NSNumber numberWithInt:[text length]];
|
||||
}
|
||||
+#endif
|
||||
|
||||
if ([attribute isEqualToString:
|
||||
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
|
||||
@@ -2705,6 +2723,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
return nil;
|
||||
}
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
if ([attribute
|
||||
isEqualToString:
|
||||
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
|
||||
@@ -2785,6 +2804,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition(
|
||||
|
||||
return @(child->GetIndexInParent());
|
||||
}
|
||||
+#endif
|
||||
|
||||
return nil;
|
||||
}
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
index e02f5f922ea0eeca39fdf0acc265e1ef9dc254a6..764cac3182c3611e2c1fc4a0aa73b13ac81a9a72 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
@@ -491,6 +491,7 @@ void PostAnnouncementNotification(NSString* announcement) {
|
||||
[user_info setObject:native_focus_object
|
||||
forKey:NSAccessibilityTextChangeElement];
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
id selected_text = [native_focus_object selectedTextMarkerRange];
|
||||
if (selected_text) {
|
||||
NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute =
|
||||
@@ -498,6 +499,7 @@ void PostAnnouncementNotification(NSString* announcement) {
|
||||
[user_info setObject:selected_text
|
||||
forKey:NSAccessibilitySelectedTextMarkerRangeAttribute];
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/content/renderer/renderer_main_platform_delegate_mac.mm b/content/renderer/renderer_main_platform_delegate_mac.mm
|
||||
index e59ac93d0e1554a2df5d8c74db2beba25d090228..6657c48664bdec4964b382f80309d1bfd097a9e9 100644
|
||||
--- a/content/renderer/renderer_main_platform_delegate_mac.mm
|
||||
+++ b/content/renderer/renderer_main_platform_delegate_mac.mm
|
||||
@@ -10,9 +10,11 @@
|
||||
#include "sandbox/mac/seatbelt.h"
|
||||
#include "sandbox/mac/system_services.h"
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
extern "C" {
|
||||
CGError CGSSetDenyWindowServerConnections(bool);
|
||||
}
|
||||
+#endif
|
||||
|
||||
namespace content {
|
||||
|
||||
@@ -22,6 +24,7 @@
|
||||
// verifies there are no existing open connections), and then indicates that
|
||||
// Chrome should continue execution without access to launchservicesd.
|
||||
void DisableSystemServices() {
|
||||
+#ifndef MAS_BUILD
|
||||
// Tell the WindowServer that we don't want to make any future connections.
|
||||
// This will return Success as long as there are no open connections, which
|
||||
// is what we want.
|
||||
@@ -29,6 +32,7 @@ void DisableSystemServices() {
|
||||
CHECK_EQ(result, kCGErrorSuccess);
|
||||
|
||||
sandbox::DisableLaunchServices();
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
|
||||
index fcf50dc3bd9a94536d7fc457c4e7b413a83dc672..6252cb195ff77aa31295c4958fd6b80c8a0df8bd 100644
|
||||
--- a/device/bluetooth/bluetooth_adapter_mac.mm
|
||||
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "device/bluetooth/bluetooth_low_energy_peripheral_manager_delegate.h"
|
||||
#include "device/bluetooth/bluetooth_socket_mac.h"
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
extern "C" {
|
||||
// Undocumented IOBluetooth Preference API [1]. Used by `blueutil` [2] and
|
||||
// `Karabiner` [3] to programmatically control the Bluetooth state. Calling the
|
||||
@@ -49,6 +50,7 @@
|
||||
// [4] https://support.apple.com/kb/PH25091
|
||||
void IOBluetoothPreferenceSetControllerPowerState(int state);
|
||||
}
|
||||
+#endif
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -121,8 +123,10 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) {
|
||||
controller_state_function_(
|
||||
base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState,
|
||||
base::Unretained(this))),
|
||||
+#ifndef MAS_BUILD
|
||||
power_state_function_(
|
||||
base::BindRepeating(IOBluetoothPreferenceSetControllerPowerState)),
|
||||
+#endif
|
||||
should_update_name_(true),
|
||||
classic_discovery_manager_(
|
||||
BluetoothDiscoveryManagerMac::CreateClassic(this)),
|
||||
@@ -319,8 +323,12 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) {
|
||||
}
|
||||
|
||||
bool BluetoothAdapterMac::SetPoweredImpl(bool powered) {
|
||||
+#ifndef MAS_BUILD
|
||||
power_state_function_.Run(base::strict_cast<int>(powered));
|
||||
return true;
|
||||
+#else
|
||||
+ return false;
|
||||
+#endif
|
||||
}
|
||||
|
||||
void BluetoothAdapterMac::RemovePairingDelegateInternal(
|
||||
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
|
||||
index cb7a5305c2d6cbe7b3aa13efdfe6dcc6dfd857e9..e3f3ee7fee0a8f9cf7b3c1b6bed7c2a6cf443954 100644
|
||||
--- a/media/audio/BUILD.gn
|
||||
+++ b/media/audio/BUILD.gn
|
||||
@@ -180,6 +180,12 @@ source_set("audio") {
|
||||
"mac/scoped_audio_unit.cc",
|
||||
"mac/scoped_audio_unit.h",
|
||||
]
|
||||
+ if (is_mas_build) {
|
||||
+ sources -= [
|
||||
+ "mac/coreaudio_dispatch_override.cc",
|
||||
+ "mac/coreaudio_dispatch_override.h",
|
||||
+ ]
|
||||
+ }
|
||||
libs += [
|
||||
"AudioToolbox.framework",
|
||||
"AudioUnit.framework",
|
||||
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
|
||||
index a9d6babb03ca318ccd15b254d3785a9ad45698c0..34ba3bfb738226ed8b53a9c24d15af5a5176642f 100644
|
||||
--- a/media/audio/mac/audio_manager_mac.cc
|
||||
+++ b/media/audio/mac/audio_manager_mac.cc
|
||||
@@ -882,7 +882,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
|
||||
|
||||
void AudioManagerMac::InitializeOnAudioThread() {
|
||||
DCHECK(GetTaskRunner()->BelongsToCurrentThread());
|
||||
- InitializeCoreAudioDispatchOverride();
|
||||
+ // InitializeCoreAudioDispatchOverride();
|
||||
power_observer_.reset(new AudioPowerObserver());
|
||||
}
|
||||
|
||||
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
|
||||
index 48ee9253d64faba7c1b9a0e77deac05dc149b874..cebc6f40070ff720eaff7013c9c58767c88cdaff 100644
|
||||
--- a/net/dns/dns_config_service_posix.cc
|
||||
+++ b/net/dns/dns_config_service_posix.cc
|
||||
@@ -245,6 +245,7 @@ class DnsConfigServicePosix::Watcher {
|
||||
|
||||
bool Watch() {
|
||||
bool success = true;
|
||||
+#ifndef MAS_BUILD
|
||||
if (!config_watcher_.Watch(base::Bind(&Watcher::OnConfigChanged,
|
||||
base::Unretained(this)))) {
|
||||
LOG(ERROR) << "DNS config watch failed to start.";
|
||||
@@ -266,6 +267,7 @@ class DnsConfigServicePosix::Watcher {
|
||||
DNS_CONFIG_WATCH_MAX);
|
||||
}
|
||||
#endif // !defined(OS_ANDROID) && !defined(OS_IOS)
|
||||
+#endif
|
||||
return success;
|
||||
}
|
||||
|
||||
diff --git a/sandbox/mac/sandbox_compiler.cc b/sandbox/mac/sandbox_compiler.cc
|
||||
index e524aa7b851022abed1edac39e18d8d92e5349b4..718d3f963da5c1a15a1bdb0e6043f89bc0f940f8 100644
|
||||
--- a/sandbox/mac/sandbox_compiler.cc
|
||||
+++ b/sandbox/mac/sandbox_compiler.cc
|
||||
@@ -28,6 +28,7 @@ bool SandboxCompiler::InsertStringParam(const std::string& key,
|
||||
}
|
||||
|
||||
bool SandboxCompiler::CompileAndApplyProfile(std::string* error) {
|
||||
+#ifndef MAS_BUILD
|
||||
char* error_internal = nullptr;
|
||||
std::vector<const char*> params;
|
||||
|
||||
@@ -44,6 +45,7 @@ bool SandboxCompiler::CompileAndApplyProfile(std::string* error) {
|
||||
sandbox::Seatbelt::FreeError(error_internal);
|
||||
return false;
|
||||
}
|
||||
+#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/sandbox/mac/seatbelt.cc b/sandbox/mac/seatbelt.cc
|
||||
index e0c31170acd13c9997c6b1d04c6de1420feaf422..0e561f97b33380bfbe52e64c2c4a6988095e8074 100644
|
||||
--- a/sandbox/mac/seatbelt.cc
|
||||
+++ b/sandbox/mac/seatbelt.cc
|
||||
@@ -64,7 +64,11 @@ void Seatbelt::FreeError(char* errorbuf) {
|
||||
|
||||
// static
|
||||
bool Seatbelt::IsSandboxed() {
|
||||
+#ifndef MAS_BUILD
|
||||
return ::sandbox_check(getpid(), NULL, 0);
|
||||
+#else
|
||||
+ return true;
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace sandbox
|
||||
diff --git a/sandbox/mac/seatbelt_extension.cc b/sandbox/mac/seatbelt_extension.cc
|
||||
index 9073364142e8f98c8872d9b5509f92f433e06624..2356add74dfae98299a4e2b207aa26fc109f47f3 100644
|
||||
--- a/sandbox/mac/seatbelt_extension.cc
|
||||
+++ b/sandbox/mac/seatbelt_extension.cc
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "sandbox/mac/seatbelt_extension_token.h"
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
// libsandbox private API.
|
||||
extern "C" {
|
||||
extern const char* APP_SANDBOX_READ;
|
||||
@@ -18,6 +19,7 @@ char* sandbox_extension_issue_file(const char* type,
|
||||
const char* path,
|
||||
uint32_t flags);
|
||||
}
|
||||
+#endif
|
||||
|
||||
namespace sandbox {
|
||||
|
||||
@@ -46,7 +48,11 @@ std::unique_ptr<SeatbeltExtension> SeatbeltExtension::FromToken(
|
||||
|
||||
bool SeatbeltExtension::Consume() {
|
||||
DCHECK(!token_.empty());
|
||||
+#ifndef MAS_BUILD
|
||||
handle_ = sandbox_extension_consume(token_.c_str());
|
||||
+#else
|
||||
+ handle_ = -1;
|
||||
+#endif
|
||||
return handle_ > 0;
|
||||
}
|
||||
|
||||
@@ -58,7 +64,11 @@ bool SeatbeltExtension::ConsumePermanently() {
|
||||
}
|
||||
|
||||
bool SeatbeltExtension::Revoke() {
|
||||
+#ifndef MAS_BUILD
|
||||
int rv = sandbox_extension_release(handle_);
|
||||
+#else
|
||||
+ int rv = -1;
|
||||
+#endif
|
||||
handle_ = 0;
|
||||
token_.clear();
|
||||
return rv == 0;
|
||||
@@ -76,9 +86,11 @@ SeatbeltExtension::SeatbeltExtension(const std::string& token)
|
||||
char* SeatbeltExtension::IssueToken(SeatbeltExtension::Type type,
|
||||
const std::string& resource) {
|
||||
switch (type) {
|
||||
+#ifndef MAS_BUILD
|
||||
case FILE_READ:
|
||||
return sandbox_extension_issue_file(APP_SANDBOX_READ, resource.c_str(),
|
||||
0);
|
||||
+#endif
|
||||
default:
|
||||
NOTREACHED();
|
||||
return nullptr;
|
|
@ -1,21 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:48:16 -0700
|
||||
Subject: no_cache_storage_check.patch
|
||||
|
||||
Do not check for unique origin in CacheStorage, in Electron we may have
|
||||
scripts running without an origin.
|
||||
|
||||
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage.cc b/content/browser/cache_storage/legacy/legacy_cache_storage.cc
|
||||
index f91df0d1bc58bdc7244c6b248844f2bd51c90fa3..d1935f5a7bc189e9621e83a02c4cf4d1bf72ab60 100644
|
||||
--- a/content/browser/cache_storage/legacy/legacy_cache_storage.cc
|
||||
+++ b/content/browser/cache_storage/legacy/legacy_cache_storage.cc
|
||||
@@ -106,7 +106,7 @@ class LegacyCacheStorage::CacheLoader {
|
||||
cache_storage_(cache_storage),
|
||||
origin_(origin),
|
||||
owner_(owner) {
|
||||
- DCHECK(!origin_.opaque());
|
||||
+ // DCHECK(!origin_.opaque());
|
||||
}
|
||||
|
||||
virtual ~CacheLoader() {}
|
|
@ -1,168 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <jeremya@chromium.org>
|
||||
Date: Fri, 5 Oct 2018 14:22:06 -0700
|
||||
Subject: pass RenderProcessHost through to PlatformNotificationService
|
||||
|
||||
this is so Electron can identify which renderer a notification came from
|
||||
|
||||
diff --git a/content/browser/notifications/blink_notification_service_impl.cc b/content/browser/notifications/blink_notification_service_impl.cc
|
||||
index 63a1fe8ebd1a59973748cf12d7a914c91a8e27f1..d2f7d4bdf41c71874849ccaeca13f2b8f9cfa483 100644
|
||||
--- a/content/browser/notifications/blink_notification_service_impl.cc
|
||||
+++ b/content/browser/notifications/blink_notification_service_impl.cc
|
||||
@@ -88,9 +88,11 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl(
|
||||
PlatformNotificationContextImpl* notification_context,
|
||||
BrowserContext* browser_context,
|
||||
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
|
||||
+ RenderProcessHost* render_process_host,
|
||||
const url::Origin& origin,
|
||||
mojo::InterfaceRequest<blink::mojom::NotificationService> request)
|
||||
: notification_context_(notification_context),
|
||||
+ render_process_host_(render_process_host),
|
||||
browser_context_(browser_context),
|
||||
service_worker_context_(std::move(service_worker_context)),
|
||||
origin_(origin),
|
||||
@@ -150,8 +152,9 @@ void BlinkNotificationServiceImpl::DisplayNonPersistentNotification(
|
||||
notification_id, std::move(event_listener_ptr));
|
||||
|
||||
GetNotificationService(browser_context_)
|
||||
- ->DisplayNotification(notification_id, origin_.GetURL(),
|
||||
- platform_notification_data, notification_resources);
|
||||
+ ->DisplayNotification(render_process_host_, notification_id,
|
||||
+ origin_.GetURL(), platform_notification_data,
|
||||
+ notification_resources);
|
||||
}
|
||||
|
||||
void BlinkNotificationServiceImpl::CloseNonPersistentNotification(
|
||||
diff --git a/content/browser/notifications/blink_notification_service_impl.h b/content/browser/notifications/blink_notification_service_impl.h
|
||||
index 3b7875f0df1f96f98a6088a8899d86d9d19d8a42..097607d267d55675ab91ad21f126acb827dcc50f 100644
|
||||
--- a/content/browser/notifications/blink_notification_service_impl.h
|
||||
+++ b/content/browser/notifications/blink_notification_service_impl.h
|
||||
@@ -36,6 +36,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
|
||||
PlatformNotificationContextImpl* notification_context,
|
||||
BrowserContext* browser_context,
|
||||
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
|
||||
+ RenderProcessHost* render_process_host,
|
||||
const url::Origin& origin,
|
||||
mojo::InterfaceRequest<blink::mojom::NotificationService> request);
|
||||
~BlinkNotificationServiceImpl() override;
|
||||
@@ -94,6 +95,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
|
||||
// The notification context that owns this service instance.
|
||||
PlatformNotificationContextImpl* notification_context_;
|
||||
|
||||
+ RenderProcessHost* render_process_host_;
|
||||
BrowserContext* browser_context_;
|
||||
|
||||
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
|
||||
diff --git a/content/browser/notifications/blink_notification_service_impl_unittest.cc b/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
||||
index cbac30fa7a12db927ba6a15173ba1181e03e0723..4d26fd795a7ce1ffd046c4a0f2ec17793bf33e6a 100644
|
||||
--- a/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
||||
+++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
||||
@@ -135,7 +135,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test {
|
||||
|
||||
notification_service_ = std::make_unique<BlinkNotificationServiceImpl>(
|
||||
notification_context_.get(), &browser_context_,
|
||||
- embedded_worker_helper_->context_wrapper(),
|
||||
+ embedded_worker_helper_->context_wrapper(), nullptr,
|
||||
url::Origin::Create(GURL(kTestOrigin)),
|
||||
mojo::MakeRequest(¬ification_service_ptr_));
|
||||
|
||||
diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc
|
||||
index 6ae821791660dfbda93430a937ba75b596332091..a17515d29eb5ed643e684d33a8ecd92b28902c13 100644
|
||||
--- a/content/browser/notifications/platform_notification_context_impl.cc
|
||||
+++ b/content/browser/notifications/platform_notification_context_impl.cc
|
||||
@@ -207,12 +207,13 @@ void PlatformNotificationContextImpl::Shutdown() {
|
||||
}
|
||||
|
||||
void PlatformNotificationContextImpl::CreateService(
|
||||
+ RenderProcessHost* render_process_host,
|
||||
const url::Origin& origin,
|
||||
blink::mojom::NotificationServiceRequest request) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
services_.push_back(std::make_unique<BlinkNotificationServiceImpl>(
|
||||
- this, browser_context_, service_worker_context_, origin,
|
||||
- std::move(request)));
|
||||
+ this, browser_context_, service_worker_context_, render_process_host,
|
||||
+ origin, std::move(request)));
|
||||
}
|
||||
|
||||
void PlatformNotificationContextImpl::RemoveService(
|
||||
diff --git a/content/browser/notifications/platform_notification_context_impl.h b/content/browser/notifications/platform_notification_context_impl.h
|
||||
index f1710b69a91931021ba56db544fce551fad52f46..b116b89114a431f8e67a68e7f7cc1c65d33985c7 100644
|
||||
--- a/content/browser/notifications/platform_notification_context_impl.h
|
||||
+++ b/content/browser/notifications/platform_notification_context_impl.h
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "content/common/content_export.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/platform_notification_context.h"
|
||||
+#include "content/public/browser/render_process_host.h"
|
||||
#include "third_party/blink/public/mojom/notifications/notification_service.mojom.h"
|
||||
|
||||
class GURL;
|
||||
@@ -65,7 +66,8 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
|
||||
void Shutdown();
|
||||
|
||||
// Creates a BlinkNotificationServiceImpl that is owned by this context.
|
||||
- void CreateService(const url::Origin& origin,
|
||||
+ void CreateService(RenderProcessHost* render_process_host,
|
||||
+ const url::Origin& origin,
|
||||
blink::mojom::NotificationServiceRequest request);
|
||||
|
||||
// Removes |service| from the list of owned services, for example because the
|
||||
diff --git a/content/browser/renderer_interface_binders.cc b/content/browser/renderer_interface_binders.cc
|
||||
index 3f0c06be2d9afcc02b326097fd99d27434635909..dea30a859da0e00f44d95642a2f469d3aabd2f45 100644
|
||||
--- a/content/browser/renderer_interface_binders.cc
|
||||
+++ b/content/browser/renderer_interface_binders.cc
|
||||
@@ -197,7 +197,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
|
||||
RenderProcessHost* host, const url::Origin& origin) {
|
||||
static_cast<StoragePartitionImpl*>(host->GetStoragePartition())
|
||||
->GetPlatformNotificationContext()
|
||||
- ->CreateService(origin, std::move(request));
|
||||
+ ->CreateService(host, origin, std::move(request));
|
||||
}));
|
||||
parameterized_binder_registry_.AddInterface(
|
||||
base::BindRepeating(&BackgroundFetchServiceImpl::CreateForWorker));
|
||||
diff --git a/content/public/browser/platform_notification_service.h b/content/public/browser/platform_notification_service.h
|
||||
index ca61088079c4150fcf389504ddcf26bcf6bf69cd..d9c034c39890eef1fe3d95c6d7c0ae68eb711a89 100644
|
||||
--- a/content/public/browser/platform_notification_service.h
|
||||
+++ b/content/public/browser/platform_notification_service.h
|
||||
@@ -27,6 +27,8 @@ struct PlatformNotificationData;
|
||||
|
||||
namespace content {
|
||||
|
||||
+class RenderProcessHost;
|
||||
+
|
||||
// The service using which notifications can be presented to the user. There
|
||||
// should be a unique instance of the PlatformNotificationService depending
|
||||
// on the browsing context being used.
|
||||
@@ -41,6 +43,7 @@ class CONTENT_EXPORT PlatformNotificationService {
|
||||
// Displays the notification described in |notification_data| to the user.
|
||||
// This method must be called on the UI thread.
|
||||
virtual void DisplayNotification(
|
||||
+ RenderProcessHost* render_process_host,
|
||||
const std::string& notification_id,
|
||||
const GURL& origin,
|
||||
const blink::PlatformNotificationData& notification_data,
|
||||
diff --git a/content/test/mock_platform_notification_service.cc b/content/test/mock_platform_notification_service.cc
|
||||
index be4638a9a8c355353424c07b73583e01c5422192..92383a54a9f86f92846b34e15a3d4a5a4f9624d3 100644
|
||||
--- a/content/test/mock_platform_notification_service.cc
|
||||
+++ b/content/test/mock_platform_notification_service.cc
|
||||
@@ -29,6 +29,7 @@ MockPlatformNotificationService::MockPlatformNotificationService(
|
||||
MockPlatformNotificationService::~MockPlatformNotificationService() = default;
|
||||
|
||||
void MockPlatformNotificationService::DisplayNotification(
|
||||
+ RenderProcessHost* render_process_host,
|
||||
const std::string& notification_id,
|
||||
const GURL& origin,
|
||||
const blink::PlatformNotificationData& notification_data,
|
||||
diff --git a/content/test/mock_platform_notification_service.h b/content/test/mock_platform_notification_service.h
|
||||
index 6d108f9884f7e8f608b70ec33d286a06346e7456..4650a01c2d090c5957eb7a7e21f124489513142a 100644
|
||||
--- a/content/test/mock_platform_notification_service.h
|
||||
+++ b/content/test/mock_platform_notification_service.h
|
||||
@@ -47,6 +47,7 @@ class MockPlatformNotificationService : public PlatformNotificationService {
|
||||
|
||||
// PlatformNotificationService implementation.
|
||||
void DisplayNotification(
|
||||
+ RenderProcessHost* render_process_host,
|
||||
const std::string& notification_id,
|
||||
const GURL& origin,
|
||||
const blink::PlatformNotificationData& notification_data,
|
|
@ -1,21 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:46:17 -0700
|
||||
Subject: out_of_process_instance.patch
|
||||
|
||||
|
||||
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
|
||||
index a33c3391d05bd7cc2346906961baab39d088ca6e..1b8f587dda2f77374b4b01df22a11a03692a3afd 100644
|
||||
--- a/pdf/out_of_process_instance.cc
|
||||
+++ b/pdf/out_of_process_instance.cc
|
||||
@@ -472,7 +472,9 @@ bool OutOfProcessInstance::Init(uint32_t argc,
|
||||
std::string document_url = document_url_var.AsString();
|
||||
base::StringPiece document_url_piece(document_url);
|
||||
is_print_preview_ = IsPrintPreviewUrl(document_url_piece);
|
||||
- if (!document_url_piece.starts_with(kChromeExtension) && !is_print_preview_)
|
||||
+ if (!document_url_piece.starts_with(kChromeExtension) &&
|
||||
+ !document_url_piece.starts_with("chrome://pdf-viewer") &&
|
||||
+ !is_print_preview_)
|
||||
return false;
|
||||
|
||||
// Check if the plugin is full frame. This is passed in from JS.
|
|
@ -1,141 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nitish Sakhawalkar <nitsakh@icloud.com>
|
||||
Date: Fri, 19 Apr 2019 14:01:12 -0700
|
||||
Subject: Partially revert fb4ab3be3fc0024d00358d5b7816d3215a8ff20c
|
||||
|
||||
This change partially reverts the changes made in gin in fb4ab3be3fc0024d00358d5b7816d3215a8ff20c. Electron uses breakpad for windows, while chromium has moved to crashpad. Once electron uses crashpad for windows, we can get rid of this change.
|
||||
|
||||
diff --git a/gin/debug_impl.cc b/gin/debug_impl.cc
|
||||
index ca0577ea4caabce42bb4ec1aad8062b59eaaa8e4..5c3b7ffc932f063c8ad458d92643564edba393dc 100644
|
||||
--- a/gin/debug_impl.cc
|
||||
+++ b/gin/debug_impl.cc
|
||||
@@ -8,6 +8,10 @@ namespace gin {
|
||||
|
||||
namespace {
|
||||
v8::JitCodeEventHandler g_jit_code_event_handler = NULL;
|
||||
+#if defined(OS_WIN)
|
||||
+Debug::CodeRangeCreatedCallback g_code_range_created_callback = NULL;
|
||||
+Debug::CodeRangeDeletedCallback g_code_range_deleted_callback = NULL;
|
||||
+#endif
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
@@ -17,9 +21,13 @@ void Debug::SetJitCodeEventHandler(v8::JitCodeEventHandler event_handler) {
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// static
|
||||
-void Debug::SetUnhandledExceptionCallback(
|
||||
- v8::UnhandledExceptionCallback callback) {
|
||||
- v8::V8::SetUnhandledExceptionCallback(callback);
|
||||
+void Debug::SetCodeRangeCreatedCallback(CodeRangeCreatedCallback callback) {
|
||||
+ g_code_range_created_callback = callback;
|
||||
+}
|
||||
+
|
||||
+// static
|
||||
+void Debug::SetCodeRangeDeletedCallback(CodeRangeDeletedCallback callback) {
|
||||
+ g_code_range_deleted_callback = callback;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -28,4 +36,16 @@ v8::JitCodeEventHandler DebugImpl::GetJitCodeEventHandler() {
|
||||
return g_jit_code_event_handler;
|
||||
}
|
||||
|
||||
+#if defined(OS_WIN)
|
||||
+// static
|
||||
+Debug::CodeRangeCreatedCallback DebugImpl::GetCodeRangeCreatedCallback() {
|
||||
+ return g_code_range_created_callback;
|
||||
+}
|
||||
+
|
||||
+// static
|
||||
+Debug::CodeRangeDeletedCallback DebugImpl::GetCodeRangeDeletedCallback() {
|
||||
+ return g_code_range_deleted_callback;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
} // namespace gin
|
||||
diff --git a/gin/debug_impl.h b/gin/debug_impl.h
|
||||
index b0b7931f3e10592577858f048eab37d4eff4c18f..b88c0b6c0896f60c6421023fe5783b614d596769 100644
|
||||
--- a/gin/debug_impl.h
|
||||
+++ b/gin/debug_impl.h
|
||||
@@ -13,6 +13,10 @@ namespace gin {
|
||||
class DebugImpl {
|
||||
public:
|
||||
static v8::JitCodeEventHandler GetJitCodeEventHandler();
|
||||
+#if defined(OS_WIN)
|
||||
+ static Debug::CodeRangeCreatedCallback GetCodeRangeCreatedCallback();
|
||||
+ static Debug::CodeRangeDeletedCallback GetCodeRangeDeletedCallback();
|
||||
+#endif
|
||||
};
|
||||
|
||||
} // namespace gin
|
||||
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
|
||||
index 4dd48f6a871cccb374c58adacb8ad9a80da89a5a..ec61b873d4e2dcdca833c8503beabb88d0798f2d 100644
|
||||
--- a/gin/isolate_holder.cc
|
||||
+++ b/gin/isolate_holder.cc
|
||||
@@ -91,9 +91,31 @@ IsolateHolder::IsolateHolder(
|
||||
|
||||
isolate_memory_dump_provider_.reset(
|
||||
new V8IsolateMemoryDumpProvider(this, task_runner));
|
||||
+#if defined(OS_WIN)
|
||||
+ {
|
||||
+ void* code_range;
|
||||
+ size_t size;
|
||||
+ isolate_->GetCodeRange(&code_range, &size);
|
||||
+ Debug::CodeRangeCreatedCallback callback =
|
||||
+ DebugImpl::GetCodeRangeCreatedCallback();
|
||||
+ if (code_range && size && callback)
|
||||
+ callback(code_range, size);
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
|
||||
IsolateHolder::~IsolateHolder() {
|
||||
+#if defined(OS_WIN)
|
||||
+ {
|
||||
+ void* code_range;
|
||||
+ size_t size;
|
||||
+ isolate_->GetCodeRange(&code_range, &size);
|
||||
+ Debug::CodeRangeDeletedCallback callback =
|
||||
+ DebugImpl::GetCodeRangeDeletedCallback();
|
||||
+ if (code_range && callback)
|
||||
+ callback(code_range);
|
||||
+ }
|
||||
+#endif
|
||||
isolate_memory_dump_provider_.reset();
|
||||
isolate_data_.reset();
|
||||
isolate_->Dispose();
|
||||
diff --git a/gin/public/debug.h b/gin/public/debug.h
|
||||
index 4e567876f7ac0f010783eded5e57f8b2293542d8..8c2eee341c3bc64331926e258e1fd20080373a80 100644
|
||||
--- a/gin/public/debug.h
|
||||
+++ b/gin/public/debug.h
|
||||
@@ -24,11 +24,25 @@ class GIN_EXPORT Debug {
|
||||
static void SetJitCodeEventHandler(v8::JitCodeEventHandler event_handler);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
- /* Sets a callback that is invoked for exceptions that arise in V8-generated
|
||||
- * code (jitted code or embedded builtins).
|
||||
+ typedef void (__cdecl *CodeRangeCreatedCallback)(void*, size_t);
|
||||
+
|
||||
+ /* Sets a callback that is invoked for every new code range being created.
|
||||
+ *
|
||||
+ * On Win64, exception handling in jitted code is broken due to the fact
|
||||
+ * that JS stack frames are not ABI compliant. It is possible to install
|
||||
+ * custom handlers for the code range which holds the jitted code to work
|
||||
+ * around this issue.
|
||||
+ *
|
||||
+ * https://code.google.com/p/v8/issues/detail?id=3598
|
||||
+ */
|
||||
+ static void SetCodeRangeCreatedCallback(CodeRangeCreatedCallback callback);
|
||||
+
|
||||
+ typedef void (__cdecl *CodeRangeDeletedCallback)(void*);
|
||||
+
|
||||
+ /* Sets a callback that is invoked for every previously registered code range
|
||||
+ * when it is deleted.
|
||||
*/
|
||||
- static void SetUnhandledExceptionCallback(
|
||||
- v8::UnhandledExceptionCallback callback);
|
||||
+ static void SetCodeRangeDeletedCallback(CodeRangeDeletedCallback callback);
|
||||
#endif
|
||||
};
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Fri, 12 Apr 2019 12:47:57 -0700
|
||||
Subject: patch the ensure_gn_version.py script to work on mac CI
|
||||
|
||||
This script is temporary until https://crbug.com/944667 is resolved. We need to
|
||||
patch it because on mac CI, we check out the source code on Linux, which
|
||||
confuses the script.
|
||||
|
||||
diff --git a/buildtools/ensure_gn_version.py b/buildtools/ensure_gn_version.py
|
||||
index 9c01f58b44991cf8b48ef8c68ca17946e73e1c3d..a4618353f722e04ea54f84c6eb1f193d3bb97dee 100755
|
||||
--- a/buildtools/ensure_gn_version.py
|
||||
+++ b/buildtools/ensure_gn_version.py
|
||||
@@ -38,6 +38,11 @@ SRC_DIR = os.path.dirname(BUILDTOOLS_DIR)
|
||||
|
||||
|
||||
def main():
|
||||
+ # NB. on Electron's CI we check out the macOS source on Linux. Bypass this
|
||||
+ # check as it's not relevant on Electron CI and it gets confused.
|
||||
+ if os.environ.get('CI') is not None:
|
||||
+ return 0
|
||||
+
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('version',
|
||||
help='CIPD "git_revision:XYZ" label for GN to sync to')
|
|
@ -1,493 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:48:09 -0700
|
||||
Subject: pepper_flash.patch
|
||||
|
||||
Allows building chrome pepper flash integration for Electron.
|
||||
|
||||
diff --git a/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h b/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h
|
||||
index 735da93c3cabb8c6139971295740ba14a30d1b69..533f53fbc42397608e3762e370cc935c045ce3f1 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h
|
||||
+++ b/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h
|
||||
@@ -5,6 +5,7 @@
|
||||
#ifndef CHROME_BROWSER_RENDERER_HOST_PEPPER_CHROME_BROWSER_PEPPER_HOST_FACTORY_H_
|
||||
#define CHROME_BROWSER_RENDERER_HOST_PEPPER_CHROME_BROWSER_PEPPER_HOST_FACTORY_H_
|
||||
|
||||
+#include "base/component_export.h"
|
||||
#include "base/macros.h"
|
||||
#include "ppapi/host/host_factory.h"
|
||||
|
||||
@@ -12,7 +13,8 @@ namespace content {
|
||||
class BrowserPpapiHost;
|
||||
} // namespace content
|
||||
|
||||
-class ChromeBrowserPepperHostFactory : public ppapi::host::HostFactory {
|
||||
+class COMPONENT_EXPORT(PEPPER_FLASH) ChromeBrowserPepperHostFactory
|
||||
+ : public ppapi::host::HostFactory {
|
||||
public:
|
||||
// Non-owning pointer to the filter must outlive this class.
|
||||
explicit ChromeBrowserPepperHostFactory(content::BrowserPpapiHost* host);
|
||||
diff --git a/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
|
||||
index 83cedb4c9e1323259afd041e571240cd971e1241..3686ae2fab5f400cf119a54aea547a72655c2b0a 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
|
||||
+++ b/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
|
||||
@@ -7,10 +7,12 @@
|
||||
#include <string>
|
||||
|
||||
#include "base/task/post_task.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "components/content_settings/core/browser/host_content_settings_map.h"
|
||||
#include "components/content_settings/core/common/content_settings.h"
|
||||
+#endif
|
||||
#include "content/public/browser/browser_ppapi_host.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
@@ -59,6 +61,7 @@ int32_t PepperBrokerMessageFilter::OnIsAllowed(
|
||||
RenderProcessHost::FromID(render_process_id_);
|
||||
if (!render_process_host)
|
||||
return PP_ERROR_FAILED;
|
||||
+#if 0
|
||||
Profile* profile =
|
||||
Profile::FromBrowserContext(render_process_host->GetBrowserContext());
|
||||
HostContentSettingsMap* content_settings =
|
||||
@@ -70,5 +73,6 @@ int32_t PepperBrokerMessageFilter::OnIsAllowed(
|
||||
std::string());
|
||||
if (setting == CONTENT_SETTING_ALLOW)
|
||||
return PP_OK;
|
||||
- return PP_ERROR_FAILED;
|
||||
+#endif
|
||||
+ return PP_OK;
|
||||
}
|
||||
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
|
||||
index 9d249be9345202f1022f550f73cb8bdd1b327c56..e63ca22a2ebe3f380f6d06ac4f1b1eb8e5ff7e53 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
|
||||
+++ b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
|
||||
@@ -8,9 +8,11 @@
|
||||
#include "base/task/post_task.h"
|
||||
#include "base/time/time.h"
|
||||
#include "build/build_config.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/content_settings/cookie_settings_factory.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "components/content_settings/core/browser/cookie_settings.h"
|
||||
+#endif
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_ppapi_host.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
@@ -43,6 +45,7 @@ using content::ServiceManagerConnection;
|
||||
|
||||
namespace {
|
||||
|
||||
+#if 0
|
||||
// Get the CookieSettings on the UI thread for the given render process ID.
|
||||
scoped_refptr<content_settings::CookieSettings> GetCookieSettings(
|
||||
int render_process_id) {
|
||||
@@ -56,6 +59,7 @@ scoped_refptr<content_settings::CookieSettings> GetCookieSettings(
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
+#endif
|
||||
|
||||
void PepperBindConnectorRequest(
|
||||
service_manager::mojom::ConnectorRequest connector_request) {
|
||||
@@ -73,7 +77,9 @@ PepperFlashBrowserHost::PepperFlashBrowserHost(BrowserPpapiHost* host,
|
||||
PP_Instance instance,
|
||||
PP_Resource resource)
|
||||
: ResourceHost(host->GetPpapiHost(), instance, resource),
|
||||
+#if 0
|
||||
host_(host),
|
||||
+#endif
|
||||
delay_timer_(FROM_HERE, base::TimeDelta::FromSeconds(45), this,
|
||||
&PepperFlashBrowserHost::OnDelayTimerFired),
|
||||
weak_factory_(this) {
|
||||
@@ -125,6 +131,7 @@ int32_t PepperFlashBrowserHost::OnGetLocalTimeZoneOffset(
|
||||
|
||||
int32_t PepperFlashBrowserHost::OnGetLocalDataRestrictions(
|
||||
ppapi::host::HostMessageContext* context) {
|
||||
+#if 0
|
||||
// Getting the Flash LSO settings requires using the CookieSettings which
|
||||
// belong to the profile which lives on the UI thread. We lazily initialize
|
||||
// |cookie_settings_| by grabbing the reference from the UI thread and then
|
||||
@@ -145,9 +152,11 @@ int32_t PepperFlashBrowserHost::OnGetLocalDataRestrictions(
|
||||
context->MakeReplyMessageContext(), document_url,
|
||||
plugin_url));
|
||||
}
|
||||
- return PP_OK_COMPLETIONPENDING;
|
||||
+#endif
|
||||
+ return PP_FLASHLSORESTRICTIONS_IN_MEMORY;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
void PepperFlashBrowserHost::GetLocalDataRestrictions(
|
||||
ppapi::host::ReplyMessageContext reply_context,
|
||||
const GURL& document_url,
|
||||
@@ -176,6 +185,7 @@ void PepperFlashBrowserHost::GetLocalDataRestrictions(
|
||||
PpapiPluginMsg_Flash_GetLocalDataRestrictionsReply(
|
||||
static_cast<int32_t>(restrictions)));
|
||||
}
|
||||
+#endif
|
||||
|
||||
device::mojom::WakeLock* PepperFlashBrowserHost::GetWakeLock() {
|
||||
// Here is a lazy binding, and will not reconnect after connection error.
|
||||
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h
|
||||
index 154120ce5156d77dd302b85cb17e2f14fb69cc2d..5152fd847c012fc2f40017687db426fab955a905 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h
|
||||
+++ b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h
|
||||
@@ -23,9 +23,11 @@ namespace content {
|
||||
class BrowserPpapiHost;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
namespace content_settings {
|
||||
class CookieSettings;
|
||||
}
|
||||
+#endif
|
||||
|
||||
class GURL;
|
||||
|
||||
@@ -49,15 +51,19 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost {
|
||||
const base::Time& t);
|
||||
int32_t OnGetLocalDataRestrictions(ppapi::host::HostMessageContext* context);
|
||||
|
||||
+#if 0
|
||||
void GetLocalDataRestrictions(
|
||||
ppapi::host::ReplyMessageContext reply_context,
|
||||
const GURL& document_url,
|
||||
const GURL& plugin_url,
|
||||
scoped_refptr<content_settings::CookieSettings> cookie_settings);
|
||||
+#endif
|
||||
|
||||
device::mojom::WakeLock* GetWakeLock();
|
||||
|
||||
+#if 0
|
||||
content::BrowserPpapiHost* host_;
|
||||
+#endif
|
||||
int render_process_id_;
|
||||
|
||||
// Requests a wake lock to prevent going to sleep, and a timer to cancel it
|
||||
@@ -65,8 +71,10 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost {
|
||||
device::mojom::WakeLockPtr wake_lock_;
|
||||
base::DelayTimer delay_timer_;
|
||||
|
||||
+#if 0
|
||||
// For fetching the Flash LSO settings.
|
||||
scoped_refptr<content_settings::CookieSettings> cookie_settings_;
|
||||
+#endif
|
||||
base::WeakPtrFactory<PepperFlashBrowserHost> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(PepperFlashBrowserHost);
|
||||
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc
|
||||
index b007195efb9202f2cc8aeeb20821afbf5e8af74d..50b50a5eb48cc4efb71ffa0719bcd1f0363853e1 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc
|
||||
+++ b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "content/public/browser/child_process_security_policy.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/common/pepper_plugin_info.h"
|
||||
+#include "net/base/network_interfaces.h"
|
||||
#include "ppapi/c/pp_errors.h"
|
||||
#include "ppapi/host/dispatch_host_message.h"
|
||||
#include "ppapi/host/host_message_context.h"
|
||||
@@ -128,7 +129,9 @@ PepperFlashDRMHost::PepperFlashDRMHost(BrowserPpapiHost* host,
|
||||
content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(
|
||||
render_process_id, voucher_file);
|
||||
|
||||
+#if 0
|
||||
fetcher_ = new DeviceIDFetcher(render_process_id);
|
||||
+#endif
|
||||
monitor_finder_ = new MonitorFinder(render_process_id, render_frame_id);
|
||||
monitor_finder_->GetMonitor();
|
||||
}
|
||||
@@ -151,12 +154,18 @@ int32_t PepperFlashDRMHost::OnResourceMessageReceived(
|
||||
|
||||
int32_t PepperFlashDRMHost::OnHostMsgGetDeviceID(
|
||||
ppapi::host::HostMessageContext* context) {
|
||||
+#if 0
|
||||
if (!fetcher_->Start(base::Bind(&PepperFlashDRMHost::GotDeviceID,
|
||||
weak_factory_.GetWeakPtr(),
|
||||
context->MakeReplyMessageContext()))) {
|
||||
return PP_ERROR_INPROGRESS;
|
||||
}
|
||||
- return PP_OK_COMPLETIONPENDING;
|
||||
+#endif
|
||||
+ static std::string id;
|
||||
+ if (id.empty())
|
||||
+ id = net::GetHostName();
|
||||
+ context->reply_msg = PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id);
|
||||
+ return PP_OK;
|
||||
}
|
||||
|
||||
int32_t PepperFlashDRMHost::OnHostMsgGetHmonitor(
|
||||
@@ -185,6 +194,7 @@ int32_t PepperFlashDRMHost::OnHostMsgMonitorIsExternal(
|
||||
return PP_OK;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
void PepperFlashDRMHost::GotDeviceID(
|
||||
ppapi::host::ReplyMessageContext reply_context,
|
||||
const std::string& id,
|
||||
@@ -197,3 +207,4 @@ void PepperFlashDRMHost::GotDeviceID(
|
||||
host()->SendReply(reply_context,
|
||||
PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id));
|
||||
}
|
||||
+#endif
|
||||
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h
|
||||
index aa4433cccff4bc637ce5e71039de3c4352e7cd6b..d9630fdf6b87e11fb9657814895dff36b04ccea8 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h
|
||||
+++ b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h
|
||||
@@ -11,7 +11,9 @@
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/renderer_host/pepper/device_id_fetcher.h"
|
||||
+#endif
|
||||
#include "ppapi/host/host_message_context.h"
|
||||
#include "ppapi/host/resource_host.h"
|
||||
|
||||
@@ -49,7 +51,9 @@ class PepperFlashDRMHost : public ppapi::host::ResourceHost {
|
||||
const std::string& id,
|
||||
int32_t result);
|
||||
|
||||
+#if 0
|
||||
scoped_refptr<DeviceIDFetcher> fetcher_;
|
||||
+#endif
|
||||
scoped_refptr<MonitorFinder> monitor_finder_;
|
||||
|
||||
base::WeakPtrFactory<PepperFlashDRMHost> weak_factory_;
|
||||
diff --git a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
|
||||
index 0d083bb09ff17a691c6399d2a5746b44e3196873..2023dc0240220362a1b503da07aa9fab4cb4b434 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
|
||||
+++ b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
|
||||
@@ -8,17 +8,21 @@
|
||||
|
||||
#include "base/stl_util.h"
|
||||
#include "base/task/post_task.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/common/pepper_permission_util.h"
|
||||
+#endif
|
||||
#include "content/public/browser/browser_ppapi_host.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/child_process_security_policy.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
+#if 0
|
||||
#include "extensions/buildflags/buildflags.h"
|
||||
+#endif
|
||||
#include "ppapi/c/pp_errors.h"
|
||||
#include "ppapi/host/dispatch_host_message.h"
|
||||
#include "ppapi/host/host_message_context.h"
|
||||
@@ -27,12 +31,11 @@
|
||||
#include "ppapi/shared_impl/file_system_util.h"
|
||||
#include "storage/browser/fileapi/isolated_context.h"
|
||||
|
||||
-#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
+#if 0
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/extension_set.h"
|
||||
-#endif
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -42,6 +45,7 @@ const char* kPredefinedAllowedCrxFsOrigins[] = {
|
||||
};
|
||||
|
||||
} // namespace
|
||||
+#endif
|
||||
|
||||
// static
|
||||
PepperIsolatedFileSystemMessageFilter*
|
||||
@@ -69,8 +73,10 @@ PepperIsolatedFileSystemMessageFilter::PepperIsolatedFileSystemMessageFilter(
|
||||
profile_directory_(profile_directory),
|
||||
document_url_(document_url),
|
||||
ppapi_host_(ppapi_host) {
|
||||
+#if 0
|
||||
for (size_t i = 0; i < base::size(kPredefinedAllowedCrxFsOrigins); ++i)
|
||||
allowed_crxfs_origins_.insert(kPredefinedAllowedCrxFsOrigins[i]);
|
||||
+#endif
|
||||
}
|
||||
|
||||
PepperIsolatedFileSystemMessageFilter::
|
||||
@@ -96,6 +102,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnResourceMessageReceived(
|
||||
return PP_ERROR_FAILED;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
Profile* PepperIsolatedFileSystemMessageFilter::GetProfile() {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
ProfileManager* profile_manager = g_browser_process->profile_manager();
|
||||
@@ -122,6 +129,7 @@ PepperIsolatedFileSystemMessageFilter::CreateCrxFileSystem(Profile* profile) {
|
||||
return storage::IsolatedContext::ScopedFSHandle();
|
||||
#endif
|
||||
}
|
||||
+#endif
|
||||
|
||||
int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
|
||||
ppapi::host::HostMessageContext* context,
|
||||
@@ -130,7 +138,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
|
||||
case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID:
|
||||
break;
|
||||
case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX:
|
||||
- return OpenCrxFileSystem(context);
|
||||
+ return PP_ERROR_NOTSUPPORTED;
|
||||
case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE:
|
||||
return OpenPluginPrivateFileSystem(context);
|
||||
}
|
||||
@@ -140,6 +148,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
|
||||
return PP_ERROR_FAILED;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
int32_t PepperIsolatedFileSystemMessageFilter::OpenCrxFileSystem(
|
||||
ppapi::host::HostMessageContext* context) {
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
@@ -180,6 +189,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OpenCrxFileSystem(
|
||||
return PP_ERROR_NOTSUPPORTED;
|
||||
#endif
|
||||
}
|
||||
+#endif
|
||||
|
||||
int32_t PepperIsolatedFileSystemMessageFilter::OpenPluginPrivateFileSystem(
|
||||
ppapi::host::HostMessageContext* context) {
|
||||
diff --git a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
|
||||
index 1d5ff1f6aa14812f2a6552f601900b03f3e3c8e7..5b6d0297c874146c21af37b983b2d8ee387b31ce 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
|
||||
+++ b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
|
||||
@@ -20,7 +20,9 @@
|
||||
#include "storage/browser/fileapi/isolated_context.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
+#if 0
|
||||
class Profile;
|
||||
+#endif
|
||||
|
||||
namespace content {
|
||||
class BrowserPpapiHost;
|
||||
@@ -54,6 +56,7 @@ class PepperIsolatedFileSystemMessageFilter
|
||||
|
||||
~PepperIsolatedFileSystemMessageFilter() override;
|
||||
|
||||
+#if 0
|
||||
Profile* GetProfile();
|
||||
|
||||
// Returns filesystem id of isolated filesystem if valid, or empty string
|
||||
@@ -61,10 +64,13 @@ class PepperIsolatedFileSystemMessageFilter
|
||||
// allows access on that thread.
|
||||
storage::IsolatedContext::ScopedFSHandle CreateCrxFileSystem(
|
||||
Profile* profile);
|
||||
+#endif
|
||||
|
||||
int32_t OnOpenFileSystem(ppapi::host::HostMessageContext* context,
|
||||
PP_IsolatedFileSystemType_Private type);
|
||||
+#if 0
|
||||
int32_t OpenCrxFileSystem(ppapi::host::HostMessageContext* context);
|
||||
+#endif
|
||||
int32_t OpenPluginPrivateFileSystem(ppapi::host::HostMessageContext* context);
|
||||
|
||||
const int render_process_id_;
|
||||
@@ -75,8 +81,10 @@ class PepperIsolatedFileSystemMessageFilter
|
||||
// Not owned by this object.
|
||||
ppapi::host::PpapiHost* ppapi_host_;
|
||||
|
||||
+#if 0
|
||||
// Set of origins that can use CrxFs private APIs from NaCl.
|
||||
std::set<std::string> allowed_crxfs_origins_;
|
||||
+#endif
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(PepperIsolatedFileSystemMessageFilter);
|
||||
};
|
||||
diff --git a/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc b/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc
|
||||
index d63e90b6c5079ab3237c4bad3d5e63ce2f99c657..c98a7bd07ddd9527fc67b05b24463ed4b05ec316 100644
|
||||
--- a/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc
|
||||
+++ b/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc
|
||||
@@ -10,8 +10,10 @@
|
||||
#include "chrome/renderer/pepper/pepper_flash_fullscreen_host.h"
|
||||
#include "chrome/renderer/pepper/pepper_flash_menu_host.h"
|
||||
#include "chrome/renderer/pepper/pepper_flash_renderer_host.h"
|
||||
+#if 0
|
||||
#include "chrome/renderer/pepper/pepper_uma_host.h"
|
||||
#include "components/pdf/renderer/pepper_pdf_host.h"
|
||||
+#endif
|
||||
#include "content/public/renderer/renderer_ppapi_host.h"
|
||||
#include "ppapi/host/ppapi_host.h"
|
||||
#include "ppapi/host/resource_host.h"
|
||||
@@ -86,6 +88,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost(
|
||||
}
|
||||
}
|
||||
|
||||
+#if 0
|
||||
if (host_->GetPpapiHost()->permissions().HasPermission(
|
||||
ppapi::PERMISSION_PDF)) {
|
||||
switch (message.type()) {
|
||||
@@ -104,6 +107,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost(
|
||||
return std::make_unique<PepperUMAHost>(host_, instance, resource);
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
diff --git a/chrome/renderer/pepper/pepper_flash_renderer_host.cc b/chrome/renderer/pepper/pepper_flash_renderer_host.cc
|
||||
index 36edbfd997d0dfaa998a4e288caf29af418a28f5..7f4012a4a5b8194a1e44f35f458612099e09fbe4 100644
|
||||
--- a/chrome/renderer/pepper/pepper_flash_renderer_host.cc
|
||||
+++ b/chrome/renderer/pepper/pepper_flash_renderer_host.cc
|
||||
@@ -13,7 +13,9 @@
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/strings/string_util.h"
|
||||
+#if 0
|
||||
#include "components/pdf/renderer/pepper_pdf_host.h"
|
||||
+#endif
|
||||
#include "content/public/renderer/pepper_plugin_instance.h"
|
||||
#include "content/public/renderer/render_thread.h"
|
||||
#include "content/public/renderer/renderer_ppapi_host.h"
|
||||
@@ -133,9 +135,11 @@ bool IsSimpleHeader(const std::string& lower_case_header_name,
|
||||
}
|
||||
|
||||
void RecordFlashNavigateUsage(FlashNavigateUsage usage) {
|
||||
+#if 0
|
||||
DCHECK_NE(FLASH_NAVIGATE_USAGE_ENUM_COUNT, usage);
|
||||
UMA_HISTOGRAM_ENUMERATION(
|
||||
"Plugin.FlashNavigateUsage", usage, FLASH_NAVIGATE_USAGE_ENUM_COUNT);
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -376,6 +380,8 @@ int32_t PepperFlashRendererHost::OnIsRectTopmost(
|
||||
|
||||
int32_t PepperFlashRendererHost::OnInvokePrinting(
|
||||
ppapi::host::HostMessageContext* host_context) {
|
||||
+#if 0
|
||||
pdf::PepperPDFHost::InvokePrintingForInstance(pp_instance());
|
||||
- return PP_OK;
|
||||
+#endif
|
||||
+ return PP_ERROR_FAILED;
|
||||
}
|
||||
diff --git a/chrome/renderer/pepper/pepper_helper.h b/chrome/renderer/pepper/pepper_helper.h
|
||||
index e021c964da3d467530775164a67d5cadaf6dc741..e035f0fb9e2baa6a9148b43765b09c52bc45599b 100644
|
||||
--- a/chrome/renderer/pepper/pepper_helper.h
|
||||
+++ b/chrome/renderer/pepper/pepper_helper.h
|
||||
@@ -6,12 +6,14 @@
|
||||
#define CHROME_RENDERER_PEPPER_PEPPER_HELPER_H_
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
+#include "base/component_export.h"
|
||||
#include "base/macros.h"
|
||||
#include "content/public/renderer/render_frame_observer.h"
|
||||
|
||||
// This class listens for Pepper creation events from the RenderFrame and
|
||||
// attaches the parts required for Chrome-specific plugin support.
|
||||
-class PepperHelper : public content::RenderFrameObserver {
|
||||
+class COMPONENT_EXPORT(PEPPER_FLASH) PepperHelper
|
||||
+ : public content::RenderFrameObserver {
|
||||
public:
|
||||
explicit PepperHelper(content::RenderFrame* render_frame);
|
||||
~PepperHelper() override;
|
|
@ -1,483 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Heilig Benedek <benecene@gmail.com>
|
||||
Date: Thu, 18 Oct 2018 17:08:18 -0700
|
||||
Subject: printing.patch
|
||||
|
||||
Add changeset that was previously applied to sources in chromium_src. The
|
||||
majority of changes originally come from these PRs:
|
||||
* https://github.com/electron/electron/pull/1835
|
||||
* https://github.com/electron/electron/pull/8596
|
||||
|
||||
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
|
||||
index 88a6142eea4c7a219c08fe3463c44711f5c9fada..a1ec557f54cea6e976d357032328f2e10cc30054 100644
|
||||
--- a/chrome/browser/printing/print_job_worker.cc
|
||||
+++ b/chrome/browser/printing/print_job_worker.cc
|
||||
@@ -21,12 +21,12 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/printing/print_job.h"
|
||||
-#include "chrome/grit/generated_resources.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
#include "printing/print_job_constants.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "printing/printing_utils.h"
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
|
||||
index 7ba43aada1ac44827cca264d6f37814e4a91f458..db011ba8370423723ff9d21be30cbf25db1e7537 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.cc
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.cc
|
||||
@@ -27,10 +27,7 @@
|
||||
#include "chrome/browser/printing/print_view_manager_common.h"
|
||||
#include "chrome/browser/printing/printer_query.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
-#include "chrome/browser/ui/simple_message_box.h"
|
||||
-#include "chrome/browser/ui/webui/print_preview/printer_handler.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
-#include "chrome/grit/generated_resources.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "components/printing/browser/print_composite_client.h"
|
||||
#include "components/printing/browser/print_manager_utils.h"
|
||||
@@ -45,6 +42,7 @@
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
#include "mojo/public/cpp/system/buffer.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "printing/metafile_skia.h"
|
||||
@@ -64,6 +62,8 @@ using PrintSettingsCallback =
|
||||
base::OnceCallback<void(scoped_refptr<PrinterQuery>)>;
|
||||
|
||||
void ShowWarningMessageBox(const base::string16& message) {
|
||||
+ LOG(ERROR) << "Invalid printer settings " << message;
|
||||
+#if 0
|
||||
// Runs always on the UI thread.
|
||||
static bool is_dialog_shown = false;
|
||||
if (is_dialog_shown)
|
||||
@@ -72,6 +72,7 @@ void ShowWarningMessageBox(const base::string16& message) {
|
||||
base::AutoReset<bool> auto_reset(&is_dialog_shown, true);
|
||||
|
||||
chrome::ShowWarningMessageBox(nullptr, base::string16(), message);
|
||||
+#endif
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
@@ -109,12 +110,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
queue_(g_browser_process->print_job_manager()->queue()),
|
||||
weak_ptr_factory_(this) {
|
||||
DCHECK(queue_);
|
||||
+#if 0
|
||||
Profile* profile =
|
||||
Profile::FromBrowserContext(web_contents->GetBrowserContext());
|
||||
printing_enabled_.Init(
|
||||
prefs::kPrintingEnabled, profile->GetPrefs(),
|
||||
base::Bind(&PrintViewManagerBase::UpdatePrintingEnabled,
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
+#endif
|
||||
}
|
||||
|
||||
PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -122,12 +125,14 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
DisconnectFromCurrentPrintJob();
|
||||
}
|
||||
|
||||
-bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
+bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh,
|
||||
+ std::unique_ptr<IPC::Message> message,
|
||||
+ CompletionCallback callback) {
|
||||
DisconnectFromCurrentPrintJob();
|
||||
|
||||
SetPrintingRFH(rfh);
|
||||
- int32_t id = rfh->GetRoutingID();
|
||||
- return PrintNowInternal(rfh, std::make_unique<PrintMsg_PrintPages>(id));
|
||||
+ callback_ = std::move(callback);
|
||||
+ return PrintNowInternal(rfh, std::move(message));
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
@@ -242,9 +247,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
|
||||
void PrintViewManagerBase::UpdatePrintingEnabled() {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
// The Unretained() is safe because ForEachFrame() is synchronous.
|
||||
- web_contents()->ForEachFrame(base::BindRepeating(
|
||||
- &PrintViewManagerBase::SendPrintingEnabled, base::Unretained(this),
|
||||
- printing_enabled_.GetValue()));
|
||||
+ web_contents()->ForEachFrame(
|
||||
+ base::BindRepeating(&PrintViewManagerBase::SendPrintingEnabled,
|
||||
+ base::Unretained(this), true));
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::NavigationStopped() {
|
||||
@@ -336,7 +341,7 @@ void PrintViewManagerBase::OnPrintingFailed(int cookie) {
|
||||
PrintManager::OnPrintingFailed(cookie);
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
- ShowPrintErrorDialog();
|
||||
+ // ShowPrintErrorDialog();
|
||||
#endif
|
||||
|
||||
ReleasePrinterQuery();
|
||||
@@ -594,6 +599,9 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
content::RenderFrameHost* rfh = printing_rfh_;
|
||||
printing_rfh_ = nullptr;
|
||||
|
||||
+ if (!callback_.is_null())
|
||||
+ std::move(callback_).Run(printing_succeeded_);
|
||||
+
|
||||
if (!print_job_)
|
||||
return;
|
||||
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
|
||||
index cf074791d0e2e17bbf8cf0b000b8d63e235b7deb..0838041cfe45d26dca65b549452535820191ae44 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.h
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.h
|
||||
@@ -39,6 +39,8 @@ class PrintJob;
|
||||
class PrintQueriesQueue;
|
||||
class PrinterQuery;
|
||||
|
||||
+using CompletionCallback = base::OnceCallback<void(bool)>;
|
||||
+
|
||||
// Base class for managing the print commands for a WebContents.
|
||||
class PrintViewManagerBase : public content::NotificationObserver,
|
||||
public PrintManager {
|
||||
@@ -48,7 +50,9 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
// Prints the current document immediately. Since the rendering is
|
||||
// asynchronous, the actual printing will not be completed on the return of
|
||||
// this function. Returns false if printing is impossible at the moment.
|
||||
- virtual bool PrintNow(content::RenderFrameHost* rfh);
|
||||
+ virtual bool PrintNow(content::RenderFrameHost* rfh,
|
||||
+ std::unique_ptr<IPC::Message> message,
|
||||
+ CompletionCallback callback);
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
// Prints the document in |print_data| with settings specified in
|
||||
@@ -195,6 +199,9 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
// The current RFH that is printing with a system printing dialog.
|
||||
content::RenderFrameHost* printing_rfh_;
|
||||
|
||||
+ // Responded with success of the print job.
|
||||
+ CompletionCallback callback_;
|
||||
+
|
||||
// Indication of success of the print job.
|
||||
bool printing_succeeded_;
|
||||
|
||||
diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc
|
||||
index 1f79e7b127f35e2eaef923af5c4a5f0a7e5250a5..b93d8f59850b59f74271233440d1a3b2d0aded46 100644
|
||||
--- a/chrome/browser/printing/printing_message_filter.cc
|
||||
+++ b/chrome/browser/printing/printing_message_filter.cc
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h"
|
||||
#include "components/printing/browser/print_manager_utils.h"
|
||||
#include "components/printing/common/print_messages.h"
|
||||
+#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
@@ -89,20 +90,23 @@ void PrintingMessageFilter::SetDelegateForTesting(TestDelegate* delegate) {
|
||||
g_test_delegate = delegate;
|
||||
}
|
||||
|
||||
-PrintingMessageFilter::PrintingMessageFilter(int render_process_id,
|
||||
- Profile* profile)
|
||||
+PrintingMessageFilter::PrintingMessageFilter(
|
||||
+ int render_process_id,
|
||||
+ content::BrowserContext* browser_context)
|
||||
: BrowserMessageFilter(PrintMsgStart),
|
||||
render_process_id_(render_process_id),
|
||||
queue_(g_browser_process->print_job_manager()->queue()) {
|
||||
DCHECK(queue_.get());
|
||||
printing_shutdown_notifier_ =
|
||||
PrintingMessageFilterShutdownNotifierFactory::GetInstance()
|
||||
- ->Get(profile)
|
||||
+ ->Get(browser_context)
|
||||
->Subscribe(base::Bind(&PrintingMessageFilter::ShutdownOnUIThread,
|
||||
base::Unretained(this)));
|
||||
+#if 0
|
||||
is_printing_enabled_.Init(prefs::kPrintingEnabled, profile->GetPrefs());
|
||||
is_printing_enabled_.MoveToThread(
|
||||
base::CreateSingleThreadTaskRunnerWithTraits({BrowserThread::IO}));
|
||||
+#endif
|
||||
}
|
||||
|
||||
PrintingMessageFilter::~PrintingMessageFilter() {
|
||||
@@ -138,11 +142,13 @@ bool PrintingMessageFilter::OnMessageReceived(const IPC::Message& message) {
|
||||
void PrintingMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
scoped_refptr<PrinterQuery> printer_query;
|
||||
+#if 0
|
||||
if (!is_printing_enabled_.GetValue()) {
|
||||
// Reply with NULL query.
|
||||
OnGetDefaultPrintSettingsReply(printer_query, reply_msg);
|
||||
return;
|
||||
}
|
||||
+#endif
|
||||
printer_query = queue_->PopPrinterQuery(0);
|
||||
if (!printer_query.get()) {
|
||||
printer_query =
|
||||
@@ -228,11 +234,13 @@ void PrintingMessageFilter::OnUpdatePrintSettings(int document_cookie,
|
||||
base::Value job_settings,
|
||||
IPC::Message* reply_msg) {
|
||||
scoped_refptr<PrinterQuery> printer_query;
|
||||
+#if 0
|
||||
if (!is_printing_enabled_.GetValue()) {
|
||||
// Reply with NULL query.
|
||||
OnUpdatePrintSettingsReply(printer_query, reply_msg);
|
||||
return;
|
||||
}
|
||||
+#endif
|
||||
printer_query = queue_->PopPrinterQuery(document_cookie);
|
||||
if (!printer_query.get()) {
|
||||
printer_query = queue_->CreatePrinterQuery(
|
||||
@@ -295,7 +303,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void PrintingMessageFilter::OnCheckForCancel(const PrintHostMsg_PreviewIds& ids,
|
||||
bool* cancel) {
|
||||
- *cancel = PrintPreviewUI::ShouldCancelRequest(ids);
|
||||
+ *cancel = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
diff --git a/chrome/browser/printing/printing_message_filter.h b/chrome/browser/printing/printing_message_filter.h
|
||||
index 04b76398ebee1bc3aeaf67ecf5b32272d56d5445..1e21ecb5fb903d56c76f338225b6df6fadc933a2 100644
|
||||
--- a/chrome/browser/printing/printing_message_filter.h
|
||||
+++ b/chrome/browser/printing/printing_message_filter.h
|
||||
@@ -24,6 +24,10 @@ struct PrintHostMsg_ScriptedPrint_Params;
|
||||
struct PrintMsg_Print_Params;
|
||||
class Profile;
|
||||
|
||||
+namespace content {
|
||||
+class BrowserContext;
|
||||
+}
|
||||
+
|
||||
namespace printing {
|
||||
|
||||
class PrintQueriesQueue;
|
||||
@@ -44,7 +48,8 @@ class PrintingMessageFilter : public content::BrowserMessageFilter {
|
||||
|
||||
static void SetDelegateForTesting(TestDelegate* delegate);
|
||||
|
||||
- PrintingMessageFilter(int render_process_id, Profile* profile);
|
||||
+ PrintingMessageFilter(int render_process_id,
|
||||
+ content::BrowserContext* browser_context);
|
||||
|
||||
// content::BrowserMessageFilter:
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
diff --git a/components/printing/common/print_messages.h b/components/printing/common/print_messages.h
|
||||
index 1802034a6e15a6ad8b0d9591cfb79ba5873dc982..a827091facdb4f6b1d74ce826c3492ced27c008e 100644
|
||||
--- a/components/printing/common/print_messages.h
|
||||
+++ b/components/printing/common/print_messages.h
|
||||
@@ -368,7 +368,10 @@ IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu)
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
// Tells the RenderFrame to switch the CSS to print media type, renders every
|
||||
// requested pages and switch back the CSS to display media type.
|
||||
-IPC_MESSAGE_ROUTED0(PrintMsg_PrintPages)
|
||||
+IPC_MESSAGE_ROUTED3(PrintMsg_PrintPages,
|
||||
+ bool /* silent print */,
|
||||
+ bool /* print page's background */,
|
||||
+ base::DictionaryValue /* settings */)
|
||||
|
||||
// Like PrintMsg_PrintPages, but using the print preview document's frame/node.
|
||||
IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog)
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index 74f26daa76a22c749007f06a7f4eeeafb8bb297b..5c54aad4e874d723dd4b9e5733449d2af6d9e047 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -1115,7 +1115,9 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
web_frame->DispatchBeforePrintEvent();
|
||||
if (!weak_this)
|
||||
return;
|
||||
- Print(web_frame, blink::WebNode(), PrintRequestType::kScripted);
|
||||
+ Print(web_frame, blink::WebNode(), PrintRequestType::kScripted,
|
||||
+ false /* silent */, false /* print_background */,
|
||||
+ base::DictionaryValue() /* new_settings */);
|
||||
if (weak_this)
|
||||
web_frame->DispatchAfterPrintEvent();
|
||||
}
|
||||
@@ -1163,7 +1165,10 @@ void PrintRenderFrameHelper::OnDestruct() {
|
||||
delete this;
|
||||
}
|
||||
|
||||
-void PrintRenderFrameHelper::OnPrintPages() {
|
||||
+void PrintRenderFrameHelper::OnPrintPages(
|
||||
+ bool silent,
|
||||
+ bool print_background,
|
||||
+ const base::DictionaryValue& settings) {
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
|
||||
@@ -1176,7 +1181,8 @@ void PrintRenderFrameHelper::OnPrintPages() {
|
||||
// If we are printing a PDF extension frame, find the plugin node and print
|
||||
// that instead.
|
||||
auto plugin = delegate_->GetPdfElement(frame);
|
||||
- Print(frame, plugin, PrintRequestType::kRegular);
|
||||
+ Print(frame, plugin, PrintRequestType::kRegular,
|
||||
+ silent, print_background, settings);
|
||||
if (weak_this)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1193,7 +1199,7 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() {
|
||||
}
|
||||
auto weak_this = weak_ptr_factory_.GetWeakPtr();
|
||||
Print(frame, print_preview_context_.source_node(),
|
||||
- PrintRequestType::kRegular);
|
||||
+ PrintRequestType::kRegular, false, false, base::DictionaryValue());
|
||||
if (weak_this)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1229,6 +1235,8 @@ void PrintRenderFrameHelper::OnPrintPreview(
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
|
||||
+ blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
+ print_preview_context_.InitWithFrame(frame);
|
||||
print_preview_context_.OnPrintPreview();
|
||||
|
||||
UMA_HISTOGRAM_ENUMERATION("PrintPreview.PreviewEvent",
|
||||
@@ -1621,7 +1629,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
|
||||
- PrintRequestType::kRegular);
|
||||
+ PrintRequestType::kRegular,
|
||||
+ false /* silent */,
|
||||
+ false /* print_background */,
|
||||
+ base::DictionaryValue() /* new_settings */);
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -1632,7 +1643,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
- PrintRequestType print_request_type) {
|
||||
+ PrintRequestType print_request_type,
|
||||
+ bool silent,
|
||||
+ bool print_background,
|
||||
+ const base::DictionaryValue& settings) {
|
||||
// If still not finished with earlier print request simply ignore.
|
||||
if (prep_frame_view_)
|
||||
return;
|
||||
@@ -1640,7 +1654,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
FrameReference frame_ref(frame);
|
||||
|
||||
int expected_page_count = 0;
|
||||
- if (!CalculateNumberOfPages(frame, node, &expected_page_count)) {
|
||||
+ if (!CalculateNumberOfPages(frame, node, &expected_page_count, settings)) {
|
||||
DidFinishPrinting(FAIL_PRINT_INIT);
|
||||
return; // Failed to init print page settings.
|
||||
}
|
||||
@@ -1660,8 +1674,9 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
|
||||
PrintMsg_PrintPages_Params print_settings;
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
- GetPrintSettingsFromUser(frame_ref.GetFrame(), node, expected_page_count,
|
||||
- print_request_type, &print_settings);
|
||||
+ if (!silent)
|
||||
+ GetPrintSettingsFromUser(frame_ref.GetFrame(), node, expected_page_count,
|
||||
+ print_request_type, &print_settings);
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -1671,6 +1686,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
? blink::kWebPrintScalingOptionSourceSize
|
||||
: scaling_option;
|
||||
SetPrintPagesParams(print_settings);
|
||||
+ print_settings.params.should_print_backgrounds = print_background;
|
||||
if (print_settings.params.dpi.IsEmpty() ||
|
||||
!print_settings.params.document_cookie) {
|
||||
DidFinishPrinting(OK); // Release resources and fail silently on failure.
|
||||
@@ -1859,10 +1875,24 @@ std::vector<int> PrintRenderFrameHelper::GetPrintedPages(
|
||||
return printed_pages;
|
||||
}
|
||||
|
||||
-bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
+bool PrintRenderFrameHelper::InitPrintSettings(
|
||||
+ bool fit_to_paper_size,
|
||||
+ const base::DictionaryValue& new_settings) {
|
||||
PrintMsg_PrintPages_Params settings;
|
||||
- Send(new PrintHostMsg_GetDefaultPrintSettings(routing_id(),
|
||||
- &settings.params));
|
||||
+ if (new_settings.empty()) {
|
||||
+ Send(new PrintHostMsg_GetDefaultPrintSettings(routing_id(),
|
||||
+ &settings.params));
|
||||
+ } else {
|
||||
+ // Send the cookie so that UpdatePrintSettings can reuse PrinterQuery when
|
||||
+ // possible.
|
||||
+ int cookie =
|
||||
+ print_pages_params_ ? print_pages_params_->params.document_cookie : 0;
|
||||
+ bool canceled = false;
|
||||
+ Send(new PrintHostMsg_UpdatePrintSettings(
|
||||
+ routing_id(), cookie, new_settings, &settings, &canceled));
|
||||
+ if (canceled)
|
||||
+ return false;
|
||||
+ }
|
||||
// Check if the printer returned any settings, if the settings is empty, we
|
||||
// can safely assume there are no printer drivers configured. So we safely
|
||||
// terminate.
|
||||
@@ -1882,12 +1912,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
return result;
|
||||
}
|
||||
|
||||
-bool PrintRenderFrameHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
|
||||
- const blink::WebNode& node,
|
||||
- int* number_of_pages) {
|
||||
+bool PrintRenderFrameHelper::CalculateNumberOfPages(
|
||||
+ blink::WebLocalFrame* frame,
|
||||
+ const blink::WebNode& node,
|
||||
+ int* number_of_pages,
|
||||
+ const base::DictionaryValue& settings) {
|
||||
DCHECK(frame);
|
||||
bool fit_to_paper_size = !IsPrintingNodeOrPdfFrame(frame, node);
|
||||
- if (!InitPrintSettings(fit_to_paper_size)) {
|
||||
+ if (!InitPrintSettings(fit_to_paper_size, settings)) {
|
||||
notify_browser_of_print_failure_ = false;
|
||||
Send(new PrintHostMsg_ShowInvalidPrinterSettingsError(routing_id()));
|
||||
return false;
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
|
||||
index 1e2777561ba600f8c11a59c79e3e1f6a4e4e696e..b4df0b89bce2ea7bf3a6ad2f02fb3821417cbb87 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.h
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.h
|
||||
@@ -193,7 +193,9 @@ class PrintRenderFrameHelper
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
// Message handlers ---------------------------------------------------------
|
||||
- void OnPrintPages();
|
||||
+ void OnPrintPages(bool silent,
|
||||
+ bool print_background,
|
||||
+ const base::DictionaryValue& settings);
|
||||
void OnPrintForSystemDialog();
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void OnInitiatePrintPreview(bool has_selection);
|
||||
@@ -243,7 +245,10 @@ class PrintRenderFrameHelper
|
||||
// WARNING: |this| may be gone after this method returns.
|
||||
void Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
- PrintRequestType print_request_type);
|
||||
+ PrintRequestType print_request_type,
|
||||
+ bool silent,
|
||||
+ bool print_background,
|
||||
+ const base::DictionaryValue& settings);
|
||||
|
||||
// Notification when printing is done - signal tear-down/free resources.
|
||||
void DidFinishPrinting(PrintingResult result);
|
||||
@@ -252,12 +257,14 @@ class PrintRenderFrameHelper
|
||||
|
||||
// Initialize print page settings with default settings.
|
||||
// Used only for native printing workflow.
|
||||
- bool InitPrintSettings(bool fit_to_paper_size);
|
||||
+ bool InitPrintSettings(bool fit_to_paper_size,
|
||||
+ const base::DictionaryValue& settings);
|
||||
|
||||
// Calculate number of pages in source document.
|
||||
bool CalculateNumberOfPages(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
- int* number_of_pages);
|
||||
+ int* number_of_pages,
|
||||
+ const base::DictionaryValue& settings);
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
// Set options for print preset from source PDF document.
|
|
@ -1,94 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Thu, 18 Oct 2018 17:07:12 -0700
|
||||
Subject: proxy_config_monitor.patch
|
||||
|
||||
Allow monitoring proxy config changes for a pref service.
|
||||
|
||||
diff --git a/chrome/browser/net/proxy_config_monitor.cc b/chrome/browser/net/proxy_config_monitor.cc
|
||||
index f1e287553244cfd1054c4949ffbb1acdaccbe1e2..94cbca68cedc314d55993375bc48159c9a9bfb3d 100644
|
||||
--- a/chrome/browser/net/proxy_config_monitor.cc
|
||||
+++ b/chrome/browser/net/proxy_config_monitor.cc
|
||||
@@ -10,7 +10,9 @@
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/net/proxy_service_factory.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
+#endif
|
||||
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "mojo/public/cpp/bindings/associated_interface_ptr.h"
|
||||
@@ -19,12 +21,13 @@
|
||||
#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
||||
#endif // defined(OS_CHROMEOS)
|
||||
|
||||
-#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
+#if 0
|
||||
#include "chrome/browser/extensions/api/proxy/proxy_api.h"
|
||||
#endif
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
+#if 0
|
||||
ProxyConfigMonitor::ProxyConfigMonitor(Profile* profile) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
DCHECK(profile);
|
||||
@@ -54,6 +57,7 @@ ProxyConfigMonitor::ProxyConfigMonitor(Profile* profile) {
|
||||
|
||||
proxy_config_service_->AddObserver(this);
|
||||
}
|
||||
+#endif
|
||||
|
||||
ProxyConfigMonitor::ProxyConfigMonitor(PrefService* local_state) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
|
||||
@@ -134,9 +138,11 @@ void ProxyConfigMonitor::OnLazyProxyConfigPoll() {
|
||||
void ProxyConfigMonitor::OnPACScriptError(int32_t line_number,
|
||||
const std::string& details) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
+#if 0
|
||||
extensions::ProxyEventRouter::GetInstance()->OnPACScriptError(
|
||||
g_browser_process->extension_event_router_forwarder(), profile_,
|
||||
line_number, base::UTF8ToUTF16(details));
|
||||
+#endif
|
||||
}
|
||||
|
||||
void ProxyConfigMonitor::OnRequestMaybeFailedDueToProxySettings(
|
||||
@@ -150,9 +156,10 @@ void ProxyConfigMonitor::OnRequestMaybeFailedDueToProxySettings(
|
||||
// controlled.
|
||||
return;
|
||||
}
|
||||
-
|
||||
+#if 0
|
||||
extensions::ProxyEventRouter::GetInstance()->OnProxyError(
|
||||
g_browser_process->extension_event_router_forwarder(), profile_,
|
||||
net_error);
|
||||
+#endif
|
||||
}
|
||||
#endif
|
||||
diff --git a/chrome/browser/net/proxy_config_monitor.h b/chrome/browser/net/proxy_config_monitor.h
|
||||
index 0f20947c7819c3be2086a69f5997412652a99915..a88a1e001a4c1b8d7bafdac74fb060a1ee30361d 100644
|
||||
--- a/chrome/browser/net/proxy_config_monitor.h
|
||||
+++ b/chrome/browser/net/proxy_config_monitor.h
|
||||
@@ -40,11 +40,12 @@ class ProxyConfigMonitor : public net::ProxyConfigService::Observer,
|
||||
|
||||
{
|
||||
public:
|
||||
+#if 0
|
||||
// Creates a ProxyConfigMonitor that gets proxy settings from |profile| and
|
||||
// watches for changes. The created ProxyConfigMonitor must be destroyed
|
||||
// before |profile|.
|
||||
explicit ProxyConfigMonitor(Profile* profile);
|
||||
-
|
||||
+#endif
|
||||
// Creates a ProxyConfigMonitor that gets proxy settings from the
|
||||
// |local_state|, for use with NetworkContexts not
|
||||
// associated with a profile. Must be destroyed before |local_state|.
|
||||
@@ -91,7 +92,6 @@ class ProxyConfigMonitor : public net::ProxyConfigService::Observer,
|
||||
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
mojo::BindingSet<network::mojom::ProxyErrorClient> error_binding_set_;
|
||||
- Profile* profile_ = nullptr;
|
||||
#endif
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ProxyConfigMonitor);
|
|
@ -1,77 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Anonymous <anonymous@electronjs.org>
|
||||
Date: Thu, 20 Sep 2018 17:46:21 -0700
|
||||
Subject: render_widget_host_view_base.patch
|
||||
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
index a2902adc59b6b4083334130f3a8e29fca0c440d2..34673d9ab62311c458a581f98865014f01c4bcc0 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
@@ -660,6 +660,15 @@ viz::FrameSinkId RenderWidgetHostViewBase::FrameSinkIdAtPoint(
|
||||
return frame_sink_id.is_valid() ? frame_sink_id : GetFrameSinkId();
|
||||
}
|
||||
|
||||
+RenderWidgetHostViewBase* RenderWidgetHostViewBase::CreateViewForWidget(
|
||||
+ RenderWidgetHost* render_widget_host,
|
||||
+ RenderWidgetHost* embedder_render_widget_host,
|
||||
+ WebContentsView* web_contents_view) {
|
||||
+ return web_contents_view->CreateViewForWidget(
|
||||
+ render_widget_host,
|
||||
+ !!embedder_render_widget_host);
|
||||
+}
|
||||
+
|
||||
void RenderWidgetHostViewBase::ProcessMouseEvent(
|
||||
const blink::WebMouseEvent& event,
|
||||
const ui::LatencyInfo& latency) {
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
index 903131f45d4fa82af9a6315227505b54ee0f1560..6450a05a4829731d3dc2338fd51ef6d0720b7fcb 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
@@ -24,9 +24,11 @@
|
||||
#include "components/viz/common/surfaces/surface_id.h"
|
||||
#include "components/viz/host/hit_test/hit_test_query.h"
|
||||
#include "content/browser/renderer_host/event_with_latency_info.h"
|
||||
+#include "content/browser/web_contents/web_contents_view.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "content/common/tab_switch_time_recorder.h"
|
||||
#include "content/public/browser/render_frame_metadata_provider.h"
|
||||
+#include "content/public/browser/render_widget_host.h"
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "content/public/common/input_event_ack_state.h"
|
||||
#include "content/public/common/screen_info.h"
|
||||
@@ -75,10 +77,12 @@ class CursorManager;
|
||||
class MouseWheelPhaseHandler;
|
||||
class RenderWidgetHostImpl;
|
||||
class RenderWidgetHostViewBaseObserver;
|
||||
+class RenderWidgetHostViewGuest;
|
||||
class SyntheticGestureTarget;
|
||||
class TextInputManager;
|
||||
class TouchSelectionControllerClientManager;
|
||||
class WebContentsAccessibility;
|
||||
+class WebContentsView;
|
||||
class WebCursor;
|
||||
class DelegatedFrameHost;
|
||||
struct TextInputState;
|
||||
@@ -136,6 +140,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
bool destination_is_loaded,
|
||||
bool destination_is_frozen) final;
|
||||
|
||||
+ virtual void InitAsGuest(RenderWidgetHostView* parent_host_view,
|
||||
+ RenderWidgetHostViewGuest* guest_view) {}
|
||||
+
|
||||
// This only needs to be overridden by RenderWidgetHostViewBase subclasses
|
||||
// that handle content embedded within other RenderWidgetHostViews.
|
||||
gfx::PointF TransformPointToRootCoordSpaceF(
|
||||
@@ -364,6 +371,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
virtual void ProcessGestureEvent(const blink::WebGestureEvent& event,
|
||||
const ui::LatencyInfo& latency);
|
||||
|
||||
+ virtual RenderWidgetHostViewBase* CreateViewForWidget(
|
||||
+ RenderWidgetHost* render_widget_host,
|
||||
+ RenderWidgetHost* embedder_render_widget_host,
|
||||
+ WebContentsView* web_contents_view);
|
||||
+
|
||||
// Transform a point that is in the coordinate space of a Surface that is
|
||||
// embedded within the RenderWidgetHostViewBase's Surface to the
|
||||
// coordinate space of an embedding, or embedded, Surface. Typically this
|
|
@ -1,79 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:46:28 -0700
|
||||
Subject: render_widget_host_view_mac.patch
|
||||
|
||||
|
||||
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
index 188fe917cb4e60458ca0aff4a467d18b2be915ea..62f8697c4a11a0df3be84ef8efe0ff90399e39ff 100644
|
||||
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
@@ -142,6 +142,11 @@ void ExtractUnderlines(NSAttributedString* string,
|
||||
|
||||
} // namespace
|
||||
|
||||
+@interface NSWindow (AtomCustomMethods)
|
||||
+- (BOOL)acceptsFirstMouse;
|
||||
+- (BOOL)disableAutoHideCursor;
|
||||
+@end
|
||||
+
|
||||
// These are not documented, so use only after checking -respondsToSelector:.
|
||||
@interface NSApplication (UndocumentedSpeechMethods)
|
||||
- (void)speakString:(NSString*)string;
|
||||
@@ -403,6 +408,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
|
||||
}
|
||||
|
||||
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
|
||||
+ if ([self.window respondsToSelector:@selector(acceptsFirstMouse)] &&
|
||||
+ [self.window acceptsFirstMouse])
|
||||
+ return YES;
|
||||
return [self acceptsMouseEventsWhenInactive];
|
||||
}
|
||||
|
||||
@@ -792,6 +800,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
|
||||
eventType == NSKeyDown &&
|
||||
!(modifierFlags & NSCommandKeyMask);
|
||||
|
||||
+ if ([theEvent.window respondsToSelector:@selector(disableAutoHideCursor)] &&
|
||||
+ [theEvent.window disableAutoHideCursor])
|
||||
+ shouldAutohideCursor = NO;
|
||||
+
|
||||
// We only handle key down events and just simply forward other events.
|
||||
if (eventType != NSKeyDown) {
|
||||
hostHelper_->ForwardKeyboardEvent(event, latency_info);
|
||||
@@ -1505,9 +1517,11 @@ - (NSAccessibilityRole)accessibilityRole {
|
||||
// Since this implementation doesn't have to wait any IPC calls, this doesn't
|
||||
// make any key-typing jank. --hbono 7/23/09
|
||||
//
|
||||
+#ifndef MAS_BUILD
|
||||
extern "C" {
|
||||
extern NSString* NSTextInputReplacementRangeAttributeName;
|
||||
}
|
||||
+#endif
|
||||
|
||||
- (NSArray*)validAttributesForMarkedText {
|
||||
// This code is just copied from WebKit except renaming variables.
|
||||
@@ -1516,7 +1530,10 @@ - (NSArray*)validAttributesForMarkedText {
|
||||
initWithObjects:NSUnderlineStyleAttributeName,
|
||||
NSUnderlineColorAttributeName,
|
||||
NSMarkedClauseSegmentAttributeName,
|
||||
- NSTextInputReplacementRangeAttributeName, nil]);
|
||||
+#ifndef MAS_BUILD
|
||||
+ NSTextInputReplacementRangeAttributeName,
|
||||
+#endif
|
||||
+ nil]);
|
||||
}
|
||||
return validAttributesForMarkedText_.get();
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
index d450d958e760bd4934f47505d4ff18069f210cfe..a9a043d191e0bc08061879bb3494f3ba1a9bea10 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -62,6 +62,7 @@
|
||||
#include "ui/events/keycodes/dom/dom_keyboard_layout_map.h"
|
||||
#include "ui/gfx/geometry/dip_util.h"
|
||||
#include "ui/gfx/mac/coordinate_conversion.h"
|
||||
+#include "ui/gl/gpu_switching_manager.h"
|
||||
|
||||
using blink::WebInputEvent;
|
||||
using blink::WebMouseEvent;
|
|
@ -1,79 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Thu, 20 Sep 2018 17:48:59 -0700
|
||||
Subject: resource_file_conflict.patch
|
||||
|
||||
Resolve conflict between //chrome's .pak files and //electron's. The paths
|
||||
that chrome code hardcodes require that we generate resources at these
|
||||
paths, but GN throws errors if there are multiple targets that generate the
|
||||
same files.
|
||||
|
||||
This is due to the hardcoded names here:
|
||||
https://chromium.googlesource.com/chromium/src/+/69.0.3497.106/ui/base/resource/resource_bundle.cc#780
|
||||
and here:
|
||||
https://chromium.googlesource.com/chromium/src/+/69.0.3497.106/ui/base/resource/resource_bundle_mac.mm#50
|
||||
|
||||
This isn't needed on Mac because resource files are copied into the app bundle,
|
||||
and are built in `$root_out_dir/electron_repack` (while Chromium's resources
|
||||
target `$root_out_dir/repack`), but on Windows and Linux, the resource files go
|
||||
directly in `$root_out_dir`, and so they conflict.
|
||||
|
||||
We don't actually ever generate Chromium's resource paks, but without this
|
||||
patch, GN refuses to generate the ninja files:
|
||||
|
||||
ERROR at //tools/grit/repack.gni:35:3: Duplicate output file.
|
||||
action(_repack_target_name) {
|
||||
^----------------------------
|
||||
Two or more targets generate the same output:
|
||||
chrome_100_percent.pak
|
||||
|
||||
This is can often be fixed by changing one of the target names, or by
|
||||
setting an output_name on one of them.
|
||||
|
||||
Collisions:
|
||||
//chrome:packed_resources_100_percent
|
||||
//electron:packed_resources_100_percent
|
||||
|
||||
See //tools/grit/repack.gni:35:3: Collision.
|
||||
action(_repack_target_name) {
|
||||
^----------------------------
|
||||
|
||||
Some alternatives to this patch:
|
||||
|
||||
1. Refactor upstream in such a way that the "chrome" pak names were
|
||||
configurable, for instance by adding a method to ResourceBundle::Delegate that
|
||||
LoadChromeResources would check.
|
||||
2. Pass a Delegate that overrides `GetPathForResourcePack`, check for the
|
||||
`chrome_{100,200}_percent.pak` filenames, and rewrite them to
|
||||
`electron_{100,200}_percent.pak`.
|
||||
3. Initialize the resource bundle with DO_NOT_LOAD_COMMON_RESOURCES and load
|
||||
the paks ourselves.
|
||||
|
||||
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
|
||||
|
||||
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
|
||||
index 7b277dc44034b556594bf47736d3ea95e85d2ac2..3d642578ed329b970e23785c09106b4cfdd9445a 100644
|
||||
--- a/chrome/BUILD.gn
|
||||
+++ b/chrome/BUILD.gn
|
||||
@@ -1686,7 +1686,7 @@ if (is_chrome_branded && !is_android) {
|
||||
}
|
||||
}
|
||||
|
||||
-if (!is_android) {
|
||||
+if (!is_android && !is_electron_build) {
|
||||
chrome_paks("packed_resources") {
|
||||
if (is_mac) {
|
||||
output_dir = "$root_gen_dir/repack"
|
||||
@@ -1710,6 +1710,12 @@ if (!is_android) {
|
||||
}
|
||||
}
|
||||
|
||||
+if (is_electron_build) {
|
||||
+ group("packed_resources") {
|
||||
+ public_deps = [ "//electron:packed_resources" ]
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
repack("browser_tests_pak") {
|
||||
sources = [
|
||||
"$root_gen_dir/chrome/webui_test_resources.pak",
|
|
@ -1,22 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Wed, 6 Feb 2019 06:36:32 +0530
|
||||
Subject: Revert "Build swiftshader for ARM32."
|
||||
|
||||
This reverts commit e7caa7ca82fc015675aea8cecf178c83a94ab3a7.
|
||||
|
||||
diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn
|
||||
index a54c5b0f49a1abd48688ef5359892ac4c4b5af16..ad9bf97a1e948f348b04791638cce9e038342ab2 100644
|
||||
--- a/ui/gl/BUILD.gn
|
||||
+++ b/ui/gl/BUILD.gn
|
||||
@@ -15,8 +15,8 @@ declare_args() {
|
||||
enable_swiftshader = (is_win || is_linux || (is_mac && use_egl) ||
|
||||
is_chromeos || is_fuchsia) &&
|
||||
(target_cpu == "x86" || target_cpu == "x64" ||
|
||||
- target_cpu == "arm" || target_cpu == "arm64" ||
|
||||
- target_cpu == "mipsel" || target_cpu == "mips64el")
|
||||
+ target_cpu == "arm64" || target_cpu == "mipsel" ||
|
||||
+ target_cpu == "mips64el")
|
||||
|
||||
# Whether service side logging (actual calls into the GL driver) is enabled
|
||||
# or not.
|
|
@ -1,20 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:49:03 -0700
|
||||
Subject: scroll_bounce_flag.patch
|
||||
|
||||
Patch to make scrollBounce option work.
|
||||
|
||||
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
|
||||
index 0fa36e789411c952bc8b1ccbe6d0164d909ac8f3..5753b9c772541f53b7cec24d0efce63cc9ab8dcc 100644
|
||||
--- a/content/renderer/render_thread_impl.cc
|
||||
+++ b/content/renderer/render_thread_impl.cc
|
||||
@@ -1509,7 +1509,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
|
||||
}
|
||||
|
||||
bool RenderThreadImpl::IsElasticOverscrollEnabled() {
|
||||
- return is_elastic_overscroll_enabled_;
|
||||
+ return base::CommandLine::ForCurrentProcess()->HasSwitch("scroll-bounce");
|
||||
}
|
||||
|
||||
bool RenderThreadImpl::IsUseZoomForDSFEnabled() {
|
|
@ -1,82 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:50:34 -0700
|
||||
Subject: ssl_security_state_tab_helper.patch
|
||||
|
||||
Allows populating security tab info for devtools in Electron.
|
||||
|
||||
diff --git a/chrome/browser/ssl/security_state_tab_helper.cc b/chrome/browser/ssl/security_state_tab_helper.cc
|
||||
index 6ef33c5357cf08c1f17e9f20bd8d659bf4807d1c..a199f0ee15427b4ea45018702048800a21d96fd5 100644
|
||||
--- a/chrome/browser/ssl/security_state_tab_helper.cc
|
||||
+++ b/chrome/browser/ssl/security_state_tab_helper.cc
|
||||
@@ -13,13 +13,17 @@
|
||||
#include "base/strings/pattern.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "build/build_config.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
|
||||
#include "chrome/browser/safe_browsing/ui_manager.h"
|
||||
+#endif
|
||||
#include "chrome/common/secure_origin_whitelist.h"
|
||||
+#if 0
|
||||
#include "components/omnibox/browser/omnibox_field_trial.h"
|
||||
#include "components/omnibox/common/omnibox_features.h"
|
||||
+#endif
|
||||
#include "components/security_state/content/content_utils.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/navigation_entry.h"
|
||||
@@ -42,8 +46,10 @@
|
||||
#endif // defined(OS_CHROMEOS)
|
||||
|
||||
#if defined(FULL_SAFE_BROWSING)
|
||||
+#if 0
|
||||
#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -63,7 +69,9 @@ void RecordSecurityLevel(
|
||||
|
||||
} // namespace
|
||||
|
||||
+#if 0
|
||||
using safe_browsing::SafeBrowsingUIManager;
|
||||
+#endif
|
||||
|
||||
SecurityStateTabHelper::SecurityStateTabHelper(
|
||||
content::WebContents* web_contents)
|
||||
@@ -129,6 +137,7 @@ void SecurityStateTabHelper::DidFinishNavigation(
|
||||
UMA_HISTOGRAM_BOOLEAN("interstitial.ssl.visited_site_after_warning", true);
|
||||
}
|
||||
|
||||
+#if 0
|
||||
// Security indicator UI study (https://crbug.com/803501): Show a message in
|
||||
// the console to reduce developer confusion about the experimental UI
|
||||
// treatments for HTTPS pages with EV certificates.
|
||||
@@ -156,6 +165,7 @@ void SecurityStateTabHelper::DidFinishNavigation(
|
||||
"Validation is still valid.");
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
void SecurityStateTabHelper::DidChangeVisibleSecurityState() {
|
||||
@@ -179,6 +189,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
||||
web_contents()->GetController().GetVisibleEntry();
|
||||
if (!entry)
|
||||
return security_state::MALICIOUS_CONTENT_STATUS_NONE;
|
||||
+#if 0
|
||||
safe_browsing::SafeBrowsingService* sb_service =
|
||||
g_browser_process->safe_browsing_service();
|
||||
if (!sb_service)
|
||||
@@ -246,6 +257,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
||||
break;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
return security_state::MALICIOUS_CONTENT_STATUS_NONE;
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Wed, 28 Nov 2018 13:20:27 -0800
|
||||
Subject: support mixed-sandbox with zygote
|
||||
|
||||
On Linux, Chromium launches all new renderer processes via a "zygote"
|
||||
process which has the sandbox pre-initialized (see
|
||||
//docs/linux_zygote.md). In order to support mixed-sandbox mode, in
|
||||
which some renderers are launched with the sandbox engaged and others
|
||||
without it, we need the option to launch non-sandboxed renderers without
|
||||
going through the zygote.
|
||||
|
||||
Chromium already supports a `--no-zygote` flag, but it turns off the
|
||||
zygote completely, and thus also disables sandboxing. This patch allows
|
||||
the `--no-zygote` flag to affect renderer processes on a case-by-case
|
||||
basis, checking immediately prior to launch whether to go through the
|
||||
zygote or not based on the command-line of the to-be-launched renderer.
|
||||
|
||||
This patch could conceivably be upstreamed, as it does not affect
|
||||
production Chromium (which does not use the `--no-zygote` flag).
|
||||
However, the patch would need to be reviewed by the security team, as it
|
||||
does touch a security-sensitive class.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 515e148c26584b7fc9c3fcd9c266e6a7714ca75d..4b8c6d7b1a2676df8ef63117785c1aed8341d12e 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -416,6 +416,10 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
: public SandboxedProcessLauncherDelegate {
|
||||
public:
|
||||
RendererSandboxedProcessLauncherDelegate() {}
|
||||
+#if BUILDFLAG(USE_ZYGOTE_HANDLE)
|
||||
+ RendererSandboxedProcessLauncherDelegate(bool use_zygote):
|
||||
+ use_zygote_(use_zygote) {}
|
||||
+#endif
|
||||
|
||||
~RendererSandboxedProcessLauncherDelegate() override {}
|
||||
|
||||
@@ -435,6 +439,9 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
|
||||
#if BUILDFLAG(USE_ZYGOTE_HANDLE)
|
||||
service_manager::ZygoteHandle GetZygote() override {
|
||||
+ if (!use_zygote_) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
const base::CommandLine& browser_command_line =
|
||||
*base::CommandLine::ForCurrentProcess();
|
||||
base::CommandLine::StringType renderer_prefix =
|
||||
@@ -448,6 +455,11 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
service_manager::SandboxType GetSandboxType() override {
|
||||
return service_manager::SANDBOX_TYPE_RENDERER;
|
||||
}
|
||||
+
|
||||
+ private:
|
||||
+#if BUILDFLAG(USE_ZYGOTE_HANDLE)
|
||||
+ bool use_zygote_ = true;
|
||||
+#endif
|
||||
};
|
||||
|
||||
const char kSessionStorageHolderKey[] = "kSessionStorageHolderKey";
|
||||
@@ -1728,11 +1740,18 @@ bool RenderProcessHostImpl::Init() {
|
||||
cmd_line->PrependWrapper(renderer_prefix);
|
||||
AppendRendererCommandLine(cmd_line.get());
|
||||
|
||||
+#if BUILDFLAG(USE_ZYGOTE_HANDLE)
|
||||
+ bool use_zygote = !cmd_line->HasSwitch(switches::kNoZygote);
|
||||
+ auto delegate = std::make_unique<RendererSandboxedProcessLauncherDelegate>(use_zygote);
|
||||
+#else
|
||||
+ auto delegate = std::make_unique<RendererSandboxedProcessLauncherDelegate>();
|
||||
+#endif
|
||||
+
|
||||
// Spawn the child process asynchronously to avoid blocking the UI thread.
|
||||
// As long as there's no renderer prefix, we can use the zygote process
|
||||
// at this stage.
|
||||
child_process_launcher_ = std::make_unique<ChildProcessLauncher>(
|
||||
- std::make_unique<RendererSandboxedProcessLauncherDelegate>(),
|
||||
+ std::move(delegate),
|
||||
std::move(cmd_line), GetID(), this, std::move(mojo_invitation_),
|
||||
base::BindRepeating(&RenderProcessHostImpl::OnMojoError, id_));
|
||||
channel_->Pause();
|
|
@ -1,35 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Thu, 18 Oct 2018 17:03:57 -0700
|
||||
Subject: sysroot.patch
|
||||
|
||||
Make chrome's install-sysroot scripts point to our custom sysroot builds,
|
||||
which include extra deps that Electron needs (e.g. libnotify)
|
||||
|
||||
diff --git a/build/linux/sysroot_scripts/install-sysroot.py b/build/linux/sysroot_scripts/install-sysroot.py
|
||||
index 858589ae0a6774d6c34a51e1db1ef852f40ad68d..c4a0ac5c9e16a217634602233bd709af6943470e 100755
|
||||
--- a/build/linux/sysroot_scripts/install-sysroot.py
|
||||
+++ b/build/linux/sysroot_scripts/install-sysroot.py
|
||||
@@ -32,9 +32,11 @@ import sys
|
||||
import urllib2
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
+SRC_DIR = os.path.dirname(os.path.dirname(os.path.dirname(SCRIPT_DIR)))
|
||||
+SYSTOORS_CONFIG_DIR = os.path.join(SRC_DIR, 'electron', 'script')
|
||||
|
||||
-URL_PREFIX = 'https://commondatastorage.googleapis.com'
|
||||
-URL_PATH = 'chrome-linux-sysroot/toolchain'
|
||||
+URL_PREFIX = 'http://s3.amazonaws.com'
|
||||
+URL_PATH = 'gh-contractor-zcbenz/toolchain'
|
||||
|
||||
VALID_ARCHS = ('arm', 'arm64', 'i386', 'amd64', 'mips', 'mips64el')
|
||||
|
||||
@@ -98,7 +100,7 @@ def GetSysrootDict(target_platform, target_arch):
|
||||
if target_arch not in VALID_ARCHS:
|
||||
raise Error('Unknown architecture: %s' % target_arch)
|
||||
|
||||
- sysroots_file = os.path.join(SCRIPT_DIR, 'sysroots.json')
|
||||
+ sysroots_file = os.path.join(SYSTOORS_CONFIG_DIR, 'sysroots.json')
|
||||
sysroots = json.load(open(sysroots_file))
|
||||
sysroot_key = '%s_%s' % (target_platform, target_arch)
|
||||
if sysroot_key not in sysroots:
|
|
@ -1,27 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Anonymous <anonymous@electronjs.org>
|
||||
Date: Thu, 20 Sep 2018 17:46:43 -0700
|
||||
Subject: thread_capabilities.patch
|
||||
|
||||
Chromium automatically drops all capabilities of renderer threads in
|
||||
Linux, which may cause issues in a context like Electron, where the main
|
||||
and renderer threads are supposed to keep inherited permissions over the
|
||||
system.
|
||||
|
||||
See https://github.com/atom/electron/issues/3666
|
||||
|
||||
diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc
|
||||
index 542567f3ee58776a8ca915f1f62dcffa29141798..0f5f017b0ee63bbe7107f39143484bc6d728104e 100644
|
||||
--- a/sandbox/linux/services/credentials.cc
|
||||
+++ b/sandbox/linux/services/credentials.cc
|
||||
@@ -352,8 +352,10 @@ pid_t Credentials::ForkAndDropCapabilitiesInChild() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
// Since we just forked, we are single threaded.
|
||||
PCHECK(DropAllCapabilitiesOnCurrentThread());
|
||||
+#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,173 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Heilig Benedek <benecene@gmail.com>
|
||||
Date: Thu, 18 Oct 2018 17:08:03 -0700
|
||||
Subject: tts.patch
|
||||
|
||||
* Adds patch in //chrome/browser/speech/tts_controller_impl.cc
|
||||
to disable calls using chrome profile class.
|
||||
* Adds patch in //chrome/browser/speech/tts_message_filter.cc
|
||||
to remove reference to browser context when its signaled for
|
||||
destruction from content layer.
|
||||
|
||||
diff --git a/chrome/browser/speech/tts_controller_delegate_impl.cc b/chrome/browser/speech/tts_controller_delegate_impl.cc
|
||||
index e96b0cef21bec8925d4adf1e8692dc00f5ec6f5f..7ec07534aa3628873c9fe784fa0235f3c5c7f15f 100644
|
||||
--- a/chrome/browser/speech/tts_controller_delegate_impl.cc
|
||||
+++ b/chrome/browser/speech/tts_controller_delegate_impl.cc
|
||||
@@ -213,6 +213,7 @@ void TtsControllerDelegateImpl::UpdateUtteranceDefaultsFromPrefs(
|
||||
const PrefService* TtsControllerDelegateImpl::GetPrefService(
|
||||
content::TtsUtterance* utterance) {
|
||||
const PrefService* prefs = nullptr;
|
||||
+#if 0
|
||||
// The utterance->GetBrowserContext() is null in tests.
|
||||
if (utterance->GetBrowserContext()) {
|
||||
const Profile* profile =
|
||||
@@ -220,6 +221,7 @@ const PrefService* TtsControllerDelegateImpl::GetPrefService(
|
||||
if (profile)
|
||||
prefs = profile->GetPrefs();
|
||||
}
|
||||
+#endif
|
||||
return prefs;
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/speech/tts_message_filter.cc b/chrome/browser/speech/tts_message_filter.cc
|
||||
index a7df91b0f6568215313899b577600feaa8c7ba31..8bccd503bb1648ef1ba07b7ff0fded6caaff8a65 100644
|
||||
--- a/chrome/browser/speech/tts_message_filter.cc
|
||||
+++ b/chrome/browser/speech/tts_message_filter.cc
|
||||
@@ -10,8 +10,11 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/task/post_task.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
+#endif
|
||||
#include "chrome/common/tts_messages.h"
|
||||
+#include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
@@ -19,6 +22,29 @@
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
+namespace {
|
||||
+
|
||||
+class TtsMessageFilterShutdownNotifierFactory
|
||||
+ : public BrowserContextKeyedServiceShutdownNotifierFactory {
|
||||
+ public:
|
||||
+ static TtsMessageFilterShutdownNotifierFactory* GetInstance() {
|
||||
+ return base::Singleton<TtsMessageFilterShutdownNotifierFactory>::get();
|
||||
+ }
|
||||
+
|
||||
+ private:
|
||||
+ friend struct base::DefaultSingletonTraits<
|
||||
+ TtsMessageFilterShutdownNotifierFactory>;
|
||||
+
|
||||
+ TtsMessageFilterShutdownNotifierFactory()
|
||||
+ : BrowserContextKeyedServiceShutdownNotifierFactory("TtsMessageFilter") {}
|
||||
+
|
||||
+ ~TtsMessageFilterShutdownNotifierFactory() override {}
|
||||
+
|
||||
+ DISALLOW_COPY_AND_ASSIGN(TtsMessageFilterShutdownNotifierFactory);
|
||||
+};
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
TtsMessageFilter::TtsMessageFilter(content::BrowserContext* browser_context)
|
||||
: BrowserMessageFilter(TtsMsgStart),
|
||||
browser_context_(browser_context),
|
||||
@@ -26,28 +52,27 @@ TtsMessageFilter::TtsMessageFilter(content::BrowserContext* browser_context)
|
||||
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
content::TtsController::GetInstance()->AddVoicesChangedDelegate(this);
|
||||
|
||||
- // TODO(dmazzoni): make it so that we can listen for a BrowserContext
|
||||
- // being destroyed rather than a Profile. http://crbug.com/444668
|
||||
- Profile* profile = Profile::FromBrowserContext(browser_context);
|
||||
- notification_registrar_.Add(this,
|
||||
- chrome::NOTIFICATION_PROFILE_DESTROYED,
|
||||
- content::Source<Profile>(profile));
|
||||
+ browser_context_shutdown_notifier_ =
|
||||
+ TtsMessageFilterShutdownNotifierFactory::GetInstance()
|
||||
+ ->Get(browser_context)
|
||||
+ ->Subscribe(base::Bind(&TtsMessageFilter::BrowserContextDestroyed,
|
||||
+ base::RetainedRef(this)));
|
||||
|
||||
// Balanced in OnChannelClosingInUIThread() to keep the ref-count be non-zero
|
||||
// until all pointers to this class are invalidated.
|
||||
AddRef();
|
||||
}
|
||||
|
||||
-void TtsMessageFilter::OverrideThreadForMessage(
|
||||
- const IPC::Message& message, BrowserThread::ID* thread) {
|
||||
+void TtsMessageFilter::OverrideThreadForMessage(const IPC::Message& message,
|
||||
+ BrowserThread::ID* thread) {
|
||||
switch (message.type()) {
|
||||
- case TtsHostMsg_InitializeVoiceList::ID:
|
||||
- case TtsHostMsg_Speak::ID:
|
||||
- case TtsHostMsg_Pause::ID:
|
||||
- case TtsHostMsg_Resume::ID:
|
||||
- case TtsHostMsg_Cancel::ID:
|
||||
- *thread = BrowserThread::UI;
|
||||
- break;
|
||||
+ case TtsHostMsg_InitializeVoiceList::ID:
|
||||
+ case TtsHostMsg_Speak::ID:
|
||||
+ case TtsHostMsg_Pause::ID:
|
||||
+ case TtsHostMsg_Resume::ID:
|
||||
+ case TtsHostMsg_Cancel::ID:
|
||||
+ *thread = BrowserThread::UI;
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,10 +236,8 @@ void TtsMessageFilter::Cleanup() {
|
||||
content::TtsController::GetInstance()->RemoveUtteranceEventDelegate(this);
|
||||
}
|
||||
|
||||
-void TtsMessageFilter::Observe(
|
||||
- int type,
|
||||
- const content::NotificationSource& source,
|
||||
- const content::NotificationDetails& details) {
|
||||
+void TtsMessageFilter::BrowserContextDestroyed() {
|
||||
+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
browser_context_ = nullptr;
|
||||
- notification_registrar_.RemoveAll();
|
||||
+ browser_context_shutdown_notifier_.reset();
|
||||
}
|
||||
diff --git a/chrome/browser/speech/tts_message_filter.h b/chrome/browser/speech/tts_message_filter.h
|
||||
index ffb607fbb275b0a75dba592f2f5f5afb881214e2..99780e56674af749a231f0e85b89e6a6ed3743d6 100644
|
||||
--- a/chrome/browser/speech/tts_message_filter.h
|
||||
+++ b/chrome/browser/speech/tts_message_filter.h
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
+#include "components/keyed_service/core/keyed_service_shutdown_notifier.h"
|
||||
#include "content/public/browser/browser_message_filter.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_observer.h"
|
||||
@@ -21,7 +22,6 @@ class BrowserContext;
|
||||
struct TtsUtteranceRequest;
|
||||
|
||||
class TtsMessageFilter : public content::BrowserMessageFilter,
|
||||
- public content::NotificationObserver,
|
||||
public content::UtteranceEventDelegate,
|
||||
public content::VoicesChangedDelegate {
|
||||
public:
|
||||
@@ -64,15 +64,13 @@ class TtsMessageFilter : public content::BrowserMessageFilter,
|
||||
// about to be deleted.
|
||||
bool Valid();
|
||||
|
||||
- // content::NotificationObserver implementation.
|
||||
- void Observe(int type,
|
||||
- const content::NotificationSource& source,
|
||||
- const content::NotificationDetails& details) override;
|
||||
+ void BrowserContextDestroyed();
|
||||
|
||||
+ std::unique_ptr<KeyedServiceShutdownNotifier::Subscription>
|
||||
+ browser_context_shutdown_notifier_;
|
||||
content::BrowserContext* browser_context_;
|
||||
mutable base::Lock mutex_;
|
||||
mutable bool valid_;
|
||||
- content::NotificationRegistrar notification_registrar_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TtsMessageFilter);
|
||||
};
|
|
@ -1,20 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Tue, 16 Apr 2019 11:25:08 -0700
|
||||
Subject: unsandboxed ppapi processes skip zygote
|
||||
|
||||
|
||||
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
|
||||
index 37713154ca38166f5abf34f128211e84a9267553..2afb96a4c46d654630c5519b7654b42654a88b5f 100644
|
||||
--- a/content/browser/ppapi_plugin_process_host.cc
|
||||
+++ b/content/browser/ppapi_plugin_process_host.cc
|
||||
@@ -121,6 +121,9 @@ class PpapiPluginSandboxedProcessLauncherDelegate
|
||||
service_manager::ZygoteHandle GetZygote() override {
|
||||
const base::CommandLine& browser_command_line =
|
||||
*base::CommandLine::ForCurrentProcess();
|
||||
+ if (browser_command_line.HasSwitch(service_manager::switches::kNoSandbox)) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
base::CommandLine::StringType plugin_launcher = browser_command_line
|
||||
.GetSwitchValueNative(switches::kPpapiPluginLauncher);
|
||||
if (is_broker_ || !plugin_launcher.empty())
|
|
@ -1,20 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nitish Sakhawalkar <nitsakh@icloud.com>
|
||||
Date: Thu, 20 Sep 2018 17:47:58 -0700
|
||||
Subject: v8_context_snapshot_generator.patch
|
||||
|
||||
v8_context_snapshot_generator is a build time executable.
|
||||
The patch adds the config.
|
||||
|
||||
diff --git a/tools/v8_context_snapshot/BUILD.gn b/tools/v8_context_snapshot/BUILD.gn
|
||||
index 2d7b357cfc2cd60e6e880a8c93b32166376540b5..002e9e67f8009e780182150705417c500a01c5cd 100644
|
||||
--- a/tools/v8_context_snapshot/BUILD.gn
|
||||
+++ b/tools/v8_context_snapshot/BUILD.gn
|
||||
@@ -109,6 +109,7 @@ if (use_v8_context_snapshot) {
|
||||
configs += [
|
||||
"//v8:external_startup_data",
|
||||
":disable_icf",
|
||||
+ "//electron/build/config:build_time_executable"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: John Kleinschmidt <jkleinsc@github.com>
|
||||
Date: Thu, 18 Oct 2018 17:08:28 -0700
|
||||
Subject: verbose_generate_breakpad_symbols.patch
|
||||
|
||||
Temporarily add additional debugging statements to
|
||||
generate_breakpad_symbols.py to determine why it is hanging.
|
||||
|
||||
diff --git a/components/crash/content/tools/generate_breakpad_symbols.py b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
index dce68b1bd1ef58a5dfddb2bbdb56930ed943ad1d..4249d7b26f9037b60a40e073f56037f9ff036138 100755
|
||||
--- a/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
+++ b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
@@ -60,7 +60,10 @@ def Resolve(path, exe_path, loader_path, rpaths):
|
||||
return path
|
||||
|
||||
|
||||
-def GetSharedLibraryDependenciesLinux(binary):
|
||||
+def GetSharedLibraryDependenciesLinux(binary, options):
|
||||
+ if options.verbose:
|
||||
+ print "GetSharedLibraryDependencies for %s" % binary
|
||||
+
|
||||
"""Return absolute paths to all shared library dependencies of the binary.
|
||||
|
||||
This implementation assumes that we're running on a Linux system."""
|
||||
@@ -71,6 +74,9 @@ def GetSharedLibraryDependenciesLinux(binary):
|
||||
m = lib_re.match(line)
|
||||
if m:
|
||||
result.append(os.path.abspath(m.group(1)))
|
||||
+ if options.verbose:
|
||||
+ print "Done GetSharedLibraryDependencies for %s" % binary
|
||||
+ print result
|
||||
return result
|
||||
|
||||
|
||||
@@ -183,7 +189,7 @@ def GetSharedLibraryDependencies(options, binary, exe_path):
|
||||
"""Return absolute paths to all shared library dependencies of the binary."""
|
||||
deps = []
|
||||
if options.platform == 'linux2':
|
||||
- deps = GetSharedLibraryDependenciesLinux(binary)
|
||||
+ deps = GetSharedLibraryDependenciesLinux(binary, options)
|
||||
elif options.platform == 'android':
|
||||
deps = GetSharedLibraryDependenciesAndroid(binary)
|
||||
elif options.platform == 'darwin':
|
||||
@@ -257,7 +263,8 @@ def CreateSymbolDir(options, output_dir):
|
||||
|
||||
def GenerateSymbols(options, binaries):
|
||||
"""Dumps the symbols of binary and places them in the given directory."""
|
||||
-
|
||||
+ if options.verbose:
|
||||
+ print "Generating symbols for %s " % (' '.join(binaries))
|
||||
queue = Queue.Queue()
|
||||
print_lock = threading.Lock()
|
||||
|
||||
@@ -277,8 +284,15 @@ def GenerateSymbols(options, binaries):
|
||||
reason = "Could not locate dump_syms executable."
|
||||
break
|
||||
|
||||
+ if options.verbose:
|
||||
+ with print_lock:
|
||||
+ print "GetBinaryInfoFromHeaderInfo for %s" % (binary)
|
||||
binary_info = GetBinaryInfoFromHeaderInfo(
|
||||
subprocess.check_output([dump_syms, '-i', binary]).splitlines()[0])
|
||||
+ if options.verbose:
|
||||
+ with print_lock:
|
||||
+ print "Done GetBinaryInfoFromHeaderInfo for %s: %s (%s)" % (binary, binary_info.name, binary_info.hash)
|
||||
+
|
||||
if not binary_info:
|
||||
should_dump_syms = False
|
||||
reason = "Could not obtain binary information."
|
||||
@@ -296,8 +310,14 @@ def GenerateSymbols(options, binaries):
|
||||
# See if there is a symbol file already found next to the binary
|
||||
potential_symbol_files = glob.glob('%s.breakpad*' % binary)
|
||||
for potential_symbol_file in potential_symbol_files:
|
||||
+ if options.verbose:
|
||||
+ with print_lock:
|
||||
+ print "Looking at %s as a potential symbol file." % (potential_symbol_file)
|
||||
with open(potential_symbol_file, 'rt') as f:
|
||||
symbol_info = GetBinaryInfoFromHeaderInfo(f.readline())
|
||||
+ if options.verbose:
|
||||
+ with print_lock:
|
||||
+ print "Got symbol_info for %s." % (potential_symbol_file)
|
||||
if symbol_info == binary_info:
|
||||
CreateSymbolDir(options, output_dir)
|
||||
shutil.copyfile(potential_symbol_file, output_path)
|
|
@ -1,121 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Anonymous <anonymous@electronjs.org>
|
||||
Date: Thu, 20 Sep 2018 17:46:53 -0700
|
||||
Subject: web_contents.patch
|
||||
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 9f68ff38beffa5840fc3f037df2d4a71f0cbc36a..f38b9d34f8c29658af6120d5422acb635fd1539c 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -2071,6 +2071,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
std::string unique_name;
|
||||
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
|
||||
|
||||
+ if (params.view && params.delegate_view) {
|
||||
+ view_.reset(params.view);
|
||||
+ render_view_host_delegate_view_ = params.delegate_view;
|
||||
+ }
|
||||
+
|
||||
+ if (!view_) {
|
||||
WebContentsViewDelegate* delegate =
|
||||
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
||||
|
||||
@@ -2086,6 +2092,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
&render_view_host_delegate_view_);
|
||||
}
|
||||
}
|
||||
+ } // !view_
|
||||
CHECK(render_view_host_delegate_view_);
|
||||
CHECK(view_.get());
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_view_guest.cc b/content/browser/web_contents/web_contents_view_guest.cc
|
||||
index ecaf30bcb7b916a92a69641dd7b96a3633d407c0..0af625928ca6227a21cd4263a14a42b72095399c 100644
|
||||
--- a/content/browser/web_contents/web_contents_view_guest.cc
|
||||
+++ b/content/browser/web_contents/web_contents_view_guest.cc
|
||||
@@ -68,19 +68,27 @@ gfx::NativeWindow WebContentsViewGuest::GetTopLevelNativeWindow() const {
|
||||
|
||||
void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) {
|
||||
#if defined(USE_AURA)
|
||||
+ if (!platform_view_->GetNativeView())
|
||||
+ return;
|
||||
// In aura, ScreenPositionClient doesn't work properly if we do
|
||||
// not have the native view associated with this WebContentsViewGuest in the
|
||||
// view hierarchy. We add this view as embedder's child here.
|
||||
// This would go in WebContentsViewGuest::CreateView, but that is too early to
|
||||
// access embedder_web_contents(). Therefore, we do it here.
|
||||
- parent_view->GetNativeView()->AddChild(platform_view_->GetNativeView());
|
||||
+ if (parent_view->GetNativeView() != platform_view_->GetNativeView()) {
|
||||
+ parent_view->GetNativeView()->AddChild(platform_view_->GetNativeView());
|
||||
+ }
|
||||
#endif // defined(USE_AURA)
|
||||
}
|
||||
|
||||
void WebContentsViewGuest::OnGuestDetached(WebContentsView* old_parent_view) {
|
||||
#if defined(USE_AURA)
|
||||
- old_parent_view->GetNativeView()->RemoveChild(
|
||||
- platform_view_->GetNativeView());
|
||||
+ if (!platform_view_->GetNativeView())
|
||||
+ return;
|
||||
+ if (old_parent_view->GetNativeView() != platform_view_->GetNativeView()) {
|
||||
+ old_parent_view->GetNativeView()->RemoveChild(
|
||||
+ platform_view_->GetNativeView());
|
||||
+ }
|
||||
#endif // defined(USE_AURA)
|
||||
}
|
||||
|
||||
@@ -132,11 +140,22 @@ RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget(
|
||||
render_widget_host->GetView());
|
||||
}
|
||||
|
||||
+ RenderWidgetHost* embedder_render_widget_host =
|
||||
+ guest_->embedder_web_contents()->GetRenderViewHost()->GetWidget();
|
||||
+ RenderWidgetHostViewBase* embedder_render_widget_host_view =
|
||||
+ static_cast<RenderWidgetHostViewBase*>(
|
||||
+ embedder_render_widget_host->GetView());
|
||||
RenderWidgetHostViewBase* platform_widget =
|
||||
- platform_view_->CreateViewForWidget(render_widget_host, true);
|
||||
-
|
||||
- return RenderWidgetHostViewGuest::Create(render_widget_host, guest_,
|
||||
- platform_widget->GetWeakPtr());
|
||||
+ embedder_render_widget_host_view->CreateViewForWidget(
|
||||
+ render_widget_host,
|
||||
+ embedder_render_widget_host,
|
||||
+ platform_view_.get());
|
||||
+ RenderWidgetHostViewGuest* guest_view = RenderWidgetHostViewGuest::Create(
|
||||
+ render_widget_host, guest_, platform_widget->GetWeakPtr());
|
||||
+ platform_widget->InitAsGuest(embedder_render_widget_host->GetView(),
|
||||
+ guest_view);
|
||||
+
|
||||
+ return guest_view;
|
||||
}
|
||||
|
||||
RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForChildWidget(
|
||||
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
|
||||
index 6cf2ca2a0ec5d54eeadd7581eaa2acfd83459965..498d8ed92b6ebbf863a26be91258bb9608e6f31e 100644
|
||||
--- a/content/public/browser/web_contents.h
|
||||
+++ b/content/public/browser/web_contents.h
|
||||
@@ -75,9 +75,12 @@ class BrowserPluginGuestDelegate;
|
||||
class InterstitialPage;
|
||||
class RenderFrameHost;
|
||||
class RenderViewHost;
|
||||
+class RenderViewHostDelegateView;
|
||||
class RenderWidgetHost;
|
||||
class RenderWidgetHostView;
|
||||
+class RenderWidgetHostViewBase;
|
||||
class WebContentsDelegate;
|
||||
+class WebContentsView;
|
||||
struct CustomContextMenuContext;
|
||||
struct DropData;
|
||||
struct MHTMLGenerationParams;
|
||||
@@ -213,6 +216,10 @@ class WebContents : public PageNavigator,
|
||||
kInitializeAndWarmupRendererProcess,
|
||||
} desired_renderer_state;
|
||||
|
||||
+ // Optionally specify the view and delegate view.
|
||||
+ content::WebContentsView* view = nullptr;
|
||||
+ content::RenderViewHostDelegateView* delegate_view = nullptr;
|
||||
+
|
||||
// Sandboxing flags set on the new WebContents.
|
||||
blink::WebSandboxFlags starting_sandbox_flags;
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Anonymous <anonymous@electronjs.org>
|
||||
Date: Thu, 20 Sep 2018 17:47:04 -0700
|
||||
Subject: webview_cross_drag.patch
|
||||
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
|
||||
index ee5760ecbe0f836d0e49f53527252a48f4344b03..a413be0448816152f99d234a4e409bf0e9816be7 100644
|
||||
--- a/content/browser/web_contents/web_contents_view_aura.cc
|
||||
+++ b/content/browser/web_contents/web_contents_view_aura.cc
|
||||
@@ -775,6 +775,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const {
|
||||
|
||||
bool WebContentsViewAura::IsValidDragTarget(
|
||||
RenderWidgetHostImpl* target_rwh) const {
|
||||
+ return true;
|
||||
return target_rwh->GetProcess()->GetID() == drag_start_process_id_ ||
|
||||
GetRenderViewHostID(web_contents_->GetRenderViewHost()) !=
|
||||
drag_start_view_id_;
|
||||
diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm
|
||||
index c4638ac6e86d6a816848cdbbdfa3e70d45086d90..18bd2fb8171568745549d490ee93887418890157 100644
|
||||
--- a/content/browser/web_contents/web_drag_dest_mac.mm
|
||||
+++ b/content/browser/web_contents/web_drag_dest_mac.mm
|
||||
@@ -336,6 +336,7 @@ - (void)setDragStartTrackersForProcess:(int)processID {
|
||||
}
|
||||
|
||||
- (bool)isValidDragTarget:(content::RenderWidgetHostImpl*)targetRWH {
|
||||
+ return YES;
|
||||
return targetRWH->GetProcess()->GetID() == dragStartProcessID_ ||
|
||||
GetRenderViewHostID(webContents_->GetRenderViewHost()) !=
|
||||
dragStartViewID_;
|
|
@ -1,30 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Townsend <richard.townsend@arm.com>
|
||||
Date: Mon, 3 Jun 2019 09:52:49 +0100
|
||||
Subject: build: pull in a fixed compiler for Windows on Arm
|
||||
|
||||
Due to a code-generation defect in the version of Clang used for the M76
|
||||
branch related to virtual method thunks, it's necessary to build M76
|
||||
with a later version of Clang. This change pulls in a corrected version
|
||||
by setting ELECTRON_BUILDING_WOA=1 or similar in the environment.
|
||||
|
||||
This PR is only intended to be a temporary workaround and will be
|
||||
removed when Electron's Chromium updates to a compiler unaffected by
|
||||
this issue.
|
||||
|
||||
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
|
||||
index c14a188f16c41002088b2f8451ea3cab7f2ff4e9..b067774bc2c1d833142ff848a9faa5d4bac0b4cd 100755
|
||||
--- a/tools/clang/scripts/update.py
|
||||
+++ b/tools/clang/scripts/update.py
|
||||
@@ -40,6 +40,11 @@ CLANG_REVISION = '67510fac36d27b2e22c7cd955fc167136b737b93'
|
||||
CLANG_SVN_REVISION = '361212'
|
||||
CLANG_SUB_REVISION = 3
|
||||
|
||||
+if os.getenv('ELECTRON_BUILDING_WOA'):
|
||||
+ CLANG_REVISION = '56bee1a90a71876cb5067b108bf5715fa1c4e843'
|
||||
+ CLANG_SVN_REVISION = '361657'
|
||||
+ CLANG_SUB_REVISION = 1
|
||||
+
|
||||
PACKAGE_VERSION = '%s-%s-%s' % (CLANG_SVN_REVISION, CLANG_REVISION[:8],
|
||||
CLANG_SUB_REVISION)
|
||||
RELEASE_VERSION = '9.0.0'
|
|
@ -1,80 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:47:12 -0700
|
||||
Subject: worker_context_will_destroy.patch
|
||||
|
||||
|
||||
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
|
||||
index 31fcd7d89bf8f23d32ad385351d272e81aad36a1..373a76a576e2ccdf604036daadf012c24d409858 100644
|
||||
--- a/content/public/renderer/content_renderer_client.h
|
||||
+++ b/content/public/renderer/content_renderer_client.h
|
||||
@@ -389,6 +389,11 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
virtual void DidInitializeWorkerContextOnWorkerThread(
|
||||
v8::Local<v8::Context> context) {}
|
||||
|
||||
+ // Notifies that a worker context will be destroyed. This function is called
|
||||
+ // from the worker thread.
|
||||
+ virtual void WillDestroyWorkerContextOnWorkerThread(
|
||||
+ v8::Local<v8::Context> context) {}
|
||||
+
|
||||
// Overwrites the given URL to use an HTML5 embed if possible.
|
||||
// An empty URL is returned if the URL is not overriden.
|
||||
virtual GURL OverrideFlashEmbedWithHTML(const GURL& url);
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
|
||||
index 8bdf34b7a2fae5941f986434d2ff39d1f6ab332a..c89bcd9d4ed37c68ec19f0d4976fe64f7ebdbb2b 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.cc
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.cc
|
||||
@@ -953,6 +953,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
|
||||
WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread();
|
||||
}
|
||||
|
||||
+void RendererBlinkPlatformImpl::WorkerContextWillDestroy(
|
||||
+ const v8::Local<v8::Context>& worker) {
|
||||
+ GetContentClient()->renderer()->WillDestroyWorkerContextOnWorkerThread(
|
||||
+ worker);
|
||||
+}
|
||||
+
|
||||
void RendererBlinkPlatformImpl::WorkerContextCreated(
|
||||
const v8::Local<v8::Context>& worker) {
|
||||
GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
|
||||
index a7cc63d04922b00cd2c65283343a9315e86a6bae..5f315876dce8fc0b695c0aa44da9cc54d9ec0fe1 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.h
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.h
|
||||
@@ -188,6 +188,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
void DidStartWorkerThread() override;
|
||||
void WillStopWorkerThread() override;
|
||||
void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
|
||||
+ void WorkerContextWillDestroy(const v8::Local<v8::Context>& worker) override;
|
||||
bool IsExcludedHeaderForServiceWorkerFetchEvent(
|
||||
const blink::WebString& header_name) override;
|
||||
|
||||
diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
|
||||
index 19b78466e66fcaf9a1cc44346e2e47f79381bf36..c2c24e3950d647ecd14585e0ed0277c1f8774290 100644
|
||||
--- a/third_party/blink/public/platform/platform.h
|
||||
+++ b/third_party/blink/public/platform/platform.h
|
||||
@@ -640,6 +640,7 @@ class BLINK_PLATFORM_EXPORT Platform {
|
||||
virtual void DidStartWorkerThread() {}
|
||||
virtual void WillStopWorkerThread() {}
|
||||
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}
|
||||
+ virtual void WorkerContextWillDestroy(const v8::Local<v8::Context>& worker) {}
|
||||
virtual bool AllowScriptExtensionForServiceWorker(
|
||||
const WebSecurityOrigin& script_origin) {
|
||||
return false;
|
||||
diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc
|
||||
index 6c71516b1906fa2cae5440782595af7a2eea8ab7..c150855e51c6623c950c3875a447217ca091ea50 100644
|
||||
--- a/third_party/blink/renderer/core/workers/worker_thread.cc
|
||||
+++ b/third_party/blink/renderer/core/workers/worker_thread.cc
|
||||
@@ -640,6 +640,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
|
||||
nested_runner_->QuitNow();
|
||||
}
|
||||
|
||||
+ {
|
||||
+ v8::HandleScope handle_scope(GetIsolate());
|
||||
+ Platform::Current()->WorkerContextWillDestroy(
|
||||
+ GlobalScope()->ScriptController()->GetContext());
|
||||
+ }
|
||||
+
|
||||
if (WorkerThreadDebugger* debugger = WorkerThreadDebugger::From(GetIsolate()))
|
||||
debugger->WorkerThreadDestroyed(this);
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"src/electron/patches/common/chromium": "src",
|
||||
|
||||
"src/electron/patches/common/boringssl": "src/third_party/boringssl/src",
|
||||
|
||||
"src/electron/patches/common/v8": "src/v8"
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
add_realloc.patch
|
||||
build_gn.patch
|
||||
expose_mksnapshot.patch
|
||||
deps_provide_more_v8_backwards_compatibility.patch
|
||||
dcheck.patch
|
||||
export_symbols_needed_for_windows_build.patch
|
||||
workaround_an_undefined_symbol_error.patch
|
||||
do_not_export_private_v8_symbols_on_windows.patch
|
|
@ -1,27 +0,0 @@
|
|||
### Exporting node's patches to v8
|
||||
|
||||
```
|
||||
$ cd third_party/electron_node
|
||||
$ CURRENT_NODE_VERSION=vX.Y.Z # e.g. v10.11.0
|
||||
|
||||
# Find the last commit with the message "deps: update V8 to <some version>"
|
||||
# This commit corresponds to node resetting V8 to its pristine upstream
|
||||
# state at the stated version.
|
||||
$ LAST_V8_UPDATE="$(git log --grep='^deps: update V8' --format='%H' -1 deps/v8)"
|
||||
|
||||
# This creates a patch file containing all changes in deps/v8 from
|
||||
# $LAST_V8_UPDATE up to the current node version, formatted in a way that
|
||||
# it will apply cleanly to the V8 repository (i.e. with `deps/v8`
|
||||
# stripped off the path and excluding the v8/gypfiles directory, which
|
||||
# isn't present in V8.
|
||||
$ git format-patch \
|
||||
--relative=deps/v8 \
|
||||
$LAST_V8_UPDATE..$CURRENT_NODE_VERSION \
|
||||
deps/v8 \
|
||||
':(exclude)deps/v8/gypfiles' \
|
||||
--stdout
|
||||
```
|
||||
|
||||
When upgrading to a new version of node, make sure to match node's patches to
|
||||
v8 by removing all the `deps_*` patches and re-exporting node's v8 patches
|
||||
using the process above.
|
|
@ -1,46 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Mon, 22 Oct 2018 10:47:11 -0700
|
||||
Subject: add_realloc.patch
|
||||
|
||||
Blink overrides ArrayBuffer's allocator with its own one, while Node simply
|
||||
uses malloc and free, so we need to use v8's allocator in Node. As part of the
|
||||
10.6.0 upgrade, we needed to make SerializerDelegate accept an allocator
|
||||
argument in its constructor, and override ReallocateBufferMemory and
|
||||
FreeBufferMemory to use the allocator. We cannot simply allocate and then memcpy
|
||||
when we override ReallocateBufferMemory, so we therefore need to implement
|
||||
Realloc on the v8 side.
|
||||
|
||||
diff --git a/include/v8.h b/include/v8.h
|
||||
index c54b088404229dccf015e20b6a5bab19d3d94e69..cc603dc4aae69de4b09f06ed0bca48cdae8eebd3 100644
|
||||
--- a/include/v8.h
|
||||
+++ b/include/v8.h
|
||||
@@ -4624,6 +4624,13 @@ class V8_EXPORT ArrayBuffer : public Object {
|
||||
*/
|
||||
virtual void* AllocateUninitialized(size_t length) = 0;
|
||||
|
||||
+ /**
|
||||
+ * Free the memory block of size |length|, pointed to by |data|.
|
||||
+ * That memory must be previously allocated by |Allocate| and not yet freed
|
||||
+ * with a call to |Free| or |Realloc|
|
||||
+ */
|
||||
+ virtual void* Realloc(void* data, size_t length);
|
||||
+
|
||||
/**
|
||||
* Free the memory block of size |length|, pointed to by |data|.
|
||||
* That memory is guaranteed to be previously allocated by |Allocate|.
|
||||
diff --git a/src/api/api.cc b/src/api/api.cc
|
||||
index 9b2c117e1ae756e3c9d3f3b0dc36a7b348c53b51..6a501f67ebf900ee30d55bd05ccc58845d71f418 100644
|
||||
--- a/src/api/api.cc
|
||||
+++ b/src/api/api.cc
|
||||
@@ -515,6 +515,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) {
|
||||
i::V8::SetSnapshotBlob(snapshot_blob);
|
||||
}
|
||||
|
||||
+void* v8::ArrayBuffer::Allocator::Realloc(void* data, size_t length) {
|
||||
+ UNIMPLEMENTED();
|
||||
+}
|
||||
+
|
||||
namespace {
|
||||
|
||||
class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
|
@ -1,37 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Tue, 16 Apr 2019 10:43:04 -0700
|
||||
Subject: build_gn.patch
|
||||
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
index cf089979d1446b7628ce3a7e634e4e4d2267024e..fc4571440d5e7b8af281b01d9a66cd563f5ab03d 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -269,7 +269,7 @@ config("internal_config") {
|
||||
":v8_header_features",
|
||||
]
|
||||
|
||||
- if (is_component_build) {
|
||||
+ if (is_component_build || is_electron_build) {
|
||||
defines += [ "BUILDING_V8_SHARED" ]
|
||||
}
|
||||
}
|
||||
@@ -3788,7 +3788,7 @@ if (current_toolchain == v8_generator_toolchain) {
|
||||
"src/interpreter/bytecodes.h",
|
||||
]
|
||||
|
||||
- configs = [ ":internal_config" ]
|
||||
+ configs = [ ":internal_config_base" ]
|
||||
|
||||
deps = [
|
||||
":v8_libbase",
|
||||
@@ -3819,6 +3819,8 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
|
||||
|
||||
configs = [ ":internal_config" ]
|
||||
|
||||
+ configs += [ "//electron/build/config:build_time_executable" ]
|
||||
+
|
||||
deps = [
|
||||
":v8_base_without_compiler",
|
||||
":v8_compiler_for_mksnapshot",
|
|
@ -1,36 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ales Pergl <alpergl@microsoft.com>
|
||||
Date: Mon, 22 Oct 2018 10:47:12 -0700
|
||||
Subject: dcheck.patch
|
||||
|
||||
|
||||
diff --git a/src/api/api.cc b/src/api/api.cc
|
||||
index 1b39655a1221b3df0012f5cc26697841d2c100d6..a6ea06b358f4ff21b3f4313c82b4ec52ca5513b8 100644
|
||||
--- a/src/api/api.cc
|
||||
+++ b/src/api/api.cc
|
||||
@@ -8236,7 +8236,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) {
|
||||
}
|
||||
|
||||
void Isolate::RunMicrotasks() {
|
||||
- DCHECK_NE(MicrotasksPolicy::kScoped, GetMicrotasksPolicy());
|
||||
+ // DCHECK_NE(MicrotasksPolicy::kScoped, GetMicrotasksPolicy());
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
|
||||
isolate->default_microtask_queue()->RunMicrotasks(isolate);
|
||||
}
|
||||
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
|
||||
index 209832dddc21b3c7ef3ab6d8586572b5eaf5f337..7416eda8db13019d8db54bf1a54a9ae4e15982d1 100644
|
||||
--- a/src/heap/heap.cc
|
||||
+++ b/src/heap/heap.cc
|
||||
@@ -5080,9 +5080,9 @@ void Heap::TearDown() {
|
||||
void Heap::AddGCPrologueCallback(v8::Isolate::GCCallbackWithData callback,
|
||||
GCType gc_type, void* data) {
|
||||
DCHECK_NOT_NULL(callback);
|
||||
- DCHECK(gc_prologue_callbacks_.end() ==
|
||||
- std::find(gc_prologue_callbacks_.begin(), gc_prologue_callbacks_.end(),
|
||||
- GCCallbackTuple(callback, gc_type, data)));
|
||||
+// DCHECK(gc_prologue_callbacks_.end() ==
|
||||
+// std::find(gc_prologue_callbacks_.begin(), gc_prologue_callbacks_.end(),
|
||||
+// GCCallbackTuple(callback, gc_type, data)));
|
||||
gc_prologue_callbacks_.emplace_back(callback, gc_type, data);
|
||||
}
|
||||
|
|
@ -1,346 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Anna Henningsen <anna@addaleax.net>
|
||||
Date: Fri, 28 Sep 2018 22:43:38 -0400
|
||||
Subject: deps: provide more V8 backwards compatibility
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Add back a number deprecated APIs, using shims that
|
||||
should work well enough at least for the duration of Node 11
|
||||
and do not come with significant maintenance overhead.
|
||||
|
||||
Refs: https://github.com/nodejs/node/issues/23122
|
||||
|
||||
PR-URL: https://github.com/nodejs/node/pull/23158
|
||||
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
||||
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
|
||||
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
||||
Reviewed-By: James M Snell <jasnell@gmail.com>
|
||||
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
|
||||
Reviewed-By: Yang Guo <yangguo@chromium.org>
|
||||
Reviewed-By: Michaël Zasso <targos@protonmail.com>
|
||||
|
||||
diff --git a/include/v8.h b/include/v8.h
|
||||
index cc603dc4aae69de4b09f06ed0bca48cdae8eebd3..c59b0fa69880c237e3b60f190160d8b94862bf36 100644
|
||||
--- a/include/v8.h
|
||||
+++ b/include/v8.h
|
||||
@@ -1108,6 +1108,10 @@ class V8_EXPORT PrimitiveArray {
|
||||
public:
|
||||
static Local<PrimitiveArray> New(Isolate* isolate, int length);
|
||||
int Length() const;
|
||||
+ V8_DEPRECATED("Use Isolate* version",
|
||||
+ void Set(int index, Local<Primitive> item));
|
||||
+ V8_DEPRECATED("Use Isolate* version",
|
||||
+ Local<Primitive> Get(int index));
|
||||
void Set(Isolate* isolate, int index, Local<Primitive> item);
|
||||
Local<Primitive> Get(Isolate* isolate, int index);
|
||||
};
|
||||
@@ -1816,6 +1820,8 @@ class V8_EXPORT StackTrace {
|
||||
/**
|
||||
* Returns a StackFrame at a particular index.
|
||||
*/
|
||||
+ V8_DEPRECATED("Use Isolate version",
|
||||
+ Local<StackFrame> GetFrame(uint32_t index) const);
|
||||
Local<StackFrame> GetFrame(Isolate* isolate, uint32_t index) const;
|
||||
|
||||
/**
|
||||
@@ -2509,6 +2515,13 @@ class V8_EXPORT Value : public Data {
|
||||
|
||||
Local<Boolean> ToBoolean(Isolate* isolate) const;
|
||||
|
||||
+ inline V8_DEPRECATED("Use maybe version",
|
||||
+ Local<Boolean> ToBoolean() const);
|
||||
+ inline V8_DEPRECATED("Use maybe version", Local<String> ToString() const);
|
||||
+ inline V8_DEPRECATED("Use maybe version", Local<Object> ToObject() const);
|
||||
+ inline V8_DEPRECATED("Use maybe version",
|
||||
+ Local<Integer> ToInteger() const);
|
||||
+
|
||||
/**
|
||||
* Attempts to convert a string to an array index.
|
||||
* Returns an empty handle if the conversion fails.
|
||||
@@ -2525,7 +2538,14 @@ class V8_EXPORT Value : public Data {
|
||||
Local<Context> context) const;
|
||||
V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
|
||||
|
||||
+ V8_DEPRECATED("Use maybe version", bool BooleanValue() const);
|
||||
+ V8_DEPRECATED("Use maybe version", double NumberValue() const);
|
||||
+ V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
|
||||
+ V8_DEPRECATED("Use maybe version", uint32_t Uint32Value() const);
|
||||
+ V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
|
||||
+
|
||||
/** JS == */
|
||||
+ V8_DEPRECATED("Use maybe version", bool Equals(Local<Value> that) const);
|
||||
V8_WARN_UNUSED_RESULT Maybe<bool> Equals(Local<Context> context,
|
||||
Local<Value> that) const;
|
||||
bool StrictEquals(Local<Value> that) const;
|
||||
@@ -2632,6 +2652,8 @@ class V8_EXPORT String : public Name {
|
||||
* Returns the number of bytes in the UTF-8 encoded
|
||||
* representation of this string.
|
||||
*/
|
||||
+ V8_DEPRECATED("Use Isolate version instead", int Utf8Length() const);
|
||||
+
|
||||
int Utf8Length(Isolate* isolate) const;
|
||||
|
||||
/**
|
||||
@@ -2688,12 +2710,23 @@ class V8_EXPORT String : public Name {
|
||||
// 16-bit character codes.
|
||||
int Write(Isolate* isolate, uint16_t* buffer, int start = 0, int length = -1,
|
||||
int options = NO_OPTIONS) const;
|
||||
+ V8_DEPRECATED("Use Isolate* version",
|
||||
+ int Write(uint16_t* buffer, int start = 0, int length = -1,
|
||||
+ int options = NO_OPTIONS) const);
|
||||
// One byte characters.
|
||||
int WriteOneByte(Isolate* isolate, uint8_t* buffer, int start = 0,
|
||||
int length = -1, int options = NO_OPTIONS) const;
|
||||
+ V8_DEPRECATED("Use Isolate* version",
|
||||
+ int WriteOneByte(uint8_t* buffer, int start = 0,
|
||||
+ int length = -1, int options = NO_OPTIONS)
|
||||
+ const);
|
||||
// UTF-8 encoded characters.
|
||||
int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
|
||||
int* nchars_ref = nullptr, int options = NO_OPTIONS) const;
|
||||
+ V8_DEPRECATED("Use Isolate* version",
|
||||
+ int WriteUtf8(char* buffer, int length = -1,
|
||||
+ int* nchars_ref = nullptr,
|
||||
+ int options = NO_OPTIONS) const);
|
||||
|
||||
/**
|
||||
* A zero length string.
|
||||
@@ -2861,6 +2894,9 @@ class V8_EXPORT String : public Name {
|
||||
*/
|
||||
static Local<String> Concat(Isolate* isolate, Local<String> left,
|
||||
Local<String> right);
|
||||
+ static V8_DEPRECATED("Use Isolate* version",
|
||||
+ Local<String> Concat(Local<String> left,
|
||||
+ Local<String> right));
|
||||
|
||||
/**
|
||||
* Creates a new external string using the data defined in the given
|
||||
@@ -2925,6 +2961,8 @@ class V8_EXPORT String : public Name {
|
||||
*/
|
||||
class V8_EXPORT Utf8Value {
|
||||
public:
|
||||
+ V8_DEPRECATED("Use Isolate version",
|
||||
+ explicit Utf8Value(Local<v8::Value> obj));
|
||||
Utf8Value(Isolate* isolate, Local<v8::Value> obj);
|
||||
~Utf8Value();
|
||||
char* operator*() { return str_; }
|
||||
@@ -2948,6 +2986,7 @@ class V8_EXPORT String : public Name {
|
||||
*/
|
||||
class V8_EXPORT Value {
|
||||
public:
|
||||
+ V8_DEPRECATED("Use Isolate version", explicit Value(Local<v8::Value> obj));
|
||||
Value(Isolate* isolate, Local<v8::Value> obj);
|
||||
~Value();
|
||||
uint16_t* operator*() { return str_; }
|
||||
@@ -5281,6 +5320,8 @@ class V8_EXPORT BooleanObject : public Object {
|
||||
class V8_EXPORT StringObject : public Object {
|
||||
public:
|
||||
static Local<Value> New(Isolate* isolate, Local<String> value);
|
||||
+ V8_DEPRECATED("Use Isolate* version",
|
||||
+ static Local<Value> New(Local<String> value));
|
||||
|
||||
Local<String> ValueOf() const;
|
||||
|
||||
@@ -10384,6 +10425,29 @@ template <class T> Value* Value::Cast(T* value) {
|
||||
}
|
||||
|
||||
|
||||
+Local<Boolean> Value::ToBoolean() const {
|
||||
+ return ToBoolean(Isolate::GetCurrent());
|
||||
+}
|
||||
+
|
||||
+
|
||||
+Local<String> Value::ToString() const {
|
||||
+ return ToString(Isolate::GetCurrent()->GetCurrentContext())
|
||||
+ .FromMaybe(Local<String>());
|
||||
+}
|
||||
+
|
||||
+
|
||||
+Local<Object> Value::ToObject() const {
|
||||
+ return ToObject(Isolate::GetCurrent()->GetCurrentContext())
|
||||
+ .FromMaybe(Local<Object>());
|
||||
+}
|
||||
+
|
||||
+
|
||||
+Local<Integer> Value::ToInteger() const {
|
||||
+ return ToInteger(Isolate::GetCurrent()->GetCurrentContext())
|
||||
+ .FromMaybe(Local<Integer>());
|
||||
+}
|
||||
+
|
||||
+
|
||||
Boolean* Boolean::Cast(v8::Value* value) {
|
||||
#ifdef V8_ENABLE_CHECKS
|
||||
CheckCast(value);
|
||||
diff --git a/src/api/api.cc b/src/api/api.cc
|
||||
index 6a501f67ebf900ee30d55bd05ccc58845d71f418..1b39655a1221b3df0012f5cc26697841d2c100d6 100644
|
||||
--- a/src/api/api.cc
|
||||
+++ b/src/api/api.cc
|
||||
@@ -2171,6 +2171,10 @@ int PrimitiveArray::Length() const {
|
||||
return array->length();
|
||||
}
|
||||
|
||||
+void PrimitiveArray::Set(int index, Local<Primitive> item) {
|
||||
+ return Set(Isolate::GetCurrent(), index, item);
|
||||
+}
|
||||
+
|
||||
void PrimitiveArray::Set(Isolate* v8_isolate, int index,
|
||||
Local<Primitive> item) {
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
||||
@@ -2184,6 +2188,10 @@ void PrimitiveArray::Set(Isolate* v8_isolate, int index,
|
||||
array->set(index, *i_item);
|
||||
}
|
||||
|
||||
+Local<Primitive> PrimitiveArray::Get(int index) {
|
||||
+ return Get(Isolate::GetCurrent(), index);
|
||||
+}
|
||||
+
|
||||
Local<Primitive> PrimitiveArray::Get(Isolate* v8_isolate, int index) {
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
||||
i::Handle<i::FixedArray> array = Utils::OpenHandle(this);
|
||||
@@ -2867,6 +2875,10 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) {
|
||||
|
||||
// --- S t a c k T r a c e ---
|
||||
|
||||
+Local<StackFrame> StackTrace::GetFrame(uint32_t index) const {
|
||||
+ return GetFrame(Isolate::GetCurrent(), index);
|
||||
+}
|
||||
+
|
||||
Local<StackFrame> StackTrace::GetFrame(Isolate* v8_isolate,
|
||||
uint32_t index) const {
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
||||
@@ -3453,6 +3465,34 @@ MaybeLocal<BigInt> Value::ToBigInt(Local<Context> context) const {
|
||||
RETURN_ESCAPED(result);
|
||||
}
|
||||
|
||||
+bool Value::BooleanValue() const {
|
||||
+ return BooleanValue(Isolate::GetCurrent());
|
||||
+}
|
||||
+
|
||||
+
|
||||
+double Value::NumberValue() const {
|
||||
+ return NumberValue(Isolate::GetCurrent()->GetCurrentContext())
|
||||
+ .FromMaybe(std::numeric_limits<double>::quiet_NaN());
|
||||
+}
|
||||
+
|
||||
+
|
||||
+int64_t Value::IntegerValue() const {
|
||||
+ return NumberValue(Isolate::GetCurrent()->GetCurrentContext())
|
||||
+ .FromMaybe(0);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+uint32_t Value::Uint32Value() const {
|
||||
+ return Uint32Value(Isolate::GetCurrent()->GetCurrentContext())
|
||||
+ .FromMaybe(0);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+int32_t Value::Int32Value() const {
|
||||
+ return Int32Value(Isolate::GetCurrent()->GetCurrentContext())
|
||||
+ .FromMaybe(0);
|
||||
+}
|
||||
+
|
||||
bool Value::BooleanValue(Isolate* v8_isolate) const {
|
||||
return Utils::OpenHandle(this)->BooleanValue(
|
||||
reinterpret_cast<i::Isolate*>(v8_isolate));
|
||||
@@ -3801,6 +3841,11 @@ MaybeLocal<Uint32> Value::ToArrayIndex(Local<Context> context) const {
|
||||
return Local<Uint32>();
|
||||
}
|
||||
|
||||
+bool Value::Equals(Local<Value> that) const {
|
||||
+ return Equals(Isolate::GetCurrent()->GetCurrentContext(), that)
|
||||
+ .FromMaybe(false);
|
||||
+}
|
||||
+
|
||||
Maybe<bool> Value::Equals(Local<Context> context, Local<Value> that) const {
|
||||
i::Isolate* isolate = Utils::OpenHandle(*context)->GetIsolate();
|
||||
auto self = Utils::OpenHandle(this);
|
||||
@@ -5033,6 +5078,10 @@ bool String::ContainsOnlyOneByte() const {
|
||||
return helper.Check(*str);
|
||||
}
|
||||
|
||||
+int String::Utf8Length() const {
|
||||
+ return Utf8Length(Isolate::GetCurrent());
|
||||
+}
|
||||
+
|
||||
int String::Utf8Length(Isolate* isolate) const {
|
||||
i::Handle<i::String> str = Utils::OpenHandle(this);
|
||||
str = i::String::Flatten(reinterpret_cast<i::Isolate*>(isolate), str);
|
||||
@@ -5185,6 +5234,14 @@ static int WriteUtf8Impl(i::Vector<const Char> string, char* write_start,
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
||||
+
|
||||
+int String::WriteUtf8(char* buffer, int capacity,
|
||||
+ int* nchars_ref, int options) const {
|
||||
+ return WriteUtf8(Isolate::GetCurrent(),
|
||||
+ buffer, capacity, nchars_ref, options);
|
||||
+}
|
||||
+
|
||||
+
|
||||
int String::WriteUtf8(Isolate* v8_isolate, char* buffer, int capacity,
|
||||
int* nchars_ref, int options) const {
|
||||
i::Handle<i::String> str = Utils::OpenHandle(this);
|
||||
@@ -5223,6 +5280,17 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string,
|
||||
return end - start;
|
||||
}
|
||||
|
||||
+int String::WriteOneByte(uint8_t* buffer, int start,
|
||||
+ int length, int options) const {
|
||||
+ return WriteOneByte(Isolate::GetCurrent(), buffer, start, length, options);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+int String::Write(uint16_t* buffer, int start, int length,
|
||||
+ int options) const {
|
||||
+ return Write(Isolate::GetCurrent(), buffer, start, length, options);
|
||||
+}
|
||||
+
|
||||
int String::WriteOneByte(Isolate* isolate, uint8_t* buffer, int start,
|
||||
int length, int options) const {
|
||||
return WriteHelper(reinterpret_cast<i::Isolate*>(isolate), this, buffer,
|
||||
@@ -6132,6 +6200,11 @@ MaybeLocal<String> String::NewFromTwoByte(Isolate* isolate,
|
||||
return result;
|
||||
}
|
||||
|
||||
+Local<String> v8::String::Concat(Local<String> left,
|
||||
+ Local<String> right) {
|
||||
+ return Concat(Isolate::GetCurrent(), left, right);
|
||||
+}
|
||||
+
|
||||
Local<String> v8::String::Concat(Isolate* v8_isolate, Local<String> left,
|
||||
Local<String> right) {
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
||||
@@ -6401,6 +6474,10 @@ bool v8::BooleanObject::ValueOf() const {
|
||||
return jsvalue->value().IsTrue(isolate);
|
||||
}
|
||||
|
||||
+Local<v8::Value> v8::StringObject::New(Local<String> value) {
|
||||
+ return New(Isolate::GetCurrent(), value);
|
||||
+}
|
||||
+
|
||||
Local<v8::Value> v8::StringObject::New(Isolate* v8_isolate,
|
||||
Local<String> value) {
|
||||
i::Handle<i::String> string = Utils::OpenHandle(*value);
|
||||
@@ -8589,6 +8666,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8_isolate) {
|
||||
return microtask_queue->IsRunningMicrotasks();
|
||||
}
|
||||
|
||||
+String::Utf8Value::Utf8Value(v8::Local<v8::Value> obj)
|
||||
+ : Utf8Value(Isolate::GetCurrent(), obj) {}
|
||||
+
|
||||
String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
|
||||
: str_(nullptr), length_(0) {
|
||||
if (obj.IsEmpty()) return;
|
||||
@@ -8606,6 +8686,9 @@ String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
|
||||
|
||||
String::Utf8Value::~Utf8Value() { i::DeleteArray(str_); }
|
||||
|
||||
+String::Value::Value(v8::Local<v8::Value> obj)
|
||||
+ : Value(Isolate::GetCurrent(), obj) {}
|
||||
+
|
||||
String::Value::Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
|
||||
: str_(nullptr), length_(0) {
|
||||
if (obj.IsEmpty()) return;
|
|
@ -1,52 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Rycl <torycl@microsoft.com>
|
||||
Date: Mon, 13 May 2019 15:48:48 +0200
|
||||
Subject: Do not export private V8 symbols on Windows
|
||||
|
||||
This change stops private V8 symbols and internal crt methods being exported.
|
||||
It fixes an issue where native node modules can import
|
||||
incorrect CRT methods and crash on Windows.
|
||||
It also reduces size of node.lib by 75%.
|
||||
|
||||
This patch can be safely removed if, when it is removed, `node.lib` does not
|
||||
contain any standard C++ library exports (e.g. `std::ostringstream`).
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
index 315c7079ed488461a456aff799b4d1f17b896150..0f668eae73686c02a7133df31a79e8a0a7b77707 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -273,6 +273,10 @@ config("internal_config") {
|
||||
":v8_header_features",
|
||||
]
|
||||
|
||||
+ if (!is_component_build && is_electron_build) {
|
||||
+ defines += [ "HIDE_PRIVATE_SYMBOLS" ]
|
||||
+ }
|
||||
+
|
||||
if (is_component_build || is_electron_build) {
|
||||
defines += [ "BUILDING_V8_SHARED" ]
|
||||
}
|
||||
diff --git a/src/base/macros.h b/src/base/macros.h
|
||||
index ad70e9820ddb4a63639ca7738c1836cb87766db5..d40be9b57294583f74594d88d9b7d7b937b2db3c 100644
|
||||
--- a/src/base/macros.h
|
||||
+++ b/src/base/macros.h
|
||||
@@ -414,13 +414,17 @@ bool is_inbounds(float_t v) {
|
||||
#ifdef V8_OS_WIN
|
||||
|
||||
// Setup for Windows shared library export.
|
||||
+#if defined(HIDE_PRIVATE_SYMBOLS)
|
||||
+#define V8_EXPORT_PRIVATE
|
||||
+#else //if !defined(HIDE_PRIVATE_SYMBOLS)
|
||||
#ifdef BUILDING_V8_SHARED
|
||||
#define V8_EXPORT_PRIVATE __declspec(dllexport)
|
||||
#elif USING_V8_SHARED
|
||||
#define V8_EXPORT_PRIVATE __declspec(dllimport)
|
||||
-#else
|
||||
+#else //!(BUILDING_V8_SHARED || USING_V8_SHARED)
|
||||
#define V8_EXPORT_PRIVATE
|
||||
-#endif // BUILDING_V8_SHARED
|
||||
+#endif
|
||||
+#endif
|
||||
|
||||
#else // V8_OS_WIN
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <jeremya@chromium.org>
|
||||
Date: Mon, 15 Apr 2019 18:12:08 -0700
|
||||
Subject: Export symbols needed for Windows build
|
||||
|
||||
These symbols are required to build v8 with BUILD_V8_SHARED on Windows.
|
||||
|
||||
diff --git a/src/objects/objects.h b/src/objects/objects.h
|
||||
index 857f3ed0f6d537cd648f23f04a0ab4c28cce1f96..14c73a0425b4e1e677426eee929910add5615201 100644
|
||||
--- a/src/objects/objects.h
|
||||
+++ b/src/objects/objects.h
|
||||
@@ -791,7 +791,7 @@ enum class KeyCollectionMode {
|
||||
// Utility superclass for stack-allocated objects that must be updated
|
||||
// on gc. It provides two ways for the gc to update instances, either
|
||||
// iterating or updating after gc.
|
||||
-class Relocatable {
|
||||
+class V8_EXPORT_PRIVATE Relocatable {
|
||||
public:
|
||||
explicit inline Relocatable(Isolate* isolate);
|
||||
inline virtual ~Relocatable();
|
||||
diff --git a/src/objects/ordered-hash-table.h b/src/objects/ordered-hash-table.h
|
||||
index a83109ed90fa4544939c3825c3a78856f41128a6..06459f407fb99218490a132bd1c5df859cbf2b3c 100644
|
||||
--- a/src/objects/ordered-hash-table.h
|
||||
+++ b/src/objects/ordered-hash-table.h
|
||||
@@ -60,7 +60,7 @@ namespace internal {
|
||||
// of the removed holes.
|
||||
// [kPrefixSize + 3 + NumberOfRemovedHoles()..length]: Not used
|
||||
template <class Derived, int entrysize>
|
||||
-class OrderedHashTable : public FixedArray {
|
||||
+class V8_EXPORT_PRIVATE OrderedHashTable : public FixedArray {
|
||||
public:
|
||||
// Returns an OrderedHashTable (possibly |table|) with enough space
|
||||
// to add at least one new element.
|
|
@ -1,20 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Mon, 22 Oct 2018 10:47:13 -0700
|
||||
Subject: expose_mksnapshot.patch
|
||||
|
||||
Needed in order to target mksnapshot for mksnapshot zip.
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
index fc4571440d5e7b8af281b01d9a66cd563f5ab03d..2d35a0b051f4130485c783807132ddcc543f4de4 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -3799,8 +3799,6 @@ if (current_toolchain == v8_generator_toolchain) {
|
||||
|
||||
if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
|
||||
v8_executable("mksnapshot") {
|
||||
- visibility = [ ":*" ] # Only targets in this file can depend on this.
|
||||
-
|
||||
sources = [
|
||||
"src/snapshot/embedded/embedded-file-writer.cc",
|
||||
"src/snapshot/embedded/embedded-file-writer.h",
|
|
@ -1,75 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Townsend <richard.townsend@arm.com>
|
||||
Date: Wed, 24 Apr 2019 13:57:36 +0100
|
||||
Subject: Workaround an undefined symbol error
|
||||
|
||||
Previously, builds configured with dcheck_always_on=true would error
|
||||
with messages like this in the log:
|
||||
lld-link: error: undefined symbol: public: bool __cdecl
|
||||
v8::internal::CPURegister::IsZero(void) const
|
||||
|
||||
By moving some functions out of the the arm64-assembler header file,
|
||||
this error no longer seems to happen.
|
||||
|
||||
diff --git a/src/codegen/arm64/assembler-arm64.cc b/src/codegen/arm64/assembler-arm64.cc
|
||||
index 1806f82b461a5f7368281bcd3741fd8195a20f11..53da75760ba31bed3e3cf19397474b353bc83fdf 100644
|
||||
--- a/src/codegen/arm64/assembler-arm64.cc
|
||||
+++ b/src/codegen/arm64/assembler-arm64.cc
|
||||
@@ -3786,6 +3786,22 @@ void Assembler::MoveWide(const Register& rd, uint64_t imm, int shift,
|
||||
ImmMoveWide(static_cast<int>(imm)) | ShiftMoveWide(shift));
|
||||
}
|
||||
|
||||
+Instr Assembler::RmNot31(CPURegister rm) {
|
||||
+ DCHECK_NE(rm.code(), kSPRegInternalCode);
|
||||
+ DCHECK(!rm.IsZero());
|
||||
+ return Rm(rm);
|
||||
+}
|
||||
+
|
||||
+Instr Assembler::RdSP(Register rd) {
|
||||
+ DCHECK(!rd.IsZero());
|
||||
+ return (rd.code() & kRegCodeMask) << Rd_offset;
|
||||
+}
|
||||
+
|
||||
+Instr Assembler::RnSP(Register rn) {
|
||||
+ DCHECK(!rn.IsZero());
|
||||
+ return (rn.code() & kRegCodeMask) << Rn_offset;
|
||||
+}
|
||||
+
|
||||
void Assembler::AddSub(const Register& rd, const Register& rn,
|
||||
const Operand& operand, FlagsUpdate S, AddSubOp op) {
|
||||
DCHECK_EQ(rd.SizeInBits(), rn.SizeInBits());
|
||||
diff --git a/src/codegen/arm64/assembler-arm64.h b/src/codegen/arm64/assembler-arm64.h
|
||||
index 04cd4222417f5ac88f3c5f3278c45f1d128c7c8c..fb5feb23074ac888e85a3676c1cbbb63126e72d5 100644
|
||||
--- a/src/codegen/arm64/assembler-arm64.h
|
||||
+++ b/src/codegen/arm64/assembler-arm64.h
|
||||
@@ -2148,11 +2148,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
|
||||
return rm.code() << Rm_offset;
|
||||
}
|
||||
|
||||
- static Instr RmNot31(CPURegister rm) {
|
||||
- DCHECK_NE(rm.code(), kSPRegInternalCode);
|
||||
- DCHECK(!rm.IsZero());
|
||||
- return Rm(rm);
|
||||
- }
|
||||
+ static Instr RmNot31(CPURegister rm);
|
||||
|
||||
static Instr Ra(CPURegister ra) {
|
||||
DCHECK_NE(ra.code(), kSPRegInternalCode);
|
||||
@@ -2176,15 +2172,8 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
|
||||
|
||||
// These encoding functions allow the stack pointer to be encoded, and
|
||||
// disallow the zero register.
|
||||
- static Instr RdSP(Register rd) {
|
||||
- DCHECK(!rd.IsZero());
|
||||
- return (rd.code() & kRegCodeMask) << Rd_offset;
|
||||
- }
|
||||
-
|
||||
- static Instr RnSP(Register rn) {
|
||||
- DCHECK(!rn.IsZero());
|
||||
- return (rn.code() & kRegCodeMask) << Rn_offset;
|
||||
- }
|
||||
+ static Instr RdSP(Register rd);
|
||||
+ static Instr RnSP(Register rn);
|
||||
|
||||
// Flags encoding.
|
||||
inline static Instr Flags(FlagsUpdate S);
|
Loading…
Add table
Add a link
Reference in a new issue