chromium 98.0.4758.91

This commit is contained in:
idriskalp
2022-02-14 05:57:47 +03:00
parent cfdc13c416
commit e69a46ec94
11 changed files with 386 additions and 123 deletions
@@ -0,0 +1,33 @@
From 00604ca8ed6d669fb6cb3ae8bacd6028d5ef10ac Mon Sep 17 00:00:00 2001
From: Stephen Roettger <sroettger@google.com>
Date: Thu, 20 Jan 2022 10:04:04 +0000
Subject: [PATCH] Downgrade duplicate peer error to dvlog
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Downgrading since this case can happen in non-error situations. There can be
duplicate introductions in flight in which case we simply drop the second one.
Change-Id: I2c51b177913ccd9634e9bb6343d468101d9735ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3398794
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Stephen Röttger <sroettger@google.com>
Cr-Commit-Position: refs/heads/main@{#961389}
---
mojo/core/node_controller.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mojo/core/node_controller.cc b/mojo/core/node_controller.cc
index 7cde7719687..81712676733 100644
--- a/mojo/core/node_controller.cc
+++ b/mojo/core/node_controller.cc
@@ -594,7 +594,7 @@ void NodeController::AddPeer(const ports::NodeName& name,
}
if (dropped_peers_.Contains(name)) {
- LOG(ERROR) << "Trying to re-add dropped peer " << name;
+ DVLOG(1) << "Trying to re-add dropped peer " << name;
return;
}
@@ -0,0 +1,62 @@
From 5b287e0be8d8d8475ec6ef81b16eaa61e19db078 Mon Sep 17 00:00:00 2001
From: "Steinar H. Gunderson" <sesse@chromium.org>
Date: Tue, 25 Jan 2022 19:14:53 +0000
Subject: [PATCH] Fix build break with system libdrm.
This patch is submitted on behalf of Andres Salomon
<dilinger@queued.net> (on Cc). Also adding him to src/AUTHORS
per policy, as he has signed the CLA.
Original patch:
https://salsa.debian.org/dilinger/chromium/-/commit/2333c2fb985ac1ef3d7331776a7833d965c63302
Change-Id: I18bd60e2e80f2b9181e74ee7972c3f457ab33b10
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3401704
Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
Commit-Queue: Steinar H Gunderson <sesse@chromium.org>
Auto-Submit: Steinar H Gunderson <sesse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#963119}
---
AUTHORS | 1 +
media/gpu/chromeos/BUILD.gn | 1 +
media/gpu/chromeos/video_decoder_pipeline.cc | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/AUTHORS b/AUTHORS
index 0eba3de5065..50edd3f6b38 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -93,6 +93,7 @@ Andreas Papacharalampous <andreas@apap04.com>
Andrei Borza <andrei.borza@gmail.com>
Andrei Parvu <andrei.prv@gmail.com>
Andrei Parvu <parvu@adobe.com>
+Andres Salomon <dilinger@queued.net>
Andreu Botella <andreu@andreubotella.com>
Andrew Boyarshin <andrew.boyarshin@gmail.com>
Andrew Brampton <me@bramp.net>
diff --git a/media/gpu/chromeos/BUILD.gn b/media/gpu/chromeos/BUILD.gn
index 7cb4c3ea39a..6fe21c15ecc 100644
--- a/media/gpu/chromeos/BUILD.gn
+++ b/media/gpu/chromeos/BUILD.gn
@@ -25,6 +25,7 @@ source_set("chromeos") {
deps = [
"//base",
+ "//build/config/linux/libdrm",
"//media",
"//media/gpu:buildflags",
"//media/gpu:command_buffer_helper",
diff --git a/media/gpu/chromeos/video_decoder_pipeline.cc b/media/gpu/chromeos/video_decoder_pipeline.cc
index d2f154ea0d8..416b9434a8d 100644
--- a/media/gpu/chromeos/video_decoder_pipeline.cc
+++ b/media/gpu/chromeos/video_decoder_pipeline.cc
@@ -28,8 +28,8 @@
#include "third_party/abseil-cpp/absl/types/optional.h"
#if BUILDFLAG(USE_VAAPI)
+#include <drm_fourcc.h>
#include "media/gpu/vaapi/vaapi_video_decoder.h"
-#include "third_party/libdrm/src/include/drm/drm_fourcc.h"
#elif BUILDFLAG(USE_V4L2_CODEC)
#include "media/gpu/v4l2/v4l2_video_decoder.h"
#else
@@ -0,0 +1,13 @@
diff --git a/third_party/libyuv/source/row_neon.cc b/third_party/libyuv/source/row_neon.cc
index 6ef6f1c..e4a9e1e 100644
--- a/third_party/libyuv/source/row_neon.cc
+++ b/third_party/libyuv/source/row_neon.cc
@@ -2346,7 +2346,7 @@ void ARGBToAB64Row_NEON(const uint8_t* src_argb,
uint16_t* dst_ab64,
int width) {
asm volatile(
- "vld1.8 q4, %3 \n" // shuffler
+ "vld1.8 {d8, d9}, %3 \n" // shuffler
"1: \n"
"vld1.8 {q0}, [%0]! \n"
"vld1.8 {q2}, [%0]! \n"
@@ -1,27 +0,0 @@
From 9850414c0425aebf038faf418f331df2d6ad573b Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Fri, 5 Nov 2021 08:53:26 +0000
Subject: [PATCH] GCC: make gfx::Point::operator== constexpr
blink::IntRect::operator== is constexpr. Therefore,
gfx::Point::operator== needs to be constexpr as well.
---
ui/gfx/geometry/point.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/gfx/geometry/point.h b/ui/gfx/geometry/point.h
index 71c5a5b..55b3220 100644
--- a/ui/gfx/geometry/point.h
+++ b/ui/gfx/geometry/point.h
@@ -95,7 +95,7 @@ class GEOMETRY_EXPORT Point {
int y_;
};
-inline bool operator==(const Point& lhs, const Point& rhs) {
+constexpr bool operator==(const Point& lhs, const Point& rhs) {
return lhs.x() == rhs.x() && lhs.y() == rhs.y();
}
--
2.32.0
@@ -1,23 +0,0 @@
From ce58517e546f3f3433931609683b5b4e455bbb7f Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Fri, 5 Nov 2021 15:48:05 +0000
Subject: [PATCH] GCC: fix undefined reference to ScrollView::SetContents()
---
ui/views/controls/scroll_view.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ui/views/controls/scroll_view.h b/ui/views/controls/scroll_view.h
index 3bd5a8bf..f850728c 100644
--- a/ui/views/controls/scroll_view.h
+++ b/ui/views/controls/scroll_view.h
@@ -386,6 +386,9 @@
ScrollViewCallbackList on_contents_scroll_ended_;
};
+// Required for WebAppUrlHandlerIntentPickerView
+template View* ScrollView::SetContents<View>(std::unique_ptr<View> a_view);
+
BEGIN_VIEW_BUILDER(VIEWS_EXPORT, ScrollView, View)
VIEW_BUILDER_VIEW_TYPE_PROPERTY(View, Contents)
VIEW_BUILDER_PROPERTY(ui::LayerType, ContentsLayerType)
@@ -0,0 +1,91 @@
Workaround GCC ICE with MiraclePtr, see https://gcc.gnu.org/PR103455
--- a/gpu/command_buffer/client/gl_helper.h
+++ b/gpu/command_buffer/client/gl_helper.h
@@ -34,7 +34,7 @@ class ScopedGLuint {
GenFunc gen_func,
DeleteFunc delete_func)
: gl_(gl), id_(0u), delete_func_(delete_func) {
- (gl_->*gen_func)(1, &id_);
+ (gl_.get()->*gen_func)(1, &id_);
}
operator GLuint() const { return id_; }
@@ -46,7 +46,7 @@ class ScopedGLuint {
~ScopedGLuint() {
if (id_ != 0) {
- (gl_->*delete_func_)(1, &id_);
+ (gl_.get()->*delete_func_)(1, &id_);
}
}
@@ -86,13 +86,13 @@ class ScopedBinder {
typedef void (gles2::GLES2Interface::*BindFunc)(GLenum target, GLuint id);
ScopedBinder(gles2::GLES2Interface* gl, GLuint id, BindFunc bind_func)
: gl_(gl), bind_func_(bind_func) {
- (gl_->*bind_func_)(Target, id);
+ (gl_.get()->*bind_func_)(Target, id);
}
ScopedBinder(const ScopedBinder&) = delete;
ScopedBinder& operator=(const ScopedBinder&) = delete;
- virtual ~ScopedBinder() { (gl_->*bind_func_)(Target, 0); }
+ virtual ~ScopedBinder() { (gl_.get()->*bind_func_)(Target, 0); }
private:
raw_ptr<gles2::GLES2Interface> gl_;
--- a/ui/accessibility/ax_node.h
+++ b/ui/accessibility/ax_node.h
@@ -822,10 +822,10 @@ AXNode::ChildIteratorBase<NodeType,
// increment the iterator past the end, we remain at the past-the-end iterator
// condition.
if (child_ && parent_) {
- if (child_ == (parent_->*LastChild)())
+ if (child_ == (parent_.get()->*LastChild)())
child_ = nullptr;
else
- child_ = (child_->*NextSibling)();
+ child_ = (child_.get()->*NextSibling)();
}
return *this;
@@ -850,12 +850,12 @@ AXNode::ChildIteratorBase<NodeType,
// If the iterator is past the end, |child_=nullptr|, decrement the iterator
// gives us the last iterator element.
if (!child_)
- child_ = (parent_->*LastChild)();
+ child_ = (parent_.get()->*LastChild)();
// Decrement the iterator gives us the previous element, except when the
// iterator is at the beginning; in which case, decrementing the iterator
// remains at the beginning.
- else if (child_ != (parent_->*FirstChild)())
- child_ = (child_->*PreviousSibling)();
+ else if (child_ != (parent_.get()->*FirstChild)())
+ child_ = (child_.get()->*PreviousSibling)();
}
return *this;
--- a/ui/views/layout/flex_layout_types.cc
+++ b/ui/views/layout/flex_layout_types.cc
@@ -59,7 +59,7 @@ class LazySize {
const gfx::Size& operator*() const { return *get(); }
const gfx::Size* get() const {
if (!size_)
- size_ = (view_->*size_func_)();
+ size_ = (view_.get()->*size_func_)();
return &size_.value();
}
LazyDimension width() const {
--- a/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc
+++ b/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc
@@ -37,7 +37,7 @@ AutoSigninFirstRunDialogView::AutoSigninFirstRunDialogView(
auto call_controller = [](AutoSigninFirstRunDialogView* dialog,
ControllerCallbackFn func) {
if (dialog->controller_) {
- (dialog->controller_->*func)();
+ (dialog->controller_.get()->*func)();
}
};
SetAcceptCallback(
@@ -0,0 +1,27 @@
From 8e2458ffc6727943518a622753b074b42e713403 Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Sat, 18 Dec 2021 08:38:57 +0000
Subject: [PATCH] libstdc++: fix DCHECK_NE in ui::WaylandFrameManager
There is no CheckOpValueStr() for std::unique_ptr. Use get() to
compare pointer values.
---
ui/ozone/platform/wayland/host/wayland_frame_manager.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/ozone/platform/wayland/host/wayland_frame_manager.cc b/ui/ozone/platform/wayland/host/wayland_frame_manager.cc
index 569526c..58fae14 100644
--- a/ui/ozone/platform/wayland/host/wayland_frame_manager.cc
+++ b/ui/ozone/platform/wayland/host/wayland_frame_manager.cc
@@ -379,7 +379,7 @@ void WaylandFrameManager::OnPresentation(
// Investigate the issue with surface sync.
frame->feedback = gfx::PresentationFeedback::Failure();
}
- CHECK_NE(frame, submitted_frames_.back());
+ CHECK_NE(frame.get(), submitted_frames_.back().get());
}
MaybeProcessSubmittedFrames();
}
--
2.32.0
@@ -1,30 +1,31 @@
From 307a0f63dd9b118f4b8470ed3d7567e81fdb7a6d Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Tue, 2 Nov 2021 11:27:25 +0000
Date: Fri, 3 Dec 2021 09:50:31 +0000
Subject: [PATCH] Disable various compiler configs
---
build/config/compiler/BUILD.gn | 98 ++++++----------------------------
1 file changed, 17 insertions(+), 81 deletions(-)
build/config/compiler/BUILD.gn | 105 ++++++---------------------------
1 file changed, 17 insertions(+), 88 deletions(-)
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 2656f80..221e6db 100644
index 5365544..e6d9b56 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -296,8 +296,6 @@ config("compiler") {
@@ -291,9 +291,7 @@ config("compiler") {
configs += [
# See the definitions below.
- ":clang_revision",
":rustc_revision",
- ":compiler_cpu_abi",
":compiler_codegen",
":compiler_deterministic",
]
@@ -538,24 +536,6 @@ config("compiler") {
@@ -534,31 +532,6 @@ config("compiler") {
ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
}
- if (is_clang && !is_nacl && !use_xcode_clang && current_os != "zos") {
- if (is_clang && !is_nacl && current_os != "zos") {
- cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ]
-
- # TODO(hans): Remove this once Clang generates better optimized debug info
@@ -40,12 +41,19 @@ index 2656f80..221e6db 100644
- ldflags += [ "-Wl,-mllvm,-instcombine-lower-dbg-declare=0" ]
- }
- }
-
- # TODO(crbug.com/1235145): Investigate why/if this should be needed.
- if (is_win) {
- cflags += [ "/clang:-ffp-contract=off" ]
- } else {
- cflags += [ "-ffp-contract=off" ]
- }
- }
-
# C11/C++11 compiler flags setup.
# ---------------------------
if (is_linux || is_chromeos || is_android || (is_nacl && is_clang) ||
@@ -1246,45 +1226,6 @@ config("compiler_deterministic") {
@@ -1231,45 +1204,6 @@ config("compiler_deterministic") {
}
}
@@ -91,7 +99,7 @@ index 2656f80..221e6db 100644
# Tells the compiler not to use absolute paths when passing the default
# paths to the tools it invokes. We don't want this because we don't
# really need it and it can mess up the goma cache entries.
@@ -1562,7 +1503,7 @@ config("chromium_code") {
@@ -1556,7 +1490,7 @@ config("chromium_code") {
defines = [ "_HAS_NODISCARD" ]
}
} else {
@@ -100,7 +108,7 @@ index 2656f80..221e6db 100644
if (treat_warnings_as_errors) {
cflags += [ "-Werror" ]
@@ -1571,10 +1512,6 @@ config("chromium_code") {
@@ -1565,10 +1499,6 @@ config("chromium_code") {
# well.
ldflags = [ "-Werror" ]
}
@@ -111,7 +119,7 @@ index 2656f80..221e6db 100644
# In Chromium code, we define __STDC_foo_MACROS in order to get the
# C99 macros on Mac and Linux.
@@ -1583,15 +1520,6 @@ config("chromium_code") {
@@ -1577,15 +1507,6 @@ config("chromium_code") {
"__STDC_FORMAT_MACROS",
]
@@ -127,7 +135,7 @@ index 2656f80..221e6db 100644
if (is_mac) {
cflags_objc = [ "-Wobjc-missing-property-synthesis" ]
cflags_objcc = [ "-Wobjc-missing-property-synthesis" ]
@@ -1959,7 +1887,8 @@ config("default_stack_frames") {
@@ -1988,7 +1909,8 @@ config("default_stack_frames") {
}
# Default "optimization on" config.
@@ -137,7 +145,7 @@ index 2656f80..221e6db 100644
if (is_win) {
if (chrome_pgo_phase != 2) {
# Favor size over speed, /O1 must be before the common flags.
@@ -1999,7 +1928,8 @@ config("optimize") {
@@ -2026,7 +1948,8 @@ config("optimize") {
}
# Turn off optimizations.
@@ -147,7 +155,7 @@ index 2656f80..221e6db 100644
if (is_win) {
cflags = [
"/Od", # Disable optimization.
@@ -2039,7 +1969,8 @@ config("no_optimize") {
@@ -2066,7 +1989,8 @@ config("no_optimize") {
# Turns up the optimization level. On Windows, this implies whole program
# optimization and link-time code generation which is very expensive and should
# be used sparingly.
@@ -157,7 +165,7 @@ index 2656f80..221e6db 100644
if (is_nacl && is_nacl_irt) {
# The NaCl IRT is a special case and always wants its own config.
# Various components do:
@@ -2072,7 +2003,8 @@ config("optimize_max") {
@@ -2099,7 +2023,8 @@ config("optimize_max") {
#
# TODO(crbug.com/621335) - rework how all of these configs are related
# so that we don't need this disclaimer.
@@ -167,7 +175,7 @@ index 2656f80..221e6db 100644
if (is_nacl && is_nacl_irt) {
# The NaCl IRT is a special case and always wants its own config.
# Various components do:
@@ -2098,7 +2030,8 @@ config("optimize_speed") {
@@ -2125,7 +2050,8 @@ config("optimize_speed") {
}
}
@@ -177,7 +185,7 @@ index 2656f80..221e6db 100644
cflags = [ "-O1" ] + common_optimize_on_cflags
rustflags = [ "-Copt-level=1" ]
ldflags = common_optimize_on_ldflags
@@ -2218,7 +2151,8 @@ config("win_pdbaltpath") {
@@ -2245,7 +2171,8 @@ config("win_pdbaltpath") {
}
# Full symbols.
@@ -187,7 +195,7 @@ index 2656f80..221e6db 100644
if (is_win) {
if (is_clang) {
cflags = [ "/Z7" ] # Debug information in the .obj files.
@@ -2337,7 +2271,8 @@ config("symbols") {
@@ -2369,7 +2296,8 @@ config("symbols") {
# Minimal symbols.
# This config guarantees to hold symbol for stack trace which are shown to user
# when crash happens in unittests running on buildbot.
@@ -197,7 +205,7 @@ index 2656f80..221e6db 100644
if (is_win) {
# Functions, files, and line tables only.
cflags = []
@@ -2407,7 +2342,8 @@ config("minimal_symbols") {
@@ -2438,7 +2366,8 @@ config("minimal_symbols") {
# This configuration contains function names only. That is, the compiler is
# told to not generate debug information and the linker then just puts function
# names in the final debug information.
@@ -1,30 +1,29 @@
From 80368f8ba7a8bab13440463a254888311efe3986 Mon Sep 17 00:00:00 2001
From 144479ad7b4287bee4067f95e4218f614798a865 Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Tue, 4 May 2021 15:00:19 +0000
Date: Sun, 16 Jan 2022 19:15:26 +0000
Subject: [PATCH] sql: make VirtualCursor standard layout type
sql::recover::VirtualCursor needs to be a standard layout type, but
has members of type std::unique_ptr. However, std::unique_ptr is not
guaranteed to be standard layout. Compiling with clang combined with
gcc-11 libstdc++ fails because of this. Replace std::unique_ptr with
raw pointers.
gcc-11 libstdc++ fails because of this.
Bug: 1189788
Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c
---
sql/recover_module/btree.cc | 21 +++++++++++++++------
sql/recover_module/btree.h | 17 +++++++++++++----
sql/recover_module/btree.cc | 18 ++++++++++++------
sql/recover_module/btree.h | 21 +++++++++++++++------
sql/recover_module/cursor.cc | 24 ++++++++++++------------
sql/recover_module/cursor.h | 2 +-
sql/recover_module/pager.cc | 7 +++----
sql/recover_module/pager.h | 5 +++--
6 files changed, 47 insertions(+), 29 deletions(-)
sql/recover_module/pager.cc | 5 ++---
sql/recover_module/pager.h | 6 +++---
6 files changed, 45 insertions(+), 31 deletions(-)
diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
index 9ecaafe8a3..839318abf9 100644
index cc9420e5c05..f12d8fa32a2 100644
--- a/sql/recover_module/btree.cc
+++ b/sql/recover_module/btree.cc
@@ -135,16 +135,25 @@ static_assert(std::is_trivially_destructible<LeafPageDecoder>::value,
@@ -136,16 +136,22 @@ static_assert(std::is_trivially_destructible<LeafPageDecoder>::value,
"Move the destructor to the .cc file if it's non-trival");
#endif // !DCHECK_IS_ON()
@@ -34,46 +33,47 @@ index 9ecaafe8a3..839318abf9 100644
- cell_count_(ComputeCellCount(db_reader)),
- next_read_index_(0),
- last_record_size_(0) {
+LeafPageDecoder::LeafPageDecoder() noexcept = default;
+
+void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) {
+ DCHECK(db_reader);
DCHECK(IsOnValidPage(db_reader));
+ page_id_ = db_reader->page_id();
+ db_reader_ = db_reader;
+ cell_count_ = ComputeCellCount(db_reader);
+ next_read_index_ = 0;
+ last_record_size_ = 0;
DCHECK(IsOnValidPage(db_reader));
DCHECK(DatabasePageReader::IsValidPageId(page_id_));
}
+void LeafPageDecoder::Reset() {
+ db_reader_ = nullptr;
+ page_id_ = 0;
+ cell_count_ = 0;
+ next_read_index_ = 0;
+ last_record_size_ = 0;
+}
+
bool LeafPageDecoder::TryAdvance() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(CanAdvance());
diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h
index d76d076bf6..33114b01fa 100644
index eaa087a5c52..df0e0c937c0 100644
--- a/sql/recover_module/btree.h
+++ b/sql/recover_module/btree.h
@@ -102,7 +102,7 @@ class LeafPageDecoder {
@@ -101,9 +101,7 @@ class LeafPageDecoder {
public:
// Creates a decoder for a DatabasePageReader's last read page.
//
// |db_reader| must have been used to read an inner page of a table B-tree.
// |db_reader| must outlive this instance.
- // |db_reader| must have been used to read an inner page of a table B-tree.
- // |db_reader| must outlive this instance.
- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept;
+ explicit LeafPageDecoder() noexcept = default;
+ LeafPageDecoder() noexcept;
~LeafPageDecoder() noexcept = default;
LeafPageDecoder(const LeafPageDecoder&) = delete;
@@ -150,6 +150,15 @@ class LeafPageDecoder {
@@ -151,6 +149,17 @@ class LeafPageDecoder {
// read as long as CanAdvance() returns true.
bool TryAdvance();
+ // Initialize with DatabasePageReader
+ // |db_reader| must have been used to read an inner page of a table B-tree.
+ // |db_reader| must outlive this instance.
+ void Initialize(DatabasePageReader* db_reader);
+
+ // Reset internal DatabasePageReader
@@ -85,7 +85,7 @@ index d76d076bf6..33114b01fa 100644
// True if the given reader may point to an inner page in a table B-tree.
//
// The last ReadPage() call on |db_reader| must have succeeded.
@@ -163,14 +172,14 @@ class LeafPageDecoder {
@@ -164,14 +173,14 @@ class LeafPageDecoder {
static int ComputeCellCount(DatabasePageReader* db_reader);
// The number of the B-tree page this reader is reading.
@@ -104,10 +104,10 @@ index d76d076bf6..33114b01fa 100644
// The reader's cursor state.
//
diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc
index 0029ff9295..42548bc4b5 100644
index 4f827edf1b4..240de4999fe 100644
--- a/sql/recover_module/cursor.cc
+++ b/sql/recover_module/cursor.cc
@@ -26,7 +26,7 @@ VirtualCursor::~VirtualCursor() {
@@ -28,7 +28,7 @@ VirtualCursor::~VirtualCursor() {
int VirtualCursor::First() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
inner_decoders_.clear();
@@ -116,7 +116,7 @@ index 0029ff9295..42548bc4b5 100644
AppendPageDecoder(table_->root_page_id());
return Next();
@@ -36,18 +36,18 @@ int VirtualCursor::Next() {
@@ -38,18 +38,18 @@ int VirtualCursor::Next() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
record_reader_.Reset();
@@ -142,7 +142,7 @@ index 0029ff9295..42548bc4b5 100644
continue;
}
if (!record_reader_.Initialize())
@@ -99,13 +99,13 @@ int VirtualCursor::ReadColumn(int column_index,
@@ -101,13 +101,13 @@ int VirtualCursor::ReadColumn(int column_index,
int64_t VirtualCursor::RowId() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(record_reader_.IsInitialized());
@@ -159,7 +159,7 @@ index 0029ff9295..42548bc4b5 100644
<< __func__
<< " must only be called when the current path has no leaf decoder";
@@ -113,7 +113,7 @@ void VirtualCursor::AppendPageDecoder(int page_id) {
@@ -115,7 +115,7 @@ void VirtualCursor::AppendPageDecoder(int page_id) {
return;
if (LeafPageDecoder::IsOnValidPage(&db_reader_)) {
@@ -169,10 +169,10 @@ index 0029ff9295..42548bc4b5 100644
}
diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h
index afcd6900e1..b15c31d425 100644
index 845b7852648..cc4e85f83f9 100644
--- a/sql/recover_module/cursor.h
+++ b/sql/recover_module/cursor.h
@@ -129,7 +129,7 @@ class VirtualCursor {
@@ -130,7 +130,7 @@ class VirtualCursor {
std::vector<std::unique_ptr<InnerPageDecoder>> inner_decoders_;
// Decodes the leaf page containing records.
@@ -182,7 +182,7 @@ index afcd6900e1..b15c31d425 100644
SEQUENCE_CHECKER(sequence_checker_);
};
diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc
index 58e75de270..5fe96204e5 100644
index 58e75de2704..69d98cef98d 100644
--- a/sql/recover_module/pager.cc
+++ b/sql/recover_module/pager.cc
@@ -23,8 +23,7 @@ static_assert(DatabasePageReader::kMaxPageId <= std::numeric_limits<int>::max(),
@@ -191,34 +191,34 @@ index 58e75de270..5fe96204e5 100644
DatabasePageReader::DatabasePageReader(VirtualTable* table)
- : page_data_(std::make_unique<uint8_t[]>(table->page_size())),
- table_(table) {
+ : page_data_(), table_(table) {
+ : page_data_(table->page_size()), table_(table) {
DCHECK(table != nullptr);
DCHECK(IsValidPageSize(table->page_size()));
}
@@ -57,8 +56,8 @@ int DatabasePageReader::ReadPage(int page_id) {
std::numeric_limits<int64_t>::max(),
@@ -58,7 +57,7 @@ int DatabasePageReader::ReadPage(int page_id) {
"The |read_offset| computation above may overflow");
- int sqlite_status =
int sqlite_status =
- RawRead(sqlite_file, read_size, read_offset, page_data_.get());
+ int sqlite_status = RawRead(sqlite_file, read_size, read_offset,
+ const_cast<uint8_t*>(page_data_.data()));
+ RawRead(sqlite_file, read_size, read_offset, page_data_.data());
// |page_id_| needs to be set to kInvalidPageId if the read failed.
// Otherwise, future ReadPage() calls with the previous |page_id_| value
diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h
index 0e388ddc3b..99314e30ff 100644
index 07cac3cb989..d08f0932fab 100644
--- a/sql/recover_module/pager.h
+++ b/sql/recover_module/pager.h
@@ -5,6 +5,7 @@
#ifndef SQL_RECOVER_MODULE_PAGER_H_
@@ -6,8 +6,8 @@
#define SQL_RECOVER_MODULE_PAGER_H_
+#include <array>
#include <cstdint>
#include <memory>
-#include <memory>
#include <ostream>
+#include <vector>
@@ -70,7 +71,7 @@ class DatabasePageReader {
#include "base/check_op.h"
#include "base/memory/raw_ptr.h"
@@ -72,7 +72,7 @@ class DatabasePageReader {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK_NE(page_id_, kInvalidPageId)
<< "Successful ReadPage() required before accessing pager state";
@@ -227,12 +227,12 @@ index 0e388ddc3b..99314e30ff 100644
}
// The number of bytes in the page read by the last ReadPage() call.
@@ -137,7 +138,7 @@ class DatabasePageReader {
@@ -139,7 +139,7 @@ class DatabasePageReader {
int page_id_ = kInvalidPageId;
// Stores the bytes of the last page successfully read by ReadPage().
// The content is undefined if the last call to ReadPage() did not succeed.
- const std::unique_ptr<uint8_t[]> page_data_;
+ const std::array<uint8_t, kMaxPageSize> page_data_;
+ std::vector<uint8_t> page_data_;
// Raw pointer usage is acceptable because this instance's owner is expected
// to ensure that the VirtualTable outlives this.
VirtualTable* const table_;
const raw_ptr<VirtualTable> table_;
@@ -0,0 +1,72 @@
From cb0aad687f34629a42053d600cf2947282cea2c0 Mon Sep 17 00:00:00 2001
From: Lei Zhang <thestig@chromium.org>
Date: Mon, 31 Jan 2022 22:42:35 +0000
Subject: [PATCH] Use FT_Done_MM_Var() in CFX_Font::AdjustMMParams() when
possible.
When FreeType has FT_Done_MM_Var(), use that to free memory in
CFX_Font::AdjustMMParams() to avoid mismatched alloc/free functions.
Bug: pdfium:1400
Change-Id: I044540893103921fc64cdd53fcd628cfebf2c9db
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/90130
Reviewed-by: Nigi <nigi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
(cherry picked from commit ffeb67faf715475f6e463d65c368f556780adf19)
---
core/fxge/cfx_font.cpp | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
index 7a4e8eb24..0ef421fe7 100644
--- a/core/fxge/cfx_font.cpp
+++ b/core/fxge/cfx_font.cpp
@@ -43,6 +43,30 @@ struct OUTLINE_PARAMS {
float m_CoordUnit;
};
+// TODO(crbug.com/pdfium/1400): When FT_Done_MM_Var() is more likely to be
+// available to all users in the future, remove FreeMMVar() and use
+// FT_Done_MM_Var() directly.
+//
+// Use weak symbols to check if FT_Done_MM_Var() is available at runtime.
+#if !defined(OS_WIN)
+extern "C" __attribute__((weak)) decltype(FT_Done_MM_Var) FT_Done_MM_Var;
+#endif
+
+void FreeMMVar(FXFT_FaceRec* rec, FXFT_MM_VarPtr variation_desc) {
+#if defined(OS_WIN)
+ // Assume `use_system_freetype` GN var is never set on Windows.
+ constexpr bool has_ft_done_mm_var_func = true;
+#else
+ static const bool has_ft_done_mm_var_func = !!FT_Done_MM_Var;
+#endif
+ if (has_ft_done_mm_var_func) {
+ FT_Done_MM_Var(CFX_GEModule::Get()->GetFontMgr()->GetFTLibrary(),
+ variation_desc);
+ } else {
+ FXFT_Free(rec, variation_desc);
+ }
+}
+
#ifdef PDF_ENABLE_XFA
unsigned long FTStreamRead(FXFT_StreamRec* stream,
unsigned long offset,
@@ -640,14 +664,14 @@ void CFX_Font::AdjustMMParams(int glyph_index,
int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
if (max_width == min_width) {
- FXFT_Free(m_Face->GetRec(), pMasters);
+ FreeMMVar(m_Face->GetRec(), pMasters);
return;
}
int param = min_param + (max_param - min_param) * (dest_width - min_width) /
(max_width - min_width);
coords[1] = param;
}
- FXFT_Free(m_Face->GetRec(), pMasters);
+ FreeMMVar(m_Face->GetRec(), pMasters);
FT_Set_MM_Design_Coordinates(m_Face->GetRec(), 2, coords);
}
+14 -7
View File
@@ -13,7 +13,7 @@
<IsA>app:gui</IsA>
<Summary>A WebKit powered web browser</Summary>
<Description>Chromium-browser is an open-source web browser, powered by WebKit.</Description>
<Archive type="tarxz" sha1sum="7fc6b55e015a4746bac5fd2e10e2c7673ae5b627">http://gsdview.appspot.com/chromium-browser-official/chromium-97.0.4692.77.tar.xz</Archive>
<Archive type="tarxz" sha1sum="16a365603bde327d98d24c3e66301db139f9f493">http://gsdview.appspot.com/chromium-browser-official/chromium-98.0.4758.91.tar.xz</Archive>
<BuildDependencies>
<Dependency>alsa-lib-devel</Dependency>
<Dependency>at-spi2-atk-devel</Dependency>
@@ -103,9 +103,9 @@
</BuildDependencies>
<Patches>
<!-- Arch Patches -->
<Patch level="0">unexpire-accelerated-video-decode-flag.patch</Patch>
<Patch level="1">fix-tag-dragging-in-KWin.patch</Patch>
<Patch level="1">fix-tag-dragging-in-Mutter.patch</Patch>
<Patch level="1">downgrade-duplicate-peer-error-to-dvlog.patch</Patch>
<Patch level="1">fix-build-break-with-system-libdrm.patch</Patch>
<Patch level="1">use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch</Patch>
<Patch level="1">sql-make-VirtualCursor-standard-layout-type.patch</Patch>
<Patch level="1">use-oauth2-client-switches-as-default.patch</Patch>
<!-- Other Patches -->
@@ -116,9 +116,9 @@
<!-- Chromium Patchset -->
<!-- Source: https://github.com/stha09/chromium-patches -->
<Patch level="1">patches/chromium-78-protobuf-RepeatedPtrField-export.patch</Patch>
<Patch level="1">patches/chromium-97-Point-constexpr.patch</Patch>
<Patch level="1">patches/chromium-97-ScrollView-reference.patch</Patch>
<Patch level="1">patches/chromium-97-compiler.patch</Patch>
<Patch level="1">patches/chromium-98-compiler.patch</Patch>
<Patch level="1">patches/chromium-98-MiraclePtr-gcc-ice.patch</Patch>
<Patch level="1">patches/chromium-98-WaylandFrameManager-check.patch</Patch>
</Patches>
</Source>
@@ -200,6 +200,13 @@
</Package>
<History>
<Update release="27">
<Date>2022-02-14</Date>
<Version>98.0.4758.91</Version>
<Comment>Version Bump</Comment>
<Name>İdris Kalp</Name>
<Email>idriskalp@gmail.com</Email>
</Update>
<Update release="26">
<Date>2022-01-11</Date>
<Version>97.0.4692.77</Version>