mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: cherry-pick f9add3b8e5 from chromium. (#27452)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
This commit is contained in:
@@ -132,6 +132,7 @@ cherry-pick-d866af575997.patch
|
||||
cherry-pick-da9b5ec032ad.patch
|
||||
cherry-pick-861253f1de98.patch
|
||||
cherry-pick-3ca3d70c7af5.patch
|
||||
mediacapabilities_use_threadsafe_static_wtf_string.patch
|
||||
cherry-pick-d74ba931c4b7.patch
|
||||
cherry-pick-9ec949913373.patch
|
||||
ots_backport_maxp_sanitization.patch
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Cunningham <chcunningham@chromium.org>
|
||||
Date: Tue, 5 Jan 2021 21:23:21 +0000
|
||||
Subject: MediaCapabilities: Use threadsafe static wtf::String
|
||||
|
||||
This replaces DEFINE_THREAD_SAFE_STATIC_LOCAL(const String, ...).
|
||||
StringImpl ref counting (behind that macro) is not currently threadsafe.
|
||||
|
||||
(cherry picked from commit f9add3b8e53c440129f7be4a181a22c440e856bc)
|
||||
|
||||
Bug: 1160534
|
||||
Change-Id: I70f4aa796aaefabbee36db4fcdf0fbf0defe4959
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2606399
|
||||
Commit-Queue: Chrome Cunningham <chcunningham@chromium.org>
|
||||
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
|
||||
Auto-Submit: Chrome Cunningham <chcunningham@chromium.org>
|
||||
Cr-Original-Commit-Position: refs/heads/master@{#839863}
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2611646
|
||||
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
|
||||
Cr-Commit-Position: refs/branch-heads/4324@{#1460}
|
||||
Cr-Branched-From: c73b5a651d37a6c4d0b8e3262cc4015a5579c6c8-refs/heads/master@{#827102}
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/BUILD.gn b/third_party/blink/renderer/modules/BUILD.gn
|
||||
index 0f08d60394f526b883a91c3994bea5dbe6a7d3e8..d38dc0f47cc186cc5bf45704a668438450797a8c 100644
|
||||
--- a/third_party/blink/renderer/modules/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/modules/BUILD.gn
|
||||
@@ -21,12 +21,18 @@ config("modules_implementation") {
|
||||
defines = [ "BLINK_MODULES_IMPLEMENTATION=1" ]
|
||||
}
|
||||
|
||||
-make_names("module_names") {
|
||||
+make_names("indexed_db_names") {
|
||||
in_files = [ "indexeddb/indexed_db_names.json5" ]
|
||||
output_dir = blink_modules_output_dir
|
||||
deps = [] # Don't use default deps (otherwise it will be circular).
|
||||
}
|
||||
|
||||
+make_names("media_capabilities_names") {
|
||||
+ in_files = [ "media_capabilities/media_capabilities_names.json5" ]
|
||||
+ output_dir = blink_modules_output_dir
|
||||
+ deps = [] # Don't use default deps (otherwise it will be circular).
|
||||
+}
|
||||
+
|
||||
jumbo_component("modules") {
|
||||
output_name = "blink_modules"
|
||||
|
||||
@@ -42,8 +48,9 @@ jumbo_component("modules") {
|
||||
"modules_initializer.h",
|
||||
]
|
||||
|
||||
- # Compile sources generated by module_names script.
|
||||
- sources += get_target_outputs(":module_names")
|
||||
+ # Compile sources generated by make_names script.
|
||||
+ sources += get_target_outputs(":indexed_db_names")
|
||||
+ sources += get_target_outputs(":media_capabilities_names")
|
||||
|
||||
sources += bindings_modules_v8_files
|
||||
sources += rebase_path(
|
||||
@@ -165,8 +172,9 @@ jumbo_component("modules") {
|
||||
}
|
||||
|
||||
deps = [
|
||||
+ ":indexed_db_names",
|
||||
":make_modules_generated",
|
||||
- ":module_names",
|
||||
+ ":media_capabilities_names",
|
||||
"//jingle:webrtc_glue",
|
||||
"//net:net",
|
||||
"//third_party/blink/renderer/bindings/modules:generated",
|
||||
@@ -249,7 +257,8 @@ jumbo_source_set("modules_testing") {
|
||||
|
||||
group("make_modules_generated") {
|
||||
public_deps = [
|
||||
- ":module_names",
|
||||
+ ":indexed_db_names",
|
||||
+ ":media_capabilities_names",
|
||||
"//third_party/blink/renderer/bindings/modules:bindings_modules_generated",
|
||||
"//third_party/blink/renderer/core:core_event_interfaces",
|
||||
]
|
||||
diff --git a/third_party/blink/renderer/modules/media_capabilities/DEPS b/third_party/blink/renderer/modules/media_capabilities/DEPS
|
||||
index 3b8d2749b4f486c4b0b207d4e20f966b5e573e07..1a5a3e9e3b6a031c4752cd92cf87426cae72f1d2 100644
|
||||
--- a/third_party/blink/renderer/modules/media_capabilities/DEPS
|
||||
+++ b/third_party/blink/renderer/modules/media_capabilities/DEPS
|
||||
@@ -12,6 +12,7 @@ include_rules = [
|
||||
"-third_party/blink/renderer/modules",
|
||||
"+third_party/blink/renderer/modules/encryptedmedia",
|
||||
"+third_party/blink/renderer/modules/media_capabilities",
|
||||
+ "+third_party/blink/renderer/modules/media_capabilities_names.h",
|
||||
"+third_party/blink/renderer/modules/mediarecorder/media_recorder_handler.h",
|
||||
"+third_party/blink/renderer/modules/modules_export.h",
|
||||
]
|
||||
diff --git a/third_party/blink/renderer/modules/media_capabilities/media_capabilities.cc b/third_party/blink/renderer/modules/media_capabilities/media_capabilities.cc
|
||||
index d571e60943092c746a7f4136b9e626128839abfc..9515ae2f71a415bb81a7e786c9d7fb2b623bd852 100644
|
||||
--- a/third_party/blink/renderer/modules/media_capabilities/media_capabilities.cc
|
||||
+++ b/third_party/blink/renderer/modules/media_capabilities/media_capabilities.cc
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "third_party/blink/renderer/modules/encryptedmedia/media_key_system_access.h"
|
||||
#include "third_party/blink/renderer/modules/encryptedmedia/media_key_system_access_initializer_base.h"
|
||||
#include "third_party/blink/renderer/modules/encryptedmedia/media_keys_controller.h"
|
||||
+#include "third_party/blink/renderer/modules/media_capabilities_names.h"
|
||||
#include "third_party/blink/renderer/modules/mediarecorder/media_recorder_handler.h"
|
||||
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
|
||||
#include "third_party/blink/renderer/platform/bindings/script_state.h"
|
||||
@@ -296,9 +297,9 @@ WebAudioConfiguration ToWebAudioConfiguration(
|
||||
DCHECK(parsed_content_type.IsValid());
|
||||
DCHECK(!parsed_content_type.GetParameters().HasDuplicatedNames());
|
||||
|
||||
- DEFINE_THREAD_SAFE_STATIC_LOCAL(const String, codecs, ("codecs"));
|
||||
web_configuration.mime_type = parsed_content_type.MimeType().LowerASCII();
|
||||
- web_configuration.codec = parsed_content_type.ParameterValueForName(codecs);
|
||||
+ web_configuration.codec = parsed_content_type.ParameterValueForName(
|
||||
+ media_capabilities_names::kCodecs);
|
||||
|
||||
// |channels| is optional and will be set to a null WebString if not present.
|
||||
web_configuration.channels = configuration->hasChannels()
|
||||
@@ -324,9 +325,9 @@ WebVideoConfiguration ToWebVideoConfiguration(
|
||||
DCHECK(parsed_content_type.IsValid());
|
||||
DCHECK(!parsed_content_type.GetParameters().HasDuplicatedNames());
|
||||
|
||||
- DEFINE_THREAD_SAFE_STATIC_LOCAL(const String, codecs, ("codecs"));
|
||||
web_configuration.mime_type = parsed_content_type.MimeType().LowerASCII();
|
||||
- web_configuration.codec = parsed_content_type.ParameterValueForName(codecs);
|
||||
+ web_configuration.codec = parsed_content_type.ParameterValueForName(
|
||||
+ media_capabilities_names::kCodecs);
|
||||
|
||||
DCHECK(configuration->hasWidth());
|
||||
web_configuration.width = configuration->width();
|
||||
@@ -586,9 +587,9 @@ bool ParseContentType(const String& content_type,
|
||||
return false;
|
||||
}
|
||||
|
||||
- DEFINE_THREAD_SAFE_STATIC_LOCAL(const String, codecs, ("codecs"));
|
||||
*mime_type = parsed_content_type.MimeType().LowerASCII();
|
||||
- *codec = parsed_content_type.ParameterValueForName(codecs);
|
||||
+ *codec = parsed_content_type.ParameterValueForName(
|
||||
+ media_capabilities_names::kCodecs);
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/media_capabilities/media_capabilities_names.json5 b/third_party/blink/renderer/modules/media_capabilities/media_capabilities_names.json5
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..01f9a0f705da3fad7708cccbd22c9a8c1789ff0c
|
||||
--- /dev/null
|
||||
+++ b/third_party/blink/renderer/modules/media_capabilities/media_capabilities_names.json5
|
||||
@@ -0,0 +1,9 @@
|
||||
+{
|
||||
+ metadata: {
|
||||
+ namespace: "media_capabilities_names",
|
||||
+ },
|
||||
+
|
||||
+ data: [
|
||||
+ "codecs",
|
||||
+ ],
|
||||
+}
|
||||
diff --git a/third_party/blink/renderer/modules/modules_initializer.cc b/third_party/blink/renderer/modules/modules_initializer.cc
|
||||
index df76ac04d4c64697cf5979609a55372b025adadb..5b830fd8c312bdbefe8a52b2e896b194aedb63c6 100644
|
||||
--- a/third_party/blink/renderer/modules/modules_initializer.cc
|
||||
+++ b/third_party/blink/renderer/modules/modules_initializer.cc
|
||||
@@ -62,6 +62,7 @@
|
||||
#include "third_party/blink/renderer/modules/launch/file_handling_expiry_impl.h"
|
||||
#include "third_party/blink/renderer/modules/launch/web_launch_service_impl.h"
|
||||
#include "third_party/blink/renderer/modules/manifest/manifest_manager.h"
|
||||
+#include "third_party/blink/renderer/modules/media_capabilities_names.h"
|
||||
#include "third_party/blink/renderer/modules/media_controls/media_controls_impl.h"
|
||||
#include "third_party/blink/renderer/modules/mediastream/user_media_client.h"
|
||||
#include "third_party/blink/renderer/modules/mediastream/user_media_controller.h"
|
||||
@@ -117,6 +118,7 @@ void ModulesInitializer::Initialize() {
|
||||
Document::RegisterEventFactory(EventModulesFactory::Create());
|
||||
ModuleBindingsInitializer::Init();
|
||||
indexed_db_names::Init();
|
||||
+ media_capabilities_names::Init();
|
||||
AXObjectCache::Init(AXObjectCacheImpl::Create);
|
||||
DraggedIsolatedFileSystem::Init(
|
||||
DraggedIsolatedFileSystemImpl::PrepareForDataObject);
|
||||
Reference in New Issue
Block a user