Skip to content

Commit

Permalink
:w
Browse files Browse the repository at this point in the history
tur-on-device(blender): update to latest commit

cgnage?

cgnage?
  • Loading branch information
T-Dynamos committed Oct 1, 2023
1 parent 53965be commit ecb95ed
Show file tree
Hide file tree
Showing 27 changed files with 532 additions and 35 deletions.
4 changes: 2 additions & 2 deletions common-files/apply-chromium-patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def check_metadata(metadata_dict):
def apply_patch(patch_file, dry_run):
try:
subprocess.check_call(
["patch", "-s", "--dry-run", "-p1", "-i", patch_file],
["patch", "--dry-run", "-p1", "-i", patch_file],
stdin=subprocess.DEVNULL
)
except:
Expand All @@ -107,7 +107,7 @@ def apply_patch(patch_file, dry_run):
def revert_patch(patch_file, dry_run):
try:
subprocess.check_call(
["patch", "-s", "-R", "--dry-run", "-p1", "-i", patch_file],
["patch", "-R", "--dry-run", "-p1", "-i", patch_file],
stdin=subprocess.DEVNULL
)
except:
Expand Down
23 changes: 23 additions & 0 deletions common-files/chromium-patches/add-missing-typename-2/5735.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
https://chromium.googlesource.com/chromium/src/+/2914039316d4ed3f53c3393dc2ba48f637807689
--- a/chrome/browser/printing/print_backend_service_manager.cc
+++ b/chrome/browser/printing/print_backend_service_manager.cc
@@ -1477,7 +1477,7 @@ template <class... T>
void PrintBackendServiceManager::RunSavedCallbacks(
RemoteSavedCallbacks<T...>& saved_callbacks,
const RemoteId& remote_id,
- std::remove_reference<T>::type... result) {
+ typename std::remove_reference<T>::type... result) {
auto found_callbacks_map = saved_callbacks.find(remote_id);
if (found_callbacks_map == saved_callbacks.end())
return; // No callbacks to run.
--- a/chrome/browser/printing/print_backend_service_manager.h
+++ b/chrome/browser/printing/print_backend_service_manager.h
@@ -588,7 +588,7 @@ class PrintBackendServiceManager {
template <class... T>
void RunSavedCallbacks(RemoteSavedCallbacks<T...>& saved_callbacks,
const RemoteId& remote_id,
- std::remove_reference<T>::type... result);
+ typename std::remove_reference<T>::type... result);

// Test support for client ID management.
static void SetClientsForTesting(
11 changes: 11 additions & 0 deletions common-files/chromium-patches/add-missing-typename-3/5790.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/components/optimization_guide/core/tflite_model_executor.h
+++ b/components/optimization_guide/core/tflite_model_executor.h
@@ -189,7 +189,7 @@
void SendForBatchExecution(
BatchExecutionCallback callback_on_complete,
base::TimeTicks start_time,
- ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
+ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
override {
DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
11 changes: 11 additions & 0 deletions common-files/chromium-patches/add-missing-typename-4/5790.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc
+++ b/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc
@@ -169,7 +169,7 @@
using Span = base::span<const Char>;
using USpan = base::span<const UChar>;
// 32 matches that used by HTMLToken::Attribute.
- typedef std::conditional<std::is_same_v<Char, UChar>,
+ typedef typename std::conditional<std::is_same_v<Char, UChar>,
UCharLiteralBuffer<32>,
LCharLiteralBuffer<32>>::type LiteralBufferType;
typedef UCharLiteralBuffer<32> UCharLiteralBufferType;
23 changes: 23 additions & 0 deletions common-files/chromium-patches/add-missing-typename/5790.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--- a/chrome/browser/download/bubble/download_bubble_update_service.cc
+++ b/chrome/browser/download/bubble/download_bubble_update_service.cc
@@ -91,7 +91,7 @@
// Helper to get an iterator to the last element in the cache. The cache
// must not be empty.
template <typename Item>
-SortedItems<Item>::const_iterator GetLastIter(const SortedItems<Item>& cache) {
+typename SortedItems<Item>::const_iterator GetLastIter(const SortedItems<Item>& cache) {
CHECK(!cache.empty());
auto it = cache.end();
return std::prev(it);
@@ -967,9 +967,9 @@
}

template <typename Id, typename Item>
-SortedItems<Item>::iterator
+typename SortedItems<Item>::iterator
DownloadBubbleUpdateService::CacheManager::RemoveItemFromCacheByIter(
- SortedItems<Item>::iterator iter,
+ typename SortedItems<Item>::iterator iter,
SortedItems<Item>& cache,
IterMap<Id, Item>& iter_map) {
CHECK(iter != cache.end());
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
--- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc
+++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc
@@ -238,7 +238,10 @@
: BuildGridSizingTree(&oof_children);

LayoutUnit intrinsic_block_size;
- auto& [grid_items, layout_data, tree_size] = grid_sizing_tree.TreeRootData();
+ auto& tree_root_data = grid_sizing_tree.TreeRootData();
+ auto& grid_items = tree_root_data.grid_items;
+ auto& layout_data = tree_root_data.layout_data;
+ auto& tree_size = tree_root_data.subtree_size;

if (IsBreakInside(BreakToken())) {
// TODO(layout-dev): When we support variable inline-size fragments we'll
@@ -520,8 +523,10 @@
row_auto_repetitions);

bool has_nested_subgrid = false;
- auto& [grid_items, layout_data, subtree_size] =
- sizing_tree->CreateSizingData(opt_subgrid_data);
+ auto& sizing_data = sizing_tree->CreateSizingData(opt_subgrid_data);
+ auto& grid_items = sizing_data.grid_items;
+ auto& layout_data = sizing_data.layout_data;
+ auto& subtree_size = sizing_data.subtree_size;

if (!must_ignore_children) {
// Construct grid items that are not subgridded.
@@ -650,8 +655,10 @@
NGGridSizingTree sizing_tree;

if (const auto* layout_subtree = ConstraintSpace().GridLayoutSubtree()) {
- 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;
+ auto& subtree_size = sizing_data.subtree_size;

const auto& node = Node();
grid_items =
@@ -1178,8 +1185,10 @@
return baseline_fragment.BlockSize() + baseline_shim;
};

- const auto& [begin_set_index, end_set_index] =
- subgridded_item->SetIndices(track_direction);
+ const auto& set_indices = subgridded_item->SetIndices(track_direction);
+ const auto& begin_set_index = set_indices.begin;
+ const auto& end_set_index = set_indices.end;
+
const auto& track_collection =
is_for_columns ? subgridded_item.ParentLayoutData().Columns()
: subgridded_item.ParentLayoutData().Rows();
@@ -1640,8 +1649,10 @@
const absl::optional<GridTrackSizingDirection>& opt_track_direction) const {
DCHECK(sizing_subtree);

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

auto InitAndCacheTrackSizes = [&](GridTrackSizingDirection track_direction) {
InitializeTrackCollection(opt_subgrid_data, track_direction, &layout_data);
@@ -1825,8 +1836,10 @@
bool* opt_needs_additional_pass) const {
DCHECK(sizing_subtree);

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

const bool is_for_columns = track_direction == kForColumns;
const bool has_non_definite_track =
@@ -4156,8 +4169,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,91 @@
--- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc
+++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc
@@ -238,7 +238,11 @@
: BuildGridSizingTree(&oof_children);

LayoutUnit intrinsic_block_size;
- auto& [grid_items, layout_data, tree_size] = grid_sizing_tree.TreeRootData();
+
+ auto& sizing_data = grid_sizing_tree.TreeRootData();
+ auto& grid_items = sizing_data.grid_items;
+ auto& layout_data = sizing_data.layout_data;
+ auto& tree_size = sizing_data.subtree_size;

if (IsBreakInside(BreakToken())) {
// TODO(layout-dev): When we support variable inline-size fragments we'll
@@ -655,8 +659,10 @@
NGGridSizingTree sizing_tree;

if (const auto* layout_subtree = ConstraintSpace().GridLayoutSubtree()) {
- 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;
+ auto& subtree_size = sizing_data.subtree_size;

const auto& node = Node();
grid_items =
@@ -694,8 +700,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)
@@ -1179,8 +1186,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()) +
@@ -1798,8 +1807,10 @@
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;
+ auto& subtree_size = sizing_data.subtree_size;

const bool is_for_columns = track_direction == kForColumns;
const bool has_non_definite_track =
@@ -1924,8 +1935,10 @@
void NGGridLayoutAlgorithm::ForEachSubgrid(
const NGGridSizingSubtree& 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.
@@ -4253,8 +4266,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);
17 changes: 17 additions & 0 deletions common-files/chromium-patches/blink-skia-constructor/5790.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc
+++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc
@@ -91,12 +91,12 @@
case kGradient:
GetCanvasGradient()->GetGradient()->ApplyToFlags(flags, SkMatrix::I(),
ImageDrawOptions());
- flags.setColor(SkColor4f(0.0f, 0.0f, 0.0f, global_alpha));
+ flags.setColor(SkColor4f({0.0f, 0.0f, 0.0f, global_alpha}));
break;
case kImagePattern:
GetCanvasPattern()->GetPattern()->ApplyToFlags(
flags, AffineTransformToSkMatrix(GetCanvasPattern()->GetTransform()));
- flags.setColor(SkColor4f(0.0f, 0.0f, 0.0f, global_alpha));
+ flags.setColor(SkColor4f({0.0f, 0.0f, 0.0f, global_alpha}));
break;
default:
NOTREACHED();
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/chrome/test/chromedriver/chrome/client_hints.h
+++ b/chrome/test/chromedriver/chrome/client_hints.h
@@ -7,6 +7,7 @@

#include <third_party/abseil-cpp/absl/types/optional.h>
#include <string>
+#include <vector>

struct BrandVersion {
// Browser brand.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/chrome/test/chromedriver/capabilities.cc
+++ b/chrome/test/chromedriver/capabilities.cc
@@ -355,7 +355,7 @@
"'version' field of type string");
}

- brands.emplace_back(*brand, *version);
+ brands.push_back({*brand, *version});
}

client_hints.brands = std::move(brands);
@@ -392,7 +392,7 @@
"a 'version' field of type string");
}

- full_version_list.emplace_back(*brand, *version);
+ full_version_list.push_back({*brand, *version});
}

client_hints.full_version_list = std::move(full_version_list);
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--- a/base/functional/callback_helpers.h
+++ b/base/functional/callback_helpers.h
@@ -10,6 +10,7 @@
#ifndef BASE_FUNCTIONAL_CALLBACK_HELPERS_H_
#define BASE_FUNCTIONAL_CALLBACK_HELPERS_H_

+#include <atomic>
#include <memory>
#include <ostream>
#include <type_traits>
@@ -90,7 +91,7 @@ class OnceCallbackHolder final {
}

private:
- std::atomic<bool> has_run_;
+ std::atomic<bool> has_run_{false};
base::OnceCallback<void(Args...)> callback_;
const bool ignore_extra_runs_;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -1393,7 +1393,10 @@
return;
}

- auto [document_url, key, callback] = std::move(*request);
+ auto request_ = std::move(*request);
+ auto& document_url = std::get<0>(request_);
+ auto& key = std::get<1>(request_);
+ auto& callback = std::get<2>(request_);

DCHECK(document_url.is_valid());
TRACE_EVENT1("ServiceWorker",
40 changes: 40 additions & 0 deletions common-files/chromium-patches/chromium-impl-scoped-file/5735.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
--- a/base/files/scoped_file_linux.cc
+++ b/base/files/scoped_file_linux.cc
@@ -14,6 +14,26 @@
#include "base/logging.h"
#include "base/strings/string_piece.h"

+#ifdef __TERMUX__
+#include <android/fdsan.h>
+#include <dlfcn.h>
+#include <sys/syscall.h>
+static inline void termux_disable_fdsan() {
+ typedef void (*android_fdsan_error_level_ptr_t)(enum android_fdsan_error_level);
+ // For Android 11+.
+ void *lib_handle = dlopen("libc.so", RTLD_LAZY);
+ if (lib_handle) {
+ android_fdsan_error_level_ptr_t set_fdsan_error_level =
+ reinterpret_cast<android_fdsan_error_level_ptr_t>(
+ dlsym(lib_handle, "android_fdsan_set_error_level"));
+ if (set_fdsan_error_level != nullptr) {
+ set_fdsan_error_level(ANDROID_FDSAN_ERROR_LEVEL_DISABLED);
+ }
+ dlclose(lib_handle);
+ }
+}
+#endif
+
namespace {

// We want to avoid any kind of allocations in our close() implementation, so we
@@ -65,6 +85,10 @@

void EnableFDOwnershipEnforcement(bool enabled) {
g_is_ownership_enforced = enabled;
+#ifdef __TERMUX__
+ // Disable the Android native fdsan.
+ termux_disable_fdsan();
+#endif
}

void ResetFDOwnership() {
Loading

0 comments on commit ecb95ed

Please sign in to comment.