epel8
parent
dca3901616
commit
4f31ec8a71
@ -1,56 +0,0 @@
|
||||
--- a/third_party/protobuf/src/google/protobuf/arena.h
|
||||
+++ b/third_party/protobuf/src/google/protobuf/arena.h
|
||||
@@ -245,7 +245,7 @@ struct ArenaOptions {
|
||||
// well as protobuf container types like RepeatedPtrField and Map. The protocol
|
||||
// is internal to protobuf and is not guaranteed to be stable. Non-proto types
|
||||
// should not rely on this protocol.
|
||||
-class PROTOBUF_EXPORT alignas(8) Arena final {
|
||||
+class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {
|
||||
public:
|
||||
// Arena constructor taking custom options. See ArenaOptions below for
|
||||
// descriptions of the options available.
|
||||
--- a/third_party/protobuf/src/google/protobuf/port_def.inc
|
||||
+++ b/third_party/protobuf/src/google/protobuf/port_def.inc
|
||||
@@ -528,6 +528,35 @@ PROTOBUF_EXPORT_TEMPLATE_TEST(DEFAULT, __declspec(dllimport));
|
||||
#undef IN
|
||||
#endif // _MSC_VER
|
||||
|
||||
+// Specify memory alignment for structs, classes, etc.
|
||||
+// Use like:
|
||||
+// class PROTOBUF_ALIGNAS(16) MyClass { ... }
|
||||
+// PROTOBUF_ALIGNAS(16) int array[4];
|
||||
+//
|
||||
+// In most places you can use the C++11 keyword "alignas", which is preferred.
|
||||
+//
|
||||
+// But compilers have trouble mixing __attribute__((...)) syntax with
|
||||
+// alignas(...) syntax.
|
||||
+//
|
||||
+// Doesn't work in clang or gcc:
|
||||
+// struct alignas(16) __attribute__((packed)) S { char c; };
|
||||
+// Works in clang but not gcc:
|
||||
+// struct __attribute__((packed)) alignas(16) S2 { char c; };
|
||||
+// Works in clang and gcc:
|
||||
+// struct alignas(16) S3 { char c; } __attribute__((packed));
|
||||
+//
|
||||
+// There are also some attributes that must be specified *before* a class
|
||||
+// definition: visibility (used for exporting functions/classes) is one of
|
||||
+// these attributes. This means that it is not possible to use alignas() with a
|
||||
+// class that is marked as exported.
|
||||
+#if defined(_MSC_VER)
|
||||
+#define PROTOBUF_ALIGNAS(byte_alignment) __declspec(align(byte_alignment))
|
||||
+#elif defined(__GNUC__)
|
||||
+#define PROTOBUF_ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
|
||||
+#else
|
||||
+#define PROTOBUF_ALIGNAS(byte_alignment) alignas(byte_alignment)
|
||||
+#endif
|
||||
+
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
// TODO(gerbens) ideally we cleanup the code. But a cursory try shows many
|
||||
--- a/third_party/protobuf/src/google/protobuf/port_undef.inc
|
||||
+++ b/third_party/protobuf/src/google/protobuf/port_undef.inc
|
||||
@@ -80,6 +80,7 @@
|
||||
#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA__declspec
|
||||
#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllexport
|
||||
#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllimport
|
||||
+#undef PROTOBUF_ALIGNAS
|
@ -1,53 +0,0 @@
|
||||
From c0b32910da192edf1b41eb52c088d0213ab2807a Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Sun, 05 Apr 2020 08:29:21 +0000
|
||||
Subject: [PATCH] libstdc++: fix incomplete-type in AXTree for NodeSetSizePosInSetInfo
|
||||
|
||||
std::unordered_map<T, U> requires U to be fully declared. ax_tree.h
|
||||
has only forward declaration of NodeSetSizePosInSetInfo. Therefore,
|
||||
move declaration from ax_tree.cc.
|
||||
Bug: 957519
|
||||
Change-Id: Ic1f4bf3ebfea229ece84251e46d4461b31873868
|
||||
---
|
||||
|
||||
diff --git a/ui/accessibility/ax_tree.cc b/ui/accessibility/ax_tree.cc
|
||||
index 7b8d9b1..e915402 100644
|
||||
--- a/ui/accessibility/ax_tree.cc
|
||||
+++ b/ui/accessibility/ax_tree.cc
|
||||
@@ -567,14 +567,8 @@
|
||||
const AXTree& tree;
|
||||
};
|
||||
|
||||
-struct AXTree::NodeSetSizePosInSetInfo {
|
||||
- NodeSetSizePosInSetInfo() = default;
|
||||
- ~NodeSetSizePosInSetInfo() = default;
|
||||
-
|
||||
- int32_t pos_in_set = 0;
|
||||
- int32_t set_size = 0;
|
||||
- base::Optional<int> lowest_hierarchical_level;
|
||||
-};
|
||||
+AXTree::NodeSetSizePosInSetInfo::NodeSetSizePosInSetInfo() = default;
|
||||
+AXTree::NodeSetSizePosInSetInfo::~NodeSetSizePosInSetInfo() = default;
|
||||
|
||||
struct AXTree::OrderedSetContent {
|
||||
explicit OrderedSetContent(const AXNode* ordered_set = nullptr)
|
||||
diff --git a/ui/accessibility/ax_tree.h b/ui/accessibility/ax_tree.h
|
||||
index a51ca8d..8c1c575 100644
|
||||
--- a/ui/accessibility/ax_tree.h
|
||||
+++ b/ui/accessibility/ax_tree.h
|
||||
@@ -328,7 +328,14 @@
|
||||
bool enable_extra_mac_nodes_ = false;
|
||||
|
||||
// Contains pos_in_set and set_size data for an AXNode.
|
||||
- struct NodeSetSizePosInSetInfo;
|
||||
+ struct NodeSetSizePosInSetInfo {
|
||||
+ NodeSetSizePosInSetInfo();
|
||||
+ ~NodeSetSizePosInSetInfo();
|
||||
+
|
||||
+ int32_t pos_in_set = 0;
|
||||
+ int32_t set_size = 0;
|
||||
+ base::Optional<int> lowest_hierarchical_level;
|
||||
+ };
|
||||
|
||||
// Represents the content of an ordered set which includes the ordered set
|
||||
// items and the ordered set container if it exists.
|
@ -1,23 +0,0 @@
|
||||
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h
|
||||
index b3c7624..85936aa 100644
|
||||
--- a/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h
|
||||
+++ b/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_PHYSICAL_CONTAINER_FRAGMENT_H_
|
||||
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_PHYSICAL_CONTAINER_FRAGMENT_H_
|
||||
|
||||
+#include <iterator>
|
||||
+
|
||||
#include "base/containers/span.h"
|
||||
#include "third_party/blink/renderer/core/core_export.h"
|
||||
#include "third_party/blink/renderer/core/layout/geometry/physical_rect.h"
|
||||
@@ -31,7 +33,8 @@ class CORE_EXPORT NGPhysicalContainerFragment : public NGPhysicalFragment {
|
||||
PostLayoutChildLinkList(wtf_size_t count, const NGLink* buffer)
|
||||
: count_(count), buffer_(buffer) {}
|
||||
|
||||
- class ConstIterator {
|
||||
+ class ConstIterator : public std::iterator<std::input_iterator_tag,
|
||||
+ NGLink> {
|
||||
STACK_ALLOCATED();
|
||||
|
||||
public:
|
@ -1,35 +0,0 @@
|
||||
diff --git a/ui/color/color_set.cc b/ui/color/color_set.cc
|
||||
index 56564d7..2798a3c 100644
|
||||
--- a/ui/color/color_set.cc
|
||||
+++ b/ui/color/color_set.cc
|
||||
@@ -11,7 +11,7 @@ ColorSet::ColorSet(ColorSetId id, ColorMap&& colors)
|
||||
|
||||
ColorSet::ColorSet(ColorSet&&) noexcept = default;
|
||||
|
||||
-ColorSet& ColorSet::operator=(ColorSet&&) noexcept = default;
|
||||
+ColorSet& ColorSet::operator=(ColorSet&&) = default;
|
||||
|
||||
ColorSet::~ColorSet() = default;
|
||||
|
||||
diff --git a/third_party/blink/public/platform/cross_variant_mojo_util.h b/third_party/blink/public/platform/cross_variant_mojo_util.h
|
||||
index dee0b95..0c83580 100644
|
||||
--- a/third_party/blink/public/platform/cross_variant_mojo_util.h
|
||||
+++ b/third_party/blink/public/platform/cross_variant_mojo_util.h
|
||||
@@ -124,7 +124,7 @@ class CrossVariantMojoAssociatedReceiver {
|
||||
~CrossVariantMojoAssociatedReceiver() = default;
|
||||
|
||||
CrossVariantMojoAssociatedReceiver(
|
||||
- CrossVariantMojoAssociatedReceiver&&) noexcept = default;
|
||||
+ CrossVariantMojoAssociatedReceiver&&) = default;
|
||||
CrossVariantMojoAssociatedReceiver& operator=(
|
||||
CrossVariantMojoAssociatedReceiver&&) noexcept = default;
|
||||
|
||||
@@ -155,7 +155,7 @@ class CrossVariantMojoAssociatedRemote {
|
||||
~CrossVariantMojoAssociatedRemote() = default;
|
||||
|
||||
CrossVariantMojoAssociatedRemote(
|
||||
- CrossVariantMojoAssociatedRemote&&) noexcept = default;
|
||||
+ CrossVariantMojoAssociatedRemote&&) = default;
|
||||
CrossVariantMojoAssociatedRemote& operator=(
|
||||
CrossVariantMojoAssociatedRemote&&) noexcept = default;
|
||||
|
@ -1,75 +0,0 @@
|
||||
From 3681c96f54b34f60493cbbf5ec830f158e469799 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Thu, 2 Apr 2020 14:35:44 +0000
|
||||
Subject: [PATCH] IWYU: std::find is defined in algorithm
|
||||
|
||||
---
|
||||
extensions/browser/install/crx_install_error.cc | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/extensions/browser/install/crx_install_error.cc b/extensions/browser/install/crx_install_error.cc
|
||||
index a9765bb..bd0d3e3 100644
|
||||
--- a/extensions/browser/install/crx_install_error.cc
|
||||
+++ b/extensions/browser/install/crx_install_error.cc
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include "extensions/browser/install/crx_install_error.h"
|
||||
|
||||
+#include <algorithm>
|
||||
+
|
||||
#include "base/logging.h"
|
||||
#include "extensions/browser/install/sandboxed_unpacker_failure_reason.h"
|
||||
|
||||
--
|
||||
2.24.1
|
||||
|
||||
From 80044e30e0014c4c322178e4b56ddbb10eede304 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Thu, 9 Apr 2020 17:58:06 +0000
|
||||
Subject: [PATCH] IWYU: std::unique_ptr is defined in memory
|
||||
|
||||
---
|
||||
.../blink/renderer/core/html/trust_token_attribute_parsing.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/html/trust_token_attribute_parsing.h b/third_party/blink/renderer/core/html/trust_token_attribute_parsing.h
|
||||
index f5a7ab0..ef19cfa 100644
|
||||
--- a/third_party/blink/renderer/core/html/trust_token_attribute_parsing.h
|
||||
+++ b/third_party/blink/renderer/core/html/trust_token_attribute_parsing.h
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRUST_TOKEN_ATTRIBUTE_PARSING_H_
|
||||
#define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRUST_TOKEN_ATTRIBUTE_PARSING_H_
|
||||
|
||||
+#include <memory>
|
||||
+
|
||||
#include "base/optional.h"
|
||||
#include "services/network/public/mojom/trust_tokens.mojom-blink-forward.h"
|
||||
#include "third_party/blink/renderer/core/core_export.h"
|
||||
--
|
||||
2.24.1
|
||||
|
||||
From 4f4d0a6d453bc22a6397dadaf6d866b4eb2d6b95 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Fri, 10 Apr 2020 08:31:08 +0000
|
||||
Subject: [PATCH] IWYU: std::numeric_limits is defined in limits
|
||||
|
||||
---
|
||||
.../graph/policies/background_tab_loading_policy_helpers.cc | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.cc b/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.cc
|
||||
index 6ab117b..43aa602 100644
|
||||
--- a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.cc
|
||||
+++ b/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.cc
|
||||
@@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
+#include <limits>
|
||||
+
|
||||
#include "chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.h"
|
||||
#include "base/logging.h"
|
||||
|
||||
--
|
||||
2.24.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From fdf2767e8dc54727c9536a4d39d230a959e3698c Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Thu, 2 Apr 2020 16:16:14 +0000
|
||||
Subject: [PATCH] GCC: add missing apps namespace to BrowserAppLauncher
|
||||
|
||||
GCC does not get namespace of BrowserAppLauncher right and
|
||||
fails like this:
|
||||
|
||||
chrome/browser/apps/app_service/app_service_proxy.h:82:23: error:
|
||||
declaration of 'apps::BrowserAppLauncher&
|
||||
apps::AppServiceProxy::BrowserAppLauncher()' changes meaning of
|
||||
'BrowserAppLauncher' [-fpermissive]
|
||||
---
|
||||
chrome/browser/apps/app_service/app_service_proxy.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/browser/apps/app_service/app_service_proxy.h b/chrome/browser/apps/app_service/app_service_proxy.h
|
||||
index b7fff63..1ecd49d 100644
|
||||
--- a/chrome/browser/apps/app_service/app_service_proxy.h
|
||||
+++ b/chrome/browser/apps/app_service/app_service_proxy.h
|
||||
@@ -79,7 +79,7 @@ class AppServiceProxy : public KeyedService,
|
||||
apps::InstanceRegistry& InstanceRegistry();
|
||||
#endif
|
||||
|
||||
- BrowserAppLauncher& BrowserAppLauncher();
|
||||
+ apps::BrowserAppLauncher& BrowserAppLauncher();
|
||||
|
||||
apps::PreferredAppsList& PreferredApps();
|
||||
|
||||
--
|
||||
2.24.1
|
@ -1,130 +0,0 @@
|
||||
From 0914a38252f205fc04fa50e858b24fa5f535ab11 Mon Sep 17 00:00:00 2001
|
||||
From: Hiroki Nakagawa <nhiroki@chromium.org>
|
||||
Date: Wed, 29 Apr 2020 11:46:54 +0900
|
||||
Subject: [PATCH] ServiceWorker: Avoid double destruction of ServiceWorkerObjectHost on connection error
|
||||
|
||||
This CL avoids the case where ServiceWorkerObjectHost is destroyed twice
|
||||
on ServiceWorkerObjectHost::OnConnectionError() when Chromium is built
|
||||
with the GCC build toolchain.
|
||||
|
||||
> How does the issue happen?
|
||||
|
||||
ServiceWorkerObjectHost has a cyclic reference like this:
|
||||
|
||||
ServiceWorkerObjectHost
|
||||
--([1] scoped_refptr)--> ServiceWorkerVersion
|
||||
--([2] std::unique_ptr)--> ServiceWorkerProviderHost
|
||||
--([3] std::unique_ptr)--> ServiceWorkerContainerHost
|
||||
--([4] std::unique_ptr)--> ServiceWorkerObjectHost
|
||||
|
||||
Note that ServiceWorkerContainerHost manages ServiceWorkerObjectHost in
|
||||
map<int64_t version_id, std::unique_ptr<ServiceWorkerObjectHost>>.
|
||||
|
||||
When ServiceWorkerObjectHost::OnConnectionError() is called, the
|
||||
function removes the reference [4] from the map, and destroys
|
||||
ServiceWorkerObjectHost. If the object host has the last reference [1]
|
||||
to ServiceWorkerVersion, the destruction also cuts off the references
|
||||
[2] and [3], and destroys ServiceWorkerProviderHost and
|
||||
ServiceWorkerContainerHost.
|
||||
|
||||
This seems to work well on the Chromium's default toolchain, but not
|
||||
work on the GCC toolchain. According to the report, destruction of
|
||||
ServiceWorkerContainerHost happens while the map owned by the container
|
||||
host is erasing the ServiceWorkerObjectHost, and this results in crash
|
||||
due to double destruction of the object host.
|
||||
|
||||
I don't know the reason why this happens only on the GCC toolchain, but
|
||||
I suspect the order of object destruction on std::map::erase() could be
|
||||
different depending on the toolchains.
|
||||
|
||||
> How does this CL fix this?
|
||||
|
||||
The ideal fix is to redesign the ownership model of
|
||||
ServiceWorkerVersion, but it's not feasible in the short term.
|
||||
|
||||
Instead, this CL avoids destruction of ServiceWorkerObjectHost on
|
||||
std::map::erase(). The new code takes the ownership of the object host
|
||||
from the map first, and then erases the entry from the map. This
|
||||
separates timings to erase the map entry and to destroy the object host,
|
||||
so the crash should no longer happen.
|
||||
|
||||
Bug: 1056598
|
||||
Change-Id: Id30654cb575bc557c42044d6f0c6f1f9bfaed613
|
||||
---
|
||||
|
||||
diff --git a/content/browser/service_worker/service_worker_container_host.cc b/content/browser/service_worker/service_worker_container_host.cc
|
||||
index c631bcd..ff917f8 100644
|
||||
--- a/content/browser/service_worker/service_worker_container_host.cc
|
||||
+++ b/content/browser/service_worker/service_worker_container_host.cc
|
||||
@@ -717,6 +717,16 @@
|
||||
int64_t version_id) {
|
||||
DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId());
|
||||
DCHECK(base::Contains(service_worker_object_hosts_, version_id));
|
||||
+
|
||||
+ // ServiceWorkerObjectHost to be deleted may have the last reference to
|
||||
+ // ServiceWorkerVersion that indirectly owns this ServiceWorkerContainerHost.
|
||||
+ // If we erase the object host directly from the map, |this| could be deleted
|
||||
+ // during the map operation and may crash. To avoid the case, we take the
|
||||
+ // ownership of the object host from the map first, and then erase the entry
|
||||
+ // from the map. See https://crbug.com/1056598 for details.
|
||||
+ std::unique_ptr<ServiceWorkerObjectHost> to_be_deleted =
|
||||
+ std::move(service_worker_object_hosts_[version_id]);
|
||||
+ DCHECK(to_be_deleted);
|
||||
service_worker_object_hosts_.erase(version_id);
|
||||
}
|
||||
|
||||
diff --git a/content/browser/service_worker/service_worker_object_host_unittest.cc b/content/browser/service_worker/service_worker_object_host_unittest.cc
|
||||
index 238cb8b..f60c7a2 100644
|
||||
--- a/content/browser/service_worker/service_worker_object_host_unittest.cc
|
||||
+++ b/content/browser/service_worker/service_worker_object_host_unittest.cc
|
||||
@@ -200,6 +200,19 @@
|
||||
return registration_info;
|
||||
}
|
||||
|
||||
+ void CallOnConnectionError(ServiceWorkerContainerHost* container_host,
|
||||
+ int64_t version_id) {
|
||||
+ // ServiceWorkerObjectHost has the last reference to the version.
|
||||
+ ServiceWorkerObjectHost* object_host =
|
||||
+ GetServiceWorkerObjectHost(container_host, version_id);
|
||||
+ EXPECT_TRUE(object_host->version_->HasOneRef());
|
||||
+
|
||||
+ // Make sure that OnConnectionError induces destruction of the version and
|
||||
+ // the object host.
|
||||
+ object_host->receivers_.Clear();
|
||||
+ object_host->OnConnectionError();
|
||||
+ }
|
||||
+
|
||||
BrowserTaskEnvironment task_environment_;
|
||||
std::unique_ptr<EmbeddedWorkerTestHelper> helper_;
|
||||
scoped_refptr<ServiceWorkerRegistration> registration_;
|
||||
@@ -409,5 +422,30 @@
|
||||
events[0]->source_info_for_client->client_type);
|
||||
}
|
||||
|
||||
+// This is a regression test for https://crbug.com/1056598.
|
||||
+TEST_F(ServiceWorkerObjectHostTest, OnConnectionError) {
|
||||
+ const GURL scope("https://www.example.com/");
|
||||
+ const GURL script_url("https://www.example.com/service_worker.js");
|
||||
+ Initialize(std::make_unique<EmbeddedWorkerTestHelper>(base::FilePath()));
|
||||
+ SetUpRegistration(scope, script_url);
|
||||
+
|
||||
+ // Create the provider host.
|
||||
+ ASSERT_EQ(blink::ServiceWorkerStatusCode::kOk,
|
||||
+ StartServiceWorker(version_.get()));
|
||||
+
|
||||
+ // Set up the case where the last reference to the version is owned by the
|
||||
+ // service worker object host.
|
||||
+ ServiceWorkerContainerHost* container_host =
|
||||
+ version_->provider_host()->container_host();
|
||||
+ ServiceWorkerVersion* version_rawptr = version_.get();
|
||||
+ version_ = nullptr;
|
||||
+ ASSERT_TRUE(version_rawptr->HasOneRef());
|
||||
+
|
||||
+ // Simulate the connection error that induces the object host destruction.
|
||||
+ // This shouldn't crash.
|
||||
+ CallOnConnectionError(container_host, version_rawptr->version_id());
|
||||
+ base::RunLoop().RunUntilIdle();
|
||||
+}
|
||||
+
|
||||
} // namespace service_worker_object_host_unittest
|
||||
} // namespace content
|
@ -1,69 +0,0 @@
|
||||
From 8d115ddda495d0d2e1e1447392db6e9e6a8a1b32 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Tue, 07 Apr 2020 00:23:57 +0000
|
||||
Subject: [PATCH] GCC: fix template specialization in WTF::VectorMover
|
||||
|
||||
GCC complains that explicit specialization in non-namespace scope
|
||||
is happening for MoveOverlappingImpl. However, secialization is
|
||||
not really necessary here with templates and can be moved
|
||||
into MoveOverlappingImpl method without changing generated code.
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: I90b893b9701748302f7b900fbcc2c341685fe0d3
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2126290
|
||||
Reviewed-by: Kent Tamura <tkent@chromium.org>
|
||||
Commit-Queue: Kent Tamura <tkent@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#756880}
|
||||
---
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/wtf/vector.h b/third_party/blink/renderer/platform/wtf/vector.h
|
||||
index 632d308..82aaf96 100644
|
||||
--- a/third_party/blink/renderer/platform/wtf/vector.h
|
||||
+++ b/third_party/blink/renderer/platform/wtf/vector.h
|
||||
@@ -205,30 +205,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
- template <bool = Allocator::kIsGarbageCollected>
|
||||
- static void MoveOverlappingImpl(const T* src, const T* src_end, T* dst);
|
||||
- template <>
|
||||
- static void MoveOverlappingImpl<false>(const T* src,
|
||||
- const T* src_end,
|
||||
- T* dst) {
|
||||
- memmove(dst, src,
|
||||
- reinterpret_cast<const char*>(src_end) -
|
||||
- reinterpret_cast<const char*>(src));
|
||||
- }
|
||||
- template <>
|
||||
- static void MoveOverlappingImpl<true>(const T* src,
|
||||
- const T* src_end,
|
||||
- T* dst) {
|
||||
- if (src == dst)
|
||||
- return;
|
||||
- if (dst < src) {
|
||||
- for (; src < src_end; ++src, ++dst)
|
||||
- AtomicWriteMemcpy<sizeof(T)>(dst, src);
|
||||
+ static void MoveOverlappingImpl(const T* src, const T* src_end, T* dst) {
|
||||
+ if (Allocator::kIsGarbageCollected) {
|
||||
+ if (src == dst)
|
||||
+ return;
|
||||
+ if (dst < src) {
|
||||
+ for (; src < src_end; ++src, ++dst)
|
||||
+ AtomicWriteMemcpy<sizeof(T)>(dst, src);
|
||||
+ } else {
|
||||
+ --src_end;
|
||||
+ T* dst_end = dst + (src_end - src);
|
||||
+ for (; src_end >= src; --src_end, --dst_end)
|
||||
+ AtomicWriteMemcpy<sizeof(T)>(dst_end, src_end);
|
||||
+ }
|
||||
} else {
|
||||
- --src_end;
|
||||
- T* dst_end = dst + (src_end - src);
|
||||
- for (; src_end >= src; --src_end, --dst_end)
|
||||
- AtomicWriteMemcpy<sizeof(T)>(dst_end, src_end);
|
||||
+ memmove(dst, src,
|
||||
+ reinterpret_cast<const char*>(src_end) -
|
||||
+ reinterpret_cast<const char*>(src));
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
diff -up chromium-83.0.4103.97/services/service_manager/sandbox/linux/bpf_cros_amd_gpu_policy_linux.cc.epel7-kcmp chromium-83.0.4103.97/services/service_manager/sandbox/linux/bpf_cros_amd_gpu_policy_linux.cc
|
||||
--- chromium-83.0.4103.97/services/service_manager/sandbox/linux/bpf_cros_amd_gpu_policy_linux.cc.epel7-kcmp 2020-06-10 09:02:52.693899311 -0400
|
||||
+++ chromium-83.0.4103.97/services/service_manager/sandbox/linux/bpf_cros_amd_gpu_policy_linux.cc 2020-06-10 09:04:14.692102541 -0400
|
||||
@@ -5,7 +5,9 @@
|
||||
#include "services/service_manager/sandbox/linux/bpf_cros_amd_gpu_policy_linux.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
-#include <linux/kcmp.h>
|
||||
+#ifndef KCMP_FILE
|
||||
+#define KCMP_FILE 0
|
||||
+#endif
|
||||
#include <sys/socket.h>
|
||||
|
||||
// Some arch's (arm64 for instance) unistd.h don't pull in symbols used here
|
@ -0,0 +1,36 @@
|
||||
From f3dfe39f9fd3091cf1a7146b936d9de77a459435 Mon Sep 17 00:00:00 2001
|
||||
From: Piotr Tworek <ptworek@vewd.com>
|
||||
Date: Mon, 18 May 2020 15:24:35 +0000
|
||||
Subject: [PATCH] Make blink::AXObject::AncestorsIterator STL compatible.
|
||||
|
||||
Commit 31e5188ffc9a04295997d22bfdb68fc367bef047, "Used some methods from
|
||||
AXRoleProperties in AXObject" started using std::any_of with this custom
|
||||
iterator type. Unfortunately this iterator does not provide traits
|
||||
mandated by the standard. This works fine for libcxx, but fails when
|
||||
compiling the code against libstdc++.
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: I78fe25475593d73ce255f1de955aa41e936dff86
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2207112
|
||||
Reviewed-by: Kentaro Hara <haraken@chromium.org>
|
||||
Commit-Queue: Piotr Tworek <ptworek@vewd.com>
|
||||
Cr-Commit-Position: refs/heads/master@{#769713}
|
||||
---
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.h b/third_party/blink/renderer/modules/accessibility/ax_object.h
|
||||
index 841715b..fbb87bf 100644
|
||||
--- a/third_party/blink/renderer/modules/accessibility/ax_object.h
|
||||
+++ b/third_party/blink/renderer/modules/accessibility/ax_object.h
|
||||
@@ -274,6 +274,12 @@
|
||||
class MODULES_EXPORT AncestorsIterator final
|
||||
: public GarbageCollected<AncestorsIterator> {
|
||||
public:
|
||||
+ using iterator_category = std::forward_iterator_tag;
|
||||
+ using value_type = AXObject;
|
||||
+ using difference_type = ptrdiff_t;
|
||||
+ using pointer = value_type*;
|
||||
+ using reference = value_type&;
|
||||
+
|
||||
~AncestorsIterator() = default;
|
||||
|
||||
AncestorsIterator(const AncestorsIterator& other)
|
@ -0,0 +1,55 @@
|
||||
From c65b4d03c76da607b6b678c4a46baa75ca0cf7b3 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Wed, 27 May 2020 18:46:40 +0000
|
||||
Subject: [PATCH] GCC: make base::FilePath move assignment operator noexcept
|
||||
|
||||
The move assignment operator in PaintPreviewClient::PaintPreviewData is
|
||||
noexcept. Because this class has a member of type base::FilePath, the
|
||||
move assignment operator of base::FilePath must be noexcept too.
|
||||
|
||||
Otherwise GCC fails like this:
|
||||
|
||||
../../components/paint_preview/browser/paint_preview_client.cc:107:1:
|
||||
|
||||
error: function 'paint_preview::PaintPreviewClient::PaintPreviewData&
|
||||
paint_preview::PaintPreviewClient::PaintPreviewData::operator=
|
||||
(paint_preview::PaintPreviewClient::PaintPreviewData&&)' defaulted on
|
||||
its redeclaration with an exception-specification that differs from
|
||||
the implicit exception-specification ''
|
||||
107 | PaintPreviewClient::PaintPreviewData::operator=(
|
||||
| ^~~~~~~~~~~~~~~~~~
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: I87b88a81e8af6b7e61f0d1a8c8444fd6707e50d2
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218168
|
||||
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
||||
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#772348}
|
||||
---
|
||||
|
||||
diff --git a/base/files/file_path.cc b/base/files/file_path.cc
|
||||
index 6dc6854..56c02d2b 100644
|
||||
--- a/base/files/file_path.cc
|
||||
+++ b/base/files/file_path.cc
|
||||
@@ -186,7 +186,7 @@
|
||||
|
||||
FilePath& FilePath::operator=(const FilePath& that) = default;
|
||||
|
||||
-FilePath& FilePath::operator=(FilePath&& that) = default;
|
||||
+FilePath& FilePath::operator=(FilePath&& that) noexcept = default;
|
||||
|
||||
bool FilePath::operator==(const FilePath& that) const {
|
||||
#if defined(FILE_PATH_USES_DRIVE_LETTERS)
|
||||
diff --git a/base/files/file_path.h b/base/files/file_path.h
|
||||
index 4e23f71a..2160fda 100644
|
||||
--- a/base/files/file_path.h
|
||||
+++ b/base/files/file_path.h
|
||||
@@ -193,7 +193,7 @@
|
||||
FilePath(FilePath&& that) noexcept;
|
||||
// Replaces the contents with those of |that|, which is left in valid but
|
||||
// unspecified state.
|
||||
- FilePath& operator=(FilePath&& that);
|
||||
+ FilePath& operator=(FilePath&& that) noexcept;
|
||||
|
||||
bool operator==(const FilePath& that) const;
|
||||
|
@ -0,0 +1,30 @@
|
||||
From 408bded3befc625e16ef18f2ff5467e040b203e7 Mon Sep 17 00:00:00 2001
|
||||
From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
|
||||
Date: Wed, 27 May 2020 16:34:56 +0000
|
||||
Subject: [PATCH] ListContainerHelper: Include <cstring> for memcpy()
|
||||
|
||||
IWYU. This fixes the libstdc++ build after commit 41989bd89 ("Remove/replace
|
||||
unnecessary logging.h includes in .cc files (cc)").
|
||||
|
||||
Bug: 957519
|
||||
Change-Id: I1e782e8310ca548947b2d541af6a2159d928d1f3
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218090
|
||||
Reviewed-by: vmpstr <vmpstr@chromium.org>
|
||||
Commit-Queue: vmpstr <vmpstr@chromium.org>
|
||||
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
|
||||
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
|
||||
Cr-Commit-Position: refs/heads/master@{#772267}
|
||||
---
|
||||
|
||||
diff --git a/cc/base/list_container_helper.cc b/cc/base/list_container_helper.cc
|
||||
index afd386e..7b594b4 100644
|
||||
--- a/cc/base/list_container_helper.cc
|
||||
+++ b/cc/base/list_container_helper.cc
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include <algorithm>
|
||||
+#include <cstring>
|
||||
#include <vector>
|
||||
|
||||
#include "base/check_op.h"
|
@ -0,0 +1,114 @@
|
||||
From bc9a96ef9eeab89276d67929f4a8a7d88f5dbc02 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Wed, 27 May 2020 13:37:25 +0000
|
||||
Subject: [PATCH] GCC: fix template specialization in TraceInCollectionTrait
|
||||
|
||||
GCC complains that explicit specialization in non-namespace scope
|
||||
is happening for TraceImpl. Move TraceImpl implementations into
|
||||
different nested classes and select implementation using
|
||||
std::conditional.
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: I8feea5f2aa6e1f87daad61f496d6b53b1bbc49ac
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2217887
|
||||
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
|
||||
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#772215}
|
||||
---
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/heap/collection_support/heap_hash_table_backing.h b/third_party/blink/renderer/platform/heap/collection_support/heap_hash_table_backing.h
|
||||
index 31e7888..2c0583f 100644
|
||||
--- a/third_party/blink/renderer/platform/heap/collection_support/heap_hash_table_backing.h
|
||||
+++ b/third_party/blink/renderer/platform/heap/collection_support/heap_hash_table_backing.h
|
||||
@@ -241,50 +241,52 @@
|
||||
|
||||
static void Trace(blink::Visitor* visitor,
|
||||
const KeyValuePair<Key, Value>& self) {
|
||||
- TraceImpl(visitor, self);
|
||||
+ TraceImpl::Trace(visitor, self);
|
||||
}
|
||||
|
||||
private:
|
||||
- template <bool = EphemeronHelper::is_ephemeron>
|
||||
- static void TraceImpl(blink::Visitor* visitor,
|
||||
- const KeyValuePair<Key, Value>& self);
|
||||
-
|
||||
- // Strongification of ephemerons, i.e., Weak/Strong and Strong/Weak.
|
||||
- template <>
|
||||
- static void TraceImpl<true>(blink::Visitor* visitor,
|
||||
- const KeyValuePair<Key, Value>& self) {
|
||||
+ struct TraceImplEphemerons {
|
||||
// Strongification of ephemerons, i.e., Weak/Strong and Strong/Weak.
|
||||
- // The helper ensures that helper.key always refers to the weak part and
|
||||
- // helper.value always refers to the dependent part.
|
||||
- // We distinguish ephemeron from Weak/Weak and Strong/Strong to allow users
|
||||
- // to override visitation behavior. An example is creating a heap snapshot,
|
||||
- // where it is useful to annotate values as being kept alive from keys
|
||||
- // rather than the table.
|
||||
- EphemeronHelper helper(&self.key, &self.value);
|
||||
- // Strongify the weak part.
|
||||
- blink::TraceCollectionIfEnabled<
|
||||
- kNoWeakHandling, typename EphemeronHelper::KeyType,
|
||||
- typename EphemeronHelper::KeyTraits>::Trace(visitor, helper.key);
|
||||
- // Strongify the dependent part.
|
||||
- visitor->TraceEphemeron(
|
||||
- *helper.key, helper.value,
|
||||
- blink::TraceCollectionIfEnabled<
|
||||
- kNoWeakHandling, typename EphemeronHelper::ValueType,
|
||||
- typename EphemeronHelper::ValueTraits>::Trace);
|
||||
- }
|
||||
+ static void Trace(blink::Visitor* visitor,
|
||||
+ const KeyValuePair<Key, Value>& self) {
|
||||
+ // Strongification of ephemerons, i.e., Weak/Strong and Strong/Weak.
|
||||
+ // The helper ensures that helper.key always refers to the weak part and
|
||||
+ // helper.value always refers to the dependent part.
|
||||
+ // We distinguish ephemeron from Weak/Weak and Strong/Strong to allow
|
||||
+ // users to override visitation behavior. An example is creating a heap
|
||||
+ // snapshot, where it is useful to annotate values as being kept alive
|
||||
+ // from keys rather than the table.
|
||||
+ EphemeronHelper helper(&self.key, &self.value);
|
||||
+ // Strongify the weak part.
|
||||
+ blink::TraceCollectionIfEnabled<
|
||||
+ kNoWeakHandling, typename EphemeronHelper::KeyType,
|
||||
+ typename EphemeronHelper::KeyTraits>::Trace(visitor, helper.key);
|
||||
+ // Strongify the dependent part.
|
||||
+ visitor->TraceEphemeron(
|
||||
+ *helper.key, helper.value,
|
||||
+ blink::TraceCollectionIfEnabled<
|
||||
+ kNoWeakHandling, typename EphemeronHelper::ValueType,
|
||||
+ typename EphemeronHelper::ValueTraits>::Trace);
|
||||
+ }
|
||||
+ };
|
||||
|
||||
- template <>
|
||||
- static void TraceImpl<false>(blink::Visitor* visitor,
|
||||
- const KeyValuePair<Key, Value>& self) {
|
||||
- // Strongification of non-ephemeron KVP, i.e., Strong/Strong or Weak/Weak.
|
||||
- // Order does not matter here.
|
||||
- blink::TraceCollectionIfEnabled<
|
||||
- kNoWeakHandling, Key, typename Traits::KeyTraits>::Trace(visitor,
|
||||
- &self.key);
|
||||
- blink::TraceCollectionIfEnabled<
|
||||
- kNoWeakHandling, Value,
|
||||
- typename Traits::ValueTraits>::Trace(visitor, &self.value);
|
||||
- }
|
||||
+ struct TraceImplDefault {
|
||||
+ static void Trace(blink::Visitor* visitor,
|
||||
+ const KeyValuePair<Key, Value>& self) {
|
||||
+ // Strongification of non-ephemeron KVP, i.e., Strong/Strong or Weak/Weak.
|
||||
+ // Order does not matter here.
|
||||
+ blink::TraceCollectionIfEnabled<
|
||||
+ kNoWeakHandling, Key, typename Traits::KeyTraits>::Trace(visitor,
|
||||
+ &self.key);
|
||||
+ blink::TraceCollectionIfEnabled<
|
||||
+ kNoWeakHandling, Value,
|
||||
+ typename Traits::ValueTraits>::Trace(visitor, &self.value);
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
+ using TraceImpl = typename std::conditional<EphemeronHelper::is_ephemeron,
|
||||
+ TraceImplEphemerons,
|
||||
+ TraceImplDefault>::type;
|
||||
};
|
||||
|
||||
template <typename Key, typename Value, typename Traits>
|
@ -0,0 +1,34 @@
|
||||
From 93b66919d34f977a7d437afc1691f2d8762a350f Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Mon, 04 May 2020 07:46:46 +0000
|
||||
Subject: [PATCH] GCC: fix template specialization in WTF::VectorBuffer
|
||||
|
||||
GCC complains that explicit specialization in non-namespace scope
|
||||
is happening for InitInlinedBuffer. However, specialization is
|
||||
not really necessary here with templates and can be moved
|
||||
into InitInlinedBuffer method without changing generated code.
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: Ia8060152bf4ba21c85dfc4d99cd7cc64983de077
|
||||
---
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/wtf/vector.h b/third_party/blink/renderer/platform/wtf/vector.h
|
||||
index 81a4e7b..8a879a0 100644
|
||||
--- a/third_party/blink/renderer/platform/wtf/vector.h
|
||||
+++ b/third_party/blink/renderer/platform/wtf/vector.h
|
||||
@@ -950,11 +950,10 @@
|
||||
return unsafe_reinterpret_cast_ptr<const T*>(inline_buffer_);
|
||||
}
|
||||
|
||||
- template <bool = Allocator::kIsGarbageCollected>
|
||||
- void InitInlinedBuffer() {}
|
||||
- template <>
|
||||
- void InitInlinedBuffer<true>() {
|
||||
- memset(&inline_buffer_, 0, kInlineBufferSize);
|
||||
+ void InitInlinedBuffer() {
|
||||
+ if (Allocator::kIsGarbageCollected) {
|
||||
+ memset(&inline_buffer_, 0, kInlineBufferSize);
|
||||
+ }
|
||||
}
|
||||
|
||||
alignas(T) char inline_buffer_[kInlineBufferSize];
|
@ -0,0 +1,33 @@
|
||||
From 08ac7188f414218ac9d764e29e7aa64a6bfc2f96 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Sun, 31 May 2020 10:02:03 +0000
|
||||
Subject: [PATCH] disable clang-format for generated code in blink
|
||||
|
||||
For GCC builds clang-format might be not available. Additionally,
|
||||
current scripts look for clang-format within chromium sources and
|
||||
don't consider system clang-format.
|
||||
---
|
||||
.../bindings/scripts/bind_gen/codegen_utils.py | 10 +---------
|
||||
1 file changed, 1 insertion(+), 9 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py b/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py
|
||||
index 7021f1a..33bf5bf 100644
|
||||
--- a/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py
|
||||
+++ b/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py
|
||||
@@ -150,12 +150,4 @@ def write_code_node_to_file(code_node, filepath):
|
||||
|
||||
rendered_text = render_code_node(code_node)
|
||||
|
||||
- format_result = style_format.auto_format(rendered_text, filename=filepath)
|
||||
- if not format_result.did_succeed:
|
||||
- raise RuntimeError("Style-formatting failed: filename = {filename}\n"
|
||||
- "---- stderr ----\n"
|
||||
- "{stderr}:".format(
|
||||
- filename=format_result.filename,
|
||||
- stderr=format_result.error_message))
|
||||
-
|
||||
- web_idl.file_io.write_to_file_if_changed(filepath, format_result.contents)
|
||||
+ web_idl.file_io.write_to_file_if_changed(filepath, rendered_text)
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,90 @@
|
||||
From effd506ce070d58e731bd6086681b9cded8573ed Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Sun, 10 May 2020 07:24:38 +0000
|
||||
Subject: [PATCH] IWYU: add a bunch of missing cstring includes
|
||||
|
||||
---
|
||||
.../crashpad/snapshot/minidump/minidump_context_converter.cc | 2 ++
|
||||
third_party/crashpad/crashpad/util/linux/ptrace_client.cc | 1 +
|
||||
.../crashpad/crashpad/util/net/http_multipart_builder.cc | 1 +
|
||||
third_party/crashpad/crashpad/util/net/http_transport_socket.cc | 2 ++
|
||||
third_party/crashpad/crashpad/util/process/process_memory.cc | 1 +
|
||||
third_party/crashpad/crashpad/util/stream/log_output_stream.cc | 1 +
|
||||
6 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/third_party/crashpad/crashpad/snapshot/minidump/minidump_context_converter.cc b/third_party/crashpad/crashpad/snapshot/minidump/minidump_context_converter.cc
|
||||
index 0c840deac..1d163b42f 100644
|
||||
--- a/third_party/crashpad/crashpad/snapshot/minidump/minidump_context_converter.cc
|
||||
+++ b/third_party/crashpad/crashpad/snapshot/minidump/minidump_context_converter.cc
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "snapshot/minidump/minidump_context_converter.h"
|
||||
|
||||
+#include <cstring>
|
||||
+
|
||||
#include "base/stl_util.h"
|
||||
#include "minidump/minidump_context.h"
|
||||
|
||||
diff --git a/third_party/crashpad/crashpad/util/linux/ptrace_client.cc b/third_party/crashpad/crashpad/util/linux/ptrace_client.cc
|
||||
index f097ad985..e91ce2eca 100644
|
||||
--- a/third_party/crashpad/crashpad/util/linux/ptrace_client.cc
|
||||
+++ b/third_party/crashpad/crashpad/util/linux/ptrace_client.cc
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
+#include <cstring>
|
||||
#include <string>
|
||||
|
||||
#include "base/logging.h"
|
||||
diff --git a/third_party/crashpad/crashpad/util/net/http_multipart_builder.cc b/third_party/crashpad/crashpad/util/net/http_multipart_builder.cc
|
||||
index 267960b27..8ed7edc2f 100644
|
||||
--- a/third_party/crashpad/crashpad/util/net/http_multipart_builder.cc
|
||||
+++ b/third_party/crashpad/crashpad/util/net/http_multipart_builder.cc
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
+#include <cstring>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
diff --git a/third_party/crashpad/crashpad/util/net/http_transport_socket.cc b/third_party/crashpad/crashpad/util/net/http_transport_socket.cc
|
||||
index 4dd01b6e7..60cd60c17 100644
|
||||
--- a/third_party/crashpad/crashpad/util/net/http_transport_socket.cc
|
||||
+++ b/third_party/crashpad/crashpad/util/net/http_transport_socket.cc
|
||||
@@ -19,6 +19,8 @@
|
||||
#include <poll.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
+#include <cstring>
|
||||
+
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
diff --git a/third_party/crashpad/crashpad/util/process/process_memory.cc b/third_party/crashpad/crashpad/util/process/process_memory.cc
|
||||
index ab87b940f..e02bcea81 100644
|
||||
--- a/third_party/crashpad/crashpad/util/process/process_memory.cc
|
||||
+++ b/third_party/crashpad/crashpad/util/process/process_memory.cc
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "util/process/process_memory.h"
|
||||
|
||||
#include <algorithm>
|
||||
+#include <cstring>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "util/numeric/safe_assignment.h"
|
||||
diff --git a/third_party/crashpad/crashpad/util/stream/log_output_stream.cc b/third_party/crashpad/crashpad/util/stream/log_output_stream.cc
|
||||
index 03c0a5a02..45d823aa4 100644
|
||||
--- a/third_party/crashpad/crashpad/util/stream/log_output_stream.cc
|
||||
+++ b/third_party/crashpad/crashpad/util/stream/log_output_stream.cc
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "util/stream/log_output_stream.h"
|
||||
|
||||
#include <algorithm>
|
||||
+#include <cstring>
|
||||
|
||||
#include "base/logging.h"
|
||||
|
||||
--
|
||||
2.26.2
|
@ -0,0 +1,37 @@
|
||||
From e174cb4af7a47b891dcaa114f0a95fd4a64a9761 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Mon, 04 May 2020 11:09:20 +0000
|
||||
Subject: [PATCH] GCC: remove noexcept on definition of move constructor
|
||||
|
||||
ScopedInterfaceEndpointHandle move constructor does not have noexcept specifier. However, noexcept can't be added there, because the move constructor uses new operator which can throw.
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: I61806b7aa6f1d77ed0668df7de5ef6cda5da97a5
|
||||
---
|
||||
|
||||
diff --git a/third_party/blink/public/platform/cross_variant_mojo_util.h b/third_party/blink/public/platform/cross_variant_mojo_util.h
|
||||
index a3a6d80..bb1095a 100644
|
||||
--- a/third_party/blink/public/platform/cross_variant_mojo_util.h
|
||||
+++ b/third_party/blink/public/platform/cross_variant_mojo_util.h
|
||||
@@ -127,8 +127,8 @@
|
||||
CrossVariantMojoAssociatedReceiver() = default;
|
||||
~CrossVariantMojoAssociatedReceiver() = default;
|
||||
|
||||
- CrossVariantMojoAssociatedReceiver(
|
||||
- CrossVariantMojoAssociatedReceiver&&) noexcept = default;
|
||||
+ CrossVariantMojoAssociatedReceiver(CrossVariantMojoAssociatedReceiver&&) =
|
||||
+ default;
|
||||
CrossVariantMojoAssociatedReceiver& operator=(
|
||||
CrossVariantMojoAssociatedReceiver&&) noexcept = default;
|
||||
|
||||
@@ -160,8 +160,8 @@
|
||||
CrossVariantMojoAssociatedRemote() = default;
|
||||
~CrossVariantMojoAssociatedRemote() = default;
|
||||
|
||||
- CrossVariantMojoAssociatedRemote(
|
||||
- CrossVariantMojoAssociatedRemote&&) noexcept = default;
|
||||
+ CrossVariantMojoAssociatedRemote(CrossVariantMojoAssociatedRemote&&) =
|
||||
+ default;
|
||||
CrossVariantMojoAssociatedRemote& operator=(
|
||||
CrossVariantMojoAssociatedRemote&&) noexcept = default;
|
||||
|
@ -0,0 +1,65 @@
|
||||
From df413313083a9dabdc573545aaf70343aa0830ca Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Wed, 27 May 2020 17:03:03 +0000
|
||||
Subject: [PATCH] GCC: fix decltype to get a valid function pointer
|
||||
|
||||
The decltype(<func>) passed as template parameter to
|
||||
CBBFunctionToVector does not return a function pointer
|
||||
and GCC complains like this:
|
||||
|
||||
../../device/fido/virtual_fido_device.cc:104:68: error:
|
||||
'int(struct cbb_st*, const struct evp_pkey_st*)' is not a valid type
|
||||
for a template non-type parameter
|
||||
104 | EVP_marshal_private_key>(pkey_.get());
|
||||
| ^
|
||||
|
||||
Fix this by passing decltype(&<func>).
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: I8114c3d75c9865779d58c0b6a6c48e6affd3175b
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2217414
|
||||
Reviewed-by: Adam Langley <agl@chromium.org>
|
||||
Commit-Queue: Adam Langley <agl@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#772283}
|
||||
---
|
||||
|
||||
diff --git a/device/fido/virtual_fido_device.cc b/device/fido/virtual_fido_device.cc
|
||||
index 0256c6a..72423d3 100644
|
||||
--- a/device/fido/virtual_fido_device.cc
|
||||
+++ b/device/fido/virtual_fido_device.cc
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
// CBBFunctionToVector converts a BoringSSL function that writes to a CBB to one
|
||||
// that returns a std::vector. Invoke for a function, f, with:
|
||||
-// CBBFunctionToVector<decltype(f), f>(args, to, f);
|
||||
+// CBBFunctionToVector<decltype(&f), f>(args, to, f);
|
||||
template <typename F, F function, typename... Args>
|
||||
std::vector<uint8_t> CBBFunctionToVector(Args&&... args) {
|
||||
uint8_t* der = nullptr;
|
||||
@@ -102,7 +102,7 @@
|
||||
}
|
||||
|
||||
std::vector<uint8_t> GetPKCS8PrivateKey() const override {
|
||||
- return CBBFunctionToVector<decltype(EVP_marshal_private_key),
|
||||
+ return CBBFunctionToVector<decltype(&EVP_marshal_private_key),
|
||||
EVP_marshal_private_key>(pkey_.get());
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
|
||||
std::vector<uint8_t> GetX962PublicKey() const override {
|
||||
const EC_KEY* ec_key = EVP_PKEY_get0_EC_KEY(pkey_.get());
|
||||
- return CBBFunctionToVector<decltype(EC_POINT_point2cbb),
|
||||
+ return CBBFunctionToVector<decltype(&EC_POINT_point2cbb),
|
||||
EC_POINT_point2cbb>(
|
||||
EC_KEY_get0_group(ec_key), EC_KEY_get0_public_key(ec_key),
|
||||
POINT_CONVERSION_UNCOMPRESSED, /*ctx=*/nullptr);
|
||||
@@ -172,7 +172,7 @@
|
||||
cbor::Writer::Write(cbor::Value(std::move(map))));
|
||||
|
||||
std::vector<uint8_t> der_bytes(
|
||||
- CBBFunctionToVector<decltype(EVP_marshal_public_key),
|
||||
+ CBBFunctionToVector<decltype(&EVP_marshal_public_key),
|
||||
EVP_marshal_public_key>(pkey_.get()));
|
||||
|
||||
return std::make_unique<PublicKey>(
|
@ -0,0 +1,66 @@
|
||||
From 911bdcd8cc5475be4ec4228cfbc85fc38f52857e Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Wed, 27 May 2020 10:00:41 +0000
|
||||
Subject: [PATCH] GCC: make base::{flat_map,flat_tree} move assignement operators noexcept
|
||||
|
||||
Move assigment operator in ui::ColorSet is noexcept. Because this
|
||||
class has a member of type base::flat_map, move assignment operators
|
||||
of base::flat_map and base::flat_tree must be noexcept too.
|
||||
base::flat_tree noexcept is conditional to avoid build failure with
|
||||
NaCl.
|
||||
|
||||
Otherwise GCC fails like this:
|
||||
|
||||
../../ui/color/color_set.cc:14:11: error: function
|
||||
'ui::ColorSet& ui::ColorSet::operator=(ui::ColorSet&&)' defaulted on its
|
||||
redeclaration with an exception-specification that differs from the
|
||||
implicit exception-specification ''
|
||||
14 | ColorSet& ColorSet::operator=(ColorSet&&) noexcept = default;
|
||||
| ^~~~~~~~
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: I10ce31851effc9ce78f2b5cbbb7148c339f065a7
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2179245
|
||||
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
|
||||
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#772175}
|
||||
---
|
||||
|
||||
diff --git a/base/containers/flat_map.h b/base/containers/flat_map.h
|
||||
index ed82c5d..1af6b40 100644
|
||||
--- a/base/containers/flat_map.h
|
||||
+++ b/base/containers/flat_map.h
|
||||
@@ -202,7 +202,7 @@
|
||||
~flat_map() = default;
|
||||
|
||||
flat_map& operator=(const flat_map&) = default;
|
||||
- flat_map& operator=(flat_map&&) = default;
|
||||
+ flat_map& operator=(flat_map&&) noexcept = default;
|
||||
// Takes the first if there are duplicates in the initializer list.
|
||||
flat_map& operator=(std::initializer_list<value_type> ilist);
|
||||
|
||||
diff --git a/base/containers/flat_tree.h b/base/containers/flat_tree.h
|
||||
index 9412ff6..ce6e92b 100644
|
||||
--- a/base/containers/flat_tree.h
|
||||
+++ b/base/containers/flat_tree.h
|
||||
@@ -125,7 +125,8 @@
|
||||
// Assume that move assignment invalidates iterators and references.
|
||||
|
||||
flat_tree& operator=(const flat_tree&);
|
||||
- flat_tree& operator=(flat_tree&&);
|
||||
+ flat_tree& operator=(flat_tree&&) noexcept(
|
||||
+ std::is_nothrow_move_assignable<underlying_type>::value);
|
||||
// Takes the first if there are duplicates in the initializer list.
|
||||
flat_tree& operator=(std::initializer_list<value_type> ilist);
|
||||
|
||||
@@ -518,7 +519,9 @@
|
||||
const flat_tree&) -> flat_tree& = default;
|
||||
|
||||
template <class Key, class Value, class GetKeyFromValue, class KeyCompare>
|
||||
-auto flat_tree<Key, Value, GetKeyFromValue, KeyCompare>::operator=(flat_tree &&)
|
||||
+auto flat_tree<Key, Value, GetKeyFromValue, KeyCompare>::
|
||||
+operator=(flat_tree&&) noexcept(
|
||||
+ std::is_nothrow_move_assignable<underlying_type>::value)
|
||||
-> flat_tree& = default;
|
||||
|
||||
template <class Key, class Value, class GetKeyFromValue, class KeyCompare>
|
@ -0,0 +1,29 @@
|
||||
From 9b749dc5c7fdb0f4b1bd0df5901beb6af1b81ff1 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Sat, 9 May 2020 16:46:07 +0000
|
||||
Subject: [PATCH] GCC: fix DCHECK_EQ in NGInlineNode::SegmentScriptRuns
|
||||
|
||||
data->segments is a std::unique_ptr, but underlying CheckOpValueStr
|
||||
has no overloaded function for std::unique_ptr.
|
||||
However, overloaded function with const void* exists and can be
|
||||
used with std::unique_ptr::get().
|
||||
---
|
||||
.../blink/renderer/core/layout/ng/inline/ng_inline_node.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node.cc
|
||||
index 55ca9e3..ee691df 100644
|
||||
--- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node.cc
|
||||
+++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node.cc
|
||||
@@ -891,7 +891,7 @@ void NGInlineNode::SegmentText(NGInlineNodeData* data) {
|
||||
|
||||
// Segment NGInlineItem by script, Emoji, and orientation using RunSegmenter.
|
||||
void NGInlineNode::SegmentScriptRuns(NGInlineNodeData* data) {
|
||||
- DCHECK_EQ(data->segments, nullptr);
|
||||
+ DCHECK_EQ(data->segments.get(), nullptr);
|
||||
|
||||
String& text_content = data->text_content;
|
||||
if (text_content.IsEmpty()) {
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,29 @@
|
||||
From 62f633b8ca2b2376ca3273e6df910feb4bd93578 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Wed, 27 May 2020 19:23:12 +0000
|
||||
Subject: [PATCH] GCC: DOMRect constexpr equal operator depends on non constexpr operators
|
||||
|
||||
Make operators 'inline' only.
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: If07442258b4ebce26c013c4dff830c1d61dff9e3
|
||||
---
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/geometry/dom_rect.h b/third_party/blink/renderer/core/geometry/dom_rect.h
|
||||
index fede005..058c60a 100644
|
||||
--- a/third_party/blink/renderer/core/geometry/dom_rect.h
|
||||
+++ b/third_party/blink/renderer/core/geometry/dom_rect.h
|
||||
@@ -34,11 +34,11 @@
|
||||
void setHeight(double height) { height_ = height; }
|
||||
};
|
||||
|
||||
-constexpr bool operator==(const DOMRect& lhs, const DOMRect& rhs) {
|
||||
+inline bool operator==(const DOMRect& lhs, const DOMRect& rhs) {
|
||||
return lhs.x() == rhs.x() && lhs.y() == rhs.y() &&
|
||||
lhs.width() == rhs.width() && lhs.height() == rhs.height();
|
||||
}
|
||||
-constexpr bool operator!=(const DOMRect& lhs, const DOMRect& rhs) {
|
||||
+inline bool operator!=(const DOMRect& lhs, const DOMRect& rhs) {
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
} // namespace blink
|
@ -0,0 +1,39 @@
|
||||
From fff3279bcf904673d312893b09bfc53811028490 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Thu, 28 May 2020 03:17:09 +0000
|
||||
Subject: [PATCH] GCC: use brace-initializer for QuotaClientType base::flat_set
|
||||
|
||||
Constructing base::flat_set of QuotaClientType with parenthesis
|
||||
constructor is ambiguous in GCC. Use brace-initializer to avoid
|
||||
that problem.
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: Id33256a25d2af98d7be6ee570e2535a8b7bdf031
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2217554
|
||||
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
|
||||
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#772542}
|
||||
---
|
||||
|
||||
diff --git a/storage/browser/quota/quota_client_type.cc b/storage/browser/quota/quota_client_type.cc
|
||||
index b9e9f62..a2daaa2 100644
|
||||
--- a/storage/browser/quota/quota_client_type.cc
|
||||
+++ b/storage/browser/quota/quota_client_type.cc
|
||||
@@ -9,7 +9,7 @@
|
||||
namespace storage {
|
||||
|
||||
const QuotaClientTypes& AllQuotaClientTypes() {
|
||||
- static base::NoDestructor<QuotaClientTypes> all({
|
||||
+ static base::NoDestructor<QuotaClientTypes> all{{
|
||||
QuotaClientType::kFileSystem,
|
||||
QuotaClientType::kDatabase,
|
||||
QuotaClientType::kAppcache,
|
||||
@@ -17,7 +17,7 @@
|
||||
QuotaClientType::kServiceWorkerCache,
|
||||
QuotaClientType::kServiceWorker,
|
||||
QuotaClientType::kBackgroundFetch,
|
||||
- });
|
||||
+ }};
|
||||
return *all;
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
From 70ea8ba2c50be2a4bc476261e7640d824b938c99 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Sat, 13 Jun 2020 18:16:27 +0000
|
||||
Subject: [PATCH] IWYU: add missing include for memset
|
||||
|
||||
---
|
||||
ui/events/ozone/evdev/event_device_info.cc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/ui/events/ozone/evdev/event_device_info.cc b/ui/events/ozone/evdev/event_device_info.cc
|
||||
index efbc258..0c5f0a3 100644
|
||||
--- a/ui/events/ozone/evdev/event_device_info.cc
|
||||
+++ b/ui/events/ozone/evdev/event_device_info.cc
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "ui/events/ozone/evdev/event_device_info.h"
|
||||
|
||||
#include <linux/input.h>
|
||||
+#include <string.h>
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/logging.h"
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,391 @@
|
||||
commit fce18322d66ea6e67275e13242dae2a8c06d3ae2
|
||||
Author: Yuzu Saijo <yuzus@chromium.org>
|
||||
Date: Thu May 14 05:02:09 2020 +0000
|
||||
|
||||
[content] Manage ManifestManagerHost per-document
|
||||
|
||||
This CL converts ManifestManagerHost class away from being owned by
|
||||
WebContents and makes it a part of RenderDocumentHostUserData.
|
||||
|
||||
We used to create an instance per-WebContents, but now it is created for
|
||||
document, and only for main-frame.
|
||||
|
||||
Bug: 1077170
|
||||
Change-Id: I2a185a6cd6f290d3b904d359b55638bf09eaa79f
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147485
|
||||
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
|
||||
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
|
||||
Reviewed-by: Kentaro Hara <haraken@chromium.org>
|
||||
Reviewed-by: Sreeja Kamishetty <sreejakshetty@chromium.org>
|
||||
Reviewed-by: Alexander Timin <altimin@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#768647}
|
||||
|
||||
diff --git b/content/browser/devtools/protocol/page_handler.cc a/content/browser/devtools/protocol/page_handler.cc
|
||||
index b1821434b975..929b63ab875e 100644
|
||||
--- b/content/browser/devtools/protocol/page_handler.cc
|
||||
+++ a/content/browser/devtools/protocol/page_handler.cc
|
||||
@@ -961,14 +961,14 @@ Response PageHandler::SetDownloadBehavior(const std::string& behavior,
|
||||
|
||||
void PageHandler::GetAppManifest(
|
||||
std::unique_ptr<GetAppManifestCallback> callback) {
|
||||
- if (!host_) {
|
||||
+ WebContentsImpl* web_contents = GetWebContents();
|
||||
+ if (!web_contents || !web_contents->GetManifestManagerHost()) {
|
||||
callback->sendFailure(Response::ServerError("Cannot retrieve manifest"));
|
||||
return;
|
||||
}
|
||||
- ManifestManagerHost::GetOrCreateForCurrentDocument(host_->GetMainFrame())
|
||||
- ->RequestManifestDebugInfo(base::BindOnce(&PageHandler::GotManifest,
|
||||
- weak_factory_.GetWeakPtr(),
|
||||
- std::move(callback)));
|
||||
+ web_contents->GetManifestManagerHost()->RequestManifestDebugInfo(
|
||||
+ base::BindOnce(&PageHandler::GotManifest, weak_factory_.GetWeakPtr(),
|
||||
+ std::move(callback)));
|
||||
}
|
||||
|
||||
WebContentsImpl* PageHandler::GetWebContents() {
|
||||
diff --git b/content/browser/frame_host/render_document_host_user_data_browsertest.cc a/content/browser/frame_host/render_document_host_user_data_browsertest.cc
|
||||
index 09dff7842517..290e5509b448 100644
|
||||
--- b/content/browser/frame_host/render_document_host_user_data_browsertest.cc
|
||||
+++ a/content/browser/frame_host/render_document_host_user_data_browsertest.cc
|
||||
@@ -88,7 +88,7 @@ class RenderDocumentHostUserDataTest : public ContentBrowserTest {
|
||||
|
||||
// Test basic functionality of RenderDocumentHostUserData.
|
||||
IN_PROC_BROWSER_TEST_F(RenderDocumentHostUserDataTest,
|
||||
- GetCreateAndDeleteForCurrentDocument) {
|
||||
+ GetAndCreateForCurrentDocument) {
|
||||
ASSERT_TRUE(embedded_test_server()->Start());
|
||||
GURL url_a(embedded_test_server()->GetURL("a.com", "/title1.html"));
|
||||
|
||||
@@ -104,14 +104,8 @@ IN_PROC_BROWSER_TEST_F(RenderDocumentHostUserDataTest,
|
||||
// 3) Create Data and check that GetForCurrentDocument shouldn't return null
|
||||
// now.
|
||||
Data::CreateForCurrentDocument(rfh_a);
|
||||
- base::WeakPtr<Data> created_data =
|
||||
- Data::GetForCurrentDocument(rfh_a)->GetWeakPtr();
|
||||
- EXPECT_TRUE(created_data);
|
||||
-
|
||||
- // 4) Delete Data and check that GetForCurrentDocument should return null.
|
||||
- Data::DeleteForCurrentDocument(rfh_a);
|
||||
- EXPECT_FALSE(created_data);
|
||||
- EXPECT_FALSE(Data::GetForCurrentDocument(rfh_a));
|
||||
+ data = Data::GetForCurrentDocument(rfh_a);
|
||||
+ EXPECT_TRUE(data);
|
||||
}
|
||||
|
||||
// Tests that RenderDocumentHostUserData objects are different for each
|
||||
diff --git b/content/browser/frame_host/render_frame_host_impl.cc a/content/browser/frame_host/render_frame_host_impl.cc
|
||||
index 30bc648d74ef..d10d99df7f1f 100644
|
||||
--- b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
+++ a/content/browser/frame_host/render_frame_host_impl.cc
|
||||
@@ -75,7 +75,6 @@
|
||||
#include "content/browser/loader/navigation_url_loader_impl.h"
|
||||
#include "content/browser/loader/prefetch_url_loader_service.h"
|
||||
#include "content/browser/log_console_message.h"
|
||||
-#include "content/browser/manifest/manifest_manager_host.h"
|
||||
#include "content/browser/media/capture/audio_mirroring_manager.h"
|
||||
#include "content/browser/media/media_interface_proxy.h"
|
||||
#include "content/browser/media/webaudio/audio_context_manager_impl.h"
|
||||
@@ -6146,15 +6145,6 @@ void RenderFrameHostImpl::SetUpMojoIfNeeded() {
|
||||
std::make_unique<ActiveURLMessageFilter>(impl));
|
||||
},
|
||||
base::Unretained(this)));
|
||||
-
|
||||
- associated_registry_->AddInterface(base::BindRepeating(
|
||||
- [](RenderFrameHostImpl* impl,
|
||||
- mojo::PendingAssociatedReceiver<
|
||||
- blink::mojom::ManifestUrlChangeObserver> receiver) {
|
||||
- ManifestManagerHost::GetOrCreateForCurrentDocument(impl)
|
||||
- ->BindObserver(std::move(receiver));
|
||||
- },
|
||||
- base::Unretained(this)));
|
||||
}
|
||||
|
||||
associated_registry_->AddInterface(base::BindRepeating(
|
||||
diff --git b/content/browser/frame_host/render_frame_host_impl.h a/content/browser/frame_host/render_frame_host_impl.h
|
||||
index bfd421386795..2bba134e0dc0 100644
|
||||
--- b/content/browser/frame_host/render_frame_host_impl.h
|
||||
+++ a/content/browser/frame_host/render_frame_host_impl.h
|
||||
@@ -1595,10 +1595,6 @@ class CONTENT_EXPORT RenderFrameHostImpl
|
||||
document_associated_data_.SetUserData(key, std::move(data));
|
||||
}
|
||||
|
||||
- void RemoveRenderDocumentHostUserData(const void* key) {
|
||||
- document_associated_data_.RemoveUserData(key);
|
||||
- }
|
||||
-
|
||||
// Returns the child RenderFrameHostImpl if |child_frame_routing_id| is an
|
||||
// immediate child of this FrameTreeNode. |child_frame_routing_id| is
|
||||
// considered untrusted, so the renderer process is killed if it refers to a
|
||||
diff --git b/content/browser/manifest/manifest_manager_host.cc a/content/browser/manifest/manifest_manager_host.cc
|
||||
index 68ea016c62eb..b063e0d1e98e 100644
|
||||
--- b/content/browser/manifest/manifest_manager_host.cc
|
||||
+++ a/content/browser/manifest/manifest_manager_host.cc
|
||||
@@ -9,34 +9,25 @@
|
||||
#include "base/bind.h"
|
||||
#include "content/browser/web_contents/web_contents_impl.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
+#include "content/public/browser/web_contents.h"
|
||||
#include "services/service_manager/public/cpp/interface_provider.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||
#include "third_party/blink/public/common/manifest/manifest.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
-ManifestManagerHost::ManifestManagerHost(RenderFrameHost* render_frame_host)
|
||||
- : manifest_manager_frame_(render_frame_host) {
|
||||
- // Check that |manifest_manager_frame_| is a main frame.
|
||||
- DCHECK(!manifest_manager_frame_->GetParent());
|
||||
-}
|
||||
+ManifestManagerHost::ManifestManagerHost(WebContents* web_contents)
|
||||
+ : WebContentsObserver(web_contents),
|
||||
+ manifest_url_change_observer_receivers_(web_contents, this) {}
|
||||
|
||||
ManifestManagerHost::~ManifestManagerHost() {
|
||||
OnConnectionError();
|
||||
}
|
||||
|
||||
-void ManifestManagerHost::BindObserver(
|
||||
- mojo::PendingAssociatedReceiver<blink::mojom::ManifestUrlChangeObserver>
|
||||
- receiver) {
|
||||
- manifest_url_change_observer_receiver_.Bind(std::move(receiver));
|
||||
-}
|
||||
-
|
||||
-ManifestManagerHost* ManifestManagerHost::GetOrCreateForCurrentDocument(
|
||||
- RenderFrameHostImpl* rfh) {
|
||||
- DCHECK(rfh->is_main_frame());
|
||||
- if (!GetForCurrentDocument(rfh))
|
||||
- CreateForCurrentDocument(rfh);
|
||||
- return GetForCurrentDocument(rfh);
|
||||
+void ManifestManagerHost::RenderFrameDeleted(
|
||||
+ RenderFrameHost* render_frame_host) {
|
||||
+ if (render_frame_host == manifest_manager_frame_)
|
||||
+ OnConnectionError();
|
||||
}
|
||||
|
||||
void ManifestManagerHost::GetManifest(GetManifestCallback callback) {
|
||||
@@ -54,7 +45,11 @@ void ManifestManagerHost::RequestManifestDebugInfo(
|
||||
}
|
||||
|
||||
blink::mojom::ManifestManager& ManifestManagerHost::GetManifestManager() {
|
||||
+ if (manifest_manager_frame_ != web_contents()->GetMainFrame())
|
||||
+ OnConnectionError();
|
||||
+
|
||||
if (!manifest_manager_) {
|
||||
+ manifest_manager_frame_ = web_contents()->GetMainFrame();
|
||||
manifest_manager_frame_->GetRemoteInterfaces()->GetInterface(
|
||||
manifest_manager_.BindNewPipeAndPassReceiver());
|
||||
manifest_manager_.set_disconnect_handler(base::BindOnce(
|
||||
@@ -64,6 +59,8 @@ blink::mojom::ManifestManager& ManifestManagerHost::GetManifestManager() {
|
||||
}
|
||||
|
||||
void ManifestManagerHost::OnConnectionError() {
|
||||
+ manifest_manager_frame_ = nullptr;
|
||||
+ manifest_manager_.reset();
|
||||
std::vector<GetManifestCallback> callbacks;
|
||||
for (CallbackMap::iterator it(&callbacks_); !it.IsAtEnd(); it.Advance()) {
|
||||
callbacks.push_back(std::move(*it.GetCurrentValue()));
|
||||
@@ -71,10 +68,6 @@ void ManifestManagerHost::OnConnectionError() {
|
||||
callbacks_.Clear();
|
||||
for (auto& callback : callbacks)
|
||||
std::move(callback).Run(GURL(), blink::Manifest());
|
||||
-
|
||||
- if (GetForCurrentDocument(manifest_manager_frame_)) {
|
||||
- DeleteForCurrentDocument(manifest_manager_frame_);
|
||||
- }
|
||||
}
|
||||
|
||||
void ManifestManagerHost::OnRequestManifestResponse(
|
||||
@@ -88,16 +81,12 @@ void ManifestManagerHost::OnRequestManifestResponse(
|
||||
|
||||
void ManifestManagerHost::ManifestUrlChanged(
|
||||
const base::Optional<GURL>& manifest_url) {
|
||||
- if (!manifest_manager_frame_->IsCurrent())
|
||||
+ if (manifest_url_change_observer_receivers_.GetCurrentTargetFrame() !=
|
||||
+ web_contents()->GetMainFrame()) {
|
||||
return;
|
||||
-
|
||||
- // TODO(yuzus): |NotifyManifestUrlChanged| should start taking a
|
||||
- // |RenderFrameHost| parameter.
|
||||
- WebContents* web_contents =
|
||||
- WebContents::FromRenderFrameHost(manifest_manager_frame_);
|
||||
- static_cast<WebContentsImpl*>(web_contents)
|
||||
+ }
|
||||
+ static_cast<WebContentsImpl*>(web_contents())
|
||||
->NotifyManifestUrlChanged(manifest_url);
|
||||
}
|
||||
|
||||
-RENDER_DOCUMENT_HOST_USER_DATA_KEY_IMPL(ManifestManagerHost)
|
||||
} // namespace content
|
||||
diff --git b/content/browser/manifest/manifest_manager_host.h a/content/browser/manifest/manifest_manager_host.h
|
||||
index 57f51dc9fad7..3dc0bbf6e1ad 100644
|
||||
--- b/content/browser/manifest/manifest_manager_host.h
|
||||
+++ a/content/browser/manifest/manifest_manager_host.h
|
||||
@@ -8,8 +8,8 @@
|
||||
#include "base/callback_forward.h"
|
||||
#include "base/containers/id_map.h"
|
||||
#include "base/macros.h"
|
||||
-#include "content/public/browser/render_document_host_user_data.h"
|
||||
-#include "mojo/public/cpp/bindings/associated_receiver.h"
|
||||
+#include "content/public/browser/web_contents_observer.h"
|
||||
+#include "content/public/browser/web_contents_receiver_set.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "third_party/blink/public/mojom/manifest/manifest_manager.mojom.h"
|
||||
#include "third_party/blink/public/mojom/manifest/manifest_observer.mojom.h"
|
||||
@@ -21,16 +21,16 @@ struct Manifest;
|
||||
namespace content {
|
||||
|
||||
class RenderFrameHost;
|
||||
-class RenderFrameHostImpl;
|
||||
+class WebContents;
|
||||
|
||||
// ManifestManagerHost is a helper class that allows callers to get the Manifest
|
||||
// associated with the main frame of the observed WebContents. It handles the
|
||||
// IPC messaging with the child process.
|
||||
// TODO(mlamouri): keep a cached version and a dirty bit here.
|
||||
-class ManifestManagerHost
|
||||
- : public RenderDocumentHostUserData<ManifestManagerHost>,
|
||||
- public blink::mojom::ManifestUrlChangeObserver {
|
||||
+class ManifestManagerHost : public WebContentsObserver,
|
||||
+ public blink::mojom::ManifestUrlChangeObserver {
|
||||
public:
|
||||
+ explicit ManifestManagerHost(WebContents* web_contents);
|
||||
~ManifestManagerHost() override;
|
||||
|
||||
using GetManifestCallback =
|
||||
@@ -44,18 +44,10 @@ class ManifestManagerHost
|
||||
void RequestManifestDebugInfo(
|
||||
blink::mojom::ManifestManager::RequestManifestDebugInfoCallback callback);
|
||||
|
||||
- void BindObserver(
|
||||
- mojo::PendingAssociatedReceiver<blink::mojom::ManifestUrlChangeObserver>
|
||||
- receiver);
|
||||
-
|
||||
- static ManifestManagerHost* GetOrCreateForCurrentDocument(
|
||||
- RenderFrameHostImpl* rfh);
|
||||
+ // WebContentsObserver
|
||||
+ void RenderFrameDeleted(RenderFrameHost* render_frame_host) override;
|
||||
|
||||
private:
|
||||
- explicit ManifestManagerHost(RenderFrameHost* render_frame_host);
|
||||
-
|
||||
- friend class RenderDocumentHostUserData<ManifestManagerHost>;
|
||||
-
|
||||
using CallbackMap = base::IDMap<std::unique_ptr<GetManifestCallback>>;
|
||||
|
||||
blink::mojom::ManifestManager& GetManifestManager();
|
||||
@@ -68,14 +60,13 @@ class ManifestManagerHost
|
||||
// blink::mojom::ManifestUrlChangeObserver:
|
||||
void ManifestUrlChanged(const base::Optional<GURL>& manifest_url) override;
|
||||
|
||||
- RenderFrameHost* manifest_manager_frame_;
|
||||
+ RenderFrameHost* manifest_manager_frame_ = nullptr;
|
||||
mojo::Remote<blink::mojom::ManifestManager> manifest_manager_;
|
||||
CallbackMap callbacks_;
|
||||
|
||||
- mojo::AssociatedReceiver<blink::mojom::ManifestUrlChangeObserver>
|
||||
- manifest_url_change_observer_receiver_{this};
|
||||
+ WebContentsFrameReceiverSet<blink::mojom::ManifestUrlChangeObserver>
|
||||
+ manifest_url_change_observer_receivers_;
|
||||
|
||||
- RENDER_DOCUMENT_HOST_USER_DATA_KEY_DECL();
|
||||
DISALLOW_COPY_AND_ASSIGN(ManifestManagerHost);
|
||||
};
|
||||
|
||||
diff --git b/content/browser/web_contents/web_contents_impl.cc a/content/browser/web_contents/web_contents_impl.cc
|
||||
index 024415bb096e..115f480ce8c1 100644
|
||||
--- b/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ a/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -2122,6 +2122,8 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
|
||||
screen_orientation_provider_.reset(new ScreenOrientationProvider(this));
|
||||
|
||||
+ manifest_manager_host_.reset(new ManifestManagerHost(this));
|
||||
+
|
||||
#if defined(OS_ANDROID)
|
||||
DateTimeChooserAndroid::CreateForWebContents(this);
|
||||
#endif
|
||||
@@ -4202,10 +4204,7 @@ bool WebContentsImpl::WasEverAudible() {
|
||||
}
|
||||
|
||||
void WebContentsImpl::GetManifest(GetManifestCallback callback) {
|
||||
- // TODO(yuzus, 1061899): Move this function to RenderFrameHostImpl.
|
||||
- ManifestManagerHost* manifest_manager_host =
|
||||
- ManifestManagerHost::GetOrCreateForCurrentDocument(GetMainFrame());
|
||||
- manifest_manager_host->GetManifest(std::move(callback));
|
||||
+ manifest_manager_host_->GetManifest(std::move(callback));
|
||||
}
|
||||
|
||||
void WebContentsImpl::ExitFullscreen(bool will_cause_resize) {
|
||||
diff --git b/content/browser/web_contents/web_contents_impl.h a/content/browser/web_contents/web_contents_impl.h
|
||||
index 59510b1f8744..e86be96fc23b 100644
|
||||
--- b/content/browser/web_contents/web_contents_impl.h
|
||||
+++ a/content/browser/web_contents/web_contents_impl.h
|
||||
@@ -102,6 +102,7 @@ class DisplayCutoutHostImpl;
|
||||
class FindRequestManager;
|
||||
class JavaScriptDialogManager;
|
||||
class JavaScriptDialogNavigationDeferrer;
|
||||
+class ManifestManagerHost;
|
||||
class MediaWebContentsObserver;
|
||||
class NFCHost;
|
||||
class PluginContentOriginAllowlist;
|
||||
@@ -311,6 +312,10 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
|
||||
|
||||
void NotifyManifestUrlChanged(const base::Optional<GURL>& manifest_url);
|
||||
|
||||
+ ManifestManagerHost* GetManifestManagerHost() const {
|
||||
+ return manifest_manager_host_.get();
|
||||
+ }
|
||||
+
|
||||
#if defined(OS_ANDROID)
|
||||
void SetMainFrameImportance(ChildProcessImportance importance);
|
||||
#endif
|
||||
@@ -1897,6 +1902,8 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
|
||||
|
||||
std::unique_ptr<ScreenOrientationProvider> screen_orientation_provider_;
|
||||
|
||||
+ std::unique_ptr<ManifestManagerHost> manifest_manager_host_;
|
||||
+
|
||||
// The accessibility mode for all frames. This is queried when each frame
|
||||
// is created, and broadcast to all frames when it changes.
|
||||
ui::AXMode accessibility_mode_;
|
||||
diff --git b/content/public/browser/render_document_host_user_data.cc a/content/public/browser/render_document_host_user_data.cc
|
||||
index 3b58bf8a3c5e..b1b385455e61 100644
|
||||
--- b/content/public/browser/render_document_host_user_data.cc
|
||||
+++ a/content/public/browser/render_document_host_user_data.cc
|
||||
@@ -23,8 +23,4 @@ void SetRenderDocumentHostUserData(
|
||||
key, std::move(data));
|
||||
}
|
||||
|
||||
-void RemoveRenderDocumentHostUserData(RenderFrameHost* rfh, const void* key) {
|
||||
- static_cast<RenderFrameHostImpl*>(rfh)->RemoveRenderDocumentHostUserData(key);
|
||||
-}
|
||||
-
|
||||
} // namespace content
|
||||
diff --git b/content/public/browser/render_document_host_user_data.h a/content/public/browser/render_document_host_user_data.h
|
||||
index a138fd60aa2a..f55f24f60992 100644
|
||||
--- b/content/public/browser/render_document_host_user_data.h
|
||||
+++ a/content/public/browser/render_document_host_user_data.h
|
||||
@@ -22,9 +22,6 @@ CONTENT_EXPORT void SetRenderDocumentHostUserData(
|
||||
const void* key,
|
||||
std::unique_ptr<base::SupportsUserData::Data> data);
|
||||
|
||||
-CONTENT_EXPORT void RemoveRenderDocumentHostUserData(RenderFrameHost* rfh,
|
||||
- const void* key);
|
||||
-
|
||||
// This class approximates the lifetime of a single blink::Document in the
|
||||
// browser process. At the moment RenderFrameHost can correspond to multiple
|
||||
// blink::Documents (when RenderFrameHost is reused for same-process
|
||||
@@ -85,12 +82,6 @@ class RenderDocumentHostUserData : public base::SupportsUserData::Data {
|
||||
return static_cast<T*>(GetRenderDocumentHostUserData(rfh, UserDataKey()));
|
||||
}
|
||||
|
||||
- static void DeleteForCurrentDocument(RenderFrameHost* rfh) {
|
||||
- DCHECK(rfh);
|
||||
- DCHECK(GetForCurrentDocument(rfh));
|
||||
- RemoveRenderDocumentHostUserData(rfh, UserDataKey());
|
||||
- }
|
||||
-
|
||||
static const void* UserDataKey() { return &T::kUserDataKey; }
|
||||
};
|
||||
|
@ -0,0 +1,49 @@
|
||||
From df982a547c5e88777a6134e5d18a1482d933f1cf Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Wed, 27 May 2020 10:38:26 +0000
|
||||
Subject: [PATCH] libstdc++: std::vector must have non-const value_type
|
||||
|
||||
Bug: 957519
|
||||
Change-Id: I535b3bcf318f98cecbf4be1520ffe4126abcacd8
|
||||
---
|
||||
|
||||
diff --git a/extensions/common/features/feature_flags.cc b/extensions/common/features/feature_flags.cc
|
||||
index 5b63764..7efa308 100644
|
||||
--- a/extensions/common/features/feature_flags.cc
|
||||
+++ b/extensions/common/features/feature_flags.cc
|
||||
@@ -19,7 +19,7 @@
|
||||
constexpr base::Feature kFeatureFlags[] = {
|
||||
{"DeclarativeNetRequest", base::FEATURE_ENABLED_BY_DEFAULT}};
|
||||
|
||||
-const std::vector<const base::Feature>* g_feature_flags_test_override = nullptr;
|
||||
+const std::vector<base::Feature>* g_feature_flags_test_override = nullptr;
|
||||
|
||||
template <typename T>
|
||||
const base::Feature* GetFeature(T begin,
|
||||
@@ -52,8 +52,8 @@
|
||||
}
|
||||
|
||||
ScopedFeatureFlagsOverride CreateScopedFeatureFlagsOverrideForTesting(
|
||||
- const std::vector<const base::Feature>* features) {
|
||||
- return base::AutoReset<const std::vector<const base::Feature>*>(
|
||||
+ const std::vector<base::Feature>* features) {
|
||||
+ return base::AutoReset<const std::vector<base::Feature>*>(
|
||||
&g_feature_flags_test_override, features);
|
||||
}
|
||||
|
||||
diff --git a/extensions/common/features/feature_flags.h b/extensions/common/features/feature_flags.h
|
||||
index d1a5dd3..b57740b 100644
|
||||
--- a/extensions/common/features/feature_flags.h
|
||||
+++ b/extensions/common/features/feature_flags.h
|
||||
@@ -25,9 +25,9 @@
|
||||
// in scope. Clients must ensure that |features| remains alive (non-dangling)
|
||||
// while the returned value is in scope.
|
||||
using ScopedFeatureFlagsOverride =
|
||||
- base::AutoReset<const std::vector<const base::Feature>*>;
|
||||
+ base::AutoReset<const std::vector<base::Feature>*>;
|
||||
ScopedFeatureFlagsOverride CreateScopedFeatureFlagsOverrideForTesting(
|
||||
- const std::vector<const base::Feature>* features);
|
||||
+ const std::vector<base::Feature>* features);
|
||||
|
||||
} // namespace extensions
|
||||
|
@ -0,0 +1,14 @@
|
||||
diff -up chromium-84.0.4147.89/services/service_manager/sandbox/linux/bpf_cros_amd_gpu_policy_linux.cc.epel7-kcmp chromium-84.0.4147.89/services/service_manager/sandbox/linux/bpf_cros_amd_gpu_policy_linux.cc
|
||||
--- chromium-84.0.4147.89/services/service_manager/sandbox/linux/bpf_cros_amd_gpu_policy_linux.cc.epel7-kcmp 2020-07-15 10:03:33.509319562 -0400
|
||||
+++ chromium-84.0.4147.89/services/service_manager/sandbox/linux/bpf_cros_amd_gpu_policy_linux.cc 2020-07-15 10:12:55.761658501 -0400
|
||||
@@ -6,7 +6,9 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
-#include <linux/kcmp.h>
|
||||
+#ifndef KCMP_FILE
|
||||
+#define KCMP_FILE 0
|
||||
+#endif
|
||||
#include <sys/socket.h>
|
||||
|
||||
// Some arch's (arm64 for instance) unistd.h don't pull in symbols used here
|
@ -0,0 +1,32 @@
|
||||
From b306036aefd1cb02132fbff400ce5bd8bc20f1fe Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Sat, 27 Jun 2020 17:08:51 +0000
|
||||
Subject: [PATCH] GCC: suppress unknown diagnostic pragma warning
|
||||
|
||||
'-Wdelete-non-abstract-non-virtual-dtor' is a clang-only
|
||||
flag. Switch pragma diagnostic from GCC to clang.
|
||||
---
|
||||
third_party/blink/renderer/platform/heap/finalizer_traits.h | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/heap/finalizer_traits.h b/third_party/blink/renderer/platform/heap/finalizer_traits.h
|
||||
index b727032..90391c0 100644
|
||||
--- a/third_party/blink/renderer/platform/heap/finalizer_traits.h
|
||||
+++ b/third_party/blink/renderer/platform/heap/finalizer_traits.h
|
||||
@@ -43,10 +43,10 @@ struct FinalizerTraitImpl<T, true> {
|
||||
// an object's base class has a virtual destructor. In case there is no virtual
|
||||
// destructor present, the object is always finalized through its leaf type. In
|
||||
// other words: there is no finalization through a base pointer.
|
||||
-#pragma GCC diagnostic push
|
||||
-#pragma GCC diagnostic ignored "-Wdelete-non-abstract-non-virtual-dtor"
|
||||
+#pragma clang diagnostic push
|
||||
+#pragma clang diagnostic ignored "-Wdelete-non-abstract-non-virtual-dtor"
|
||||
static_cast<T*>(obj)->~T();
|
||||
-#pragma GCC diagnostic pop
|
||||
+#pragma clang diagnostic pop
|
||||
}
|
||||
};
|
||||
using FinalizeImpl =
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,53 @@
|
||||
From 4e380a0e486c080f36adad5b035787d64cfedb3e Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Sat, 27 Jun 2020 13:59:20 +0000
|
||||
Subject: [PATCH] GCC: fix mixing __attribute__ with C++ attributes
|
||||
|
||||
GCC does not support mixing __attribute__ with [[...]] attributes.
|
||||
On the other hand [[clang::lto_visibility_public]] isn't supported
|
||||
by GCC and only emits a warning. Therefore define Clang specific
|
||||
attribute and leave it empty for GCC.
|
||||
---
|
||||
base/compiler_specific.h | 6 ++++++
|
||||
third_party/blink/renderer/core/frame/frame_view.h | 3 ++-
|
||||
2 files changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
|
||||
index c8a7649..8fd2252 100644
|
||||
--- a/base/compiler_specific.h
|
||||
+++ b/base/compiler_specific.h
|
||||
@@ -292,4 +292,10 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
|
||||
|
||||
#endif // defined(__clang_analyzer__)
|
||||
|
||||
+#if defined(__clang__)
|
||||
+#define LTO_VISIBILITY_PUBLIC [[clang::lto_visibility_public]]
|
||||
+#else
|
||||
+#define LTO_VISIBILITY_PUBLIC
|
||||
+#endif
|
||||
+
|
||||
#endif // BASE_COMPILER_SPECIFIC_H_
|
||||
diff --git a/third_party/blink/renderer/core/frame/frame_view.h b/third_party/blink/renderer/core/frame/frame_view.h
|
||||
index aa5e42a..ec93d89 100644
|
||||
--- a/third_party/blink/renderer/core/frame/frame_view.h
|
||||
+++ b/third_party/blink/renderer/core/frame/frame_view.h
|
||||
@@ -5,6 +5,7 @@
|
||||
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_FRAME_VIEW_H_
|
||||
#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_FRAME_VIEW_H_
|
||||
|
||||
+#include "base/compiler_specific.h"
|
||||
#include "third_party/blink/public/mojom/frame/lifecycle.mojom-blink.h"
|
||||
#include "third_party/blink/public/platform/viewport_intersection_state.h"
|
||||
#include "third_party/blink/renderer/core/frame/embedded_content_view.h"
|
||||
@@ -20,7 +21,7 @@ struct IntrinsicSizingInfo;
|
||||
// clang::lto_visibility_public is necessary to prevent the compiler from
|
||||
// performing a vtable optimization that crashes the renderer. See
|
||||
// crbug.com/1062006.
|
||||
-class CORE_EXPORT [[clang::lto_visibility_public]] FrameView
|
||||
+class CORE_EXPORT LTO_VISIBILITY_PUBLIC FrameView
|
||||
: public EmbeddedContentView {
|
||||
public:
|
||||
FrameView(const IntRect& frame_rect) : EmbeddedContentView(frame_rect) {}
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,14 @@
|
||||
--- a/base/strings/char_traits.h
|
||||
+++ b/base/strings/char_traits.h
|
||||
@@ -67,9 +67,9 @@
|
||||
return __builtin_memcmp(s1, s2, n);
|
||||
#else
|
||||
for (; n; --n, ++s1, ++s2) {
|
||||
- if (*s1 < *s2)
|
||||
+ if ((unsigned char)*s1 < (unsigned char)*s2)
|
||||
return -1;
|
||||
- if (*s1 > *s2)
|
||||
+ if ((unsigned char)*s1 > (unsigned char)*s2)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
@ -0,0 +1,57 @@
|
||||
From 4cea86e76af28b28aa72cb7c69ff7cf242b2bd5d Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Sat, 27 Jun 2020 12:18:05 +0000
|
||||
Subject: [PATCH] GCC: supress invalid-offsetof warning
|
||||
|
||||
GCC emits a warning if offsetof is used for non-POD
|
||||
types. However, GCC supports this and prints only
|
||||
the warning, because it might be nonportable code.
|
||||
Disable the warning for GCC with a pragma.
|
||||
---
|
||||
net/third_party/quiche/src/quic/core/frames/quic_frame.h | 7 +++++++
|
||||
.../quiche/src/quic/core/frames/quic_inlined_frame.h | 7 +++++++
|
||||
2 files changed, 14 insertions(+)
|
||||
|
||||
diff --git a/net/third_party/quiche/src/quic/core/frames/quic_frame.h b/net/third_party/quiche/src/quic/core/frames/quic_frame.h
|
||||
index 756b69f..aceba76 100644
|
||||
--- a/net/third_party/quiche/src/quic/core/frames/quic_frame.h
|
||||
+++ b/net/third_party/quiche/src/quic/core/frames/quic_frame.h
|
||||
@@ -110,8 +110,15 @@ struct QUIC_EXPORT_PRIVATE QuicFrame {
|
||||
|
||||
static_assert(sizeof(QuicFrame) <= 24,
|
||||
"Frames larger than 24 bytes should be referenced by pointer.");
|
||||
+#if defined(__GNUC__)
|
||||
+#pragma GCC diagnostic push
|
||||
+#pragma GCC diagnostic ignored "-Winvalid-offsetof"
|
||||
+#endif
|
||||
static_assert(offsetof(QuicStreamFrame, type) == offsetof(QuicFrame, type),
|
||||
"Offset of |type| must match in QuicFrame and QuicStreamFrame");
|
||||
+#if defined(__GNUC__)
|
||||
+#pragma GCC diagnostic pop
|
||||
+#endif
|
||||
|
||||
// A inline size of 1 is chosen to optimize the typical use case of
|
||||
// 1-stream-frame in QuicTransmissionInfo.retransmittable_frames.
|
||||
diff --git a/net/third_party/quiche/src/quic/core/frames/quic_inlined_frame.h b/net/third_party/quiche/src/quic/core/frames/quic_inlined_frame.h
|
||||
index 08c4869..804e4bb 100644
|
||||
--- a/net/third_party/quiche/src/quic/core/frames/quic_inlined_frame.h
|
||||
+++ b/net/third_party/quiche/src/quic/core/frames/quic_inlined_frame.h
|
||||
@@ -17,8 +17,15 @@ namespace quic {
|
||||
template <typename DerivedT>
|
||||
struct QUIC_EXPORT_PRIVATE QuicInlinedFrame {
|
||||
QuicInlinedFrame(QuicFrameType type) : type(type) {
|
||||
+#if defined(__GNUC__)
|
||||
+#pragma GCC diagnostic push
|
||||
+#pragma GCC diagnostic ignored "-Winvalid-offsetof"
|
||||
+#endif
|
||||
static_assert(offsetof(DerivedT, type) == 0,
|
||||
"type must be the first field.");
|
||||
+#if defined(__GNUC__)
|
||||
+#pragma GCC diagnostic pop
|
||||
+#endif
|
||||
static_assert(sizeof(DerivedT) <= 24,
|
||||
"Frames larger than 24 bytes should not be inlined.");
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,61 @@
|
||||
From 3b382845f8fb3adc1300981bb7006d321f855a01 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Sat, 27 Jun 2020 12:04:19 +0000
|
||||
Subject: [PATCH] GCC: fix unknown attribute warnings for no_sanitize
|
||||
|
||||
Clang and GCC use different syntax to add no_sanitize
|
||||
attribute on functions. This results in a large amount
|
||||
of warnings for GCC, because responsible header is included
|
||||
very often. Solve this by defining compiler specific macro
|
||||
locally.
|
||||
---
|
||||
.../skia/include/private/SkFloatingPoint.h | 15 ++++++++++++---
|
||||
1 file changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/third_party/skia/include/private/SkFloatingPoint.h b/third_party/skia/include/private/SkFloatingPoint.h
|
||||
index 110dda2..a8f1b7b 100644
|
||||
--- a/third_party/skia/include/private/SkFloatingPoint.h
|
||||
+++ b/third_party/skia/include/private/SkFloatingPoint.h
|
||||
@@ -156,10 +156,17 @@ static inline int64_t sk_float_saturate2int64(float x) {
|
||||
#define sk_double_round2int(x) (int)floor((x) + 0.5)
|
||||
#define sk_double_ceil2int(x) (int)ceil(x)
|
||||
|
||||
+// attribute no_sanitize is specified differently for GCC and Clang
|
||||
+#if defined(__GNUC__)
|
||||
+#define SK_NO_SANITIZE(x) __attribute__ ((no_sanitize(x)))
|
||||
+#else
|
||||
+#define SK_NO_SANITIZE(x) [[clang::no_sanitize(x)]]
|
||||
+#endif
|
||||
+
|
||||
// Cast double to float, ignoring any warning about too-large finite values being cast to float.
|
||||
// Clang thinks this is undefined, but it's actually implementation defined to return either
|
||||
// the largest float or infinity (one of the two bracketing representable floats). Good enough!
|
||||
-[[clang::no_sanitize("float-cast-overflow")]]
|
||||
+SK_NO_SANITIZE("float-cast-overflow")
|
||||
static inline float sk_double_to_float(double x) {
|
||||
return static_cast<float>(x);
|
||||
}
|
||||
@@ -226,16 +233,18 @@ static inline float sk_float_rsqrt(float x) {
|
||||
// IEEE defines how float divide behaves for non-finite values and zero-denoms, but C does not
|
||||
// so we have a helper that suppresses the possible undefined-behavior warnings.
|
||||
|
||||
-[[clang::no_sanitize("float-divide-by-zero")]]
|
||||
+SK_NO_SANITIZE("float-divide-by-zero")
|
||||
static inline float sk_ieee_float_divide(float numer, float denom) {
|
||||
return numer / denom;
|
||||
}
|
||||
|
||||
-[[clang::no_sanitize("float-divide-by-zero")]]
|
||||
+SK_NO_SANITIZE("float-divide-by-zero")
|
||||
static inline double sk_ieee_double_divide(double numer, double denom) {
|
||||
return numer / denom;
|
||||
}
|
||||
|
||||
+#undef SK_NO_SANITIZE
|
||||
+
|
||||
// While we clean up divide by zero, we'll replace places that do divide by zero with this TODO.
|
||||
static inline float sk_ieee_float_divide_TODO_IS_DIVIDE_BY_ZERO_SAFE_HERE(float n, float d) {
|
||||
return sk_ieee_float_divide(n,d);
|
||||
--
|
||||
2.26.2
|
||||
|
Loading…
Reference in new issue