diff options
author | Ting-Wei Lan <lantw44@gmail.com> | 2019-04-27 20:24:21 +0800 |
---|---|---|
committer | Ting-Wei Lan <lantw44@gmail.com> | 2019-04-27 20:24:21 +0800 |
commit | 65d44c3117627831e83b6e5b0f7bd6de7571dc8b (patch) | |
tree | e9123a1c675fcd957fedfa494fc30c7819c60607 | |
parent | 16ae047ab5f82b05286d517b0f614bc241898be8 (diff) | |
download | copr-rpm-spec-65d44c3117627831e83b6e5b0f7bd6de7571dc8b.tar copr-rpm-spec-65d44c3117627831e83b6e5b0f7bd6de7571dc8b.tar.gz copr-rpm-spec-65d44c3117627831e83b6e5b0f7bd6de7571dc8b.tar.bz2 copr-rpm-spec-65d44c3117627831e83b6e5b0f7bd6de7571dc8b.tar.lz copr-rpm-spec-65d44c3117627831e83b6e5b0f7bd6de7571dc8b.tar.xz copr-rpm-spec-65d44c3117627831e83b6e5b0f7bd6de7571dc8b.tar.zst copr-rpm-spec-65d44c3117627831e83b6e5b0f7bd6de7571dc8b.zip |
chromium: Chromium 73.0.3683.103 -> 74.0.3729.108
-rw-r--r-- | chromium/chromium/chromium-disable-unrar.patch | 32 | ||||
-rwxr-xr-x | chromium/chromium/chromium-ffmpeg-clean.sh | 1 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-cl1503254.patch | 75 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-r630084.patch | 108 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-r630140.patch | 51 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-r630249.patch | 69 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-r630355.patch | 99 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-r631472.patch | 59 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-r631962.patch | 65 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-r632385.patch | 100 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-r641329.patch | 101 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-r641404.patch | 587 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-r642680.patch | 75 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-r647271.patch | 483 | ||||
-rw-r--r-- | chromium/chromium/chromium-gcc8-r647382.patch | 42 | ||||
-rw-r--r-- | chromium/chromium/chromium-nacl-llvm-ar.patch | 8 | ||||
-rw-r--r-- | chromium/chromium/chromium.spec | 25 |
17 files changed, 1398 insertions, 582 deletions
diff --git a/chromium/chromium/chromium-disable-unrar.patch b/chromium/chromium/chromium-disable-unrar.patch index 7395711..7471da0 100644 --- a/chromium/chromium/chromium-disable-unrar.patch +++ b/chromium/chromium/chromium-disable-unrar.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/safe_browsing/download_protection/check_client_download_request.h b/chrome/browser/safe_browsing/download_protection/check_client_download_request.h -index af72d11371e1..472cb0098d5e 100644 +index 557124968ac2..625830599b5e 100644 --- a/chrome/browser/safe_browsing/download_protection/check_client_download_request.h +++ b/chrome/browser/safe_browsing/download_protection/check_client_download_request.h @@ -22,7 +22,6 @@ @@ -11,10 +11,10 @@ index af72d11371e1..472cb0098d5e 100644 #include "components/download/public/common/download_item.h" #include "components/history/core/browser/history_service.h" diff --git a/chrome/browser/safe_browsing/download_protection/file_analyzer.cc b/chrome/browser/safe_browsing/download_protection/file_analyzer.cc -index 683d4f23f2c6..35483e4a4041 100644 +index 4d4756b45221..43bacd5e5742 100644 --- a/chrome/browser/safe_browsing/download_protection/file_analyzer.cc +++ b/chrome/browser/safe_browsing/download_protection/file_analyzer.cc -@@ -99,8 +99,6 @@ void FileAnalyzer::Start(const base::FilePath& target_path, +@@ -100,8 +100,6 @@ void FileAnalyzer::Start(const base::FilePath& target_path, if (inspection_type == DownloadFileType::ZIP) { StartExtractZipFeatures(); @@ -23,7 +23,7 @@ index 683d4f23f2c6..35483e4a4041 100644 #if defined(OS_MACOSX) } else if (inspection_type == DownloadFileType::DMG) { StartExtractDmgFeatures(); -@@ -210,6 +208,7 @@ void FileAnalyzer::OnZipAnalysisFinished( +@@ -214,6 +212,7 @@ void FileAnalyzer::OnZipAnalysisFinished( std::move(callback_).Run(std::move(results_)); } @@ -31,7 +31,7 @@ index 683d4f23f2c6..35483e4a4041 100644 void FileAnalyzer::StartExtractRarFeatures() { DCHECK_CURRENTLY_ON(BrowserThread::UI); -@@ -266,6 +265,7 @@ void FileAnalyzer::OnRarAnalysisFinished( +@@ -273,6 +272,7 @@ void FileAnalyzer::OnRarAnalysisFinished( std::move(callback_).Run(std::move(results_)); } @@ -40,7 +40,7 @@ index 683d4f23f2c6..35483e4a4041 100644 #if defined(OS_MACOSX) // This is called for .DMGs and other files that can be parsed by diff --git a/chrome/browser/safe_browsing/download_protection/file_analyzer.h b/chrome/browser/safe_browsing/download_protection/file_analyzer.h -index a1f5abf77f5c..6e88eb7954ad 100644 +index 99684ffae04a..60ae52f70565 100644 --- a/chrome/browser/safe_browsing/download_protection/file_analyzer.h +++ b/chrome/browser/safe_browsing/download_protection/file_analyzer.h @@ -11,7 +11,6 @@ @@ -51,7 +51,7 @@ index a1f5abf77f5c..6e88eb7954ad 100644 #include "chrome/services/file_util/public/cpp/sandboxed_zip_analyzer.h" #include "components/safe_browsing/proto/csd.pb.h" #include "third_party/protobuf/src/google/protobuf/repeated_field.h" -@@ -88,9 +87,6 @@ class FileAnalyzer { +@@ -94,9 +93,6 @@ class FileAnalyzer { void StartExtractZipFeatures(); void OnZipAnalysisFinished(const ArchiveAnalyzerResults& archive_results); @@ -61,7 +61,7 @@ index a1f5abf77f5c..6e88eb7954ad 100644 #if defined(OS_MACOSX) void StartExtractDmgFeatures(); void ExtractFileOrDmgFeatures(bool download_file_has_koly_signature); -@@ -107,9 +103,6 @@ class FileAnalyzer { +@@ -113,9 +109,6 @@ class FileAnalyzer { scoped_refptr<SandboxedZipAnalyzer> zip_analyzer_; base::TimeTicks zip_analysis_start_time_; @@ -103,7 +103,7 @@ index c191816456b0..49076ee372c0 100644 "+third_party/zlib", ] diff --git a/chrome/common/safe_browsing/rar_analyzer.cc b/chrome/common/safe_browsing/rar_analyzer.cc -index b8d56f05248d..dfefc7b1b05f 100644 +index a9161d4acf61..14ec282a7579 100644 --- a/chrome/common/safe_browsing/rar_analyzer.cc +++ b/chrome/common/safe_browsing/rar_analyzer.cc @@ -15,7 +15,6 @@ @@ -115,7 +115,7 @@ index b8d56f05248d..dfefc7b1b05f 100644 namespace safe_browsing { namespace rar_analyzer { diff --git a/chrome/services/file_util/public/cpp/BUILD.gn b/chrome/services/file_util/public/cpp/BUILD.gn -index 158cbfc6d157..6d8b0df7c59e 100644 +index 351a5e2e90b3..213f49de1ee9 100644 --- a/chrome/services/file_util/public/cpp/BUILD.gn +++ b/chrome/services/file_util/public/cpp/BUILD.gn @@ -14,8 +14,6 @@ source_set("cpp") { @@ -127,13 +127,13 @@ index 158cbfc6d157..6d8b0df7c59e 100644 "sandboxed_zip_analyzer.cc", "sandboxed_zip_analyzer.h", ] -@@ -35,7 +33,6 @@ source_set("unit_tests") { +@@ -49,7 +47,6 @@ if (safe_browsing_mode == 1) { - sources = [ - "sandboxed_dmg_analyzer_mac_unittest.cc", -- "sandboxed_rar_analyzer_unittest.cc", - "sandboxed_zip_analyzer_unittest.cc", - ] + sources = [ + "sandboxed_dmg_analyzer_mac_unittest.cc", +- "sandboxed_rar_analyzer_unittest.cc", + "sandboxed_zip_analyzer_unittest.cc", + ] diff --git a/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom b/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom index 266160351e18..15d5aaba3657 100644 diff --git a/chromium/chromium/chromium-ffmpeg-clean.sh b/chromium/chromium/chromium-ffmpeg-clean.sh index a523088..9a6eb67 100755 --- a/chromium/chromium/chromium-ffmpeg-clean.sh +++ b/chromium/chromium/chromium-ffmpeg-clean.sh @@ -130,6 +130,7 @@ header_files=" libavcodec/x86/inline_asm.h \ libavcodec/pcm_tablegen.h \ libavcodec/pixblockdsp.h \ libavcodec/pixels.h \ + libavcodec/png.h \ libavcodec/put_bits.h \ libavcodec/qpeldsp.h \ libavcodec/ratecontrol.h \ diff --git a/chromium/chromium/chromium-gcc8-cl1503254.patch b/chromium/chromium/chromium-gcc8-cl1503254.patch new file mode 100644 index 0000000..25f0e6a --- /dev/null +++ b/chromium/chromium/chromium-gcc8-cl1503254.patch @@ -0,0 +1,75 @@ +From 22cd5f5f9f8af1f343e9fa747c03fc79667a60ea Mon Sep 17 00:00:00 2001 +From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> +Date: Tue, 05 Mar 2019 11:11:51 +0100 +Subject: [PATCH] quic: Make QuicCryptoStream::substreams_ a std::unique_ptr + +This works around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63707, which +was causing the GCC build to fail since commit 167db3e68 ("Landing Recent +QUIC changes until 8:59 AM, Feb 26, 2019 UTC-5"): + +../../net/third_party/quic/core/quic_crypto_stream.cc: In constructor ‘quic::QuicCryptoStream::QuicCryptoStream(quic::QuicSession*)’: +../../net/third_party/quic/core/quic_crypto_stream.cc:33:52: error: use of deleted function ‘quic::QuicCryptoStream::CryptoSubstream::CryptoSubstream(quic::QuicCryptoStream::CryptoSubstream&&)’ + {this, ENCRYPTION_FORWARD_SECURE}} { + ^ +In file included from ../../net/third_party/quic/core/quic_crypto_stream.cc:5: +../../net/third_party/quic/core/quic_crypto_stream.h:152:10: note: ‘quic::QuicCryptoStream::CryptoSubstream::CryptoSubstream(quic::QuicCryptoStream::CryptoSubstream&&)’ is implicitly deleted because the default definition would be ill-formed: + struct CryptoSubstream { + ^~~~~~~~~~~~~~~ +../../net/third_party/quic/core/quic_crypto_stream.h:152:10: error: use of deleted function ‘quic::QuicStreamSendBuffer::QuicStreamSendBuffer(quic::QuicStreamSendBuffer&&)’ +In file included from ../../net/third_party/quic/core/quic_stream.h:27, + from ../../net/third_party/quic/core/quic_crypto_stream.h:15, + from ../../net/third_party/quic/core/quic_crypto_stream.cc:5: +../../net/third_party/quic/core/quic_stream_send_buffer.h:63:3: note: declared here + QuicStreamSendBuffer(QuicStreamSendBuffer&& other) = delete; + ^~~~~~~~~~~~~~~~~~~~ + +The code is actually correct, but that GCC bug causes the initialization to +fail. Work around it by making |substreams_| a std::unique_ptr so we can +initialize it via operator new[] instead. + +Bug: 819294, 937886 +Change-Id: If56f2a12a733e6f6680ed9c9e6f7688439e9d216 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1503254 +--- + +diff --git a/net/third_party/quic/core/quic_crypto_stream.cc b/net/third_party/quic/core/quic_crypto_stream.cc +index eb58f53..6ee344e 100644 +--- a/net/third_party/quic/core/quic_crypto_stream.cc ++++ b/net/third_party/quic/core/quic_crypto_stream.cc +@@ -28,9 +28,10 @@ + session, + /*is_static=*/true, + BIDIRECTIONAL), +- substreams_{{this, ENCRYPTION_NONE}, +- {this, ENCRYPTION_ZERO_RTT}, +- {this, ENCRYPTION_FORWARD_SECURE}} { ++ substreams_(new CryptoSubstream[NUM_ENCRYPTION_LEVELS]{ ++ {this, ENCRYPTION_NONE}, ++ {this, ENCRYPTION_ZERO_RTT}, ++ {this, ENCRYPTION_FORWARD_SECURE}}) { + // The crypto stream is exempt from connection level flow control. + DisableConnectionFlowControlForThisStream(); + } +diff --git a/net/third_party/quic/core/quic_crypto_stream.h b/net/third_party/quic/core/quic_crypto_stream.h +index 132751a..b13768c 100644 +--- a/net/third_party/quic/core/quic_crypto_stream.h ++++ b/net/third_party/quic/core/quic_crypto_stream.h +@@ -6,6 +6,7 @@ + #define NET_THIRD_PARTY_QUIC_CORE_QUIC_CRYPTO_STREAM_H_ + + #include <cstddef> ++#include <memory> + + #include "base/macros.h" + #include "net/third_party/quic/core/crypto/crypto_framer.h" +@@ -169,7 +170,9 @@ + + // Keeps state for data sent/received in CRYPTO frames at each encryption + // level. +- CryptoSubstream substreams_[NUM_ENCRYPTION_LEVELS]; ++ // N.B.: We are using a std::unique_ptr here only due to ++ // https://crbug.com/937886. ++ std::unique_ptr<CryptoSubstream[]> substreams_; + }; + + } // namespace quic diff --git a/chromium/chromium/chromium-gcc8-r630084.patch b/chromium/chromium/chromium-gcc8-r630084.patch deleted file mode 100644 index 5a50700..0000000 --- a/chromium/chromium/chromium-gcc8-r630084.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 2c3b57cafbbb38c13a519c9d2fda8b65691d9564 Mon Sep 17 00:00:00 2001 -From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Date: Thu, 7 Feb 2019 22:55:37 +0000 -Subject: [PATCH] allocator shim: Swap ALIGN_LINKAGE and SHIM_ALWAYS_EXPORT's - positions -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This fixes the GCC build. GCC seems to be stricter with the position of the -linkage specification, so just swap the terms to prevent an error that looks -like: - -In file included from ../../base/allocator/allocator_shim.cc:333: -../../base/allocator/allocator_shim_override_cpp_symbols.h:39:30: error: expected unqualified-id before string constant - #define ALIGN_LINKAGE extern "C" - ^~~ -../../base/allocator/allocator_shim_override_cpp_symbols.h:99:20: note: in expansion of macro ‘ALIGN_LINKAGE’ - SHIM_ALWAYS_EXPORT ALIGN_LINKAGE void* ALIGN_NEW(std::size_t size, - ^~~~~~~~~~~~~ - -Bug: 819294 -Change-Id: I0aa16ea88cead42e83796a1c86afad8b447ddc50 -Reviewed-on: https://chromium-review.googlesource.com/c/1458256 -Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Reviewed-by: Thomas Anderson <thomasanderson@chromium.org> -Reviewed-by: Primiano Tucci <primiano@chromium.org> -Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Cr-Commit-Position: refs/heads/master@{#630084} ---- - .../allocator_shim_override_cpp_symbols.h | 20 +++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) - -diff --git a/base/allocator/allocator_shim_override_cpp_symbols.h b/base/allocator/allocator_shim_override_cpp_symbols.h -index 1228f5e33d28..01d25b7f6437 100644 ---- a/base/allocator/allocator_shim_override_cpp_symbols.h -+++ b/base/allocator/allocator_shim_override_cpp_symbols.h -@@ -96,57 +96,57 @@ SHIM_ALWAYS_EXPORT void operator delete[](void* p, size_t) __THROW { - ShimCppDelete(p); - } - --SHIM_ALWAYS_EXPORT ALIGN_LINKAGE void* ALIGN_NEW(std::size_t size, -+ALIGN_LINKAGE SHIM_ALWAYS_EXPORT void* ALIGN_NEW(std::size_t size, - ALIGN_VAL_T alignment) { - return ShimCppAlignedNew(size, static_cast<size_t>(alignment)); - } - --SHIM_ALWAYS_EXPORT ALIGN_LINKAGE void* ALIGN_NEW_NOTHROW( -+ALIGN_LINKAGE SHIM_ALWAYS_EXPORT void* ALIGN_NEW_NOTHROW( - std::size_t size, - ALIGN_VAL_T alignment, - const std::nothrow_t&) __THROW { - return ShimCppAlignedNew(size, static_cast<size_t>(alignment)); - } - --SHIM_ALWAYS_EXPORT ALIGN_LINKAGE void ALIGN_DEL(void* p, ALIGN_VAL_T) __THROW { -+ALIGN_LINKAGE SHIM_ALWAYS_EXPORT void ALIGN_DEL(void* p, ALIGN_VAL_T) __THROW { - ShimCppDelete(p); - } - --SHIM_ALWAYS_EXPORT ALIGN_LINKAGE void ALIGN_DEL_SIZED(void* p, -+ALIGN_LINKAGE SHIM_ALWAYS_EXPORT void ALIGN_DEL_SIZED(void* p, - std::size_t size, - ALIGN_VAL_T) __THROW { - ShimCppDelete(p); - } - --SHIM_ALWAYS_EXPORT ALIGN_LINKAGE void -+ALIGN_LINKAGE SHIM_ALWAYS_EXPORT void - ALIGN_DEL_NOTHROW(void* p, ALIGN_VAL_T, const std::nothrow_t&) __THROW { - ShimCppDelete(p); - } - --SHIM_ALWAYS_EXPORT ALIGN_LINKAGE void* ALIGN_NEW_ARR(std::size_t size, -+ALIGN_LINKAGE SHIM_ALWAYS_EXPORT void* ALIGN_NEW_ARR(std::size_t size, - ALIGN_VAL_T alignment) { - return ShimCppAlignedNew(size, static_cast<size_t>(alignment)); - } - --SHIM_ALWAYS_EXPORT ALIGN_LINKAGE void* ALIGN_NEW_ARR_NOTHROW( -+ALIGN_LINKAGE SHIM_ALWAYS_EXPORT void* ALIGN_NEW_ARR_NOTHROW( - std::size_t size, - ALIGN_VAL_T alignment, - const std::nothrow_t&) __THROW { - return ShimCppAlignedNew(size, static_cast<size_t>(alignment)); - } - --SHIM_ALWAYS_EXPORT ALIGN_LINKAGE void ALIGN_DEL_ARR(void* p, -+ALIGN_LINKAGE SHIM_ALWAYS_EXPORT void ALIGN_DEL_ARR(void* p, - ALIGN_VAL_T) __THROW { - ShimCppDelete(p); - } - --SHIM_ALWAYS_EXPORT ALIGN_LINKAGE void ALIGN_DEL_ARR_SIZED(void* p, -+ALIGN_LINKAGE SHIM_ALWAYS_EXPORT void ALIGN_DEL_ARR_SIZED(void* p, - std::size_t size, - ALIGN_VAL_T) __THROW { - ShimCppDelete(p); - } - --SHIM_ALWAYS_EXPORT ALIGN_LINKAGE void -+ALIGN_LINKAGE SHIM_ALWAYS_EXPORT void - ALIGN_DEL_ARR_NOTHROW(void* p, ALIGN_VAL_T, const std::nothrow_t&) __THROW { - ShimCppDelete(p); - } --- -2.20.1 - diff --git a/chromium/chromium/chromium-gcc8-r630140.patch b/chromium/chromium/chromium-gcc8-r630140.patch deleted file mode 100644 index 9d1f05a..0000000 --- a/chromium/chromium/chromium-gcc8-r630140.patch +++ /dev/null @@ -1,51 +0,0 @@ -From a5ba6f9bb7665040045dc0f8087407096630ad7b Mon Sep 17 00:00:00 2001 -From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Date: Fri, 8 Feb 2019 02:57:28 +0000 -Subject: [PATCH] color_utils: Use std::sqrt() instead of std::sqrtf() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This fixes the build with libstdc++: - - ../../ui/gfx/color_utils.cc: In function ‘SkColor color_utils::SetDarkestColorForTesting(SkColor)’: - ../../ui/gfx/color_utils.cc:434:12: error: ‘sqrtf’ is not a member of ‘std’ - std::sqrtf((dark_luminance + 0.05f) * (kWhiteLuminance + 0.05f)) - 0.05f; - ^~~~~ - ../../ui/gfx/color_utils.cc:434:12: note: suggested alternative: ‘sqrt’ - std::sqrtf((dark_luminance + 0.05f) * (kWhiteLuminance + 0.05f)) - 0.05f; - ^~~~~ - sqrt - -sqrtf() is not formally part of C++14 as far as I can see even though libc++ -has it in <cmath>. Additionally, we're only dealing with floats in all parts -of the expression above, so using the float sqrt() overload should be -harmless anyway. - -Bug: 819294 -Change-Id: If6c7bf31819df97a761e6963def6d6506154c34d -Reviewed-on: https://chromium-review.googlesource.com/c/1458193 -Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Reviewed-by: Peter Kasting <pkasting@chromium.org> -Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Cr-Commit-Position: refs/heads/master@{#630140} ---- - ui/gfx/color_utils.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ui/gfx/color_utils.cc b/ui/gfx/color_utils.cc -index c868cd54bac3..92ba1407d594 100644 ---- a/ui/gfx/color_utils.cc -+++ b/ui/gfx/color_utils.cc -@@ -431,7 +431,7 @@ SkColor SetDarkestColorForTesting(SkColor color) { - // GetContrastRatio(kWhiteLuminance, g_luminance_midpoint). The formula below - // can be verified by plugging it into how GetContrastRatio() operates. - g_luminance_midpoint = -- std::sqrtf((dark_luminance + 0.05f) * (kWhiteLuminance + 0.05f)) - 0.05f; -+ std::sqrt((dark_luminance + 0.05f) * (kWhiteLuminance + 0.05f)) - 0.05f; - - return previous_darkest_color; - } --- -2.20.1 - diff --git a/chromium/chromium/chromium-gcc8-r630249.patch b/chromium/chromium/chromium-gcc8-r630249.patch deleted file mode 100644 index 9cc6cf2..0000000 --- a/chromium/chromium/chromium-gcc8-r630249.patch +++ /dev/null @@ -1,69 +0,0 @@ -From c33e832cc145c696d2157796c7640e659740dafa Mon Sep 17 00:00:00 2001 -From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Date: Fri, 8 Feb 2019 08:44:00 +0000 -Subject: [PATCH] quic_flags_impl: Fix GCC build after #618558 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84849, having -base::NoDestructor<T<U>> and passing an initializer list of Us does not -work if this is not done explicitly, as GCC incorrectly fails to determine -which constructor overload to use: - - ../../net/third_party/quic/platform/impl/quic_flags_impl.cc: In member function ‘bool quic::TypedQuicFlagHelper<T>::SetFlag(const string&) const [with T = bool; std::__cxx11::string = std::__cxx11::basic_string<char>]’: - ../../net/third_party/quic/platform/impl/quic_flags_impl.cc:156:41: error: call of overloaded ‘NoDestructor(<brace-enclosed initializer list>)’ is ambiguous - {"", "1", "t", "true", "y", "yes"}); - ^ - In file included from ../../net/third_party/quic/platform/impl/quic_flags_impl.h:16, - from ../../net/third_party/quic/platform/impl/quic_flags_impl.cc:5: - ../../base/no_destructor.h:62:3: note: candidate: ‘base::NoDestructor<T>::NoDestructor(const base::NoDestructor<T>&) [with T = std::set<std::__cxx11::basic_string<char> >]’ <deleted> - NoDestructor(const NoDestructor&) = delete; - ^~~~~~~~~~~~ - ../../base/no_destructor.h:60:12: note: candidate: ‘base::NoDestructor<T>::NoDestructor(T&&) [with T = std::set<std::__cxx11::basic_string<char> >]’ - explicit NoDestructor(T&& x) { new (storage_) T(std::move(x)); } - ^~~~~~~~~~~~ - ../../base/no_destructor.h:59:12: note: candidate: ‘base::NoDestructor<T>::NoDestructor(const T&) [with T = std::set<std::__cxx11::basic_string<char> >]’ - explicit NoDestructor(const T& x) { new (storage_) T(x); } - ^~~~~~~~~~~~ - -Explicitly use an std::initializer_list to make the build work everywhere. - -Bug: 819294 -Change-Id: I775be20e3766a88a656b58c94c40869cb1bee2a8 -Reviewed-on: https://chromium-review.googlesource.com/c/1458214 -Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Reviewed-by: Ryan Hamilton <rch@chromium.org> -Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Cr-Commit-Position: refs/heads/master@{#630249} ---- - net/third_party/quic/platform/impl/quic_flags_impl.cc | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/net/third_party/quic/platform/impl/quic_flags_impl.cc b/net/third_party/quic/platform/impl/quic_flags_impl.cc -index 5e6962d1e770..3fa45fc6892d 100644 ---- a/net/third_party/quic/platform/impl/quic_flags_impl.cc -+++ b/net/third_party/quic/platform/impl/quic_flags_impl.cc -@@ -5,6 +5,7 @@ - #include "net/third_party/quic/platform/impl/quic_flags_impl.h" - - #include <algorithm> -+#include <initializer_list> - #include <iostream> - #include <set> - -@@ -153,9 +154,9 @@ std::string QuicFlagRegistry::GetHelp() const { - template <> - bool TypedQuicFlagHelper<bool>::SetFlag(const std::string& s) const { - static const base::NoDestructor<std::set<std::string>> kTrueValues( -- {"", "1", "t", "true", "y", "yes"}); -+ std::initializer_list<std::string>({"", "1", "t", "true", "y", "yes"})); - static const base::NoDestructor<std::set<std::string>> kFalseValues( -- {"0", "f", "false", "n", "no"}); -+ std::initializer_list<std::string>({"0", "f", "false", "n", "no"})); - if (kTrueValues->find(base::ToLowerASCII(s)) != kTrueValues->end()) { - *flag_ = true; - return true; --- -2.20.1 - diff --git a/chromium/chromium/chromium-gcc8-r630355.patch b/chromium/chromium/chromium-gcc8-r630355.patch deleted file mode 100644 index c3f8e42..0000000 --- a/chromium/chromium/chromium-gcc8-r630355.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 130a5ae24a02daba8729ba2216bcaf3dbfacea69 Mon Sep 17 00:00:00 2001 -From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Date: Fri, 8 Feb 2019 16:58:38 +0000 -Subject: [PATCH] media::learning: Make LabelledExample's move assignment - operator noexcept -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The GCC build is currently broken with an error like this: - - ../../media/learning/common/labelled_example.cc:20:1: error: function ‘media::learning::LabelledExample::LabelledExample(media::learning::LabelledExample&&)’ defaulted on its redeclaration with an exception-specification that differs from the implicit exception-specification ‘’ - LabelledExample::LabelledExample(LabelledExample&& rhs) noexcept = default; - ^~~~~~~~~~~~~~~ - -With GCC, having that noexcept marker requires all members to be marked with -noexcept themselves, and TargetValue was missing some assignment operators -and noexcept markers. - -clang is fine because we pass -fno-exceptions and it disables the same error -there, while GCC continues to raise it (bug 843143 and its corresponding CL -have a longer discussion on this issue). - -Bug: 819294 -Change-Id: Ide30932fc466ccb52d6883a82777e703dae48798 -Reviewed-on: https://chromium-review.googlesource.com/c/1458210 -Commit-Queue: Frank Liberato <liberato@chromium.org> -Reviewed-by: Frank Liberato <liberato@chromium.org> -Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Cr-Commit-Position: refs/heads/master@{#630355} ---- - media/learning/common/labelled_example.cc | 3 ++- - media/learning/common/labelled_example.h | 2 +- - media/learning/common/value.cc | 6 ++++++ - media/learning/common/value.h | 4 ++++ - 4 files changed, 13 insertions(+), 2 deletions(-) - -diff --git a/media/learning/common/labelled_example.cc b/media/learning/common/labelled_example.cc -index 76d08509298e..43e834f9f3cf 100644 ---- a/media/learning/common/labelled_example.cc -+++ b/media/learning/common/labelled_example.cc -@@ -59,7 +59,8 @@ bool LabelledExample::operator<(const LabelledExample& rhs) const { - LabelledExample& LabelledExample::operator=(const LabelledExample& rhs) = - default; - --LabelledExample& LabelledExample::operator=(LabelledExample&& rhs) = default; -+LabelledExample& LabelledExample::operator=(LabelledExample&& rhs) noexcept = -+ default; - - TrainingData::TrainingData() = default; - -diff --git a/media/learning/common/labelled_example.h b/media/learning/common/labelled_example.h -index 4f43c54e7a76..365abc3c0ebf 100644 ---- a/media/learning/common/labelled_example.h -+++ b/media/learning/common/labelled_example.h -@@ -40,7 +40,7 @@ struct COMPONENT_EXPORT(LEARNING_COMMON) LabelledExample { - bool operator<(const LabelledExample& rhs) const; - - LabelledExample& operator=(const LabelledExample& rhs); -- LabelledExample& operator=(LabelledExample&& rhs); -+ LabelledExample& operator=(LabelledExample&& rhs) noexcept; - - // Observed feature values. - // Note that to interpret these values, you probably need to have the -diff --git a/media/learning/common/value.cc b/media/learning/common/value.cc -index 9c9395c25d4e..12ea399d24c3 100644 ---- a/media/learning/common/value.cc -+++ b/media/learning/common/value.cc -@@ -23,6 +23,12 @@ Value::Value(const std::string& x) : value_(base::PersistentHash(x)) {} - - Value::Value(const Value& other) : value_(other.value_) {} - -+Value::Value(Value&& rhs) noexcept = default; -+ -+Value& Value::operator=(const Value& rhs) = default; -+ -+Value& Value::operator=(Value&& rhs) noexcept = default; -+ - bool Value::operator==(const Value& rhs) const { - return value_ == rhs.value_; - } -diff --git a/media/learning/common/value.h b/media/learning/common/value.h -index 0e64da961f34..62f4953f691c 100644 ---- a/media/learning/common/value.h -+++ b/media/learning/common/value.h -@@ -38,6 +38,10 @@ class COMPONENT_EXPORT(LEARNING_COMMON) Value { - explicit Value(const std::string& x); - - Value(const Value& other); -+ Value(Value&&) noexcept; -+ -+ Value& operator=(const Value&); -+ Value& operator=(Value&&) noexcept; - - bool operator==(const Value& rhs) const; - bool operator!=(const Value& rhs) const; --- -2.20.1 - diff --git a/chromium/chromium/chromium-gcc8-r631472.patch b/chromium/chromium/chromium-gcc8-r631472.patch deleted file mode 100644 index df7d630..0000000 --- a/chromium/chromium/chromium-gcc8-r631472.patch +++ /dev/null @@ -1,59 +0,0 @@ -From bdd76190e54e6a0e11343dd19e4bf1d06956fa48 Mon Sep 17 00:00:00 2001 -From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Date: Wed, 13 Feb 2019 01:02:27 +0000 -Subject: [PATCH] BaseRenderingContext2D: Use base::CheckMul and simplify code - in putImageData() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Follow-up to commit e0b3253a56 ("Fix image conversion truncation issues"). -The current code does not build with GCC due to -https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89287: - - ../../third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc: In member function ‘void blink::BaseRenderingContext2D::putImageData(blink::ImageData*, int, int, int, int, int, int, blink::ExceptionState&)’: - ../../third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc:1777:44: error: default type conversion can't deduce template argument for ‘template<class Dst, typename std::enable_if<base::internal::IsNumericRangeContained<Dst, long unsigned int, void>::value, void>::type* <anonymous> > constexpr base::internal::StrictNumeric<T>::operator Dst() const [with Dst = Dst; typename std::enable_if<base::internal::IsNumericRangeContained<Dst, T>::value>::type* <anonymous> = <enumerator>; T = long unsigned int]’ - new uint8_t[data_length.ValueOrDie()]); - ^ - -Work around it by using the more idiomatic base::CheckMul() with -AssignIfValid, so that we can have |data_length| be a size_t again and not -leave it to the compiler to figure out the type we want when creating the -|converted_pixels| array. - -Bug: 819294 -Change-Id: Id124cc4f3d749b45def4708e21e4badafd708578 -Reviewed-on: https://chromium-review.googlesource.com/c/1467201 -Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Commit-Queue: Kentaro Hara <haraken@chromium.org> -Reviewed-by: Kentaro Hara <haraken@chromium.org> -Cr-Commit-Position: refs/heads/master@{#631472} ---- - .../canvas/canvas2d/base_rendering_context_2d.cc | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc -index d9fa696c9a9d..34a8a202bfd3 100644 ---- a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc -+++ b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc -@@ -1769,12 +1769,12 @@ void BaseRenderingContext2D::putImageData(ImageData* data, - CanvasColorParams(ColorParams().ColorSpace(), PixelFormat(), kNonOpaque); - if (data_color_params.NeedsColorConversion(context_color_params) || - PixelFormat() == kF16CanvasPixelFormat) { -- base::CheckedNumeric<size_t> data_length = data->Size().Area(); -- data_length *= context_color_params.BytesPerPixel(); -- if (!data_length.IsValid()) -+ size_t data_length; -+ if (!base::CheckMul(data->Size().Area(), -+ context_color_params.BytesPerPixel()) -+ .AssignIfValid(&data_length)) - return; -- std::unique_ptr<uint8_t[]> converted_pixels( -- new uint8_t[data_length.ValueOrDie()]); -+ std::unique_ptr<uint8_t[]> converted_pixels(new uint8_t[data_length]); - if (data->ImageDataInCanvasColorSettings( - ColorParams().ColorSpace(), PixelFormat(), converted_pixels.get(), - kRGBAColorType)) { --- -2.20.1 - diff --git a/chromium/chromium/chromium-gcc8-r631962.patch b/chromium/chromium/chromium-gcc8-r631962.patch deleted file mode 100644 index 033861e..0000000 --- a/chromium/chromium/chromium-gcc8-r631962.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 78b0f0dfa9e6f3c37b71102c01def92f1ab8c330 Mon Sep 17 00:00:00 2001 -From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Date: Wed, 13 Feb 2019 23:28:46 +0000 -Subject: [PATCH] CastActivityManager: Do not make DoLaunchSessionParams' move - constructor noexcept -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This fixes the GCC build: - - ../../chrome/browser/media/router/providers/cast/cast_activity_manager.cc:806:1: error: function ‘media_router::CastActivityManager::DoLaunchSessionParams::DoLaunchSessionParams(media_router::CastActivityManager::DoLaunchSessionParams&&)’ defaulted on its redeclaration with an exception-specification that differs from the implicit exception-specification ‘’ - CastActivityManager::DoLaunchSessionParams::DoLaunchSessionParams( - ^~~~~~~~~~~~~~~~~~~ - -With GCC, having that noexcept marker requires all members to be marked with -noexcept themselves, and MediaRoute, CastMediaSource and url::Origin need -the right annotations. Just making DoLaunchSessionParams not noexcept is the -least intrusive solution for now. - -clang is fine because we pass -fno-exceptions and it disables the same error -there, while GCC continues to raise it (bug 843143 and its corresponding CL -have a longer discussion on this issue). - -Bug: 819294 -Change-Id: Ia3a5fb60b5e74e68bd35cfa50e2fcc728b64e5eb -Reviewed-on: https://chromium-review.googlesource.com/c/1469942 -Commit-Queue: mark a. foltz <mfoltz@chromium.org> -Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Reviewed-by: mark a. foltz <mfoltz@chromium.org> -Cr-Commit-Position: refs/heads/master@{#631962} ---- - .../media/router/providers/cast/cast_activity_manager.cc | 2 +- - .../browser/media/router/providers/cast/cast_activity_manager.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/chrome/browser/media/router/providers/cast/cast_activity_manager.cc b/chrome/browser/media/router/providers/cast/cast_activity_manager.cc -index b7ee9695f69a..8569e0cd30a3 100644 ---- a/chrome/browser/media/router/providers/cast/cast_activity_manager.cc -+++ b/chrome/browser/media/router/providers/cast/cast_activity_manager.cc -@@ -804,7 +804,7 @@ CastActivityManager::DoLaunchSessionParams::DoLaunchSessionParams( - callback(std::move(callback)) {} - - CastActivityManager::DoLaunchSessionParams::DoLaunchSessionParams( -- DoLaunchSessionParams&& other) noexcept = default; -+ DoLaunchSessionParams&& other) = default; - - CastActivityManager::DoLaunchSessionParams::~DoLaunchSessionParams() = default; - -diff --git a/chrome/browser/media/router/providers/cast/cast_activity_manager.h b/chrome/browser/media/router/providers/cast/cast_activity_manager.h -index 325bffc725ee..08fe0ccca603 100644 ---- a/chrome/browser/media/router/providers/cast/cast_activity_manager.h -+++ b/chrome/browser/media/router/providers/cast/cast_activity_manager.h -@@ -295,7 +295,7 @@ class CastActivityManager : public cast_channel::CastMessageHandler::Observer, - const url::Origin& origin, - int tab_id, - mojom::MediaRouteProvider::CreateRouteCallback callback); -- DoLaunchSessionParams(DoLaunchSessionParams&& other) noexcept; -+ DoLaunchSessionParams(DoLaunchSessionParams&& other); - ~DoLaunchSessionParams(); - DoLaunchSessionParams& operator=(DoLaunchSessionParams&&) = delete; - --- -2.20.1 - diff --git a/chromium/chromium/chromium-gcc8-r632385.patch b/chromium/chromium/chromium-gcc8-r632385.patch deleted file mode 100644 index d8eca1e..0000000 --- a/chromium/chromium/chromium-gcc8-r632385.patch +++ /dev/null @@ -1,100 +0,0 @@ -From cf4c534f04c223f8a9d65407852e2a531a6d7fb6 Mon Sep 17 00:00:00 2001 -From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Date: Thu, 14 Feb 2019 22:22:21 +0000 -Subject: [PATCH] chrome/browser: Replace some forward declarations with actual - includes -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This fixes the GCC build which was failing like this: - - ../../base/scoped_observer.h: In instantiation of ‘void ScopedObserver<Source, Observer>::RemoveAll() [with Source = TabStripModel; Observer = TabStripModelObserver]’: - ../../base/scoped_observer.h:26:5: required from ‘ScopedObserver<Source, Observer>::~ScopedObserver() [with Source = TabStripModel; Observer = TabStripModelObserver]’ - ../../chrome/browser/ui/views/extensions/extension_popup.h:115:70: required from here - ../../base/scoped_observer.h:45:20: error: invalid use of incomplete type ‘class TabStripModel’ - sources_[i]->RemoveObserver(observer_); - ~~~~~~~~~~~~~^~~~~~~~~~~~~~ - -This is caused by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89311 ("Brace -initialization needlessly invokes destructor"), i.e. having something like - - ScopedObserver<T, U> observer_{this}; - -in a header declaration requires T and U to be fully declared because -ScopedObserver's destructor references them. In a few cases, T was only -forward-declared. - -Bug: 819294 -Change-Id: Ie5b9dc2745e27d4532c5539e3845a8c9147a0595 -Reviewed-on: https://chromium-review.googlesource.com/c/1472576 -Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> -Commit-Queue: Alan Cutter <alancutter@chromium.org> -Reviewed-by: Finnur Thorarinsson <finnur@chromium.org> -Reviewed-by: Alan Cutter <alancutter@chromium.org> -Cr-Commit-Position: refs/heads/master@{#632385} ---- - chrome/browser/ui/views/extensions/extension_popup.cc | 1 - - chrome/browser/ui/views/extensions/extension_popup.h | 1 + - chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.cc | 1 - - chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h | 2 +- - .../web_applications/extensions/bookmark_app_tab_helper.cc | 1 - - .../web_applications/extensions/bookmark_app_tab_helper.h | 2 +- - 6 files changed, 3 insertions(+), 5 deletions(-) - -diff --git a/chrome/browser/ui/views/extensions/extension_popup.cc b/chrome/browser/ui/views/extensions/extension_popup.cc -index 80b5a17eb84f..656640e21e58 100644 ---- a/chrome/browser/ui/views/extensions/extension_popup.cc -+++ b/chrome/browser/ui/views/extensions/extension_popup.cc -@@ -8,7 +8,6 @@ - #include "chrome/browser/devtools/devtools_window.h" - #include "chrome/browser/extensions/extension_view_host.h" - #include "chrome/browser/ui/browser.h" --#include "chrome/browser/ui/tabs/tab_strip_model.h" - #include "content/public/browser/devtools_agent_host.h" - #include "content/public/browser/notification_details.h" - #include "content/public/browser/notification_source.h" -diff --git a/chrome/browser/ui/views/extensions/extension_popup.h b/chrome/browser/ui/views/extensions/extension_popup.h -index ae8853766e15..ab007fe09e9a 100644 ---- a/chrome/browser/ui/views/extensions/extension_popup.h -+++ b/chrome/browser/ui/views/extensions/extension_popup.h -@@ -9,6 +9,7 @@ - #include "base/compiler_specific.h" - #include "base/macros.h" - #include "base/scoped_observer.h" -+#include "chrome/browser/ui/tabs/tab_strip_model.h" - #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" - #include "chrome/browser/ui/views/extensions/extension_view_views.h" - #include "content/public/browser/devtools_agent_host_observer.h" -diff --git a/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.cc b/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.cc -index d0ebf139b57d..beeaed9bf431 100644 ---- a/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.cc -+++ b/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.cc -@@ -9,7 +9,6 @@ - #include "base/single_thread_task_runner.h" - #include "base/threading/thread_task_runner_handle.h" - #include "base/time/time.h" --#include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" - #include "chrome/browser/ui/views/frame/browser_view.h" - #include "chrome/browser/ui/views/toolbar/app_menu.h" - #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" -diff --git a/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h b/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h -index d9814594270a..f5fee9f4fbe7 100644 ---- a/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h -+++ b/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h -@@ -8,6 +8,7 @@ - #include "base/macros.h" - #include "base/memory/weak_ptr.h" - #include "base/scoped_observer.h" -+#include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" - #include "chrome/browser/ui/toolbar/toolbar_actions_bar_observer.h" - #include "chrome/browser/ui/views/toolbar/app_menu_observer.h" - #include "ui/views/controls/scroll_view.h" -@@ -15,7 +16,6 @@ - class AppMenu; - class Browser; - class BrowserActionsContainer; --class ToolbarActionsBar; - - namespace views { - class MenuItemView; diff --git a/chromium/chromium/chromium-gcc8-r641329.patch b/chromium/chromium/chromium-gcc8-r641329.patch new file mode 100644 index 0000000..49fcf69 --- /dev/null +++ b/chromium/chromium/chromium-gcc8-r641329.patch @@ -0,0 +1,101 @@ +From 0e121588d500217a38d57f5e285aa586676059b2 Mon Sep 17 00:00:00 2001 +From: Sergey Abbakumov <sabbakumov@yandex-team.ru> +Date: Fri, 15 Mar 2019 22:32:16 +0000 +Subject: [PATCH] base::Value::SetKey/SetPath performance improvements + +Use rvalue references to avoid copying sizeof(base::Value). + +This commit gives about -20KB of the browser.dll and browser_child.dll +size. Also it reduces renderer memory consumption by ~200 +KB max. + +Bug: 646113 +Change-Id: I8c86594838292a2faf4d134b899a7978dbc214fc +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1520407 +Reviewed-by: danakj <danakj@chromium.org> +Commit-Queue: danakj <danakj@chromium.org> +Cr-Commit-Position: refs/heads/master@{#641329} +--- + base/values.cc | 10 +++++----- + base/values.h | 10 +++++----- + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/base/values.cc b/base/values.cc +index 2b0c6c8163d8..0c002551b317 100644 +--- a/base/values.cc ++++ b/base/values.cc +@@ -353,7 +353,7 @@ bool Value::RemoveKey(StringPiece key) { + return dict_.erase(key) != 0; + } + +-Value* Value::SetKey(StringPiece key, Value value) { ++Value* Value::SetKey(StringPiece key, Value&& value) { + CHECK(is_dict()); + // NOTE: We can't use |insert_or_assign| here, as only |try_emplace| does + // an explicit conversion from StringPiece to std::string if necessary. +@@ -366,7 +366,7 @@ Value* Value::SetKey(StringPiece key, Value value) { + return result.first->second.get(); + } + +-Value* Value::SetKey(std::string&& key, Value value) { ++Value* Value::SetKey(std::string&& key, Value&& value) { + CHECK(is_dict()); + return dict_ + .insert_or_assign(std::move(key), +@@ -374,7 +374,7 @@ Value* Value::SetKey(std::string&& key, Value value) { + .first->second.get(); + } + +-Value* Value::SetKey(const char* key, Value value) { ++Value* Value::SetKey(const char* key, Value&& value) { + return SetKey(StringPiece(key), std::move(value)); + } + +@@ -425,12 +425,12 @@ const Value* Value::FindPathOfType(span<const StringPiece> path, + return result; + } + +-Value* Value::SetPath(std::initializer_list<StringPiece> path, Value value) { ++Value* Value::SetPath(std::initializer_list<StringPiece> path, Value&& value) { + DCHECK_GE(path.size(), 2u) << "Use SetKey() for a path of length 1."; + return SetPath(make_span(path.begin(), path.size()), std::move(value)); + } + +-Value* Value::SetPath(span<const StringPiece> path, Value value) { ++Value* Value::SetPath(span<const StringPiece> path, Value&& value) { + DCHECK(path.begin() != path.end()); // Can't be empty path. + + // Walk/construct intermediate dictionaries. The last element requires +diff --git a/base/values.h b/base/values.h +index 7546fa53756d..429ef1dfdebd 100644 +--- a/base/values.h ++++ b/base/values.h +@@ -210,11 +210,11 @@ class BASE_EXPORT Value { + // + // Example: + // SetKey("foo", std::move(myvalue)); +- Value* SetKey(StringPiece key, Value value); ++ Value* SetKey(StringPiece key, Value&& value); + // This overload results in a performance improvement for std::string&&. +- Value* SetKey(std::string&& key, Value value); ++ Value* SetKey(std::string&& key, Value&& value); + // This overload is necessary to avoid ambiguity for const char* arguments. +- Value* SetKey(const char* key, Value value); ++ Value* SetKey(const char* key, Value&& value); + + // This attemps to remove the value associated with |key|. In case of failure, + // e.g. the key does not exist, |false| is returned and the underlying +@@ -276,8 +276,8 @@ class BASE_EXPORT Value { + // value.SetPath(components, std::move(myvalue)); + // + // Note: If there is only one component in the path, use SetKey() instead. +- Value* SetPath(std::initializer_list<StringPiece> path, Value value); +- Value* SetPath(span<const StringPiece> path, Value value); ++ Value* SetPath(std::initializer_list<StringPiece> path, Value&& value); ++ Value* SetPath(span<const StringPiece> path, Value&& value); + + // Tries to remove a Value at the given path. + // +-- +2.20.1 + diff --git a/chromium/chromium/chromium-gcc8-r641404.patch b/chromium/chromium/chromium-gcc8-r641404.patch new file mode 100644 index 0000000..fe84c7b --- /dev/null +++ b/chromium/chromium/chromium-gcc8-r641404.patch @@ -0,0 +1,587 @@ +From e1b1f3a5f273c8da533fad495b9de316e2c83c9b Mon Sep 17 00:00:00 2001 +From: jdoerrie <jdoerrie@chromium.org> +Date: Sat, 16 Mar 2019 04:08:01 +0000 +Subject: [PATCH] [base] Add Dead Type to base::Value + +This change adds a temporary DEAD type to base::Value which should help +to track down use-after-free bugs. Furthermore, this change also removes +the now unneeded is_alive_ flag. + +Bug: 859477, 941404 +Change-Id: I9b7a2f3cbb0b22d7e3ed35b2453537419f3f7e55 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1478897 +Reviewed-by: Pavol Marko <pmarko@chromium.org> +Reviewed-by: Tao Bai <michaelbai@chromium.org> +Reviewed-by: Thomas Anderson <thomasanderson@chromium.org> +Reviewed-by: Mike Pinkerton <pinkerton@chromium.org> +Reviewed-by: Bill Budge <bbudge@chromium.org> +Reviewed-by: Ken Rockot <rockot@google.com> +Reviewed-by: Steven Bennetts <stevenjb@chromium.org> +Reviewed-by: Daniel Cheng <dcheng@chromium.org> +Reviewed-by: David Turner <digit@chromium.org> +Commit-Queue: Thomas Anderson <thomasanderson@chromium.org> +Cr-Commit-Position: refs/heads/master@{#641404} +--- + base/json/json_writer.cc | 5 ++ + base/values.cc | 68 ++++++++++++------- + base/values.h | 23 ++----- + base/values_unittest.cc | 10 ++- + .../ui/cocoa/applescript/apple_event_util.mm | 10 +++ + chromeos/network/onc/variable_expander.cc | 6 ++ + .../core/browser/android/policy_converter.cc | 11 ++- + .../core/common/policy_loader_win_unittest.cc | 8 ++- + .../policy/core/common/policy_test_utils.cc | 5 ++ + .../policy/core/common/registry_dict.cc | 4 ++ + .../gin_java_script_to_java_types_coercion.cc | 8 ++- + ipc/ipc_message_utils.cc | 11 ++- + mojo/public/cpp/base/values_mojom_traits.h | 7 +- + .../ppb_x509_certificate_private_shared.cc | 2 + + 14 files changed, 127 insertions(+), 51 deletions(-) + +diff --git a/base/json/json_writer.cc b/base/json/json_writer.cc +index 376a459f9a46..cd020e7fa0c0 100644 +--- a/base/json/json_writer.cc ++++ b/base/json/json_writer.cc +@@ -179,6 +179,11 @@ bool JSONWriter::BuildJSONString(const Value& node, size_t depth) { + // Successful only if we're allowed to omit it. + DLOG_IF(ERROR, !omit_binary_values_) << "Cannot serialize binary value."; + return omit_binary_values_; ++ ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case Value::Type::DEAD: ++ CHECK(false); ++ return false; + } + + // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. +diff --git a/base/values.cc b/base/values.cc +index 0c002551b317..035aa2350cde 100644 +--- a/base/values.cc ++++ b/base/values.cc +@@ -90,8 +90,6 @@ std::unique_ptr<Value> CopyWithoutEmptyChildren(const Value& node) { + + } // namespace + +-constexpr uint16_t Value::kMagicIsAlive; +- + // static + std::unique_ptr<Value> Value::CreateWithCopiedBuffer(const char* buffer, + size_t size) { +@@ -112,9 +110,9 @@ Value::Value(Value&& that) noexcept { + InternalMoveConstructFrom(std::move(that)); + } + +-Value::Value() noexcept : type_(Type::NONE), is_alive_(kMagicIsAlive) {} ++Value::Value() noexcept : type_(Type::NONE) {} + +-Value::Value(Type type) : type_(type), is_alive_(kMagicIsAlive) { ++Value::Value(Type type) : type_(type) { + // Initialize with the default value. + switch (type_) { + case Type::NONE: +@@ -141,22 +139,26 @@ Value::Value(Type type) : type_(type), is_alive_(kMagicIsAlive) { + case Type::LIST: + new (&list_) ListStorage(); + return; ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case Type::DEAD: ++ CHECK(false); ++ return; + } ++ ++ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. ++ CHECK(false); + } + + Value::Value(bool in_bool) + : bool_type_(Type::BOOLEAN), +- bool_is_alive_(kMagicIsAlive), + bool_value_(in_bool) {} + + Value::Value(int in_int) + : int_type_(Type::INTEGER), +- int_is_alive_(kMagicIsAlive), + int_value_(in_int) {} + + Value::Value(double in_double) + : double_type_(Type::DOUBLE), +- double_is_alive_(kMagicIsAlive), + double_value_(in_double) { + if (!std::isfinite(double_value_)) { + NOTREACHED() << "Non-finite (i.e. NaN or positive/negative infinity) " +@@ -171,7 +173,6 @@ Value::Value(StringPiece in_string) : Value(std::string(in_string)) {} + + Value::Value(std::string&& in_string) noexcept + : string_type_(Type::STRING), +- string_is_alive_(kMagicIsAlive), + string_value_(std::move(in_string)) { + DCHECK(IsStringUTF8(string_value_)); + } +@@ -182,21 +183,18 @@ Value::Value(StringPiece16 in_string16) : Value(UTF16ToUTF8(in_string16)) {} + + Value::Value(const std::vector<char>& in_blob) + : binary_type_(Type::BINARY), +- binary_is_alive_(kMagicIsAlive), + binary_value_(in_blob.begin(), in_blob.end()) {} + + Value::Value(base::span<const uint8_t> in_blob) + : binary_type_(Type::BINARY), +- binary_is_alive_(kMagicIsAlive), + binary_value_(in_blob.begin(), in_blob.end()) {} + + Value::Value(BlobStorage&& in_blob) noexcept + : binary_type_(Type::BINARY), +- binary_is_alive_(kMagicIsAlive), + binary_value_(std::move(in_blob)) {} + + Value::Value(const DictStorage& in_dict) +- : dict_type_(Type::DICTIONARY), dict_is_alive_(kMagicIsAlive), dict_() { ++ : dict_type_(Type::DICTIONARY), dict_() { + dict_.reserve(in_dict.size()); + for (const auto& it : in_dict) { + dict_.try_emplace(dict_.end(), it.first, +@@ -206,11 +204,9 @@ Value::Value(const DictStorage& in_dict) + + Value::Value(DictStorage&& in_dict) noexcept + : dict_type_(Type::DICTIONARY), +- dict_is_alive_(kMagicIsAlive), + dict_(std::move(in_dict)) {} + +-Value::Value(const ListStorage& in_list) +- : list_type_(Type::LIST), list_is_alive_(kMagicIsAlive), list_() { ++Value::Value(const ListStorage& in_list) : list_type_(Type::LIST), list_() { + list_.reserve(in_list.size()); + for (const auto& val : in_list) + list_.emplace_back(val.Clone()); +@@ -218,7 +214,6 @@ Value::Value(const ListStorage& in_list) + + Value::Value(ListStorage&& in_list) noexcept + : list_type_(Type::LIST), +- list_is_alive_(kMagicIsAlive), + list_(std::move(in_list)) {} + + Value& Value::operator=(Value&& that) noexcept { +@@ -246,15 +241,21 @@ Value Value::Clone() const { + return Value(dict_); + case Type::LIST: + return Value(list_); ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case Type::DEAD: ++ CHECK(false); ++ return Value(); + } + +- NOTREACHED(); ++ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. ++ CHECK(false); + return Value(); + } + + Value::~Value() { + InternalCleanup(); +- is_alive_ = 0; ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ type_ = Type::DEAD; + } + + // static +@@ -654,9 +655,14 @@ bool operator==(const Value& lhs, const Value& rhs) { + }); + case Value::Type::LIST: + return lhs.list_ == rhs.list_; ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case Value::Type::DEAD: ++ CHECK(false); ++ return false; + } + +- NOTREACHED(); ++ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. ++ CHECK(false); + return false; + } + +@@ -693,9 +699,14 @@ bool operator<(const Value& lhs, const Value& rhs) { + }); + case Value::Type::LIST: + return lhs.list_ < rhs.list_; ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case Value::Type::DEAD: ++ CHECK(false); ++ return false; + } + +- NOTREACHED(); ++ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. ++ CHECK(false); + return false; + } + +@@ -733,7 +744,6 @@ size_t Value::EstimateMemoryUsage() const { + + void Value::InternalMoveConstructFrom(Value&& that) { + type_ = that.type_; +- is_alive_ = that.is_alive_; + + switch (type_) { + case Type::NONE: +@@ -759,12 +769,17 @@ void Value::InternalMoveConstructFrom(Value&& that) { + case Type::LIST: + new (&list_) ListStorage(std::move(that.list_)); + return; ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case Type::DEAD: ++ CHECK(false); ++ return; + } ++ ++ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. ++ CHECK(false); + } + + void Value::InternalCleanup() { +- CHECK_EQ(is_alive_, kMagicIsAlive); +- + switch (type_) { + case Type::NONE: + case Type::BOOLEAN: +@@ -785,7 +800,14 @@ void Value::InternalCleanup() { + case Type::LIST: + list_.~ListStorage(); + return; ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case Type::DEAD: ++ CHECK(false); ++ return; + } ++ ++ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. ++ CHECK(false); + } + + ///////////////////// DictionaryValue //////////////////// +diff --git a/base/values.h b/base/values.h +index 429ef1dfdebd..e31cadd83102 100644 +--- a/base/values.h ++++ b/base/values.h +@@ -92,7 +92,9 @@ class BASE_EXPORT Value { + STRING, + BINARY, + DICTIONARY, +- LIST ++ LIST, ++ // TODO(crbug.com/859477): Remove once root cause is found. ++ DEAD + // Note: Do not add more types. See the file-level comment above for why. + }; + +@@ -375,10 +377,6 @@ class BASE_EXPORT Value { + size_t EstimateMemoryUsage() const; + + protected: +- // Magic IsAlive signature to debug double frees. +- // TODO(crbug.com/859477): Remove once root cause is found. +- static constexpr uint16_t kMagicIsAlive = 0x2f19; +- + // Technical note: + // The naive way to implement a tagged union leads to wasted bytes + // in the object on CPUs like ARM ones, which impose an 8-byte alignment +@@ -408,8 +406,8 @@ class BASE_EXPORT Value { + // that |double_value_| below is always located at an offset that is a + // multiple of 8, relative to the start of the overall data structure. + // +- // Each struct must declare its own |type_| and |is_alive_| field, which +- // must have a different name, to appease the C++ compiler. ++ // Each struct must declare its own |type_| field, which must have a different ++ // name, to appease the C++ compiler. + // + // Using this technique sizeof(base::Value) == 16 on 32-bit ARM instead + // of 24, without losing any information. Results are unchanged for x86, +@@ -419,24 +417,17 @@ class BASE_EXPORT Value { + // TODO(crbug.com/646113): Make these private once DictionaryValue and + // ListValue are properly inlined. + Type type_ : 8; +- +- // IsAlive member to debug double frees. +- // TODO(crbug.com/859477): Remove once root cause is found. +- uint16_t is_alive_ = kMagicIsAlive; + }; + struct { + Type bool_type_ : 8; +- uint16_t bool_is_alive_; + bool bool_value_; + }; + struct { + Type int_type_ : 8; +- uint16_t int_is_alive_; + int int_value_; + }; + struct { + Type double_type_ : 8; +- uint16_t double_is_alive_; + // Subtle: On architectures that require it, the compiler will ensure + // that |double_value_|'s offset is a multiple of 8 (e.g. 32-bit ARM). + // See technical note above to understand why it is important. +@@ -444,22 +435,18 @@ class BASE_EXPORT Value { + }; + struct { + Type string_type_ : 8; +- uint16_t string_is_alive_; + std::string string_value_; + }; + struct { + Type binary_type_ : 8; +- uint16_t binary_is_alive_; + BlobStorage binary_value_; + }; + struct { + Type dict_type_ : 8; +- uint16_t dict_is_alive_; + DictStorage dict_; + }; + struct { + Type list_type_ : 8; +- uint16_t list_is_alive_; + ListStorage list_; + }; + }; +diff --git a/base/values_unittest.cc b/base/values_unittest.cc +index 0a641bcc7ef4..b23fd8332491 100644 +--- a/base/values_unittest.cc ++++ b/base/values_unittest.cc +@@ -20,17 +20,20 @@ + #include "base/strings/string16.h" + #include "base/strings/string_piece.h" + #include "base/strings/utf_string_conversions.h" ++#include "build/build_config.h" + #include "testing/gmock/include/gmock/gmock.h" + #include "testing/gtest/include/gtest/gtest.h" + + namespace base { + ++// Test is currently incorrect on Windows x86. ++#if !defined(OS_WIN) || !defined(ARCH_CPU_X86) + TEST(ValuesTest, SizeOfValue) { + // Ensure that base::Value is as small as possible, i.e. that there is + // no wasted space after the inner value due to alignment constraints. +- // Distinguish between the 'header' that includes |type_| and |is_alive_| +- // and the inner value that follows it, which can be a bool, int, double, +- // string, blob, list or dict. ++ // Distinguish between the 'header' that includes |type_| and and the inner ++ // value that follows it, which can be a bool, int, double, string, blob, list ++ // or dict. + #define INNER_TYPES_LIST(X) \ + X(bool, bool_value_) \ + X(int, int_value_) \ +@@ -61,6 +64,7 @@ TEST(ValuesTest, SizeOfValue) { + LOG(INFO) << "max_inner_struct_limit=" << max_inner_struct_limit; + } + } ++#endif + + TEST(ValuesTest, TestNothrow) { + static_assert(std::is_nothrow_move_constructible<Value>::value, +diff --git a/chrome/browser/ui/cocoa/applescript/apple_event_util.mm b/chrome/browser/ui/cocoa/applescript/apple_event_util.mm +index 16d685607ced..25a59338ee73 100644 +--- a/chrome/browser/ui/cocoa/applescript/apple_event_util.mm ++++ b/chrome/browser/ui/cocoa/applescript/apple_event_util.mm +@@ -96,6 +96,16 @@ NSAppleEventDescriptor* ValueToAppleEventDescriptor(const base::Value* value) { + } + break; + } ++ ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case base::Value::Type::DEAD: ++ CHECK(false); ++ break; ++ ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ default: ++ CHECK(false); ++ break; + } + + return descriptor; +diff --git a/chromeos/network/onc/variable_expander.cc b/chromeos/network/onc/variable_expander.cc +index fd72752c2aa6..cd5bbb238eb3 100644 +--- a/chromeos/network/onc/variable_expander.cc ++++ b/chromeos/network/onc/variable_expander.cc +@@ -145,6 +145,12 @@ bool VariableExpander::ExpandValue(base::Value* value) const { + // Nothing to do here. + break; + } ++ ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case base::Value::Type::DEAD: { ++ CHECK(false); ++ break; ++ } + } + return no_error; + } +diff --git a/components/policy/core/browser/android/policy_converter.cc b/components/policy/core/browser/android/policy_converter.cc +index b711a64febc9..9d41ad0d1507 100644 +--- a/components/policy/core/browser/android/policy_converter.cc ++++ b/components/policy/core/browser/android/policy_converter.cc +@@ -175,10 +175,17 @@ std::unique_ptr<base::Value> PolicyConverter::ConvertValueToSchema( + } + return value; + } ++ ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case base::Value::Type::DEAD: { ++ CHECK(false); ++ return nullptr; ++ } + } + +- NOTREACHED(); +- return std::unique_ptr<base::Value>(); ++ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. ++ CHECK(false); ++ return nullptr; + } + + void PolicyConverter::SetPolicyValue(const std::string& key, +diff --git a/components/policy/core/common/policy_loader_win_unittest.cc b/components/policy/core/common/policy_loader_win_unittest.cc +index 311e7fb122fc..0377307c5e28 100644 +--- a/components/policy/core/common/policy_loader_win_unittest.cc ++++ b/components/policy/core/common/policy_loader_win_unittest.cc +@@ -133,8 +133,14 @@ bool InstallValue(const base::Value& value, + + case base::Value::Type::BINARY: + return false; ++ ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case base::Value::Type::DEAD: ++ CHECK(false); ++ return false; + } +- NOTREACHED(); ++ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. ++ CHECK(false); + return false; + } + +diff --git a/components/policy/core/common/policy_test_utils.cc b/components/policy/core/common/policy_test_utils.cc +index 5af98b47275c..919f004153ec 100644 +--- a/components/policy/core/common/policy_test_utils.cc ++++ b/components/policy/core/common/policy_test_utils.cc +@@ -137,6 +137,11 @@ CFPropertyListRef ValueToProperty(const base::Value& value) { + // because there's no equivalent JSON type, and policy values can only + // take valid JSON values. + break; ++ ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case base::Value::Type::DEAD: ++ CHECK(false); ++ break; + } + + return NULL; +diff --git a/components/policy/core/common/registry_dict.cc b/components/policy/core/common/registry_dict.cc +index f3ed372bdcb3..696ba7e04abe 100644 +--- a/components/policy/core/common/registry_dict.cc ++++ b/components/policy/core/common/registry_dict.cc +@@ -135,6 +135,10 @@ std::unique_ptr<base::Value> ConvertRegistryValue(const base::Value& value, + case base::Value::Type::BINARY: + // No conversion possible. + break; ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case base::Value::Type::DEAD: ++ CHECK(false); ++ return nullptr; + } + + LOG(WARNING) << "Failed to convert " << value.type() << " to " +diff --git a/content/browser/android/java/gin_java_script_to_java_types_coercion.cc b/content/browser/android/java/gin_java_script_to_java_types_coercion.cc +index dabd66ba8c72..84fd5489a414 100644 +--- a/content/browser/android/java/gin_java_script_to_java_types_coercion.cc ++++ b/content/browser/android/java/gin_java_script_to_java_types_coercion.cc +@@ -722,8 +722,14 @@ jvalue CoerceJavaScriptValueToJavaValue(JNIEnv* env, + case base::Value::Type::BINARY: + return CoerceGinJavaBridgeValueToJavaValue( + env, value, target_type, coerce_to_string, object_refs, error); ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case base::Value::Type::DEAD: ++ CHECK(false); ++ return jvalue(); + } +- NOTREACHED(); ++ ++ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. ++ CHECK(false); + return jvalue(); + } + +diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc +index ec04c77c6c18..df6ec39bd663 100644 +--- a/ipc/ipc_message_utils.cc ++++ b/ipc/ipc_message_utils.cc +@@ -92,7 +92,7 @@ void WriteValue(base::Pickle* m, const base::Value* value, int recursion) { + + switch (value->type()) { + case base::Value::Type::NONE: +- break; ++ break; + case base::Value::Type::BOOLEAN: { + bool val; + result = value->GetAsBoolean(&val); +@@ -147,6 +147,11 @@ void WriteValue(base::Pickle* m, const base::Value* value, int recursion) { + } + break; + } ++ ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ default: ++ CHECK(false); ++ break; + } + } + +@@ -260,7 +265,9 @@ bool ReadValue(const base::Pickle* m, + break; + } + default: +- return false; ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ CHECK(false); ++ return false; + } + + return true; +diff --git a/mojo/public/cpp/base/values_mojom_traits.h b/mojo/public/cpp/base/values_mojom_traits.h +index cdb9bbbd94df..66752b7c90d8 100644 +--- a/mojo/public/cpp/base/values_mojom_traits.h ++++ b/mojo/public/cpp/base/values_mojom_traits.h +@@ -86,8 +86,13 @@ struct COMPONENT_EXPORT(MOJO_BASE_SHARED_TRAITS) + return mojo_base::mojom::ValueDataView::Tag::DICTIONARY_VALUE; + case base::Value::Type::LIST: + return mojo_base::mojom::ValueDataView::Tag::LIST_VALUE; ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case base::Value::Type::DEAD: ++ CHECK(false); ++ return mojo_base::mojom::ValueDataView::Tag::NULL_VALUE; + } +- NOTREACHED(); ++ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. ++ CHECK(false); + return mojo_base::mojom::ValueDataView::Tag::NULL_VALUE; + } + +diff --git a/ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc b/ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc +index 6ffff36337e0..7f392d50f718 100644 +--- a/ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc ++++ b/ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc +@@ -73,6 +73,8 @@ PP_Var PPB_X509Certificate_Fields::GetFieldAsPPVar( + } + case base::Value::Type::DICTIONARY: + case base::Value::Type::LIST: ++ // TODO(crbug.com/859477): Remove after root cause is found. ++ case base::Value::Type::DEAD: + // Not handled. + break; + } +-- +2.20.1 + diff --git a/chromium/chromium/chromium-gcc8-r642680.patch b/chromium/chromium/chromium-gcc8-r642680.patch new file mode 100644 index 0000000..c81a758 --- /dev/null +++ b/chromium/chromium/chromium-gcc8-r642680.patch @@ -0,0 +1,75 @@ +From c2c467f69fc00d353879d7add5f2c04a6acabbb1 Mon Sep 17 00:00:00 2001 +From: David 'Digit' Turner <digit@google.com> +Date: Wed, 20 Mar 2019 21:41:09 +0000 +Subject: [PATCH] base: Value::FindDoubleKey() converts integers to doubles + +Ensure that FindDoubleKey() can return the value of an +INTEGER key as a double. This is consistent with the behaviour +of Value::GetDouble() which will auto-convert INTEGER values +to doubles. + +BUG=646113 +R=dcheng@chromium.org,jdoerrie@chromium.org,sdefresne@chromium.org,hidehiko@chromium.org + +Change-Id: I2c08cb91b6cfd5db268a182ffffe16682d848008 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1529017 +Reviewed-by: Sylvain Defresne <sdefresne@chromium.org> +Reviewed-by: Daniel Cheng <dcheng@chromium.org> +Commit-Queue: David Turner <digit@chromium.org> +Cr-Commit-Position: refs/heads/master@{#642680} +--- + base/values.cc | 10 ++++++++-- + base/values.h | 2 ++ + base/values_unittest.cc | 2 +- + 3 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/base/values.cc b/base/values.cc +index 035aa2350cde..69d66ff8ab00 100644 +--- a/base/values.cc ++++ b/base/values.cc +@@ -339,8 +339,14 @@ base::Optional<int> Value::FindIntKey(StringPiece key) const { + } + + base::Optional<double> Value::FindDoubleKey(StringPiece key) const { +- const Value* result = FindKeyOfType(key, Type::DOUBLE); +- return result ? base::make_optional(result->double_value_) : base::nullopt; ++ const Value* result = FindKey(key); ++ if (result) { ++ if (result->is_int()) ++ return base::make_optional(static_cast<double>(result->int_value_)); ++ if (result->is_double()) ++ return base::make_optional(result->double_value_); ++ } ++ return base::nullopt; + } + + const std::string* Value::FindStringKey(StringPiece key) const { +diff --git a/base/values.h b/base/values.h +index e31cadd83102..6f2cd3cc3d79 100644 +--- a/base/values.h ++++ b/base/values.h +@@ -200,6 +200,8 @@ class BASE_EXPORT Value { + // function's name. + base::Optional<bool> FindBoolKey(StringPiece key) const; + base::Optional<int> FindIntKey(StringPiece key) const; ++ // Note FindDoubleKey() will auto-convert INTEGER keys to their double ++ // value, for consistency with GetDouble(). + base::Optional<double> FindDoubleKey(StringPiece key) const; + + // |FindStringKey| returns |nullptr| if value is not found or not a string. +diff --git a/base/values_unittest.cc b/base/values_unittest.cc +index b23fd8332491..7c545c09d947 100644 +--- a/base/values_unittest.cc ++++ b/base/values_unittest.cc +@@ -674,7 +674,7 @@ TEST(ValuesTest, FindDoubleKey) { + const Value dict(std::move(storage)); + EXPECT_EQ(base::nullopt, dict.FindDoubleKey("null")); + EXPECT_EQ(base::nullopt, dict.FindDoubleKey("bool")); +- EXPECT_EQ(base::nullopt, dict.FindDoubleKey("int")); ++ EXPECT_NE(base::nullopt, dict.FindDoubleKey("int")); + EXPECT_NE(base::nullopt, dict.FindDoubleKey("double")); + EXPECT_EQ(base::nullopt, dict.FindDoubleKey("string")); + EXPECT_EQ(base::nullopt, dict.FindDoubleKey("blob")); +-- +2.20.1 + diff --git a/chromium/chromium/chromium-gcc8-r647271.patch b/chromium/chromium/chromium-gcc8-r647271.patch new file mode 100644 index 0000000..9a53050 --- /dev/null +++ b/chromium/chromium/chromium-gcc8-r647271.patch @@ -0,0 +1,483 @@ +From 2f28731c17b246bd70075f828dcafcd23547da5d Mon Sep 17 00:00:00 2001 +From: David 'Digit' Turner <digit@google.com> +Date: Wed, 3 Apr 2019 14:32:09 +0000 +Subject: [PATCH] base: Fix Value layout for GCC +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +It turns out that the previous changes to the base::Value +layout broke GCC compilation (see [1] for details). + +This CL fixes the situation by using a new DoubleStorage +type that will store double values in a 4-byte aligned +struct, with bit_cast<> being used to convert between +double and DoubleStorage values in the implementation. + +This ensures that base::Value remains as small as possible +in all cases. The small penalty is that loading/storing +double values on 32-bit ARM is slightly slower due to +the fact that the value is no longer 8-byte aligned. + ++ Fix the ValuesTest.SizeOfValue test to work correctly, + and disable it for debug builds, so it doesn't fail + because debug versions of the internal containers + are larger on certain systems. + +[1] https://chromium-review.googlesource.com/c/chromium/src/+/1472716 + +BUG=646113 +R=dcheng@chromium.org, pasko@chromium.org, lizeb@chromium.org, jdoerrie@chromium.org, jose.dapena@lge.com + +Change-Id: I9a365407dc064ba1bdc19859706f4154a495921e +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1550363 +Commit-Queue: David Turner <digit@chromium.org> +Reviewed-by: Jan Wilken Dörrie <jdoerrie@chromium.org> +Cr-Commit-Position: refs/heads/master@{#647271} +--- + base/values.cc | 67 +++++++++++++--------------- + base/values.h | 94 ++++++++++------------------------------ + base/values_unittest.cc | 96 ++++++++++++++++++++++++++++++----------- + 3 files changed, 124 insertions(+), 133 deletions(-) + +diff --git a/base/values.cc b/base/values.cc +index 9fed5b52d60e..16d686b0bee5 100644 +--- a/base/values.cc ++++ b/base/values.cc +@@ -12,6 +12,7 @@ + #include <ostream> + #include <utility> + ++#include "base/bit_cast.h" + #include "base/json/json_writer.h" + #include "base/logging.h" + #include "base/memory/ptr_util.h" +@@ -36,6 +37,9 @@ static_assert(std::is_standard_layout<Value>::value, + "base::Value should be a standard-layout C++ class in order " + "to avoid undefined behaviour in its implementation!"); + ++static_assert(sizeof(Value::DoubleStorage) == sizeof(double), ++ "The double and DoubleStorage types should have the same size"); ++ + namespace { + + const char* const kTypeNames[] = {"null", "boolean", "integer", "double", +@@ -110,8 +114,6 @@ Value::Value(Value&& that) noexcept { + InternalMoveConstructFrom(std::move(that)); + } + +-Value::Value() noexcept : type_(Type::NONE) {} +- + Value::Value(Type type) : type_(type) { + // Initialize with the default value. + switch (type_) { +@@ -125,7 +127,7 @@ Value::Value(Type type) : type_(type) { + int_value_ = 0; + return; + case Type::DOUBLE: +- double_value_ = 0.0; ++ double_value_ = bit_cast<DoubleStorage>(0.0); + return; + case Type::STRING: + new (&string_value_) std::string(); +@@ -149,21 +151,16 @@ Value::Value(Type type) : type_(type) { + CHECK(false); + } + +-Value::Value(bool in_bool) +- : bool_type_(Type::BOOLEAN), +- bool_value_(in_bool) {} ++Value::Value(bool in_bool) : type_(Type::BOOLEAN), bool_value_(in_bool) {} + +-Value::Value(int in_int) +- : int_type_(Type::INTEGER), +- int_value_(in_int) {} ++Value::Value(int in_int) : type_(Type::INTEGER), int_value_(in_int) {} + + Value::Value(double in_double) +- : double_type_(Type::DOUBLE), +- double_value_(in_double) { +- if (!std::isfinite(double_value_)) { ++ : type_(Type::DOUBLE), double_value_(bit_cast<DoubleStorage>(in_double)) { ++ if (!std::isfinite(in_double)) { + NOTREACHED() << "Non-finite (i.e. NaN or positive/negative infinity) " + << "values cannot be represented in JSON"; +- double_value_ = 0.0; ++ double_value_ = bit_cast<DoubleStorage>(0.0); + } + } + +@@ -172,8 +169,7 @@ Value::Value(const char* in_string) : Value(std::string(in_string)) {} + Value::Value(StringPiece in_string) : Value(std::string(in_string)) {} + + Value::Value(std::string&& in_string) noexcept +- : string_type_(Type::STRING), +- string_value_(std::move(in_string)) { ++ : type_(Type::STRING), string_value_(std::move(in_string)) { + DCHECK(IsStringUTF8(string_value_)); + } + +@@ -182,19 +178,15 @@ Value::Value(const char16* in_string16) : Value(StringPiece16(in_string16)) {} + Value::Value(StringPiece16 in_string16) : Value(UTF16ToUTF8(in_string16)) {} + + Value::Value(const std::vector<char>& in_blob) +- : binary_type_(Type::BINARY), +- binary_value_(in_blob.begin(), in_blob.end()) {} ++ : type_(Type::BINARY), binary_value_(in_blob.begin(), in_blob.end()) {} + + Value::Value(base::span<const uint8_t> in_blob) +- : binary_type_(Type::BINARY), +- binary_value_(in_blob.begin(), in_blob.end()) {} ++ : type_(Type::BINARY), binary_value_(in_blob.begin(), in_blob.end()) {} + + Value::Value(BlobStorage&& in_blob) noexcept +- : binary_type_(Type::BINARY), +- binary_value_(std::move(in_blob)) {} ++ : type_(Type::BINARY), binary_value_(std::move(in_blob)) {} + +-Value::Value(const DictStorage& in_dict) +- : dict_type_(Type::DICTIONARY), dict_() { ++Value::Value(const DictStorage& in_dict) : type_(Type::DICTIONARY), dict_() { + dict_.reserve(in_dict.size()); + for (const auto& it : in_dict) { + dict_.try_emplace(dict_.end(), it.first, +@@ -203,18 +195,16 @@ Value::Value(const DictStorage& in_dict) + } + + Value::Value(DictStorage&& in_dict) noexcept +- : dict_type_(Type::DICTIONARY), +- dict_(std::move(in_dict)) {} ++ : type_(Type::DICTIONARY), dict_(std::move(in_dict)) {} + +-Value::Value(const ListStorage& in_list) : list_type_(Type::LIST), list_() { ++Value::Value(const ListStorage& in_list) : type_(Type::LIST), list_() { + list_.reserve(in_list.size()); + for (const auto& val : in_list) + list_.emplace_back(val.Clone()); + } + + Value::Value(ListStorage&& in_list) noexcept +- : list_type_(Type::LIST), +- list_(std::move(in_list)) {} ++ : type_(Type::LIST), list_(std::move(in_list)) {} + + Value& Value::operator=(Value&& that) noexcept { + InternalCleanup(); +@@ -223,6 +213,10 @@ Value& Value::operator=(Value&& that) noexcept { + return *this; + } + ++double Value::AsDoubleInternal() const { ++ return bit_cast<double>(double_value_); ++} ++ + Value Value::Clone() const { + switch (type_) { + case Type::NONE: +@@ -232,7 +226,7 @@ Value Value::Clone() const { + case Type::INTEGER: + return Value(int_value_); + case Type::DOUBLE: +- return Value(double_value_); ++ return Value(AsDoubleInternal()); + case Type::STRING: + return Value(string_value_); + case Type::BINARY: +@@ -277,7 +271,7 @@ int Value::GetInt() const { + + double Value::GetDouble() const { + if (is_double()) +- return double_value_; ++ return AsDoubleInternal(); + if (is_int()) + return int_value_; + CHECK(false); +@@ -342,9 +336,10 @@ base::Optional<double> Value::FindDoubleKey(StringPiece key) const { + const Value* result = FindKey(key); + if (result) { + if (result->is_int()) +- return base::make_optional(static_cast<double>(result->int_value_)); +- if (result->is_double()) +- return base::make_optional(result->double_value_); ++ return static_cast<double>(result->int_value_); ++ if (result->is_double()) { ++ return result->AsDoubleInternal(); ++ } + } + return base::nullopt; + } +@@ -601,7 +596,7 @@ bool Value::GetAsInteger(int* out_value) const { + + bool Value::GetAsDouble(double* out_value) const { + if (out_value && is_double()) { +- *out_value = double_value_; ++ *out_value = AsDoubleInternal(); + return true; + } + if (out_value && is_int()) { +@@ -696,7 +691,7 @@ bool operator==(const Value& lhs, const Value& rhs) { + case Value::Type::INTEGER: + return lhs.int_value_ == rhs.int_value_; + case Value::Type::DOUBLE: +- return lhs.double_value_ == rhs.double_value_; ++ return lhs.AsDoubleInternal() == rhs.AsDoubleInternal(); + case Value::Type::STRING: + return lhs.string_value_ == rhs.string_value_; + case Value::Type::BINARY: +@@ -741,7 +736,7 @@ bool operator<(const Value& lhs, const Value& rhs) { + case Value::Type::INTEGER: + return lhs.int_value_ < rhs.int_value_; + case Value::Type::DOUBLE: +- return lhs.double_value_ < rhs.double_value_; ++ return lhs.AsDoubleInternal() < rhs.AsDoubleInternal(); + case Value::Type::STRING: + return lhs.string_value_ < rhs.string_value_; + case Value::Type::BINARY: +diff --git a/base/values.h b/base/values.h +index 486fe7ff3976..c455936d4961 100644 +--- a/base/values.h ++++ b/base/values.h +@@ -83,6 +83,8 @@ class BASE_EXPORT Value { + using BlobStorage = std::vector<uint8_t>; + using DictStorage = flat_map<std::string, std::unique_ptr<Value>>; + using ListStorage = std::vector<Value>; ++ // See technical note below explaining why this is used. ++ using DoubleStorage = struct { alignas(4) char v[sizeof(double)]; }; + + enum class Type { + NONE = 0, +@@ -111,7 +113,10 @@ class BASE_EXPORT Value { + static std::unique_ptr<Value> ToUniquePtrValue(Value val); + + Value(Value&& that) noexcept; +- Value() noexcept; // A null value. ++ Value() noexcept {} // A null value ++ // Fun fact: using '= default' above instead of '{}' does not work because ++ // the compiler complains that the default constructor was deleted since ++ // the inner union contains fields with non-default constructors. + + // Value's copy constructor and copy assignment operator are deleted. Use this + // to obtain a deep copy explicitly. +@@ -405,82 +410,29 @@ class BASE_EXPORT Value { + size_t EstimateMemoryUsage() const; + + protected: +- // Technical note: +- // The naive way to implement a tagged union leads to wasted bytes +- // in the object on CPUs like ARM ones, which impose an 8-byte alignment +- // for double values. I.e. if one does something like: ++ // Special case for doubles, which are aligned to 8 bytes on some ++ // 32-bit architectures. In this case, a simple declaration as a ++ // double member would make the whole union 8 byte-aligned, which ++ // would also force 4 bytes of wasted padding space before it in ++ // the Value layout. + // +- // struct TaggedValue { +- // int type_; // size = 1, align = 4 +- // union { +- // bool bool_value_; // size = 1, align = 1 +- // int int_value_; // size = 4, align = 4 +- // double double_value_; // size = 8, align = 8 +- // std::string string_value_; // size = 12, align = 4 (32-bit) +- // }; +- // }; +- // +- // The end result is that the union will have an alignment of 8, and a size +- // of 16, due to 4 extra padding bytes following |string_value_| to respect +- // the alignment requirement. +- // +- // As a consequence, the struct TaggedValue will have a size of 24 bytes, +- // due to the size of the union (16), the size of |type_| (4) and 4 bytes +- // of padding between |type_| and the union to respect its alignment. +- // +- // This means 8 bytes of unused memory per instance on 32-bit ARM! +- // +- // To reclaim these, a union of structs is used instead, in order to ensure +- // that |double_value_| below is always located at an offset that is a +- // multiple of 8, relative to the start of the overall data structure. +- // +- // Each struct must declare its own |type_| field, which must have a different +- // name, to appease the C++ compiler. +- // +- // Using this technique sizeof(base::Value) == 16 on 32-bit ARM instead +- // of 24, without losing any information. Results are unchanged for x86, +- // x86_64 and arm64 (16, 32 and 32 bytes respectively). ++ // To override this, store the value as an array of 32-bit integers, and ++ // perform the appropriate bit casts when reading / writing to it. ++ Type type_ = Type::NONE; ++ + union { +- struct { +- // TODO(crbug.com/646113): Make these private once DictionaryValue and +- // ListValue are properly inlined. +- Type type_ : 8; +- }; +- struct { +- Type bool_type_ : 8; +- bool bool_value_; +- }; +- struct { +- Type int_type_ : 8; +- int int_value_; +- }; +- struct { +- Type double_type_ : 8; +- // Subtle: On architectures that require it, the compiler will ensure +- // that |double_value_|'s offset is a multiple of 8 (e.g. 32-bit ARM). +- // See technical note above to understand why it is important. +- double double_value_; +- }; +- struct { +- Type string_type_ : 8; +- std::string string_value_; +- }; +- struct { +- Type binary_type_ : 8; +- BlobStorage binary_value_; +- }; +- struct { +- Type dict_type_ : 8; +- DictStorage dict_; +- }; +- struct { +- Type list_type_ : 8; +- ListStorage list_; +- }; ++ bool bool_value_; ++ int int_value_; ++ DoubleStorage double_value_; ++ std::string string_value_; ++ BlobStorage binary_value_; ++ DictStorage dict_; ++ ListStorage list_; + }; + + private: + friend class ValuesTest_SizeOfValue_Test; ++ double AsDoubleInternal() const; + void InternalMoveConstructFrom(Value&& that); + void InternalCleanup(); + +diff --git a/base/values_unittest.cc b/base/values_unittest.cc +index 2dd1c76afaa9..f3536a8612b1 100644 +--- a/base/values_unittest.cc ++++ b/base/values_unittest.cc +@@ -26,45 +26,89 @@ + + namespace base { + +-// Test is currently incorrect on Windows x86. +-#if !defined(OS_WIN) || !defined(ARCH_CPU_X86) ++// Ensure that base::Value is as small as possible, i.e. that there is ++// no wasted space after the inner value due to alignment constraints. ++// Distinguish between the 'header' that includes |type_| and and the inner ++// value that follows it, which can be a bool, int, double, string, blob, list ++// or dict. ++// ++// This test is only enabled when NDEBUG is defined. This way the test will not ++// fail in debug builds that sometimes contain larger versions of the standard ++// containers used inside base::Value. ++#if defined(NDEBUG) ++ ++static size_t AlignSizeTo(size_t size, size_t alignment) { ++ EXPECT_TRUE((alignment & (alignment - 1)) == 0) ++ << "Alignment " << alignment << " is not a power of 2!"; ++ return (size + (alignment - 1u)) & ~(alignment - 1u); ++} ++ + TEST(ValuesTest, SizeOfValue) { +- // Ensure that base::Value is as small as possible, i.e. that there is +- // no wasted space after the inner value due to alignment constraints. +- // Distinguish between the 'header' that includes |type_| and and the inner +- // value that follows it, which can be a bool, int, double, string, blob, list +- // or dict. +-#define INNER_TYPES_LIST(X) \ +- X(bool, bool_value_) \ +- X(int, int_value_) \ +- X(double, double_value_) \ +- X(std::string, string_value_) \ +- X(Value::BlobStorage, binary_value_) \ +- X(Value::ListStorage, list_) \ ++#define INNER_TYPES_LIST(X) \ ++ X(bool, bool_value_) \ ++ X(int, int_value_) \ ++ X(Value::DoubleStorage, double_value_) \ ++ X(std::string, string_value_) \ ++ X(Value::BlobStorage, binary_value_) \ ++ X(Value::ListStorage, list_) \ + X(Value::DictStorage, dict_) + +-#define INNER_STRUCT_LIMIT(type, value) offsetof(Value, value) + sizeof(type), ++#define INNER_FIELD_ALIGNMENT(type, value) alignof(type), ++ ++ // The maximum alignment of each inner struct value field inside base::Value ++ size_t max_inner_value_alignment = ++ std::max({INNER_TYPES_LIST(INNER_FIELD_ALIGNMENT)}); ++ ++ // Check that base::Value has the smallest alignment possible. This would ++ // fail if the header would contain something that has a larger alignment ++ // than necessary. ++ EXPECT_EQ(max_inner_value_alignment, alignof(Value)); ++ ++ // Find the offset of each inner value. Which should normally not be ++ // larger than 4. Note that we use std::max(4, ...) because bool_value_ ++ // could be stored just after the |bool_type_| field, with an offset of ++ // 1, and that would be ok. ++#define INNER_VALUE_START_OFFSET(type, value) offsetof(Value, value), ++ ++ size_t min_inner_value_offset = ++ std::min({INNER_TYPES_LIST(INNER_VALUE_START_OFFSET)}); + +- // Return the maximum size in bytes of each inner struct inside base::Value +- size_t max_inner_struct_limit = +- std::max({INNER_TYPES_LIST(INNER_STRUCT_LIMIT)}); ++ // Inner fields may contain pointers, which have an alignment of 8 ++ // on most 64-bit platforms. ++ size_t expected_min_offset = alignof(void*); ++ ++ EXPECT_EQ(expected_min_offset, min_inner_value_offset); + + // Ensure that base::Value is not larger than necessary, i.e. that there is +- // no un-necessary padding afte the structs due to alignment constraints of ++ // no un-necessary padding after the structs due to alignment constraints of + // one of the inner fields. +- EXPECT_EQ(max_inner_struct_limit, sizeof(Value)); +- if (max_inner_struct_limit != sizeof(Value)) { ++#define INNER_STRUCT_END_OFFSET(type, value) \ ++ offsetof(Value, value) + sizeof(type), ++ ++ // The maximum size in bytes of each inner struct inside base::Value, ++ size_t max_inner_struct_end_offset = ++ std::max({INNER_TYPES_LIST(INNER_STRUCT_END_OFFSET)}); ++ ++ // The expected value size. ++ size_t expected_value_size = ++ AlignSizeTo(max_inner_struct_end_offset, alignof(Value)); ++ ++ EXPECT_EQ(expected_value_size, sizeof(Value)); ++ if (min_inner_value_offset != expected_min_offset || ++ expected_value_size != sizeof(Value)) { + // The following are useful to understand what's wrong when the EXPECT_EQ() +- // above actually fails. +-#define PRINT_INNER_FIELD_INFO(x, y) \ +- LOG(INFO) << #y " type=" #x " size=" << sizeof(x) << " align=" << alignof(x); ++ // above actually fail. ++#define PRINT_INNER_FIELD_INFO(x, y) \ ++ LOG(INFO) << #y " type=" #x " offset=" << offsetof(Value, y) \ ++ << " size=" << sizeof(x) << " align=" << alignof(x); + + LOG(INFO) << "Value size=" << sizeof(Value) << " align=" << alignof(Value); + INNER_TYPES_LIST(PRINT_INNER_FIELD_INFO) +- LOG(INFO) << "max_inner_struct_limit=" << max_inner_struct_limit; ++ LOG(INFO) << "max_inner_struct_end_offset=" << max_inner_struct_end_offset; + } + } +-#endif ++ ++#endif // NDEBUG + + TEST(ValuesTest, TestNothrow) { + static_assert(std::is_nothrow_move_constructible<Value>::value, +-- +2.20.1 + diff --git a/chromium/chromium/chromium-gcc8-r647382.patch b/chromium/chromium/chromium-gcc8-r647382.patch new file mode 100644 index 0000000..62efd00 --- /dev/null +++ b/chromium/chromium/chromium-gcc8-r647382.patch @@ -0,0 +1,42 @@ +From 7685422a90e1da829cb32d685a4b970d30738098 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz <jose.dapena@lge.com> +Date: Wed, 3 Apr 2019 18:35:04 +0000 +Subject: [PATCH] base: Value::Type enum class size should be 8-bit. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC is complaining because, when base::Type is used to declare the different +variants of Type in its union, they are forced to take 8-bit, that is smaller +than the enum class default size (same as int). + +So this change sets explicitely the enum class underlying type to be unsigned +char. + +BUG=chromium:819294 + +Change-Id: I1765e2503e2c3d3675c73ecb0f7f5bc33456e6f0 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1550366 +Commit-Queue: José Dapena Paz <jose.dapena@lge.com> +Reviewed-by: Jan Wilken Dörrie <jdoerrie@chromium.org> +Cr-Commit-Position: refs/heads/master@{#647382} +--- + base/values.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/base/values.h b/base/values.h +index c455936d4961..14b76acec02f 100644 +--- a/base/values.h ++++ b/base/values.h +@@ -86,7 +86,7 @@ class BASE_EXPORT Value { + // See technical note below explaining why this is used. + using DoubleStorage = struct { alignas(4) char v[sizeof(double)]; }; + +- enum class Type { ++ enum class Type : unsigned char { + NONE = 0, + BOOLEAN, + INTEGER, +-- +2.20.1 + diff --git a/chromium/chromium/chromium-nacl-llvm-ar.patch b/chromium/chromium/chromium-nacl-llvm-ar.patch index e3c7dfd..9b3f67c 100644 --- a/chromium/chromium/chromium-nacl-llvm-ar.patch +++ b/chromium/chromium/chromium-nacl-llvm-ar.patch @@ -1,8 +1,8 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index 68dc6a001a49..5f828d828464 100644 +index ca6ff2b13809..e96b04df99fe 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1695,7 +1695,7 @@ config("thin_archive") { +@@ -1708,7 +1708,7 @@ config("thin_archive") { # have a "thin archive" mode (it does accept -T, but it means truncating # archive names to 16 characters, which is not what we want). if ((is_posix && !is_nacl && !is_mac && !is_ios) || is_fuchsia) { @@ -12,10 +12,10 @@ index 68dc6a001a49..5f828d828464 100644 arflags = [ "/llvmlibthin" ] } diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni -index d3bf0ae004be..20be4a557ed3 100644 +index 7326a840dc58..01927b126d1b 100644 --- a/build/toolchain/gcc_toolchain.gni +++ b/build/toolchain/gcc_toolchain.gni -@@ -351,7 +351,7 @@ template("gcc_toolchain") { +@@ -377,7 +377,7 @@ template("gcc_toolchain") { } else { rspfile = "{{output}}.rsp" rspfile_content = "{{inputs}}" diff --git a/chromium/chromium/chromium.spec b/chromium/chromium/chromium.spec index ee18bb3..ed5b0a4 100644 --- a/chromium/chromium/chromium.spec +++ b/chromium/chromium/chromium.spec @@ -47,7 +47,7 @@ %bcond_with fedora_compilation_flags Name: chromium -Version: 73.0.3683.103 +Version: 74.0.3729.108 Release: 100%{?dist} Summary: A WebKit (Blink) powered web browser @@ -93,16 +93,13 @@ Patch50: chromium-nacl-llvm-ar.patch # https://src.fedoraproject.org/rpms/chromium/c/cb0be2c990fc724e Patch60: chromium-bootstrap-python2.patch -# Pull upstream patches from Gentoo -# https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a18dfb2bc7b05084 -# https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a4db4358f52de35 -Patch70: chromium-gcc8-r630084.patch -Patch71: chromium-gcc8-r630140.patch -Patch72: chromium-gcc8-r630249.patch -Patch73: chromium-gcc8-r630355.patch -Patch74: chromium-gcc8-r631472.patch -Patch75: chromium-gcc8-r631962.patch -Patch76: chromium-gcc8-r632385.patch +# Pull upstream patches +Patch70: chromium-gcc8-r641329.patch +Patch71: chromium-gcc8-r641404.patch +Patch72: chromium-gcc8-r642680.patch +Patch73: chromium-gcc8-r647271.patch +Patch74: chromium-gcc8-r647382.patch +Patch75: chromium-gcc8-cl1503254.patch # Pull patches from Fedora # https://src.fedoraproject.org/rpms/chromium/c/9071ee2d2f996b84 @@ -274,13 +271,16 @@ find -type f -exec \ third_party/crashpad/crashpad/third_party/zlib \ third_party/crc32c \ third_party/cros_system_api \ + third_party/dav1d \ third_party/devscripts \ third_party/dom_distiller_js \ + third_party/emoji-segmenter \ third_party/ffmpeg \ third_party/fips181 \ third_party/flatbuffers \ third_party/flot \ third_party/freetype \ + third_party/glslang \ third_party/google_input_tools \ third_party/google_input_tools/third_party/closure_library \ third_party/google_input_tools/third_party/closure_library/third_party/closure \ @@ -640,6 +640,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog +* Thu Apr 25 2019 - Ting-Wei Lan <lantw44@gmail.com> - 74.0.3729.108-100 +- Update to 74.0.3729.108 + * Sat Apr 06 2019 - Ting-Wei Lan <lantw44@gmail.com> - 73.0.3683.103-100 - Update to 73.0.3683.103 |