Skip to content

Commit

Permalink
Drop Temp-fix-Content-settings-infrastructure.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
uazo committed Feb 28, 2024
1 parent 4ca8045 commit 4da0221
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 26 deletions.
1 change: 0 additions & 1 deletion build/cromite_patches_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ TEMP-Add-a-log-to-track-strange-behavior.patch
Temp-guard-FileSystemAccessPersistentPermissions.patch
Fix-chromium-build-bugs.patch
00Temp-disable-network-service-windows.patch
00Temp-fix-Content-settings-infrastructure.patch

eyeo-beta-118.0.5993.48-base.patch
eyeo-beta-118.0.5993.48-chrome_integration.patch
Expand Down
23 changes: 0 additions & 23 deletions build/patches/00Temp-fix-Content-settings-infrastructure.patch

This file was deleted.

2 changes: 1 addition & 1 deletion build/patches/Content-settings-infrastructure.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3129,7 +3129,7 @@ diff --git a/components/content_settings/core/common/content_settings_types.mojo

- NUM_TYPES,
+ NUM_TYPES_CHROMIUM,
+// #include "components/content_settings/core/common/bromite_content_settings.inc"
+#include "components/content_settings/core/common/bromite_content_settings.inc"
+ NUM_TYPES_BROMITE,
};

Expand Down
52 changes: 51 additions & 1 deletion build/patches/bromite-build-utils.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ Subject: bromite build utils
.../flags/android/cromite_native_utils.cc | 43 +++++++
.../flags/android/cromite_native_utils.h | 14 +++
.../browser/flags/CromiteNativeUtils.java | 46 ++++++++
mojo/public/tools/mojom/mojom_parser.py | 22 +++-
tools/grit/grit/grd_reader.py | 27 ++++-
tools/grit/preprocess_if_expr.py | 32 +++++-
16 files changed, 469 insertions(+), 16 deletions(-)
17 files changed, 488 insertions(+), 19 deletions(-)
create mode 100644 build/bromite/bromite_utils.gni
create mode 100644 build/bromite/gyp/cpp_bromite_include.py
create mode 100644 build/bromite/gyp/cpp_bromite_include.pydeps
Expand Down Expand Up @@ -624,6 +625,55 @@ new file mode 100755
+ boolean isFlagEnabled(String featureName);
+ }
+}
diff --git a/mojo/public/tools/mojom/mojom_parser.py b/mojo/public/tools/mojom/mojom_parser.py
--- a/mojo/public/tools/mojom/mojom_parser.py
+++ b/mojo/public/tools/mojom/mojom_parser.py
@@ -21,6 +21,7 @@ import os
import os.path
import sys
import traceback
+import re
from collections import defaultdict

from mojom.generate import module
@@ -176,11 +177,26 @@ def _CollectAllowedImportsFromBuildMetadata(build_metadata_filename):
collect(build_metadata_filename)
return allowed_imports

+def _ResolveInclude(mojom_abspath, input_root_paths):
+ mojom_abspath = _ResolveRelativeImportPath(mojom_abspath, input_root_paths)
+ with codecs.open(mojom_abspath, encoding='utf-8') as f:
+ src = f.read()
+
+ lines = src.splitlines();
+ for idx, i in enumerate(lines):
+ if i.startswith("#include"):
+ include_file = re.findall(r'"([^"]*)"', i)[0]
+ if include_file.startswith("../../"):
+ include_file = include_file[6::]
+ lines[idx] = _ResolveInclude(include_file, input_root_paths)
+
+ return "\n".join(lines)

# multiprocessing helper.
-def _ParseAstHelper(mojom_abspath, enabled_features):
+def _ParseAstHelper(mojom_abspath, enabled_features, input_root_paths):
with codecs.open(mojom_abspath, encoding='utf-8') as f:
- ast = parser.Parse(f.read(), mojom_abspath)
+ src = _ResolveInclude(mojom_abspath, input_root_paths)
+ ast = parser.Parse(src, mojom_abspath)
conditional_features.RemoveDisabledDefinitions(ast, enabled_features)
return mojom_abspath, ast

@@ -300,7 +316,7 @@ def _ParseMojoms(mojom_files,
(path, abs_path) for abs_path, path in mojom_files_to_parse.items())

logging.info('Parsing %d .mojom into ASTs', len(mojom_files_to_parse))
- map_args = ((mojom_abspath, enabled_features)
+ map_args = ((mojom_abspath, enabled_features, input_root_paths)
for mojom_abspath in mojom_files_to_parse)
for mojom_abspath, ast in _Shard(_ParseAstHelper, map_args):
loaded_mojom_asts[mojom_abspath] = ast
diff --git a/tools/grit/grit/grd_reader.py b/tools/grit/grit/grd_reader.py
--- a/tools/grit/grit/grd_reader.py
+++ b/tools/grit/grit/grd_reader.py
Expand Down

0 comments on commit 4da0221

Please sign in to comment.