Skip to content

Commit

Permalink
v122 wip
Browse files Browse the repository at this point in the history
  • Loading branch information
uazo committed Feb 18, 2024
1 parent c3f33c0 commit 2b1f1fa
Show file tree
Hide file tree
Showing 15 changed files with 306 additions and 306 deletions.
54 changes: 16 additions & 38 deletions build/patches/AImageReader-CFI-crash-mitigations.patch
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ See discussions at:

License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
base/android/android_image_reader_compat.cc | 8 +++++++-
base/android/android_image_reader_compat.h | 4 ++++
base/android/android_image_reader_compat.cc | 9 +++++++++
chrome/browser/flag-metadata.json | 6 +++---
.../AImageReader-CFI-crash-mitigations.inc | 4 ++++
.../AImageReader-CFI-crash-mitigations.inc | 1 +
Expand All @@ -32,61 +31,40 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
gpu/config/gpu_workaround_list.txt | 1 +
gpu/ipc/service/gpu_init.cc | 7 +++++++
gpu/ipc/service/stream_texture_android.cc | 11 ++++++++++-
12 files changed, 67 insertions(+), 5 deletions(-)
11 files changed, 65 insertions(+), 4 deletions(-)
create mode 100644 cromite_flags/media/base/media_switches_cc/AImageReader-CFI-crash-mitigations.inc
create mode 100644 cromite_flags/media/base/media_switches_h/AImageReader-CFI-crash-mitigations.inc

diff --git a/base/android/android_image_reader_compat.cc b/base/android/android_image_reader_compat.cc
--- a/base/android/android_image_reader_compat.cc
+++ b/base/android/android_image_reader_compat.cc
@@ -23,6 +23,8 @@
@@ -7,7 +7,14 @@
namespace base {
namespace android {

+bool AndroidImageReader::disable_support_ = false;
+
AndroidImageReader& AndroidImageReader::GetInstance() {
// C++11 static local variable initialization is
// thread-safe.
@@ -30,8 +32,12 @@ AndroidImageReader& AndroidImageReader::GetInstance() {
return instance;
}

+void AndroidImageReader::DisableSupport() {
+ disable_support_ = true;
+}
+
bool AndroidImageReader::IsSupported() {
- return is_supported_;
+ return !disable_support_ && is_supported_;
bool EnableAndroidImageReader() {
+ if (disable_support_) return false;
// Currently we want to enable AImageReader only for android P+ devices.
if (__builtin_available(android 28, *)) {
return true;
@@ -15,5 +22,7 @@ bool EnableAndroidImageReader() {
return false;
}

AndroidImageReader::AndroidImageReader() : is_supported_(LoadFunctions()) {}
diff --git a/base/android/android_image_reader_compat.h b/base/android/android_image_reader_compat.h
--- a/base/android/android_image_reader_compat.h
+++ b/base/android/android_image_reader_compat.h
@@ -24,6 +24,9 @@ class BASE_EXPORT AndroidImageReader {
AndroidImageReader(const AndroidImageReader&) = delete;
AndroidImageReader& operator=(const AndroidImageReader&) = delete;

+ // Disable image reader support.
+ static void DisableSupport();
+FIX ME!
+
// Check if the image reader usage is supported. This function returns TRUE
// if android version is >=OREO, image reader support is not disabled and all
// the required functions are loaded.
@@ -61,6 +64,7 @@ class BASE_EXPORT AndroidImageReader {
jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window);

private:
+ static bool disable_support_;
friend class base::NoDestructor<AndroidImageReader>;

AndroidImageReader();
} // namespace android
} // namespace base
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -2923,9 +2923,9 @@
@@ -2980,9 +2980,9 @@
"expiry_milestone": 125
},
{
Expand Down Expand Up @@ -179,7 +157,7 @@ diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
if (!gpu_preferences.enable_android_surface_control)
return kGpuFeatureStatusDisabled;

@@ -355,6 +358,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) {
@@ -356,6 +359,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) {
gpu_feature_info->status_values[GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION] =
kGpuFeatureStatusBlocklisted;
}
Expand All @@ -205,7 +183,7 @@ diff --git a/gpu/config/gpu_workaround_list.txt b/gpu/config/gpu_workaround_list
diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc
--- a/gpu/ipc/service/gpu_init.cc
+++ b/gpu/ipc/service/gpu_init.cc
@@ -675,6 +675,13 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
@@ -672,6 +672,13 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
}
#endif // BUILDFLAG(IS_WIN)

Expand Down
20 changes: 10 additions & 10 deletions build/patches/Add-flag-to-disable-IPv6-probes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ new file mode 100644
diff --git a/net/BUILD.gn b/net/BUILD.gn
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -1033,6 +1033,7 @@ component("net") {
@@ -1028,6 +1028,7 @@ component("net") {
"//build:chromeos_buildflags",
"//components/miracle_parameter/common",
"//net/http:transport_security_state_generated_files",
Expand All @@ -56,25 +56,25 @@ diff --git a/net/BUILD.gn b/net/BUILD.gn
diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
--- a/net/dns/host_resolver_manager.cc
+++ b/net/dns/host_resolver_manager.cc
@@ -109,6 +109,7 @@
@@ -113,6 +113,7 @@
#include "net/log/net_log_event_type.h"
#include "net/log/net_log_source.h"
#include "net/log/net_log_source_type.h"
+#include "services/network/public/cpp/features.h"
#include "net/log/net_log_with_source.h"
#include "net/socket/client_socket_factory.h"
#include "net/url_request/url_request_context.h"
@@ -681,6 +682,9 @@ class HostResolverManager::RequestImpl
// request source is LOCAL_ONLY. This is due to LOCAL_ONLY requiring a
// synchronous response, so it cannot wait on an async probe result and
// cannot make assumptions about reachability.
@@ -1320,6 +1321,9 @@ void HostResolverManager::CreateTaskSequence(
case HostResolverSource::MULTICAST_DNS:
out_tasks->push_back(TaskType::MDNS);
break;
+ if (!base::FeatureList::IsEnabled(features::kIPv6Probing)) {
+ return OK;
+ }
if (parameters_.source == HostResolverSource::LOCAL_ONLY) {
int rv = resolver_->StartIPv6ReachabilityCheck(
source_net_log_, GetClientSocketFactory(),
@@ -3899,6 +3903,13 @@ int HostResolverManager::StartIPv6ReachabilityCheck(
case HostResolverSource::LOCAL_ONLY:
// If no external source allowed, a job should not be created or started
break;
@@ -1373,6 +1377,13 @@ int HostResolverManager::StartIPv6ReachabilityCheck(
return OK;
}

Expand Down
Loading

0 comments on commit 2b1f1fa

Please sign in to comment.