parent
5027d01233
commit
b733bdb781
@ -1,231 +0,0 @@
|
|||||||
From 144479ad7b4287bee4067f95e4218f614798a865 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Stephan Hartmann <stha09@googlemail.com>
|
|
||||||
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.
|
|
||||||
|
|
||||||
Bug: 1189788
|
|
||||||
Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c
|
|
||||||
---
|
|
||||||
|
|
||||||
diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
|
|
||||||
index cc9420e5..f12d8fa 100644
|
|
||||||
--- a/sql/recover_module/btree.cc
|
|
||||||
+++ b/sql/recover_module/btree.cc
|
|
||||||
@@ -136,16 +136,22 @@
|
|
||||||
"Move the destructor to the .cc file if it's non-trival");
|
|
||||||
#endif // !DCHECK_IS_ON()
|
|
||||||
|
|
||||||
-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept
|
|
||||||
- : page_id_(db_reader->page_id()),
|
|
||||||
- db_reader_(db_reader),
|
|
||||||
- cell_count_(ComputeCellCount(db_reader)),
|
|
||||||
- next_read_index_(0),
|
|
||||||
- last_record_size_(0) {
|
|
||||||
+LeafPageDecoder::LeafPageDecoder() noexcept = default;
|
|
||||||
+
|
|
||||||
+void LeafPageDecoder::Initialize(DatabasePageReader* 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;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
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 eaa087a5..df0e0c9 100644
|
|
||||||
--- a/sql/recover_module/btree.h
|
|
||||||
+++ b/sql/recover_module/btree.h
|
|
||||||
@@ -101,9 +101,7 @@
|
|
||||||
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.
|
|
||||||
- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept;
|
|
||||||
+ LeafPageDecoder() noexcept;
|
|
||||||
~LeafPageDecoder() noexcept = default;
|
|
||||||
|
|
||||||
LeafPageDecoder(const LeafPageDecoder&) = delete;
|
|
||||||
@@ -151,6 +149,17 @@
|
|
||||||
// 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
|
|
||||||
+ void Reset();
|
|
||||||
+
|
|
||||||
+ // True if DatabasePageReader is valid
|
|
||||||
+ bool IsValid() { return (db_reader_ != nullptr); }
|
|
||||||
+
|
|
||||||
// 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.
|
|
||||||
@@ -164,14 +173,14 @@
|
|
||||||
static int ComputeCellCount(DatabasePageReader* db_reader);
|
|
||||||
|
|
||||||
// The number of the B-tree page this reader is reading.
|
|
||||||
- const int64_t page_id_;
|
|
||||||
+ int64_t page_id_;
|
|
||||||
// Used to read the tree page.
|
|
||||||
//
|
|
||||||
// Raw pointer usage is acceptable because this instance's owner is expected
|
|
||||||
// to ensure that the DatabasePageReader outlives this.
|
|
||||||
- DatabasePageReader* const db_reader_;
|
|
||||||
+ DatabasePageReader* db_reader_;
|
|
||||||
// Caches the ComputeCellCount() value for this reader's page.
|
|
||||||
- const int cell_count_ = ComputeCellCount(db_reader_);
|
|
||||||
+ int cell_count_;
|
|
||||||
|
|
||||||
// The reader's cursor state.
|
|
||||||
//
|
|
||||||
diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc
|
|
||||||
index 4f827ed..240de499 100644
|
|
||||||
--- a/sql/recover_module/cursor.cc
|
|
||||||
+++ b/sql/recover_module/cursor.cc
|
|
||||||
@@ -28,7 +28,7 @@
|
|
||||||
int VirtualCursor::First() {
|
|
||||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
||||||
inner_decoders_.clear();
|
|
||||||
- leaf_decoder_ = nullptr;
|
|
||||||
+ leaf_decoder_.Reset();
|
|
||||||
|
|
||||||
AppendPageDecoder(table_->root_page_id());
|
|
||||||
return Next();
|
|
||||||
@@ -38,18 +38,18 @@
|
|
||||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
||||||
record_reader_.Reset();
|
|
||||||
|
|
||||||
- while (!inner_decoders_.empty() || leaf_decoder_.get()) {
|
|
||||||
- if (leaf_decoder_.get()) {
|
|
||||||
- if (!leaf_decoder_->CanAdvance()) {
|
|
||||||
+ while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) {
|
|
||||||
+ if (leaf_decoder_.IsValid()) {
|
|
||||||
+ if (!leaf_decoder_.CanAdvance()) {
|
|
||||||
// The leaf has been exhausted. Remove it from the DFS stack.
|
|
||||||
- leaf_decoder_ = nullptr;
|
|
||||||
+ leaf_decoder_.Reset();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
- if (!leaf_decoder_->TryAdvance())
|
|
||||||
+ if (!leaf_decoder_.TryAdvance())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
- if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(),
|
|
||||||
- leaf_decoder_->last_record_offset())) {
|
|
||||||
+ if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(),
|
|
||||||
+ leaf_decoder_.last_record_offset())) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!record_reader_.Initialize())
|
|
||||||
@@ -101,13 +101,13 @@
|
|
||||||
int64_t VirtualCursor::RowId() {
|
|
||||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
||||||
DCHECK(record_reader_.IsInitialized());
|
|
||||||
- DCHECK(leaf_decoder_.get());
|
|
||||||
- return leaf_decoder_->last_record_rowid();
|
|
||||||
+ DCHECK(leaf_decoder_.IsValid());
|
|
||||||
+ return leaf_decoder_.last_record_rowid();
|
|
||||||
}
|
|
||||||
|
|
||||||
void VirtualCursor::AppendPageDecoder(int page_id) {
|
|
||||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
||||||
- DCHECK(leaf_decoder_.get() == nullptr)
|
|
||||||
+ DCHECK(!leaf_decoder_.IsValid())
|
|
||||||
<< __func__
|
|
||||||
<< " must only be called when the current path has no leaf decoder";
|
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (LeafPageDecoder::IsOnValidPage(&db_reader_)) {
|
|
||||||
- leaf_decoder_ = std::make_unique<LeafPageDecoder>(&db_reader_);
|
|
||||||
+ leaf_decoder_.Initialize(&db_reader_);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h
|
|
||||||
index 845b785..cc4e85f8 100644
|
|
||||||
--- a/sql/recover_module/cursor.h
|
|
||||||
+++ b/sql/recover_module/cursor.h
|
|
||||||
@@ -130,7 +130,7 @@
|
|
||||||
std::vector<std::unique_ptr<InnerPageDecoder>> inner_decoders_;
|
|
||||||
|
|
||||||
// Decodes the leaf page containing records.
|
|
||||||
- std::unique_ptr<LeafPageDecoder> leaf_decoder_;
|
|
||||||
+ LeafPageDecoder leaf_decoder_;
|
|
||||||
|
|
||||||
SEQUENCE_CHECKER(sequence_checker_);
|
|
||||||
};
|
|
||||||
diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc
|
|
||||||
index 58e75de..69d98cef 100644
|
|
||||||
--- a/sql/recover_module/pager.cc
|
|
||||||
+++ b/sql/recover_module/pager.cc
|
|
||||||
@@ -23,8 +23,7 @@
|
|
||||||
"ints are not appropriate for representing page IDs");
|
|
||||||
|
|
||||||
DatabasePageReader::DatabasePageReader(VirtualTable* table)
|
|
||||||
- : page_data_(std::make_unique<uint8_t[]>(table->page_size())),
|
|
||||||
- table_(table) {
|
|
||||||
+ : page_data_(table->page_size()), table_(table) {
|
|
||||||
DCHECK(table != nullptr);
|
|
||||||
DCHECK(IsValidPageSize(table->page_size()));
|
|
||||||
}
|
|
||||||
@@ -58,7 +57,7 @@
|
|
||||||
"The |read_offset| computation above may overflow");
|
|
||||||
|
|
||||||
int sqlite_status =
|
|
||||||
- RawRead(sqlite_file, read_size, read_offset, page_data_.get());
|
|
||||||
+ 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 07cac3cb..d08f093 100644
|
|
||||||
--- a/sql/recover_module/pager.h
|
|
||||||
+++ b/sql/recover_module/pager.h
|
|
||||||
@@ -6,8 +6,8 @@
|
|
||||||
#define SQL_RECOVER_MODULE_PAGER_H_
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
-#include <memory>
|
|
||||||
#include <ostream>
|
|
||||||
+#include <vector>
|
|
||||||
|
|
||||||
#include "base/check_op.h"
|
|
||||||
#include "base/memory/raw_ptr.h"
|
|
||||||
@@ -72,7 +72,7 @@
|
|
||||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
||||||
DCHECK_NE(page_id_, kInvalidPageId)
|
|
||||||
<< "Successful ReadPage() required before accessing pager state";
|
|
||||||
- return page_data_.get();
|
|
||||||
+ return page_data_.data();
|
|
||||||
}
|
|
||||||
|
|
||||||
// The number of bytes in the page read by the last ReadPage() call.
|
|
||||||
@@ -139,7 +139,7 @@
|
|
||||||
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_;
|
|
||||||
+ 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.
|
|
||||||
const raw_ptr<VirtualTable> table_;
|
|
@ -1,86 +0,0 @@
|
|||||||
From 96ee2a8e20bb7a7c4fb19e27dc31ff5c6a472849 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ryan Gonzalez <rymg19@gmail.com>
|
|
||||||
Date: Mon, 06 Mar 2023 20:22:25 -0600
|
|
||||||
Subject: [PATCH] AddressTrackerLinux: Increase the message buffer size
|
|
||||||
|
|
||||||
On non-4k-page systems, the message sizes may be too large to fit into
|
|
||||||
the buffer, resulting in MSG_TRUNC. Instead of using the fixed 4kb size,
|
|
||||||
follow the kernel documentation guidelines as to how large the buffer
|
|
||||||
should be.
|
|
||||||
|
|
||||||
Originally found by Asahi Lina:
|
|
||||||
|
|
||||||
https://vt.social/@lina/109976892758680822
|
|
||||||
|
|
||||||
Bug: None
|
|
||||||
Change-Id: I4790435190167a706fa7490ab57706db1f4a6120
|
|
||||||
---
|
|
||||||
|
|
||||||
diff --git a/net/base/address_tracker_linux.cc b/net/base/address_tracker_linux.cc
|
|
||||||
index 4976cae..f1a1fff 100644
|
|
||||||
--- a/net/base/address_tracker_linux.cc
|
|
||||||
+++ b/net/base/address_tracker_linux.cc
|
|
||||||
@@ -14,6 +14,7 @@
|
|
||||||
#include "base/files/scoped_file.h"
|
|
||||||
#include "base/functional/callback_helpers.h"
|
|
||||||
#include "base/logging.h"
|
|
||||||
+#include "base/memory/page_size.h"
|
|
||||||
#include "base/posix/eintr_wrapper.h"
|
|
||||||
#include "base/task/current_thread.h"
|
|
||||||
#include "base/threading/scoped_blocking_call.h"
|
|
||||||
@@ -323,8 +324,30 @@
|
|
||||||
*address_changed = false;
|
|
||||||
*link_changed = false;
|
|
||||||
*tunnel_changed = false;
|
|
||||||
- char buffer[4096];
|
|
||||||
bool first_loop = true;
|
|
||||||
+
|
|
||||||
+ // Varying sources have different opinions regarding the buffer size needed
|
|
||||||
+ // for netlink messages to avoid truncation:
|
|
||||||
+ // - The official documentation on netlink says messages are generally 8kb
|
|
||||||
+ // or the system page size, whichever is *larger*:
|
|
||||||
+ // https://www.kernel.org/doc/html/v6.2/userspace-api/netlink/intro.html#buffer-sizing
|
|
||||||
+ // - The kernel headers would imply that messages are generally the system
|
|
||||||
+ // page size or 8kb, whichever is *smaller*:
|
|
||||||
+ // https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/linux/netlink.h?h=v6.2.2#n226
|
|
||||||
+ // (libmnl follows this.)
|
|
||||||
+ // - The netlink(7) man page's example always uses a fixed size 8kb buffer:
|
|
||||||
+ // https://man7.org/linux/man-pages/man7/netlink.7.html
|
|
||||||
+ // Here, we follow the guidelines in the documentation, for two primary
|
|
||||||
+ // reasons:
|
|
||||||
+ // - Erring on the side of a larger size is the safer way to go to avoid
|
|
||||||
+ // MSG_TRUNC.
|
|
||||||
+ // - Since this is heap-allocated anyway, there's no risk to the stack by
|
|
||||||
+ // using the larger size.
|
|
||||||
+
|
|
||||||
+ constexpr size_t kMinNetlinkBufferSize = 8 * 1024;
|
|
||||||
+ std::vector<char> buffer(
|
|
||||||
+ std::max(base::GetPageSize(), kMinNetlinkBufferSize));
|
|
||||||
+
|
|
||||||
{
|
|
||||||
absl::optional<base::ScopedBlockingCall> blocking_call;
|
|
||||||
if (tracking_) {
|
|
||||||
@@ -334,9 +357,10 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
- int rv = HANDLE_EINTR(recv(netlink_fd_.get(), buffer, sizeof(buffer),
|
|
||||||
- // Block the first time through loop.
|
|
||||||
- first_loop ? 0 : MSG_DONTWAIT));
|
|
||||||
+ int rv =
|
|
||||||
+ HANDLE_EINTR(recv(netlink_fd_.get(), buffer.data(), buffer.size(),
|
|
||||||
+ // Block the first time through loop.
|
|
||||||
+ first_loop ? 0 : MSG_DONTWAIT));
|
|
||||||
first_loop = false;
|
|
||||||
if (rv == 0) {
|
|
||||||
LOG(ERROR) << "Unexpected shutdown of NETLINK socket.";
|
|
||||||
@@ -348,7 +372,8 @@
|
|
||||||
PLOG(ERROR) << "Failed to recv from netlink socket";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
- HandleMessage(buffer, rv, address_changed, link_changed, tunnel_changed);
|
|
||||||
+ HandleMessage(buffer.data(), rv, address_changed, link_changed,
|
|
||||||
+ tunnel_changed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (*link_changed || *address_changed)
|
|
@ -1,454 +0,0 @@
|
|||||||
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
|
|
||||||
index 3470da1..ff39851b 100644
|
|
||||||
--- a/chrome/browser/ui/BUILD.gn
|
|
||||||
+++ b/chrome/browser/ui/BUILD.gn
|
|
||||||
@@ -5628,8 +5628,12 @@
|
|
||||||
sources += [
|
|
||||||
"views/chrome_browser_main_extra_parts_views_linux.cc",
|
|
||||||
"views/chrome_browser_main_extra_parts_views_linux.h",
|
|
||||||
+ "views/dark_mode_manager_linux.cc",
|
|
||||||
+ "views/dark_mode_manager_linux.h",
|
|
||||||
]
|
|
||||||
deps += [
|
|
||||||
+ "//components/dbus/thread_linux",
|
|
||||||
+ "//dbus",
|
|
||||||
"//ui/base/cursor",
|
|
||||||
"//ui/ozone",
|
|
||||||
]
|
|
||||||
diff --git a/chrome/browser/ui/DEPS b/chrome/browser/ui/DEPS
|
|
||||||
index fc3fab23..b56a704e 100644
|
|
||||||
--- a/chrome/browser/ui/DEPS
|
|
||||||
+++ b/chrome/browser/ui/DEPS
|
|
||||||
@@ -42,6 +42,9 @@
|
|
||||||
"browser_navigator_browsertest\.cc": [
|
|
||||||
"+ash/shell.h",
|
|
||||||
],
|
|
||||||
+ "dark_mode_manager_linux\.cc": [
|
|
||||||
+ "+dbus",
|
|
||||||
+ ],
|
|
||||||
"fullscreen_controller_interactive_browsertest\.cc": [
|
|
||||||
"+ash/shell.h",
|
|
||||||
],
|
|
||||||
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
|
|
||||||
index dbc9cc4e..d7fad5b 100644
|
|
||||||
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
|
|
||||||
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
|
|
||||||
@@ -7,6 +7,7 @@
|
|
||||||
#include "base/metrics/histogram_macros.h"
|
|
||||||
#include "chrome/browser/themes/theme_service_aura_linux.h"
|
|
||||||
#include "chrome/browser/ui/browser_list.h"
|
|
||||||
+#include "chrome/browser/ui/views/dark_mode_manager_linux.h"
|
|
||||||
#include "chrome/browser/ui/views/theme_profile_key.h"
|
|
||||||
#include "ui/base/buildflags.h"
|
|
||||||
#include "ui/base/cursor/cursor_factory.h"
|
|
||||||
@@ -56,6 +57,8 @@
|
|
||||||
UMA_HISTOGRAM_ENUMERATION("Linux.SystemTheme.Default",
|
|
||||||
linux_ui_theme->GetNativeTheme()->system_theme());
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ dark_mode_manager_ = std::make_unique<ui::DarkModeManagerLinux>();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChromeBrowserMainExtraPartsViewsLinux::PreCreateThreads() {
|
|
||||||
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h
|
|
||||||
index 392d14c..6deb520 100644
|
|
||||||
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h
|
|
||||||
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h
|
|
||||||
@@ -13,6 +13,7 @@
|
|
||||||
|
|
||||||
namespace ui {
|
|
||||||
class LinuxUiGetter;
|
|
||||||
+class DarkModeManagerLinux;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extra parts, which are used by both Ozone/X11/Wayland and inherited by the
|
|
||||||
@@ -41,6 +42,8 @@
|
|
||||||
absl::optional<display::ScopedDisplayObserver> display_observer_;
|
|
||||||
|
|
||||||
std::unique_ptr<ui::LinuxUiGetter> linux_ui_getter_;
|
|
||||||
+
|
|
||||||
+ std::unique_ptr<ui::DarkModeManagerLinux> dark_mode_manager_;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // CHROME_BROWSER_UI_VIEWS_CHROME_BROWSER_MAIN_EXTRA_PARTS_VIEWS_LINUX_H_
|
|
||||||
diff --git a/chrome/browser/ui/views/dark_mode_manager_linux.cc b/chrome/browser/ui/views/dark_mode_manager_linux.cc
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..bb638f7
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/chrome/browser/ui/views/dark_mode_manager_linux.cc
|
|
||||||
@@ -0,0 +1,160 @@
|
|
||||||
+// Copyright 2023 The Chromium Authors
|
|
||||||
+// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
+// found in the LICENSE file.
|
|
||||||
+
|
|
||||||
+#include "chrome/browser/ui/views/dark_mode_manager_linux.h"
|
|
||||||
+
|
|
||||||
+#include "base/functional/bind.h"
|
|
||||||
+#include "base/logging.h"
|
|
||||||
+#include "components/dbus/thread_linux/dbus_thread_linux.h"
|
|
||||||
+#include "dbus/bus.h"
|
|
||||||
+#include "dbus/message.h"
|
|
||||||
+#include "dbus/object_proxy.h"
|
|
||||||
+#include "ui/linux/linux_ui.h"
|
|
||||||
+#include "ui/linux/linux_ui_factory.h"
|
|
||||||
+#include "ui/native_theme/native_theme.h"
|
|
||||||
+
|
|
||||||
+namespace {
|
|
||||||
+
|
|
||||||
+constexpr char kFreedesktopSettingsService[] = "org.freedesktop.portal.Desktop";
|
|
||||||
+constexpr char kFreedesktopSettingsObjectPath[] =
|
|
||||||
+ "/org/freedesktop/portal/desktop";
|
|
||||||
+constexpr char kFreedesktopSettingsInterface[] =
|
|
||||||
+ "org.freedesktop.portal.Settings";
|
|
||||||
+constexpr char kSettingChangedSignal[] = "SettingChanged";
|
|
||||||
+constexpr char kReadMethod[] = "Read";
|
|
||||||
+constexpr char kSettingsNamespace[] = "org.freedesktop.appearance";
|
|
||||||
+constexpr char kColorSchemeKey[] = "color-scheme";
|
|
||||||
+constexpr int kFreedesktopColorSchemeDark = 1;
|
|
||||||
+
|
|
||||||
+scoped_refptr<dbus::Bus> CreateBus() {
|
|
||||||
+ dbus::Bus::Options options;
|
|
||||||
+ options.bus_type = dbus::Bus::SESSION;
|
|
||||||
+ options.connection_type = dbus::Bus::PRIVATE;
|
|
||||||
+ options.dbus_task_runner = dbus_thread_linux::GetTaskRunner();
|
|
||||||
+ return base::MakeRefCounted<dbus::Bus>(options);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+} // namespace
|
|
||||||
+
|
|
||||||
+namespace ui {
|
|
||||||
+
|
|
||||||
+DarkModeManagerLinux::DarkModeManagerLinux()
|
|
||||||
+ : bus_(CreateBus()),
|
|
||||||
+ settings_proxy_(bus_->GetObjectProxy(
|
|
||||||
+ kFreedesktopSettingsService,
|
|
||||||
+ dbus::ObjectPath(kFreedesktopSettingsObjectPath))) {
|
|
||||||
+ // Subscribe to changes in the color scheme preference.
|
|
||||||
+ settings_proxy_->ConnectToSignal(
|
|
||||||
+ kFreedesktopSettingsInterface, kSettingChangedSignal,
|
|
||||||
+ base::BindRepeating(&DarkModeManagerLinux::OnPortalSettingChanged,
|
|
||||||
+ weak_ptr_factory_.GetWeakPtr()),
|
|
||||||
+ base::BindOnce(&DarkModeManagerLinux::OnSignalConnected,
|
|
||||||
+ weak_ptr_factory_.GetWeakPtr()));
|
|
||||||
+
|
|
||||||
+ // Read initial color scheme preference.
|
|
||||||
+ dbus::MethodCall method_call(kFreedesktopSettingsInterface, kReadMethod);
|
|
||||||
+ dbus::MessageWriter writer(&method_call);
|
|
||||||
+ writer.AppendString(kSettingsNamespace);
|
|
||||||
+ writer.AppendString(kColorSchemeKey);
|
|
||||||
+ settings_proxy_->CallMethod(
|
|
||||||
+ &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
|
||||||
+ base::BindOnce(&DarkModeManagerLinux::OnReadColorSchemeResponse,
|
|
||||||
+ weak_ptr_factory_.GetWeakPtr()));
|
|
||||||
+
|
|
||||||
+ // Read the toolkit preference while asynchronously fetching the
|
|
||||||
+ // portal preference.
|
|
||||||
+ if (auto* linux_ui_theme = ui::GetDefaultLinuxUiTheme()) {
|
|
||||||
+ auto* native_theme = linux_ui_theme->GetNativeTheme();
|
|
||||||
+ native_theme_observer_.Observe(native_theme);
|
|
||||||
+ SetColorScheme(native_theme->ShouldUseDarkColors());
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+DarkModeManagerLinux::~DarkModeManagerLinux() {
|
|
||||||
+ settings_proxy_ = nullptr;
|
|
||||||
+ dbus::Bus* const bus_ptr = bus_.get();
|
|
||||||
+ bus_ptr->GetDBusTaskRunner()->PostTask(
|
|
||||||
+ FROM_HERE, base::BindOnce(&dbus::Bus::ShutdownAndBlock, std::move(bus_)));
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void DarkModeManagerLinux::OnNativeThemeUpdated(
|
|
||||||
+ ui::NativeTheme* observed_theme) {
|
|
||||||
+ SetColorScheme(observed_theme->ShouldUseDarkColors());
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void DarkModeManagerLinux::OnSignalConnected(const std::string& interface_name,
|
|
||||||
+ const std::string& signal_name,
|
|
||||||
+ bool connected) {
|
|
||||||
+ // Nothing to do. Continue using the toolkit setting if !connected.
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void DarkModeManagerLinux::OnPortalSettingChanged(dbus::Signal* signal) {
|
|
||||||
+ dbus::MessageReader reader(signal);
|
|
||||||
+
|
|
||||||
+ std::string namespace_changed;
|
|
||||||
+ std::string key_changed;
|
|
||||||
+ dbus::MessageReader variant_reader(nullptr);
|
|
||||||
+ if (!reader.PopString(&namespace_changed) ||
|
|
||||||
+ !reader.PopString(&key_changed) || !reader.PopVariant(&variant_reader)) {
|
|
||||||
+ LOG(ERROR) << "Received malformed Setting Changed signal from "
|
|
||||||
+ "org.freedesktop.portal.Settings";
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (namespace_changed != kSettingsNamespace ||
|
|
||||||
+ key_changed != kColorSchemeKey) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ uint32_t new_color_scheme;
|
|
||||||
+ if (!variant_reader.PopUint32(&new_color_scheme)) {
|
|
||||||
+ LOG(ERROR)
|
|
||||||
+ << "Failed to read color-scheme value from SettingChanged signal";
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ SetColorScheme(new_color_scheme == kFreedesktopColorSchemeDark);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void DarkModeManagerLinux::OnReadColorSchemeResponse(dbus::Response* response) {
|
|
||||||
+ if (!response) {
|
|
||||||
+ // Continue using the toolkit setting.
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ dbus::MessageReader reader(response);
|
|
||||||
+ dbus::MessageReader variant_reader(nullptr);
|
|
||||||
+ if (!reader.PopVariant(&variant_reader)) {
|
|
||||||
+ LOG(ERROR) << "Failed to read variant from Read method response";
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ uint32_t new_color_scheme;
|
|
||||||
+ if (!variant_reader.PopVariantOfUint32(&new_color_scheme)) {
|
|
||||||
+ LOG(ERROR) << "Failed to read color-scheme value from Read "
|
|
||||||
+ "method response";
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // Ignore future updates from the toolkit theme.
|
|
||||||
+ native_theme_observer_.Reset();
|
|
||||||
+
|
|
||||||
+ SetColorScheme(new_color_scheme == kFreedesktopColorSchemeDark);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void DarkModeManagerLinux::SetColorScheme(bool prefer_dark_theme) {
|
|
||||||
+ if (prefer_dark_theme_ == prefer_dark_theme) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ prefer_dark_theme_ = prefer_dark_theme;
|
|
||||||
+
|
|
||||||
+ NativeTheme* web_theme = NativeTheme::GetInstanceForWeb();
|
|
||||||
+ web_theme->set_use_dark_colors(prefer_dark_theme_);
|
|
||||||
+ web_theme->set_preferred_color_scheme(
|
|
||||||
+ prefer_dark_theme_ ? NativeTheme::PreferredColorScheme::kDark
|
|
||||||
+ : NativeTheme::PreferredColorScheme::kLight);
|
|
||||||
+ web_theme->NotifyOnNativeThemeUpdated();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+} // namespace ui
|
|
||||||
diff --git a/chrome/browser/ui/views/dark_mode_manager_linux.h b/chrome/browser/ui/views/dark_mode_manager_linux.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..34b07ff
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/chrome/browser/ui/views/dark_mode_manager_linux.h
|
|
||||||
@@ -0,0 +1,62 @@
|
|
||||||
+// Copyright 2023 The Chromium Authors
|
|
||||||
+// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
+// found in the LICENSE file.
|
|
||||||
+
|
|
||||||
+#ifndef CHROME_BROWSER_UI_VIEWS_DARK_MODE_MANAGER_LINUX_H_
|
|
||||||
+#define CHROME_BROWSER_UI_VIEWS_DARK_MODE_MANAGER_LINUX_H_
|
|
||||||
+
|
|
||||||
+#include <string>
|
|
||||||
+
|
|
||||||
+#include "base/memory/scoped_refptr.h"
|
|
||||||
+#include "base/memory/weak_ptr.h"
|
|
||||||
+#include "base/scoped_observation.h"
|
|
||||||
+#include "ui/native_theme/native_theme_observer.h"
|
|
||||||
+
|
|
||||||
+namespace dbus {
|
|
||||||
+class Bus;
|
|
||||||
+class ObjectProxy;
|
|
||||||
+class Response;
|
|
||||||
+class Signal;
|
|
||||||
+} // namespace dbus
|
|
||||||
+
|
|
||||||
+namespace ui {
|
|
||||||
+
|
|
||||||
+// Observes the system color scheme preference using
|
|
||||||
+// org.freedesktop.portal.Settings. Falls back to the toolkit preference if
|
|
||||||
+// org.freedesktop.portal.Settings is unavailable. Propagates the dark mode
|
|
||||||
+// preference to the web theme.
|
|
||||||
+class DarkModeManagerLinux : public NativeThemeObserver {
|
|
||||||
+ public:
|
|
||||||
+ DarkModeManagerLinux();
|
|
||||||
+ DarkModeManagerLinux(const DarkModeManagerLinux&) = delete;
|
|
||||||
+ DarkModeManagerLinux& operator=(const DarkModeManagerLinux&) = delete;
|
|
||||||
+ ~DarkModeManagerLinux() override;
|
|
||||||
+
|
|
||||||
+ private:
|
|
||||||
+ // ui::NativeThemeObserver:
|
|
||||||
+ void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override;
|
|
||||||
+
|
|
||||||
+ // D-Bus async handlers
|
|
||||||
+ void OnSignalConnected(const std::string& interface_name,
|
|
||||||
+ const std::string& signal_name,
|
|
||||||
+ bool connected);
|
|
||||||
+ void OnPortalSettingChanged(dbus::Signal* signal);
|
|
||||||
+ void OnReadColorSchemeResponse(dbus::Response* response);
|
|
||||||
+
|
|
||||||
+ // Sets `prefer_dark_theme_` and propagates to the web theme.
|
|
||||||
+ void SetColorScheme(bool prefer_dark_theme);
|
|
||||||
+
|
|
||||||
+ scoped_refptr<dbus::Bus> bus_;
|
|
||||||
+ raw_ptr<dbus::ObjectProxy> settings_proxy_;
|
|
||||||
+
|
|
||||||
+ bool prefer_dark_theme_ = false;
|
|
||||||
+
|
|
||||||
+ base::ScopedObservation<NativeTheme, NativeThemeObserver>
|
|
||||||
+ native_theme_observer_{this};
|
|
||||||
+
|
|
||||||
+ base::WeakPtrFactory<DarkModeManagerLinux> weak_ptr_factory_{this};
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+} // namespace ui
|
|
||||||
+
|
|
||||||
+#endif // CHROME_BROWSER_UI_VIEWS_DARK_MODE_MANAGER_LINUX_H_
|
|
||||||
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
|
|
||||||
index 91b1e98..7adddbd 100644
|
|
||||||
--- a/chrome/common/chrome_features.cc
|
|
||||||
+++ b/chrome/common/chrome_features.cc
|
|
||||||
@@ -1448,17 +1448,17 @@
|
|
||||||
BASE_FEATURE(kWebShare, "WebShare", base::FEATURE_DISABLED_BY_DEFAULT);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-// Whether to enable "dark mode" enhancements in Mac Mojave or Windows 10 for
|
|
||||||
-// UIs implemented with web technologies.
|
|
||||||
+// Whether to enable "dark mode" enhancements in Mac Mojave, Windows 10, or
|
|
||||||
+// Linux for UIs implemented with web technologies.
|
|
||||||
BASE_FEATURE(kWebUIDarkMode,
|
|
||||||
"WebUIDarkMode",
|
|
||||||
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || \
|
|
||||||
- BUILDFLAG(IS_CHROMEOS)
|
|
||||||
+ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
|
|
||||||
base::FEATURE_ENABLED_BY_DEFAULT
|
|
||||||
#else
|
|
||||||
base::FEATURE_DISABLED_BY_DEFAULT
|
|
||||||
#endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) ||
|
|
||||||
- // BUILDFLAG(IS_CHROMEOS)
|
|
||||||
+ // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
|
|
||||||
);
|
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
|
||||||
diff --git a/ui/qt/qt_ui.cc b/ui/qt/qt_ui.cc
|
|
||||||
index b188ad0..6c0d2cd 100644
|
|
||||||
--- a/ui/qt/qt_ui.cc
|
|
||||||
+++ b/ui/qt/qt_ui.cc
|
|
||||||
@@ -98,6 +98,13 @@
|
|
||||||
QtNativeTheme& operator=(const QtNativeTheme&) = delete;
|
|
||||||
~QtNativeTheme() override = default;
|
|
||||||
|
|
||||||
+ void ThemeChanged(bool prefer_dark_theme) {
|
|
||||||
+ set_use_dark_colors(IsForcedDarkMode() || prefer_dark_theme);
|
|
||||||
+ set_preferred_color_scheme(CalculatePreferredColorScheme());
|
|
||||||
+
|
|
||||||
+ NotifyOnNativeThemeUpdated();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
// ui::NativeTheme:
|
|
||||||
DISABLE_CFI_VCALL
|
|
||||||
void PaintFrameTopArea(cc::PaintCanvas* canvas,
|
|
||||||
@@ -387,7 +394,7 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
void QtUi::ThemeChanged() {
|
|
||||||
- native_theme_->NotifyOnNativeThemeUpdated();
|
|
||||||
+ native_theme_->ThemeChanged(PreferDarkTheme());
|
|
||||||
}
|
|
||||||
|
|
||||||
DISABLE_CFI_VCALL
|
|
||||||
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
|
|
||||||
index decfb02b6817e..108e2af907e25 100644
|
|
||||||
--- a/chrome/browser/ui/BUILD.gn
|
|
||||||
+++ b/chrome/browser/ui/BUILD.gn
|
|
||||||
@@ -5632,20 +5632,24 @@ static_library("ui") {
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (use_aura) {
|
|
||||||
+ if (use_aura && (is_linux || is_chromeos_lacros)) {
|
|
||||||
# These files can do Gtk+-based theming for builds with gtk enabled.
|
|
||||||
- if (is_linux || is_chromeos_lacros) {
|
|
||||||
+ sources += [
|
|
||||||
+ "views/chrome_browser_main_extra_parts_views_linux.cc",
|
|
||||||
+ "views/chrome_browser_main_extra_parts_views_linux.h",
|
|
||||||
+ ]
|
|
||||||
+ deps += [
|
|
||||||
+ "//ui/base/cursor",
|
|
||||||
+ "//ui/ozone",
|
|
||||||
+ ]
|
|
||||||
+ if (use_dbus) {
|
|
||||||
sources += [
|
|
||||||
- "views/chrome_browser_main_extra_parts_views_linux.cc",
|
|
||||||
- "views/chrome_browser_main_extra_parts_views_linux.h",
|
|
||||||
"views/dark_mode_manager_linux.cc",
|
|
||||||
"views/dark_mode_manager_linux.h",
|
|
||||||
]
|
|
||||||
deps += [
|
|
||||||
"//components/dbus/thread_linux",
|
|
||||||
"//dbus",
|
|
||||||
- "//ui/base/cursor",
|
|
||||||
- "//ui/ozone",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
|
|
||||||
index d7fad5b5b9007..23d0611fdb2b5 100644
|
|
||||||
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
|
|
||||||
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
|
|
||||||
@@ -7,7 +7,6 @@
|
|
||||||
#include "base/metrics/histogram_macros.h"
|
|
||||||
#include "chrome/browser/themes/theme_service_aura_linux.h"
|
|
||||||
#include "chrome/browser/ui/browser_list.h"
|
|
||||||
-#include "chrome/browser/ui/views/dark_mode_manager_linux.h"
|
|
||||||
#include "chrome/browser/ui/views/theme_profile_key.h"
|
|
||||||
#include "ui/base/buildflags.h"
|
|
||||||
#include "ui/base/cursor/cursor_factory.h"
|
|
||||||
@@ -19,6 +18,10 @@
|
|
||||||
#include "ui/native_theme/native_theme.h"
|
|
||||||
#include "ui/ozone/public/ozone_platform.h"
|
|
||||||
|
|
||||||
+#if defined(USE_DBUS)
|
|
||||||
+#include "chrome/browser/ui/views/dark_mode_manager_linux.h"
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
class LinuxUiGetterImpl : public ui::LinuxUiGetter {
|
|
||||||
@@ -57,8 +60,9 @@ void ChromeBrowserMainExtraPartsViewsLinux::ToolkitInitialized() {
|
|
||||||
UMA_HISTOGRAM_ENUMERATION("Linux.SystemTheme.Default",
|
|
||||||
linux_ui_theme->GetNativeTheme()->system_theme());
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+#if defined(USE_DBUS)
|
|
||||||
dark_mode_manager_ = std::make_unique<ui::DarkModeManagerLinux>();
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChromeBrowserMainExtraPartsViewsLinux::PreCreateThreads() {
|
|
||||||
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h
|
|
||||||
index 6deb5205d198a..bc9167bda1fc3 100644
|
|
||||||
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h
|
|
||||||
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h
|
|
||||||
@@ -13,7 +13,9 @@
|
|
||||||
|
|
||||||
namespace ui {
|
|
||||||
class LinuxUiGetter;
|
|
||||||
+#if defined(USE_DBUS)
|
|
||||||
class DarkModeManagerLinux;
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extra parts, which are used by both Ozone/X11/Wayland and inherited by the
|
|
||||||
@@ -42,8 +44,9 @@ class ChromeBrowserMainExtraPartsViewsLinux
|
|
||||||
absl::optional<display::ScopedDisplayObserver> display_observer_;
|
|
||||||
|
|
||||||
std::unique_ptr<ui::LinuxUiGetter> linux_ui_getter_;
|
|
||||||
-
|
|
||||||
+#if defined(USE_DBUS)
|
|
||||||
std::unique_ptr<ui::DarkModeManagerLinux> dark_mode_manager_;
|
|
||||||
+#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // CHROME_BROWSER_UI_VIEWS_CHROME_BROWSER_MAIN_EXTRA_PARTS_VIEWS_LINUX_H_
|
|
@ -1,115 +0,0 @@
|
|||||||
diff -up chromium-113.0.5672.24/chrome/common/safe_browsing/BUILD.gn.nounrar chromium-113.0.5672.24/chrome/common/safe_browsing/BUILD.gn
|
|
||||||
--- chromium-113.0.5672.24/chrome/common/safe_browsing/BUILD.gn.nounrar 2023-04-07 13:11:59.495927476 +0200
|
|
||||||
+++ chromium-113.0.5672.24/chrome/common/safe_browsing/BUILD.gn 2023-04-07 13:47:57.004758029 +0200
|
|
||||||
@@ -143,8 +143,6 @@ source_set("safe_browsing") {
|
|
||||||
"protobuf_message_log_macros.h",
|
|
||||||
"protobuf_message_read_macros.h",
|
|
||||||
"protobuf_message_write_macros.h",
|
|
||||||
- "rar_analyzer.cc",
|
|
||||||
- "rar_analyzer.h",
|
|
||||||
"seven_zip_analyzer.cc",
|
|
||||||
"seven_zip_analyzer.h",
|
|
||||||
"zip_analyzer.cc",
|
|
||||||
@@ -160,7 +158,6 @@ source_set("safe_browsing") {
|
|
||||||
"//components/safe_browsing/content/common:file_type_policies",
|
|
||||||
"//components/safe_browsing/core/common",
|
|
||||||
"//third_party/lzma_sdk/google:seven_zip_reader",
|
|
||||||
- "//third_party/unrar:unrar",
|
|
||||||
]
|
|
||||||
|
|
||||||
if (is_linux) {
|
|
||||||
diff -up chromium-113.0.5672.24/chrome/common/safe_browsing/DEPS.nounrar chromium-113.0.5672.24/chrome/common/safe_browsing/DEPS
|
|
||||||
--- chromium-113.0.5672.24/chrome/common/safe_browsing/DEPS.nounrar 2023-04-04 20:41:26.000000000 +0200
|
|
||||||
+++ chromium-113.0.5672.24/chrome/common/safe_browsing/DEPS 2023-04-07 13:11:59.495927476 +0200
|
|
||||||
@@ -3,7 +3,6 @@ include_rules = [
|
|
||||||
"+components/safe_browsing/core/common",
|
|
||||||
"+third_party/maldoca",
|
|
||||||
"+third_party/protobuf",
|
|
||||||
- "+third_party/unrar",
|
|
||||||
"+third_party/zlib",
|
|
||||||
"+third_party/lzma_sdk/google",
|
|
||||||
]
|
|
||||||
diff -up chromium-113.0.5672.24/chrome/services/file_util/BUILD.gn.nounrar chromium-113.0.5672.24/chrome/services/file_util/BUILD.gn
|
|
||||||
diff -up chromium-113.0.5672.24/chrome/services/file_util/safe_archive_analyzer.cc.nounrar chromium-113.0.5672.24/chrome/services/file_util/safe_archive_analyzer.cc
|
|
||||||
--- chromium-113.0.5672.24/chrome/services/file_util/safe_archive_analyzer.cc.nounrar 2023-04-07 13:11:59.495927476 +0200
|
|
||||||
+++ chromium-113.0.5672.24/chrome/services/file_util/safe_archive_analyzer.cc 2023-04-07 13:52:52.998109006 +0200
|
|
||||||
@@ -61,6 +61,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile
|
|
||||||
base::File rar_file,
|
|
||||||
mojo::PendingRemote<chrome::mojom::TemporaryFileGetter> temp_file_getter,
|
|
||||||
AnalyzeRarFileCallback callback) {
|
|
||||||
+#if 0
|
|
||||||
DCHECK(rar_file.IsValid());
|
|
||||||
temp_file_getter_.Bind(std::move(temp_file_getter));
|
|
||||||
callback_ = std::move(callback);
|
|
||||||
@@ -76,6 +77,9 @@ void SafeArchiveAnalyzer::AnalyzeRarFile
|
|
||||||
rar_analyzer_.Init(std::move(rar_file), base::FilePath(),
|
|
||||||
std::move(analysis_finished_callback),
|
|
||||||
std::move(temp_file_getter_callback), &results_);
|
|
||||||
+#else
|
|
||||||
+ NOTREACHED();
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void SafeArchiveAnalyzer::AnalyzeSevenZipFile(
|
|
||||||
diff -up chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.cc.me chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.cc
|
|
||||||
--- chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.cc.me 2023-04-23 18:10:06.103858362 +0200
|
|
||||||
+++ chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.cc 2023-04-23 18:12:05.428092347 +0200
|
|
||||||
@@ -18,7 +18,7 @@
|
|
||||||
#include "base/time/time.h"
|
|
||||||
#include "build/build_config.h"
|
|
||||||
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
|
|
||||||
-#include "chrome/common/safe_browsing/rar_analyzer.h"
|
|
||||||
+//#include "chrome/common/safe_browsing/rar_analyzer.h"
|
|
||||||
#include "components/safe_browsing/content/common/file_type_policies.h"
|
|
||||||
#include "components/safe_browsing/core/common/features.h"
|
|
||||||
#include "components/safe_browsing/core/common/proto/csd.pb.h"
|
|
||||||
@@ -132,14 +132,14 @@ bool ZipAnalyzer::AnalyzeNestedArchive(
|
|
||||||
std::move(nested_analysis_finished_callback),
|
|
||||||
get_temp_file_callback_, results_);
|
|
||||||
return true;
|
|
||||||
- } else if (file_type == DownloadFileType::RAR) {
|
|
||||||
+ } /* else if (file_type == DownloadFileType::RAR) {
|
|
||||||
nested_rar_analyzer_ = std::make_unique<safe_browsing::RarAnalyzer>();
|
|
||||||
nested_rar_analyzer_->Init(temp_file_.Duplicate(),
|
|
||||||
root_zip_path_.Append(path),
|
|
||||||
std::move(nested_analysis_finished_callback),
|
|
||||||
get_temp_file_callback_, results_);
|
|
||||||
return true;
|
|
||||||
- }
|
|
||||||
+ }*/
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff -up chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.h.me chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.h
|
|
||||||
--- chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.h.me 2023-04-23 18:12:11.316203496 +0200
|
|
||||||
+++ chromium-113.0.5672.53/chrome/common/safe_browsing/zip_analyzer.h 2023-04-23 18:12:26.827498082 +0200
|
|
||||||
@@ -78,7 +78,7 @@ class ZipAnalyzer {
|
|
||||||
// DFS.
|
|
||||||
// TODO(crbug.com/1426164) Create a common class to hold all analyzers.
|
|
||||||
std::unique_ptr<safe_browsing::ZipAnalyzer> nested_zip_analyzer_;
|
|
||||||
- std::unique_ptr<safe_browsing::RarAnalyzer> nested_rar_analyzer_;
|
|
||||||
+// std::unique_ptr<safe_browsing::RarAnalyzer> nested_rar_analyzer_;
|
|
||||||
|
|
||||||
base::WeakPtrFactory<ZipAnalyzer> weak_factory_{this};
|
|
||||||
};
|
|
||||||
diff -up chromium-113.0.5672.53/chrome/services/file_util/safe_archive_analyzer.h.me chromium-113.0.5672.53/chrome/services/file_util/safe_archive_analyzer.h
|
|
||||||
--- chromium-113.0.5672.53/chrome/services/file_util/safe_archive_analyzer.h.me 2023-04-23 18:06:26.476791520 +0200
|
|
||||||
+++ chromium-113.0.5672.53/chrome/services/file_util/safe_archive_analyzer.h 2023-04-23 18:08:58.594606171 +0200
|
|
||||||
@@ -6,7 +6,7 @@
|
|
||||||
#define CHROME_SERVICES_FILE_UTIL_SAFE_ARCHIVE_ANALYZER_H_
|
|
||||||
|
|
||||||
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
|
|
||||||
-#include "chrome/common/safe_browsing/rar_analyzer.h"
|
|
||||||
+//#include "chrome/common/safe_browsing/rar_analyzer.h"
|
|
||||||
#include "chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom.h"
|
|
||||||
#include "mojo/public/cpp/bindings/remote.h"
|
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ class SafeArchiveAnalyzer : public chrom
|
|
||||||
void Timeout();
|
|
||||||
|
|
||||||
safe_browsing::ZipAnalyzer zip_analyzer_;
|
|
||||||
- safe_browsing::RarAnalyzer rar_analyzer_;
|
|
||||||
+// safe_browsing::RarAnalyzer rar_analyzer_;
|
|
||||||
|
|
||||||
// A timer to ensure no archive takes too long to unpack.
|
|
||||||
base::OneShotTimer timeout_timer_;
|
|
@ -1,30 +0,0 @@
|
|||||||
diff -up chromium-113.0.5672.63/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.me chromium-113.0.5672.63/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc
|
|
||||||
--- chromium-113.0.5672.63/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.me 2023-05-03 16:30:34.244612573 +0200
|
|
||||||
+++ chromium-113.0.5672.63/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc 2023-05-03 16:37:36.732278590 +0200
|
|
||||||
@@ -516,8 +516,11 @@ wtf_size_t NGGridLayoutAlgorithm::BuildG
|
|
||||||
row_auto_repetitions);
|
|
||||||
|
|
||||||
bool has_nested_subgrid = false;
|
|
||||||
- auto& [grid_items, layout_data, subtree_size] =
|
|
||||||
- sizing_tree->CreateSizingData();
|
|
||||||
+
|
|
||||||
+ auto& workaround_clang_bug = sizing_tree->CreateSizingData();
|
|
||||||
+ auto& grid_items = workaround_clang_bug.grid_items;
|
|
||||||
+ auto& layout_data = workaround_clang_bug.layout_data;
|
|
||||||
+ auto& subtree_size = workaround_clang_bug.subtree_size;
|
|
||||||
|
|
||||||
if (!must_ignore_children) {
|
|
||||||
// Construct grid items that are not subgridded.
|
|
||||||
@@ -1540,8 +1543,10 @@ void NGGridLayoutAlgorithm::InitializeTr
|
|
||||||
NGGridSizingTree* sizing_tree) const {
|
|
||||||
DCHECK(sizing_tree && current_grid_index < sizing_tree->Size());
|
|
||||||
|
|
||||||
- auto& [grid_items, layout_data, subtree_size] =
|
|
||||||
- sizing_tree->At(current_grid_index);
|
|
||||||
+ auto& workaround_clang_bug = sizing_tree->At(current_grid_index);
|
|
||||||
+ auto& grid_items = workaround_clang_bug.grid_items;
|
|
||||||
+ auto& layout_data = workaround_clang_bug.layout_data;
|
|
||||||
+ auto& subtree_size = workaround_clang_bug.subtree_size;
|
|
||||||
|
|
||||||
auto InitAndCacheTrackSizes = [&](GridTrackSizingDirection track_direction) {
|
|
||||||
InitializeTrackCollection(opt_subgrid_data, track_direction, &layout_data);
|
|
@ -0,0 +1,21 @@
|
|||||||
|
diff -up chromium-114.0.5735.26/components/omnibox/browser/omnibox_edit_model.cc.me chromium-114.0.5735.26/components/omnibox/browser/omnibox_edit_model.cc
|
||||||
|
--- chromium-114.0.5735.26/components/omnibox/browser/omnibox_edit_model.cc.me 2023-05-14 09:14:10.886314480 +0200
|
||||||
|
+++ chromium-114.0.5735.26/components/omnibox/browser/omnibox_edit_model.cc 2023-05-14 09:16:59.380054720 +0200
|
||||||
|
@@ -79,7 +79,7 @@
|
||||||
|
#include "ui/gfx/vector_icon_types.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||||
|
+#ifdef GOOGLE_CHROME_BRANDING
|
||||||
|
#include "components/vector_icons/vector_icons.h" // nogncheck
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@ -628,7 +628,7 @@ bool OmniboxEditModel::ShouldShowCurrent
|
||||||
|
}
|
||||||
|
|
||||||
|
ui::ImageModel OmniboxEditModel::GetSuperGIcon(int image_size, bool dark_mode) {
|
||||||
|
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||||
|
+#ifdef GOOGLE_CHROME_BRANDING
|
||||||
|
if (dark_mode) {
|
||||||
|
return ui::ImageModel::FromVectorIcon(
|
||||||
|
vector_icons::kGoogleGLogoMonochromeIcon, ui::kColorRefPrimary100,
|
@ -0,0 +1,105 @@
|
|||||||
|
diff -up chromium-114.0.5735.35/chrome/browser/safe_browsing/download_protection/file_analyzer.cc.nounrar chromium-114.0.5735.35/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
|
||||||
|
--- chromium-114.0.5735.35/chrome/browser/safe_browsing/download_protection/file_analyzer.cc.nounrar 2023-05-18 00:37:47.000000000 +0200
|
||||||
|
+++ chromium-114.0.5735.35/chrome/browser/safe_browsing/download_protection/file_analyzer.cc 2023-05-21 18:12:30.368425080 +0200
|
||||||
|
@@ -77,8 +77,6 @@ void FileAnalyzer::Start(const base::Fil
|
||||||
|
|
||||||
|
if (inspection_type == DownloadFileType::ZIP) {
|
||||||
|
StartExtractZipFeatures();
|
||||||
|
- } else if (inspection_type == DownloadFileType::RAR) {
|
||||||
|
- StartExtractRarFeatures();
|
||||||
|
#if BUILDFLAG(IS_MAC)
|
||||||
|
} else if (inspection_type == DownloadFileType::DMG) {
|
||||||
|
StartExtractDmgFeatures();
|
||||||
|
diff -up chromium-114.0.5735.35/chrome/common/safe_browsing/archive_analyzer.cc.nounrar chromium-114.0.5735.35/chrome/common/safe_browsing/archive_analyzer.cc
|
||||||
|
--- chromium-114.0.5735.35/chrome/common/safe_browsing/archive_analyzer.cc.nounrar 2023-05-18 00:37:48.000000000 +0200
|
||||||
|
+++ chromium-114.0.5735.35/chrome/common/safe_browsing/archive_analyzer.cc 2023-05-21 18:11:14.870058635 +0200
|
||||||
|
@@ -8,7 +8,6 @@
|
||||||
|
#include "build/build_config.h"
|
||||||
|
#include "build/buildflag.h"
|
||||||
|
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
|
||||||
|
-#include "chrome/common/safe_browsing/rar_analyzer.h"
|
||||||
|
#include "chrome/common/safe_browsing/seven_zip_analyzer.h"
|
||||||
|
#include "chrome/common/safe_browsing/zip_analyzer.h"
|
||||||
|
#include "components/safe_browsing/content/common/proto/download_file_types.pb.h"
|
||||||
|
@@ -23,9 +22,7 @@ namespace safe_browsing {
|
||||||
|
// static
|
||||||
|
std::unique_ptr<ArchiveAnalyzer> ArchiveAnalyzer::CreateForArchiveType(
|
||||||
|
DownloadFileType_InspectionType file_type) {
|
||||||
|
- if (file_type == DownloadFileType::RAR) {
|
||||||
|
- return std::make_unique<RarAnalyzer>();
|
||||||
|
- } else if (file_type == DownloadFileType::ZIP) {
|
||||||
|
+ if (file_type == DownloadFileType::ZIP) {
|
||||||
|
return std::make_unique<ZipAnalyzer>();
|
||||||
|
} else if (file_type == DownloadFileType::SEVEN_ZIP) {
|
||||||
|
return std::make_unique<SevenZipAnalyzer>();
|
||||||
|
diff -up chromium-114.0.5735.35/chrome/common/safe_browsing/BUILD.gn.nounrar chromium-114.0.5735.35/chrome/common/safe_browsing/BUILD.gn
|
||||||
|
--- chromium-114.0.5735.35/chrome/common/safe_browsing/BUILD.gn.nounrar 2023-05-18 00:37:48.000000000 +0200
|
||||||
|
+++ chromium-114.0.5735.35/chrome/common/safe_browsing/BUILD.gn 2023-05-21 18:11:14.869058617 +0200
|
||||||
|
@@ -145,8 +145,6 @@ source_set("safe_browsing") {
|
||||||
|
"protobuf_message_log_macros.h",
|
||||||
|
"protobuf_message_read_macros.h",
|
||||||
|
"protobuf_message_write_macros.h",
|
||||||
|
- "rar_analyzer.cc",
|
||||||
|
- "rar_analyzer.h",
|
||||||
|
"seven_zip_analyzer.cc",
|
||||||
|
"seven_zip_analyzer.h",
|
||||||
|
"zip_analyzer.cc",
|
||||||
|
@@ -162,7 +160,6 @@ source_set("safe_browsing") {
|
||||||
|
"//components/safe_browsing/content/common:file_type_policies",
|
||||||
|
"//components/safe_browsing/core/common",
|
||||||
|
"//third_party/lzma_sdk/google:seven_zip_reader",
|
||||||
|
- "//third_party/unrar:unrar",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (is_linux) {
|
||||||
|
diff -up chromium-114.0.5735.35/chrome/common/safe_browsing/zip_analyzer.cc.nounrar chromium-114.0.5735.35/chrome/common/safe_browsing/zip_analyzer.cc
|
||||||
|
--- chromium-114.0.5735.35/chrome/common/safe_browsing/zip_analyzer.cc.nounrar 2023-05-18 00:37:48.000000000 +0200
|
||||||
|
+++ chromium-114.0.5735.35/chrome/common/safe_browsing/zip_analyzer.cc 2023-05-21 18:11:14.869058617 +0200
|
||||||
|
@@ -18,7 +18,6 @@
|
||||||
|
#include "base/time/time.h"
|
||||||
|
#include "build/build_config.h"
|
||||||
|
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
|
||||||
|
-#include "chrome/common/safe_browsing/rar_analyzer.h"
|
||||||
|
#include "components/safe_browsing/content/common/file_type_policies.h"
|
||||||
|
#include "components/safe_browsing/core/common/features.h"
|
||||||
|
#include "components/safe_browsing/core/common/proto/csd.pb.h"
|
||||||
|
diff -up chromium-114.0.5735.35/chrome/services/file_util/safe_archive_analyzer.cc.nounrar chromium-114.0.5735.35/chrome/services/file_util/safe_archive_analyzer.cc
|
||||||
|
--- chromium-114.0.5735.35/chrome/services/file_util/safe_archive_analyzer.cc.nounrar 2023-05-18 00:37:48.000000000 +0200
|
||||||
|
+++ chromium-114.0.5735.35/chrome/services/file_util/safe_archive_analyzer.cc 2023-05-21 18:11:14.870058635 +0200
|
||||||
|
@@ -71,6 +71,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile
|
||||||
|
base::File rar_file,
|
||||||
|
mojo::PendingRemote<chrome::mojom::TemporaryFileGetter> temp_file_getter,
|
||||||
|
AnalyzeRarFileCallback callback) {
|
||||||
|
+#if 0
|
||||||
|
DCHECK(rar_file.IsValid());
|
||||||
|
temp_file_getter_.Bind(std::move(temp_file_getter));
|
||||||
|
callback_ = std::move(callback);
|
||||||
|
@@ -86,6 +87,9 @@ void SafeArchiveAnalyzer::AnalyzeRarFile
|
||||||
|
rar_analyzer_.Analyze(std::move(rar_file), base::FilePath(),
|
||||||
|
std::move(analysis_finished_callback),
|
||||||
|
std::move(temp_file_getter_callback), &results_);
|
||||||
|
+#else
|
||||||
|
+ NOTREACHED();
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void SafeArchiveAnalyzer::AnalyzeSevenZipFile(
|
||||||
|
diff -up chromium-114.0.5735.35/chrome/services/file_util/safe_archive_analyzer.h.nounrar chromium-114.0.5735.35/chrome/services/file_util/safe_archive_analyzer.h
|
||||||
|
--- chromium-114.0.5735.35/chrome/services/file_util/safe_archive_analyzer.h.nounrar 2023-05-18 00:37:48.000000000 +0200
|
||||||
|
+++ chromium-114.0.5735.35/chrome/services/file_util/safe_archive_analyzer.h 2023-05-21 18:11:14.870058635 +0200
|
||||||
|
@@ -6,7 +6,6 @@
|
||||||
|
#define CHROME_SERVICES_FILE_UTIL_SAFE_ARCHIVE_ANALYZER_H_
|
||||||
|
|
||||||
|
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
|
||||||
|
-#include "chrome/common/safe_browsing/rar_analyzer.h"
|
||||||
|
#include "chrome/common/safe_browsing/seven_zip_analyzer.h"
|
||||||
|
#include "chrome/common/safe_browsing/zip_analyzer.h"
|
||||||
|
#include "chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom.h"
|
||||||
|
@@ -63,7 +62,6 @@ class SafeArchiveAnalyzer : public chrom
|
||||||
|
void Timeout();
|
||||||
|
|
||||||
|
safe_browsing::ZipAnalyzer zip_analyzer_;
|
||||||
|
- safe_browsing::RarAnalyzer rar_analyzer_;
|
||||||
|
safe_browsing::SevenZipAnalyzer seven_zip_analyzer_;
|
||||||
|
#if BUILDFLAG(IS_MAC)
|
||||||
|
safe_browsing::dmg::DMGAnalyzer dmg_analyzer_;
|
@ -0,0 +1,87 @@
|
|||||||
|
diff -up chromium-114.0.5735.35/media/gpu/vaapi/vaapi_video_encode_accelerator.cc.me chromium-114.0.5735.35/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
|
||||||
|
--- chromium-114.0.5735.35/media/gpu/vaapi/vaapi_video_encode_accelerator.cc.me 2023-05-21 10:05:00.357860329 +0200
|
||||||
|
+++ chromium-114.0.5735.35/media/gpu/vaapi/vaapi_video_encode_accelerator.cc 2023-05-21 10:18:09.665432735 +0200
|
||||||
|
@@ -41,7 +41,6 @@
|
||||||
|
#include "media/gpu/gpu_video_encode_accelerator_helpers.h"
|
||||||
|
#include "media/gpu/h264_dpb.h"
|
||||||
|
#include "media/gpu/macros.h"
|
||||||
|
-#include "media/gpu/vaapi/av1_vaapi_video_encoder_delegate.h"
|
||||||
|
#include "media/gpu/vaapi/h264_vaapi_video_encoder_delegate.h"
|
||||||
|
#include "media/gpu/vaapi/va_surface.h"
|
||||||
|
#include "media/gpu/vaapi/vaapi_common.h"
|
||||||
|
@@ -200,7 +199,7 @@ bool VaapiVideoEncodeAccelerator::Initia
|
||||||
|
|
||||||
|
const VideoCodec codec = VideoCodecProfileToVideoCodec(config.output_profile);
|
||||||
|
if (codec != VideoCodec::kH264 && codec != VideoCodec::kVP8 &&
|
||||||
|
- codec != VideoCodec::kVP9 && codec != VideoCodec::kAV1) {
|
||||||
|
+ codec != VideoCodec::kVP9) {
|
||||||
|
MEDIA_LOG(ERROR, media_log.get())
|
||||||
|
<< "Unsupported profile: " << GetProfileName(config.output_profile);
|
||||||
|
return false;
|
||||||
|
@@ -293,7 +292,6 @@ void VaapiVideoEncodeAccelerator::Initia
|
||||||
|
break;
|
||||||
|
case VideoCodec::kVP8:
|
||||||
|
case VideoCodec::kVP9:
|
||||||
|
- case VideoCodec::kAV1:
|
||||||
|
mode = VaapiWrapper::kEncodeConstantQuantizationParameter;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
@@ -356,12 +354,6 @@ void VaapiVideoEncodeAccelerator::Initia
|
||||||
|
vaapi_wrapper_, error_cb);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
- case VideoCodec::kAV1:
|
||||||
|
- if (!IsConfiguredForTesting()) {
|
||||||
|
- encoder_ = std::make_unique<AV1VaapiVideoEncoderDelegate>(
|
||||||
|
- vaapi_wrapper_, error_cb);
|
||||||
|
- }
|
||||||
|
- break;
|
||||||
|
default:
|
||||||
|
NOTREACHED() << "Unsupported codec type " << GetCodecName(output_codec_);
|
||||||
|
return;
|
||||||
|
@@ -835,10 +827,6 @@ VaapiVideoEncodeAccelerator::CreateEncod
|
||||||
|
case VideoCodec::kVP9:
|
||||||
|
picture = new VaapiVP9Picture(std::move(reconstructed_surface));
|
||||||
|
break;
|
||||||
|
- case VideoCodec::kAV1:
|
||||||
|
- picture = new VaapiAV1Picture(/*display_va_surface=*/nullptr,
|
||||||
|
- std::move(reconstructed_surface));
|
||||||
|
- break;
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
diff -up chromium-114.0.5735.35/media/gpu/BUILD.gn.revert-av1enc chromium-114.0.5735.35/media/gpu/BUILD.gn
|
||||||
|
--- chromium-114.0.5735.35/media/gpu/BUILD.gn.revert-av1enc 2023-05-18 00:37:57.000000000 +0200
|
||||||
|
+++ chromium-114.0.5735.35/media/gpu/BUILD.gn 2023-05-20 13:14:10.755183630 +0200
|
||||||
|
@@ -373,10 +373,7 @@ source_set("common") {
|
||||||
|
"vp9_svc_layers.h",
|
||||||
|
]
|
||||||
|
configs += [ "//third_party/libvpx:libvpx_config" ]
|
||||||
|
- deps += [
|
||||||
|
- "//third_party/libaom:libaomrc",
|
||||||
|
- "//third_party/libvpx:libvpxrc",
|
||||||
|
- ]
|
||||||
|
+ deps += [ "//third_party/libvpx:libvpxrc" ]
|
||||||
|
}
|
||||||
|
if (use_libgav1_parser) {
|
||||||
|
sources += [
|
||||||
|
diff -up chromium-114.0.5735.35/media/gpu/vaapi/BUILD.gn.revert-av1enc chromium-114.0.5735.35/media/gpu/vaapi/BUILD.gn
|
||||||
|
--- chromium-114.0.5735.35/media/gpu/vaapi/BUILD.gn.revert-av1enc 2023-05-18 00:37:57.000000000 +0200
|
||||||
|
+++ chromium-114.0.5735.35/media/gpu/vaapi/BUILD.gn 2023-05-20 13:14:10.756183626 +0200
|
||||||
|
@@ -38,8 +38,6 @@ source_set("vaapi") {
|
||||||
|
sources = [
|
||||||
|
"av1_vaapi_video_decoder_delegate.cc",
|
||||||
|
"av1_vaapi_video_decoder_delegate.h",
|
||||||
|
- "av1_vaapi_video_encoder_delegate.cc",
|
||||||
|
- "av1_vaapi_video_encoder_delegate.h",
|
||||||
|
"h264_vaapi_video_decoder_delegate.cc",
|
||||||
|
"h264_vaapi_video_decoder_delegate.h",
|
||||||
|
"h264_vaapi_video_encoder_delegate.cc",
|
||||||
|
@@ -107,7 +105,6 @@ source_set("vaapi") {
|
||||||
|
"//media/gpu/chromeos:common",
|
||||||
|
"//media/parsers",
|
||||||
|
"//mojo/public/cpp/bindings",
|
||||||
|
- "//third_party/libaom:libaomrc",
|
||||||
|
"//third_party/libvpx:libvpxrc",
|
||||||
|
"//third_party/libyuv",
|
||||||
|
"//ui/gfx",
|
@ -0,0 +1,22 @@
|
|||||||
|
diff -up chromium-114.0.5735.26/sandbox/policy/linux/bpf_network_policy_linux.cc.me chromium-114.0.5735.26/sandbox/policy/linux/bpf_network_policy_linux.cc
|
||||||
|
--- chromium-114.0.5735.26/sandbox/policy/linux/bpf_network_policy_linux.cc.me 2023-05-13 12:09:44.423727385 +0200
|
||||||
|
+++ chromium-114.0.5735.26/sandbox/policy/linux/bpf_network_policy_linux.cc 2023-05-13 17:52:19.934347246 +0200
|
||||||
|
@@ -11,7 +11,6 @@
|
||||||
|
#include <linux/net.h>
|
||||||
|
#include <linux/netlink.h>
|
||||||
|
#include <linux/sockios.h>
|
||||||
|
-#include <linux/wireless.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <netinet/tcp.h>
|
||||||
|
#include <sys/inotify.h>
|
||||||
|
@@ -48,6 +47,10 @@ using sandbox::syscall_broker::BrokerPro
|
||||||
|
#define F2FS_IOC_GET_FEATURES _IOR(0xf5, 12, uint32_t)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if !defined(SIOCGIWNAME)
|
||||||
|
+#define SIOCGIWNAME 0x8B01
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
namespace sandbox::policy {
|
||||||
|
|
||||||
|
namespace {
|
@ -0,0 +1,81 @@
|
|||||||
|
diff -up chromium-114.0.5735.26/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.workaround_clang_bug-structured_binding chromium-114.0.5735.26/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc
|
||||||
|
--- chromium-114.0.5735.26/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.workaround_clang_bug-structured_binding 2023-05-11 03:36:27.000000000 +0200
|
||||||
|
+++ chromium-114.0.5735.26/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc 2023-05-14 11:49:42.558129164 +0200
|
||||||
|
@@ -238,7 +238,10 @@ const NGLayoutResult* NGGridLayoutAlgori
|
||||||
|
: BuildGridSizingTree(&oof_children);
|
||||||
|
|
||||||
|
LayoutUnit intrinsic_block_size;
|
||||||
|
- auto& [grid_items, layout_data, tree_size] = grid_sizing_tree.TreeRootData();
|
||||||
|
+ auto& [g_i, l_d, t_s] = grid_sizing_tree.TreeRootData();
|
||||||
|
+ auto& grid_items = g_i;
|
||||||
|
+ auto& layout_data = l_d;
|
||||||
|
+ auto& tree_size = t_s;
|
||||||
|
|
||||||
|
if (IsBreakInside(BreakToken())) {
|
||||||
|
// TODO(layout-dev): When we support variable inline-size fragments we'll
|
||||||
|
@@ -520,8 +523,10 @@ wtf_size_t NGGridLayoutAlgorithm::BuildG
|
||||||
|
row_auto_repetitions);
|
||||||
|
|
||||||
|
bool has_nested_subgrid = false;
|
||||||
|
- auto& [grid_items, layout_data, subtree_size] =
|
||||||
|
- sizing_tree->CreateSizingData(opt_subgrid_data);
|
||||||
|
+ auto& [g_i, l_d, s_s] = sizing_tree->CreateSizingData(opt_subgrid_data);
|
||||||
|
+ auto& grid_items = g_i;
|
||||||
|
+ auto& layout_data = l_d;
|
||||||
|
+ auto& subtree_size = s_s;
|
||||||
|
|
||||||
|
if (!must_ignore_children) {
|
||||||
|
// Construct grid items that are not subgridded.
|
||||||
|
@@ -650,8 +655,10 @@ NGGridSizingTree NGGridLayoutAlgorithm::
|
||||||
|
NGGridSizingTree sizing_tree;
|
||||||
|
|
||||||
|
if (const auto* layout_subtree = ConstraintSpace().GridLayoutSubtree()) {
|
||||||
|
- auto& [grid_items, layout_data, subtree_size] =
|
||||||
|
- sizing_tree.CreateSizingData();
|
||||||
|
+ auto& [g_i, l_d, s_s] = sizing_tree.CreateSizingData();
|
||||||
|
+ auto& grid_items = g_i;
|
||||||
|
+ auto& layout_data = l_d;
|
||||||
|
+ auto& subtree_size = s_s;
|
||||||
|
|
||||||
|
const auto& node = Node();
|
||||||
|
grid_items =
|
||||||
|
@@ -1640,8 +1647,10 @@ void NGGridLayoutAlgorithm::InitializeTr
|
||||||
|
const absl::optional<GridTrackSizingDirection>& opt_track_direction) const {
|
||||||
|
DCHECK(sizing_subtree);
|
||||||
|
|
||||||
|
- auto& [grid_items, layout_data, subtree_size] =
|
||||||
|
- sizing_subtree.SubtreeRootData();
|
||||||
|
+ auto& [g_i, l_d, s_s] = sizing_subtree.SubtreeRootData();
|
||||||
|
+ auto& grid_items = g_i;
|
||||||
|
+ auto& layout_data = l_d;
|
||||||
|
+ auto& subtree_size = s_s;
|
||||||
|
|
||||||
|
auto InitAndCacheTrackSizes = [&](GridTrackSizingDirection track_direction) {
|
||||||
|
InitializeTrackCollection(opt_subgrid_data, track_direction, &layout_data);
|
||||||
|
@@ -1825,8 +1834,10 @@ void NGGridLayoutAlgorithm::CompleteTrac
|
||||||
|
bool* opt_needs_additional_pass) const {
|
||||||
|
DCHECK(sizing_subtree);
|
||||||
|
|
||||||
|
- auto& [grid_items, layout_data, subtree_size] =
|
||||||
|
- sizing_subtree.SubtreeRootData();
|
||||||
|
+ auto& [g_i, l_d, s_s] = sizing_subtree.SubtreeRootData();
|
||||||
|
+ auto& grid_items = g_i;
|
||||||
|
+ auto& layout_data = l_d;
|
||||||
|
+ auto& subtree_size = s_s;
|
||||||
|
|
||||||
|
const bool is_for_columns = track_direction == kForColumns;
|
||||||
|
const bool has_non_definite_track =
|
||||||
|
diff -up chromium-114.0.5735.26/media/base/cdm_promise_adapter.cc.me chromium-114.0.5735.26/media/base/cdm_promise_adapter.cc
|
||||||
|
--- chromium-114.0.5735.26/media/base/cdm_promise_adapter.cc.me 2023-05-14 17:35:00.446844465 +0200
|
||||||
|
+++ chromium-114.0.5735.26/media/base/cdm_promise_adapter.cc 2023-05-14 17:39:22.991733926 +0200
|
||||||
|
@@ -94,7 +94,9 @@ void CdmPromiseAdapter::RejectPromise(ui
|
||||||
|
void CdmPromiseAdapter::Clear(ClearReason reason) {
|
||||||
|
// Reject all outstanding promises.
|
||||||
|
DCHECK(thread_checker_.CalledOnValidThread());
|
||||||
|
- for (auto& [promise_id, promise] : promises_) {
|
||||||
|
+ for (auto& [p_i, p_e] : promises_) {
|
||||||
|
+ auto& promise_id = p_i;
|
||||||
|
+ auto& promise = p_e;
|
||||||
|
TRACE_EVENT_NESTABLE_ASYNC_END1(
|
||||||
|
"media", "CdmPromise", TRACE_ID_WITH_SCOPE("CdmPromise", promise_id),
|
||||||
|
"status", "cleared");
|
@ -1,3 +1,3 @@
|
|||||||
SHA512 (node-v19.8.1-linux-arm64.tar.xz) = 86ff19085669e92ce7afe2fd7d4df0c5441df2d88c00f29d5463b805f3cf5625626db8aebf98349c9a495b772da1ce6d68263730018207ea98815058a1c81397
|
SHA512 (node-v19.8.1-linux-arm64.tar.xz) = 86ff19085669e92ce7afe2fd7d4df0c5441df2d88c00f29d5463b805f3cf5625626db8aebf98349c9a495b772da1ce6d68263730018207ea98815058a1c81397
|
||||||
SHA512 (node-v19.8.1-linux-x64.tar.xz) = 925c0037c6b7074d0b0245bced20d0a0d9b1300f53b808106f16b5018d763f5f5b00bc321b33fa1033d736b1e1076608da9b7fcae66aed53d27b100b1186e2c6
|
SHA512 (node-v19.8.1-linux-x64.tar.xz) = 925c0037c6b7074d0b0245bced20d0a0d9b1300f53b808106f16b5018d763f5f5b00bc321b33fa1033d736b1e1076608da9b7fcae66aed53d27b100b1186e2c6
|
||||||
SHA512 (chromium-113.0.5672.126-clean.tar.xz) = 1c7c48f2ea78f09f533dd42eee22876b0716517c8d6beb76b2c8ae1c616bfc050e179c8bda4fe1f9e6ab7fa9dc29077b0cdf149a6e27d10e2fac35d6ef8e6c99
|
SHA512 (chromium-114.0.5735.45-clean.tar.xz) = fc5a0c7296247f31fbc9306fc2bf807cc77df20c0666ff8c21d1b3b9bed83bbd56608991a4c967e7290b3203bdef13411f28687403e2a77ba21673951c32da98
|
||||||
|
Loading…
Reference in new issue