Skip to content

Commit

Permalink
cr-patches: update for 6099
Browse files Browse the repository at this point in the history
  • Loading branch information
licy183 committed Dec 22, 2023
1 parent f4de609 commit 07827a3
Show file tree
Hide file tree
Showing 19 changed files with 984 additions and 5 deletions.
20 changes: 20 additions & 0 deletions common-files/chromium-patches/add-missing-typename-6/6099.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/base/containers/map_util.h
+++ b/base/containers/map_util.h
@@ -42,7 +42,7 @@
template <typename Map,
typename Key,
typename MappedElementType =
- std::pointer_traits<internal::MappedType<Map>>::element_type>
+ typename std::pointer_traits<internal::MappedType<Map>>::element_type>
constexpr const MappedElementType* FindPtrOrNull(const Map& map,
const Key& key) {
auto it = map.find(key);
@@ -58,7 +58,7 @@
template <typename Map,
typename Key,
typename MappedElementType =
- std::pointer_traits<internal::MappedType<Map>>::element_type>
+ typename std::pointer_traits<internal::MappedType<Map>>::element_type>
constexpr MappedElementType* FindPtrOrNull(Map& map, const Key& key) {
auto it = map.find(key);
return it != map.end() ? std::to_address(it->second) : nullptr;
20 changes: 20 additions & 0 deletions common-files/chromium-patches/add-missing-typename-7/6099.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/third_party/blink/renderer/bindings/core/v8/async_iterable.h
+++ b/third_party/blink/renderer/bindings/core/v8/async_iterable.h
@@ -220,7 +220,7 @@
private:
virtual IterationSource* CreateIterationSource(
ScriptState* script_state,
- IterationSource::Kind kind,
+ typename IterationSource::Kind kind,
ExceptionState& exception_state) = 0;
};

@@ -262,7 +262,7 @@
private:
virtual IterationSource* CreateIterationSource(
ScriptState* script_state,
- IterationSource::Kind kind,
+ typename IterationSource::Kind kind,
ExceptionState& exception_state) = 0;
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The building system of chromium on Termux is much complex. For the host
toolchain, it uses clang-15 from Ubuntu as CXX compiler and libstdcxx-10
from Google-provided sysroot as CXX headers. For the target toolchain, it
uses CXX compiler and headers from Android NDK, which is from clang-17 and
libcxx-17. This patch is to satisfy them all.

--- a/components/autofill/core/browser/data_model/autofill_i18n_api.h
+++ b/components/autofill/core/browser/data_model/autofill_i18n_api.h
@@ -15,8 +15,8 @@
// Country code that represents autofill's legacy address hierarchy model as
// stored `kAutofillModelRules`. As a workaround for GCC we declare the
// std::string constexpr first.
-constexpr inline std::string kLegacyHierarchyCountryCodeString{"XX"};
-constexpr AddressCountryCode kLegacyHierarchyCountryCode =
+constexpr inline const char kLegacyHierarchyCountryCodeString[] = "XX";
+static const inline AddressCountryCode kLegacyHierarchyCountryCode =
AddressCountryCode(kLegacyHierarchyCountryCodeString);

// Creates an instance of the address hierarchy model corresponding to the
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
--- a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc
+++ b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc
@@ -632,8 +632,9 @@
GridSizingTree sizing_tree;

if (const auto* layout_subtree = ConstraintSpace().GetGridLayoutSubtree()) {
- auto& [grid_items, layout_data, subtree_size] =
- sizing_tree.CreateSizingData();
+ auto& sizing_data = sizing_tree.CreateSizingData();
+ auto& grid_items = sizing_data.grid_items;
+ auto& layout_data = sizing_data.layout_data;

const auto& node = Node();
grid_items =
@@ -671,8 +672,9 @@
const auto& track_collection = (track_direction == kForColumns)
? layout_data.Columns()
: layout_data.Rows();
- const auto& [begin_set_index, end_set_index] =
- grid_item.SetIndices(track_direction);
+ const auto& set_indices = grid_item.SetIndices(track_direction);
+ const auto& begin_set_index = set_indices.begin;
+ const auto& end_set_index = set_indices.end;

return (grid_item.BaselineGroup(track_direction) == BaselineGroup::kMajor)
? track_collection.MajorBaseline(begin_set_index)
@@ -1181,8 +1183,10 @@
: subgridded_item.Rows(writing_mode);

const auto margins = ComputeMarginsFor(space, item_style, constraint_space);
- const auto& [begin_set_index, end_set_index] =
- subgridded_item->SetIndices(track_collection.Direction());
+
+ const auto& set_indices = subgridded_item->SetIndices(track_collection.Direction());
+ const auto& begin_set_index = set_indices.begin;
+ const auto& end_set_index = set_indices.end;

const auto margin_sum =
(is_for_columns ? margins.InlineSum() : margins.BlockSum()) +
@@ -1835,8 +1839,9 @@
bool* opt_needs_additional_pass) const {
DCHECK(sizing_subtree);

- auto& [grid_items, layout_data, subtree_size] =
- sizing_subtree.SubtreeRootData();
+ auto& sizing_data = sizing_subtree.SubtreeRootData();
+ auto& grid_items = sizing_data.grid_items;
+ auto& layout_data = sizing_data.layout_data;

const bool is_for_columns = track_direction == kForColumns;
const bool has_non_definite_track =
@@ -1982,8 +1987,10 @@
void GridLayoutAlgorithm::ForEachSubgrid(
const GridSizingSubtree& sizing_subtree,
const CallbackFunc& callback_func) const {
- auto& [grid_items, layout_data, subtree_size] =
- sizing_subtree.SubtreeRootData();
+ auto& sizing_data = sizing_subtree.SubtreeRootData();
+ auto& grid_items = sizing_data.grid_items;
+ auto& layout_data = sizing_data.layout_data;
+ auto& subtree_size = sizing_data.subtree_size;

// If we know this subtree doesn't have nested subgrids we can exit early
// instead of iterating over every grid item looking for them.
@@ -3447,7 +3454,9 @@
DCHECK(out_row_break_between);

const auto& container_space = ConstraintSpace();
- const auto& [grid_items, layout_data, tree_size] = sizing_tree.TreeRootData();
+ const auto& sizing_data = sizing_tree.TreeRootData();
+ const auto& grid_items = sizing_data.grid_items;
+ const auto& layout_data = sizing_data.layout_data;

const auto* cached_layout_subtree = container_space.GetGridLayoutSubtree();
const auto container_writing_direction =
@@ -3611,7 +3620,9 @@

// TODO(ikilpatrick): Update |SetHasSeenAllChildren| and early exit if true.
const auto& constraint_space = ConstraintSpace();
- const auto& [grid_items, layout_data, tree_size] = sizing_tree.TreeRootData();
+ const auto& sizing_data = sizing_tree.TreeRootData();
+ const auto& grid_items = sizing_data.grid_items;
+ const auto& layout_data = sizing_data.layout_data;

const auto* cached_layout_subtree = constraint_space.GetGridLayoutSubtree();
const auto container_writing_direction =
@@ -4313,8 +4324,9 @@
DCHECK(!grid_item.IsOutOfFlow());
DCHECK(!grid_item.is_subgridded_to_parent_grid);

- const auto& [begin_set_index, end_set_index] =
- grid_item.SetIndices(track_collection.Direction());
+ const auto& set_indices = grid_item.SetIndices(track_collection.Direction());
+ const auto& begin_set_index = set_indices.begin;
+ const auto& end_set_index = set_indices.end;

if (start_offset) {
*start_offset = track_collection.GetSetOffset(begin_set_index);
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- a/content/browser/fenced_frame/fenced_frame_reporter.h
+++ b/content/browser/fenced_frame/fenced_frame_reporter.h
@@ -44,6 +44,8 @@
std::string type;
std::string data;

+ ~DestinationEnumEvent() {}
+
// The equal to operator is defined in order to enable comparison of
// DestinationVariant.
bool operator==(const DestinationEnumEvent& other) const {
@@ -57,6 +59,8 @@
struct DestinationURLEvent {
GURL url;

+ ~DestinationURLEvent() {}
+
// The equal to operator is defined in order to enable comparison of
// DestinationVariant.
bool operator==(const DestinationURLEvent& other) const {
@@ -71,6 +75,8 @@
blink::mojom::AutomaticBeaconType type;
std::string data;

+ ~AutomaticBeaconEvent() {}
+
// The equal to operator is defined in order to enable comparison of
// DestinationVariant.
bool operator==(const AutomaticBeaconEvent& other) const {
69 changes: 69 additions & 0 deletions common-files/chromium-patches/chromium-no-execinfo/6099.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
musl does not have execinfo.h, and hence no implementation of
. backtrace()
. backtrace_symbols()
for discussion about this, see https://www.openwall.com/lists/musl/2021/07/16/1
--
--- a/v8/src/codegen/external-reference-table.cc
+++ b/v8/src/codegen/external-reference-table.cc
@@ -11,7 +11,9 @@

#if defined(DEBUG) && defined(V8_OS_LINUX) && !defined(V8_OS_ANDROID)
#define SYMBOLIZE_FUNCTION
+#if defined(__GLIBC__)
#include <execinfo.h>
+#endif

#include <vector>

@@ -96,7 +98,7 @@
}

const char* ExternalReferenceTable::ResolveSymbol(void* address) {
-#ifdef SYMBOLIZE_FUNCTION
+#if defined(SYMBOLIZE_FUNCTION) && defined(__GLIBC__)
char** names = backtrace_symbols(&address, 1);
const char* name = names[0];
// The array of names is malloc'ed. However, each name string is static
--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
@@ -58,7 +58,7 @@
#define HAVE_ERRNO_H 1

/* Define to 1 if you have the <execinfo.h> header file. */
-#define HAVE_EXECINFO_H 1
+/* #define HAVE_EXECINFO_H 1 */

/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
--- a/base/debug/stack_trace.cc
+++ b/base/debug/stack_trace.cc
@@ -251,7 +253,9 @@
}

void StackTrace::OutputToStream(std::ostream* os) const {
+#if defined(__GLIBC__) && !defined(_AIX)
OutputToStreamWithPrefix(os, nullptr);
+#endif
}

std::string StackTrace::ToString() const {
@@ -281,7 +281,7 @@
}
std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
std::stringstream stream;
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if defined(__GLIBC__) && !defined(_AIX)
OutputToStreamWithPrefix(&stream, prefix_string);
#endif
return stream.str();
--- a/base/debug/stack_trace_unittest.cc
+++ b/base/debug/stack_trace_unittest.cc
@@ -33,7 +33,7 @@
typedef testing::Test StackTraceTest;
#endif

-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if !defined(__UCLIBC__) && !defined(_AIX) && defined(__GLIBC__)
// StackTrace::OutputToStream() is not implemented under uclibc, nor AIX.
// See https://crbug.com/706728

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1859,31 +1859,6 @@
# TODO(thakis): Only for no_chromium_code? http://crbug.com/912662
"-Wno-ignored-pragma-optimize",
]
-
- if (!is_nacl) {
- cflags += [
- # TODO(crbug.com/1343975) Evaluate and possibly enable.
- "-Wno-deprecated-builtins",
-
- # TODO(crbug.com/1352183) Evaluate and possibly enable.
- "-Wno-bitfield-constant-conversion",
-
- # TODO(crbug.com/1412713) Evaluate and possibly enable.
- "-Wno-deprecated-this-capture",
-
- # TODO(https://crbug.com/1491833): Fix and re-enable.
- "-Wno-invalid-offsetof",
-
- # TODO(crbug.com/1494809): Evaluate and possibly enable.
- "-Wno-vla-extension",
-
- # TODO(https://crbug.com/1490607): Fix and re-enable.
- "-Wno-thread-safety-reference-return",
-
- # TODO(crbug.com/1495100): Evaluate and possibly enable.
- "-Wno-delayed-template-parsing-in-cxx20",
- ]
- }
}

# Some builders, such as Cronet, use a different version of Clang than
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/third_party/blink/renderer/core/paint/fragment_data_iterator.h
+++ b/third_party/blink/renderer/core/paint/fragment_data_iterator.h
@@ -21,7 +21,7 @@

public:
explicit FragmentDataIteratorBase(Head& head) : fragment_head_(head) {}
- explicit FragmentDataIteratorBase(nullptr_t) {}
+ explicit FragmentDataIteratorBase(std::nullptr_t) {}

Data* GetFragmentData() const {
return !IsDone() ? &fragment_head_.at(idx_) : nullptr;
Loading

0 comments on commit 07827a3

Please sign in to comment.