1 |
commit: 9705ddaaa8b993425ddf53c4c7122f013a4af198 |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 28 20:44:59 2019 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 28 20:44:59 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9705ddaa |
7 |
|
8 |
www-client/chromium: move large patches to DISTDIR |
9 |
|
10 |
Package-Manager: Portage-2.3.66_p2, Repoman-2.3.12_p111 |
11 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
12 |
|
13 |
www-client/chromium/Manifest | 2 + |
14 |
www-client/chromium/chromium-74.0.3729.169.ebuild | 9 +- |
15 |
.../chromium/files/chromium-74-2f28731.patch | 483 ----------------- |
16 |
.../chromium/files/chromium-74-e1b1f3a.patch | 587 --------------------- |
17 |
4 files changed, 8 insertions(+), 1073 deletions(-) |
18 |
|
19 |
diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest |
20 |
index 891c6691a42..7d963e3ba36 100644 |
21 |
--- a/www-client/chromium/Manifest |
22 |
+++ b/www-client/chromium/Manifest |
23 |
@@ -1,3 +1,5 @@ |
24 |
DIST chromium-73.0.3683.75.tar.xz 710439908 BLAKE2B 23ed7facf2f67e9bbfc2f1baf434892773d9d63dab10cebab350c3b0b2c75a07f84a4f677e01563a441cc3bae0d42212b3eb28b6d7c573b0137d25e478064a3b SHA512 52bd1dac782a2f7960eba48446d4dfc4c6c13c8e9de21bbee250fad2802beb222cff7bea9878c7338926030aa3aa7ffd2dd1238d35e261a0d766b2d9974fdaf6 |
25 |
DIST chromium-73.0.3683.86.tar.xz 710449412 BLAKE2B 87b4d15440e88be506920813a52e7a503ac81458aa3f2818490c28f6bb5cfc0ca24b316072e5a0664a8bfe6444be23e565579bc232cdfcef42acf8eeca9f216f SHA512 5dd450640c1ea30f7941231e8c459aec0312c18e089b2c8b9104c4ee835a8fa389f5fb9b301b46d87ce260956eaf3e3bd6aff6ae54c279a303aa757537cace15 |
26 |
+DIST chromium-74-2f28731.patch 18581 BLAKE2B 146f6375071a0e85501a7c666d13ecb7ee196a97c6dffb709f2049f219a66c2058b6b29777e3a3cef17272c29cbe38f6c273e03452dfc9a303abc90f539353f6 SHA512 9c3cce89715ea5d27531dc0f53afa25d00c2b73dfa24123680a7960e6784f09bb2accca495a8c2540a9b43204089cb203d92644f7633e758bf24603d207bafb7 |
27 |
+DIST chromium-74-e1b1f3a.patch 20750 BLAKE2B 327752fc232ed568ef494f40d97672ff79d304bbe979f70e98422ac18616004e1289470340657995a6959b34a38df310145e0947ee2d75aca6c55c7d5dd1647f SHA512 b7401e8577577dd1e00fe06cce6a18039a812e4ca08df633b4cb431a15873fbb033525a608a558aa68fed22f1e42c08a04cc01e2b750d750d7a63419eac8d19b |
28 |
DIST chromium-74.0.3729.169.tar.xz 749495820 BLAKE2B bfe485220239aad146eab0cd7bf158a20bccf03abe74457ea3933094c9fb200ff7a2e9db4a62fa1a736341ce8ee987520e20bd32e13e213435fd6724d15a7d85 SHA512 783558bbae43a928b7d9fe18717b63be432409c81aba0a38ccb14f38398d8681122bdd763db6d22b01363108253432ed203a86f8c9ba627247219bf1519f839b |
29 |
|
30 |
diff --git a/www-client/chromium/chromium-74.0.3729.169.ebuild b/www-client/chromium/chromium-74.0.3729.169.ebuild |
31 |
index fd1b3c28994..74328f3a342 100644 |
32 |
--- a/www-client/chromium/chromium-74.0.3729.169.ebuild |
33 |
+++ b/www-client/chromium/chromium-74.0.3729.169.ebuild |
34 |
@@ -12,7 +12,10 @@ inherit check-reqs chromium-2 desktop flag-o-matic multilib ninja-utils pax-util |
35 |
|
36 |
DESCRIPTION="Open-source version of Google Chrome web browser" |
37 |
HOMEPAGE="http://chromium.org/" |
38 |
-SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz" |
39 |
+SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz |
40 |
+ https://dev.gentoo.org/~floppym/dist/chromium-74-e1b1f3a.patch |
41 |
+ https://dev.gentoo.org/~floppym/dist/chromium-74-2f28731.patch |
42 |
+" |
43 |
|
44 |
LICENSE="BSD" |
45 |
SLOT="0" |
46 |
@@ -142,9 +145,9 @@ PATCHES=( |
47 |
"${FILESDIR}"/chromium-compiler-r8.patch |
48 |
"${FILESDIR}"/chromium-widevine-r4.patch |
49 |
"${FILESDIR}"/chromium-fix-char_traits.patch |
50 |
- "${FILESDIR}"/chromium-74-e1b1f3a.patch |
51 |
+ "${DISTDIR}"/chromium-74-e1b1f3a.patch |
52 |
"${FILESDIR}"/chromium-74-c2c467f.patch |
53 |
- "${FILESDIR}"/chromium-74-2f28731.patch |
54 |
+ "${DISTDIR}"/chromium-74-2f28731.patch |
55 |
"${FILESDIR}"/chromium-74-7685422.patch |
56 |
"${FILESDIR}"/quiche-00f47df.patch |
57 |
) |
58 |
|
59 |
diff --git a/www-client/chromium/files/chromium-74-2f28731.patch b/www-client/chromium/files/chromium-74-2f28731.patch |
60 |
deleted file mode 100644 |
61 |
index 83452619fe0..00000000000 |
62 |
--- a/www-client/chromium/files/chromium-74-2f28731.patch |
63 |
+++ /dev/null |
64 |
@@ -1,483 +0,0 @@ |
65 |
-From 2f28731c17b246bd70075f828dcafcd23547da5d Mon Sep 17 00:00:00 2001 |
66 |
-From: David 'Digit' Turner <digit@××××××.com> |
67 |
-Date: Wed, 3 Apr 2019 14:32:09 +0000 |
68 |
-Subject: [PATCH] base: Fix Value layout for GCC |
69 |
-MIME-Version: 1.0 |
70 |
-Content-Type: text/plain; charset=UTF-8 |
71 |
-Content-Transfer-Encoding: 8bit |
72 |
- |
73 |
-It turns out that the previous changes to the base::Value |
74 |
-layout broke GCC compilation (see [1] for details). |
75 |
- |
76 |
-This CL fixes the situation by using a new DoubleStorage |
77 |
-type that will store double values in a 4-byte aligned |
78 |
-struct, with bit_cast<> being used to convert between |
79 |
-double and DoubleStorage values in the implementation. |
80 |
- |
81 |
-This ensures that base::Value remains as small as possible |
82 |
-in all cases. The small penalty is that loading/storing |
83 |
-double values on 32-bit ARM is slightly slower due to |
84 |
-the fact that the value is no longer 8-byte aligned. |
85 |
- |
86 |
-+ Fix the ValuesTest.SizeOfValue test to work correctly, |
87 |
- and disable it for debug builds, so it doesn't fail |
88 |
- because debug versions of the internal containers |
89 |
- are larger on certain systems. |
90 |
- |
91 |
-[1] https://chromium-review.googlesource.com/c/chromium/src/+/1472716 |
92 |
- |
93 |
-BUG=646113 |
94 |
-R=dcheng@××××××××.org, pasko@××××××××.org, lizeb@××××××××.org, jdoerrie@××××××××.org, jose.dapena@×××.com |
95 |
- |
96 |
-Change-Id: I9a365407dc064ba1bdc19859706f4154a495921e |
97 |
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1550363 |
98 |
-Commit-Queue: David Turner <digit@××××××××.org> |
99 |
-Reviewed-by: Jan Wilken Dörrie <jdoerrie@××××××××.org> |
100 |
-Cr-Commit-Position: refs/heads/master@{#647271} |
101 |
---- |
102 |
- base/values.cc | 67 +++++++++++++--------------- |
103 |
- base/values.h | 94 ++++++++++------------------------------ |
104 |
- base/values_unittest.cc | 96 ++++++++++++++++++++++++++++++----------- |
105 |
- 3 files changed, 124 insertions(+), 133 deletions(-) |
106 |
- |
107 |
-diff --git a/base/values.cc b/base/values.cc |
108 |
-index 9fed5b52d60e..16d686b0bee5 100644 |
109 |
---- a/base/values.cc |
110 |
-+++ b/base/values.cc |
111 |
-@@ -12,6 +12,7 @@ |
112 |
- #include <ostream> |
113 |
- #include <utility> |
114 |
- |
115 |
-+#include "base/bit_cast.h" |
116 |
- #include "base/json/json_writer.h" |
117 |
- #include "base/logging.h" |
118 |
- #include "base/memory/ptr_util.h" |
119 |
-@@ -36,6 +37,9 @@ static_assert(std::is_standard_layout<Value>::value, |
120 |
- "base::Value should be a standard-layout C++ class in order " |
121 |
- "to avoid undefined behaviour in its implementation!"); |
122 |
- |
123 |
-+static_assert(sizeof(Value::DoubleStorage) == sizeof(double), |
124 |
-+ "The double and DoubleStorage types should have the same size"); |
125 |
-+ |
126 |
- namespace { |
127 |
- |
128 |
- const char* const kTypeNames[] = {"null", "boolean", "integer", "double", |
129 |
-@@ -110,8 +114,6 @@ Value::Value(Value&& that) noexcept { |
130 |
- InternalMoveConstructFrom(std::move(that)); |
131 |
- } |
132 |
- |
133 |
--Value::Value() noexcept : type_(Type::NONE) {} |
134 |
-- |
135 |
- Value::Value(Type type) : type_(type) { |
136 |
- // Initialize with the default value. |
137 |
- switch (type_) { |
138 |
-@@ -125,7 +127,7 @@ Value::Value(Type type) : type_(type) { |
139 |
- int_value_ = 0; |
140 |
- return; |
141 |
- case Type::DOUBLE: |
142 |
-- double_value_ = 0.0; |
143 |
-+ double_value_ = bit_cast<DoubleStorage>(0.0); |
144 |
- return; |
145 |
- case Type::STRING: |
146 |
- new (&string_value_) std::string(); |
147 |
-@@ -149,21 +151,16 @@ Value::Value(Type type) : type_(type) { |
148 |
- CHECK(false); |
149 |
- } |
150 |
- |
151 |
--Value::Value(bool in_bool) |
152 |
-- : bool_type_(Type::BOOLEAN), |
153 |
-- bool_value_(in_bool) {} |
154 |
-+Value::Value(bool in_bool) : type_(Type::BOOLEAN), bool_value_(in_bool) {} |
155 |
- |
156 |
--Value::Value(int in_int) |
157 |
-- : int_type_(Type::INTEGER), |
158 |
-- int_value_(in_int) {} |
159 |
-+Value::Value(int in_int) : type_(Type::INTEGER), int_value_(in_int) {} |
160 |
- |
161 |
- Value::Value(double in_double) |
162 |
-- : double_type_(Type::DOUBLE), |
163 |
-- double_value_(in_double) { |
164 |
-- if (!std::isfinite(double_value_)) { |
165 |
-+ : type_(Type::DOUBLE), double_value_(bit_cast<DoubleStorage>(in_double)) { |
166 |
-+ if (!std::isfinite(in_double)) { |
167 |
- NOTREACHED() << "Non-finite (i.e. NaN or positive/negative infinity) " |
168 |
- << "values cannot be represented in JSON"; |
169 |
-- double_value_ = 0.0; |
170 |
-+ double_value_ = bit_cast<DoubleStorage>(0.0); |
171 |
- } |
172 |
- } |
173 |
- |
174 |
-@@ -172,8 +169,7 @@ Value::Value(const char* in_string) : Value(std::string(in_string)) {} |
175 |
- Value::Value(StringPiece in_string) : Value(std::string(in_string)) {} |
176 |
- |
177 |
- Value::Value(std::string&& in_string) noexcept |
178 |
-- : string_type_(Type::STRING), |
179 |
-- string_value_(std::move(in_string)) { |
180 |
-+ : type_(Type::STRING), string_value_(std::move(in_string)) { |
181 |
- DCHECK(IsStringUTF8(string_value_)); |
182 |
- } |
183 |
- |
184 |
-@@ -182,19 +178,15 @@ Value::Value(const char16* in_string16) : Value(StringPiece16(in_string16)) {} |
185 |
- Value::Value(StringPiece16 in_string16) : Value(UTF16ToUTF8(in_string16)) {} |
186 |
- |
187 |
- Value::Value(const std::vector<char>& in_blob) |
188 |
-- : binary_type_(Type::BINARY), |
189 |
-- binary_value_(in_blob.begin(), in_blob.end()) {} |
190 |
-+ : type_(Type::BINARY), binary_value_(in_blob.begin(), in_blob.end()) {} |
191 |
- |
192 |
- Value::Value(base::span<const uint8_t> in_blob) |
193 |
-- : binary_type_(Type::BINARY), |
194 |
-- binary_value_(in_blob.begin(), in_blob.end()) {} |
195 |
-+ : type_(Type::BINARY), binary_value_(in_blob.begin(), in_blob.end()) {} |
196 |
- |
197 |
- Value::Value(BlobStorage&& in_blob) noexcept |
198 |
-- : binary_type_(Type::BINARY), |
199 |
-- binary_value_(std::move(in_blob)) {} |
200 |
-+ : type_(Type::BINARY), binary_value_(std::move(in_blob)) {} |
201 |
- |
202 |
--Value::Value(const DictStorage& in_dict) |
203 |
-- : dict_type_(Type::DICTIONARY), dict_() { |
204 |
-+Value::Value(const DictStorage& in_dict) : type_(Type::DICTIONARY), dict_() { |
205 |
- dict_.reserve(in_dict.size()); |
206 |
- for (const auto& it : in_dict) { |
207 |
- dict_.try_emplace(dict_.end(), it.first, |
208 |
-@@ -203,18 +195,16 @@ Value::Value(const DictStorage& in_dict) |
209 |
- } |
210 |
- |
211 |
- Value::Value(DictStorage&& in_dict) noexcept |
212 |
-- : dict_type_(Type::DICTIONARY), |
213 |
-- dict_(std::move(in_dict)) {} |
214 |
-+ : type_(Type::DICTIONARY), dict_(std::move(in_dict)) {} |
215 |
- |
216 |
--Value::Value(const ListStorage& in_list) : list_type_(Type::LIST), list_() { |
217 |
-+Value::Value(const ListStorage& in_list) : type_(Type::LIST), list_() { |
218 |
- list_.reserve(in_list.size()); |
219 |
- for (const auto& val : in_list) |
220 |
- list_.emplace_back(val.Clone()); |
221 |
- } |
222 |
- |
223 |
- Value::Value(ListStorage&& in_list) noexcept |
224 |
-- : list_type_(Type::LIST), |
225 |
-- list_(std::move(in_list)) {} |
226 |
-+ : type_(Type::LIST), list_(std::move(in_list)) {} |
227 |
- |
228 |
- Value& Value::operator=(Value&& that) noexcept { |
229 |
- InternalCleanup(); |
230 |
-@@ -223,6 +213,10 @@ Value& Value::operator=(Value&& that) noexcept { |
231 |
- return *this; |
232 |
- } |
233 |
- |
234 |
-+double Value::AsDoubleInternal() const { |
235 |
-+ return bit_cast<double>(double_value_); |
236 |
-+} |
237 |
-+ |
238 |
- Value Value::Clone() const { |
239 |
- switch (type_) { |
240 |
- case Type::NONE: |
241 |
-@@ -232,7 +226,7 @@ Value Value::Clone() const { |
242 |
- case Type::INTEGER: |
243 |
- return Value(int_value_); |
244 |
- case Type::DOUBLE: |
245 |
-- return Value(double_value_); |
246 |
-+ return Value(AsDoubleInternal()); |
247 |
- case Type::STRING: |
248 |
- return Value(string_value_); |
249 |
- case Type::BINARY: |
250 |
-@@ -277,7 +271,7 @@ int Value::GetInt() const { |
251 |
- |
252 |
- double Value::GetDouble() const { |
253 |
- if (is_double()) |
254 |
-- return double_value_; |
255 |
-+ return AsDoubleInternal(); |
256 |
- if (is_int()) |
257 |
- return int_value_; |
258 |
- CHECK(false); |
259 |
-@@ -342,9 +336,10 @@ base::Optional<double> Value::FindDoubleKey(StringPiece key) const { |
260 |
- const Value* result = FindKey(key); |
261 |
- if (result) { |
262 |
- if (result->is_int()) |
263 |
-- return base::make_optional(static_cast<double>(result->int_value_)); |
264 |
-- if (result->is_double()) |
265 |
-- return base::make_optional(result->double_value_); |
266 |
-+ return static_cast<double>(result->int_value_); |
267 |
-+ if (result->is_double()) { |
268 |
-+ return result->AsDoubleInternal(); |
269 |
-+ } |
270 |
- } |
271 |
- return base::nullopt; |
272 |
- } |
273 |
-@@ -601,7 +596,7 @@ bool Value::GetAsInteger(int* out_value) const { |
274 |
- |
275 |
- bool Value::GetAsDouble(double* out_value) const { |
276 |
- if (out_value && is_double()) { |
277 |
-- *out_value = double_value_; |
278 |
-+ *out_value = AsDoubleInternal(); |
279 |
- return true; |
280 |
- } |
281 |
- if (out_value && is_int()) { |
282 |
-@@ -696,7 +691,7 @@ bool operator==(const Value& lhs, const Value& rhs) { |
283 |
- case Value::Type::INTEGER: |
284 |
- return lhs.int_value_ == rhs.int_value_; |
285 |
- case Value::Type::DOUBLE: |
286 |
-- return lhs.double_value_ == rhs.double_value_; |
287 |
-+ return lhs.AsDoubleInternal() == rhs.AsDoubleInternal(); |
288 |
- case Value::Type::STRING: |
289 |
- return lhs.string_value_ == rhs.string_value_; |
290 |
- case Value::Type::BINARY: |
291 |
-@@ -741,7 +736,7 @@ bool operator<(const Value& lhs, const Value& rhs) { |
292 |
- case Value::Type::INTEGER: |
293 |
- return lhs.int_value_ < rhs.int_value_; |
294 |
- case Value::Type::DOUBLE: |
295 |
-- return lhs.double_value_ < rhs.double_value_; |
296 |
-+ return lhs.AsDoubleInternal() < rhs.AsDoubleInternal(); |
297 |
- case Value::Type::STRING: |
298 |
- return lhs.string_value_ < rhs.string_value_; |
299 |
- case Value::Type::BINARY: |
300 |
-diff --git a/base/values.h b/base/values.h |
301 |
-index 486fe7ff3976..c455936d4961 100644 |
302 |
---- a/base/values.h |
303 |
-+++ b/base/values.h |
304 |
-@@ -83,6 +83,8 @@ class BASE_EXPORT Value { |
305 |
- using BlobStorage = std::vector<uint8_t>; |
306 |
- using DictStorage = flat_map<std::string, std::unique_ptr<Value>>; |
307 |
- using ListStorage = std::vector<Value>; |
308 |
-+ // See technical note below explaining why this is used. |
309 |
-+ using DoubleStorage = struct { alignas(4) char v[sizeof(double)]; }; |
310 |
- |
311 |
- enum class Type { |
312 |
- NONE = 0, |
313 |
-@@ -111,7 +113,10 @@ class BASE_EXPORT Value { |
314 |
- static std::unique_ptr<Value> ToUniquePtrValue(Value val); |
315 |
- |
316 |
- Value(Value&& that) noexcept; |
317 |
-- Value() noexcept; // A null value. |
318 |
-+ Value() noexcept {} // A null value |
319 |
-+ // Fun fact: using '= default' above instead of '{}' does not work because |
320 |
-+ // the compiler complains that the default constructor was deleted since |
321 |
-+ // the inner union contains fields with non-default constructors. |
322 |
- |
323 |
- // Value's copy constructor and copy assignment operator are deleted. Use this |
324 |
- // to obtain a deep copy explicitly. |
325 |
-@@ -405,82 +410,29 @@ class BASE_EXPORT Value { |
326 |
- size_t EstimateMemoryUsage() const; |
327 |
- |
328 |
- protected: |
329 |
-- // Technical note: |
330 |
-- // The naive way to implement a tagged union leads to wasted bytes |
331 |
-- // in the object on CPUs like ARM ones, which impose an 8-byte alignment |
332 |
-- // for double values. I.e. if one does something like: |
333 |
-+ // Special case for doubles, which are aligned to 8 bytes on some |
334 |
-+ // 32-bit architectures. In this case, a simple declaration as a |
335 |
-+ // double member would make the whole union 8 byte-aligned, which |
336 |
-+ // would also force 4 bytes of wasted padding space before it in |
337 |
-+ // the Value layout. |
338 |
- // |
339 |
-- // struct TaggedValue { |
340 |
-- // int type_; // size = 1, align = 4 |
341 |
-- // union { |
342 |
-- // bool bool_value_; // size = 1, align = 1 |
343 |
-- // int int_value_; // size = 4, align = 4 |
344 |
-- // double double_value_; // size = 8, align = 8 |
345 |
-- // std::string string_value_; // size = 12, align = 4 (32-bit) |
346 |
-- // }; |
347 |
-- // }; |
348 |
-- // |
349 |
-- // The end result is that the union will have an alignment of 8, and a size |
350 |
-- // of 16, due to 4 extra padding bytes following |string_value_| to respect |
351 |
-- // the alignment requirement. |
352 |
-- // |
353 |
-- // As a consequence, the struct TaggedValue will have a size of 24 bytes, |
354 |
-- // due to the size of the union (16), the size of |type_| (4) and 4 bytes |
355 |
-- // of padding between |type_| and the union to respect its alignment. |
356 |
-- // |
357 |
-- // This means 8 bytes of unused memory per instance on 32-bit ARM! |
358 |
-- // |
359 |
-- // To reclaim these, a union of structs is used instead, in order to ensure |
360 |
-- // that |double_value_| below is always located at an offset that is a |
361 |
-- // multiple of 8, relative to the start of the overall data structure. |
362 |
-- // |
363 |
-- // Each struct must declare its own |type_| field, which must have a different |
364 |
-- // name, to appease the C++ compiler. |
365 |
-- // |
366 |
-- // Using this technique sizeof(base::Value) == 16 on 32-bit ARM instead |
367 |
-- // of 24, without losing any information. Results are unchanged for x86, |
368 |
-- // x86_64 and arm64 (16, 32 and 32 bytes respectively). |
369 |
-+ // To override this, store the value as an array of 32-bit integers, and |
370 |
-+ // perform the appropriate bit casts when reading / writing to it. |
371 |
-+ Type type_ = Type::NONE; |
372 |
-+ |
373 |
- union { |
374 |
-- struct { |
375 |
-- // TODO(crbug.com/646113): Make these private once DictionaryValue and |
376 |
-- // ListValue are properly inlined. |
377 |
-- Type type_ : 8; |
378 |
-- }; |
379 |
-- struct { |
380 |
-- Type bool_type_ : 8; |
381 |
-- bool bool_value_; |
382 |
-- }; |
383 |
-- struct { |
384 |
-- Type int_type_ : 8; |
385 |
-- int int_value_; |
386 |
-- }; |
387 |
-- struct { |
388 |
-- Type double_type_ : 8; |
389 |
-- // Subtle: On architectures that require it, the compiler will ensure |
390 |
-- // that |double_value_|'s offset is a multiple of 8 (e.g. 32-bit ARM). |
391 |
-- // See technical note above to understand why it is important. |
392 |
-- double double_value_; |
393 |
-- }; |
394 |
-- struct { |
395 |
-- Type string_type_ : 8; |
396 |
-- std::string string_value_; |
397 |
-- }; |
398 |
-- struct { |
399 |
-- Type binary_type_ : 8; |
400 |
-- BlobStorage binary_value_; |
401 |
-- }; |
402 |
-- struct { |
403 |
-- Type dict_type_ : 8; |
404 |
-- DictStorage dict_; |
405 |
-- }; |
406 |
-- struct { |
407 |
-- Type list_type_ : 8; |
408 |
-- ListStorage list_; |
409 |
-- }; |
410 |
-+ bool bool_value_; |
411 |
-+ int int_value_; |
412 |
-+ DoubleStorage double_value_; |
413 |
-+ std::string string_value_; |
414 |
-+ BlobStorage binary_value_; |
415 |
-+ DictStorage dict_; |
416 |
-+ ListStorage list_; |
417 |
- }; |
418 |
- |
419 |
- private: |
420 |
- friend class ValuesTest_SizeOfValue_Test; |
421 |
-+ double AsDoubleInternal() const; |
422 |
- void InternalMoveConstructFrom(Value&& that); |
423 |
- void InternalCleanup(); |
424 |
- |
425 |
-diff --git a/base/values_unittest.cc b/base/values_unittest.cc |
426 |
-index 2dd1c76afaa9..f3536a8612b1 100644 |
427 |
---- a/base/values_unittest.cc |
428 |
-+++ b/base/values_unittest.cc |
429 |
-@@ -26,45 +26,89 @@ |
430 |
- |
431 |
- namespace base { |
432 |
- |
433 |
--// Test is currently incorrect on Windows x86. |
434 |
--#if !defined(OS_WIN) || !defined(ARCH_CPU_X86) |
435 |
-+// Ensure that base::Value is as small as possible, i.e. that there is |
436 |
-+// no wasted space after the inner value due to alignment constraints. |
437 |
-+// Distinguish between the 'header' that includes |type_| and and the inner |
438 |
-+// value that follows it, which can be a bool, int, double, string, blob, list |
439 |
-+// or dict. |
440 |
-+// |
441 |
-+// This test is only enabled when NDEBUG is defined. This way the test will not |
442 |
-+// fail in debug builds that sometimes contain larger versions of the standard |
443 |
-+// containers used inside base::Value. |
444 |
-+#if defined(NDEBUG) |
445 |
-+ |
446 |
-+static size_t AlignSizeTo(size_t size, size_t alignment) { |
447 |
-+ EXPECT_TRUE((alignment & (alignment - 1)) == 0) |
448 |
-+ << "Alignment " << alignment << " is not a power of 2!"; |
449 |
-+ return (size + (alignment - 1u)) & ~(alignment - 1u); |
450 |
-+} |
451 |
-+ |
452 |
- TEST(ValuesTest, SizeOfValue) { |
453 |
-- // Ensure that base::Value is as small as possible, i.e. that there is |
454 |
-- // no wasted space after the inner value due to alignment constraints. |
455 |
-- // Distinguish between the 'header' that includes |type_| and and the inner |
456 |
-- // value that follows it, which can be a bool, int, double, string, blob, list |
457 |
-- // or dict. |
458 |
--#define INNER_TYPES_LIST(X) \ |
459 |
-- X(bool, bool_value_) \ |
460 |
-- X(int, int_value_) \ |
461 |
-- X(double, double_value_) \ |
462 |
-- X(std::string, string_value_) \ |
463 |
-- X(Value::BlobStorage, binary_value_) \ |
464 |
-- X(Value::ListStorage, list_) \ |
465 |
-+#define INNER_TYPES_LIST(X) \ |
466 |
-+ X(bool, bool_value_) \ |
467 |
-+ X(int, int_value_) \ |
468 |
-+ X(Value::DoubleStorage, double_value_) \ |
469 |
-+ X(std::string, string_value_) \ |
470 |
-+ X(Value::BlobStorage, binary_value_) \ |
471 |
-+ X(Value::ListStorage, list_) \ |
472 |
- X(Value::DictStorage, dict_) |
473 |
- |
474 |
--#define INNER_STRUCT_LIMIT(type, value) offsetof(Value, value) + sizeof(type), |
475 |
-+#define INNER_FIELD_ALIGNMENT(type, value) alignof(type), |
476 |
-+ |
477 |
-+ // The maximum alignment of each inner struct value field inside base::Value |
478 |
-+ size_t max_inner_value_alignment = |
479 |
-+ std::max({INNER_TYPES_LIST(INNER_FIELD_ALIGNMENT)}); |
480 |
-+ |
481 |
-+ // Check that base::Value has the smallest alignment possible. This would |
482 |
-+ // fail if the header would contain something that has a larger alignment |
483 |
-+ // than necessary. |
484 |
-+ EXPECT_EQ(max_inner_value_alignment, alignof(Value)); |
485 |
-+ |
486 |
-+ // Find the offset of each inner value. Which should normally not be |
487 |
-+ // larger than 4. Note that we use std::max(4, ...) because bool_value_ |
488 |
-+ // could be stored just after the |bool_type_| field, with an offset of |
489 |
-+ // 1, and that would be ok. |
490 |
-+#define INNER_VALUE_START_OFFSET(type, value) offsetof(Value, value), |
491 |
-+ |
492 |
-+ size_t min_inner_value_offset = |
493 |
-+ std::min({INNER_TYPES_LIST(INNER_VALUE_START_OFFSET)}); |
494 |
- |
495 |
-- // Return the maximum size in bytes of each inner struct inside base::Value |
496 |
-- size_t max_inner_struct_limit = |
497 |
-- std::max({INNER_TYPES_LIST(INNER_STRUCT_LIMIT)}); |
498 |
-+ // Inner fields may contain pointers, which have an alignment of 8 |
499 |
-+ // on most 64-bit platforms. |
500 |
-+ size_t expected_min_offset = alignof(void*); |
501 |
-+ |
502 |
-+ EXPECT_EQ(expected_min_offset, min_inner_value_offset); |
503 |
- |
504 |
- // Ensure that base::Value is not larger than necessary, i.e. that there is |
505 |
-- // no un-necessary padding afte the structs due to alignment constraints of |
506 |
-+ // no un-necessary padding after the structs due to alignment constraints of |
507 |
- // one of the inner fields. |
508 |
-- EXPECT_EQ(max_inner_struct_limit, sizeof(Value)); |
509 |
-- if (max_inner_struct_limit != sizeof(Value)) { |
510 |
-+#define INNER_STRUCT_END_OFFSET(type, value) \ |
511 |
-+ offsetof(Value, value) + sizeof(type), |
512 |
-+ |
513 |
-+ // The maximum size in bytes of each inner struct inside base::Value, |
514 |
-+ size_t max_inner_struct_end_offset = |
515 |
-+ std::max({INNER_TYPES_LIST(INNER_STRUCT_END_OFFSET)}); |
516 |
-+ |
517 |
-+ // The expected value size. |
518 |
-+ size_t expected_value_size = |
519 |
-+ AlignSizeTo(max_inner_struct_end_offset, alignof(Value)); |
520 |
-+ |
521 |
-+ EXPECT_EQ(expected_value_size, sizeof(Value)); |
522 |
-+ if (min_inner_value_offset != expected_min_offset || |
523 |
-+ expected_value_size != sizeof(Value)) { |
524 |
- // The following are useful to understand what's wrong when the EXPECT_EQ() |
525 |
-- // above actually fails. |
526 |
--#define PRINT_INNER_FIELD_INFO(x, y) \ |
527 |
-- LOG(INFO) << #y " type=" #x " size=" << sizeof(x) << " align=" << alignof(x); |
528 |
-+ // above actually fail. |
529 |
-+#define PRINT_INNER_FIELD_INFO(x, y) \ |
530 |
-+ LOG(INFO) << #y " type=" #x " offset=" << offsetof(Value, y) \ |
531 |
-+ << " size=" << sizeof(x) << " align=" << alignof(x); |
532 |
- |
533 |
- LOG(INFO) << "Value size=" << sizeof(Value) << " align=" << alignof(Value); |
534 |
- INNER_TYPES_LIST(PRINT_INNER_FIELD_INFO) |
535 |
-- LOG(INFO) << "max_inner_struct_limit=" << max_inner_struct_limit; |
536 |
-+ LOG(INFO) << "max_inner_struct_end_offset=" << max_inner_struct_end_offset; |
537 |
- } |
538 |
- } |
539 |
--#endif |
540 |
-+ |
541 |
-+#endif // NDEBUG |
542 |
- |
543 |
- TEST(ValuesTest, TestNothrow) { |
544 |
- static_assert(std::is_nothrow_move_constructible<Value>::value, |
545 |
--- |
546 |
-2.21.0 |
547 |
- |
548 |
|
549 |
diff --git a/www-client/chromium/files/chromium-74-e1b1f3a.patch b/www-client/chromium/files/chromium-74-e1b1f3a.patch |
550 |
deleted file mode 100644 |
551 |
index 344b0874b81..00000000000 |
552 |
--- a/www-client/chromium/files/chromium-74-e1b1f3a.patch |
553 |
+++ /dev/null |
554 |
@@ -1,587 +0,0 @@ |
555 |
-From e1b1f3a5f273c8da533fad495b9de316e2c83c9b Mon Sep 17 00:00:00 2001 |
556 |
-From: jdoerrie <jdoerrie@××××××××.org> |
557 |
-Date: Sat, 16 Mar 2019 04:08:01 +0000 |
558 |
-Subject: [PATCH] [base] Add Dead Type to base::Value |
559 |
- |
560 |
-This change adds a temporary DEAD type to base::Value which should help |
561 |
-to track down use-after-free bugs. Furthermore, this change also removes |
562 |
-the now unneeded is_alive_ flag. |
563 |
- |
564 |
-Bug: 859477, 941404 |
565 |
-Change-Id: I9b7a2f3cbb0b22d7e3ed35b2453537419f3f7e55 |
566 |
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1478897 |
567 |
-Reviewed-by: Pavol Marko <pmarko@××××××××.org> |
568 |
-Reviewed-by: Tao Bai <michaelbai@××××××××.org> |
569 |
-Reviewed-by: Thomas Anderson <thomasanderson@××××××××.org> |
570 |
-Reviewed-by: Mike Pinkerton <pinkerton@××××××××.org> |
571 |
-Reviewed-by: Bill Budge <bbudge@××××××××.org> |
572 |
-Reviewed-by: Ken Rockot <rockot@××××××.com> |
573 |
-Reviewed-by: Steven Bennetts <stevenjb@××××××××.org> |
574 |
-Reviewed-by: Daniel Cheng <dcheng@××××××××.org> |
575 |
-Reviewed-by: David Turner <digit@××××××××.org> |
576 |
-Commit-Queue: Thomas Anderson <thomasanderson@××××××××.org> |
577 |
-Cr-Commit-Position: refs/heads/master@{#641404} |
578 |
---- |
579 |
- base/json/json_writer.cc | 5 ++ |
580 |
- base/values.cc | 68 ++++++++++++------- |
581 |
- base/values.h | 23 ++----- |
582 |
- base/values_unittest.cc | 10 ++- |
583 |
- .../ui/cocoa/applescript/apple_event_util.mm | 10 +++ |
584 |
- chromeos/network/onc/variable_expander.cc | 6 ++ |
585 |
- .../core/browser/android/policy_converter.cc | 11 ++- |
586 |
- .../core/common/policy_loader_win_unittest.cc | 8 ++- |
587 |
- .../policy/core/common/policy_test_utils.cc | 5 ++ |
588 |
- .../policy/core/common/registry_dict.cc | 4 ++ |
589 |
- .../gin_java_script_to_java_types_coercion.cc | 8 ++- |
590 |
- ipc/ipc_message_utils.cc | 11 ++- |
591 |
- mojo/public/cpp/base/values_mojom_traits.h | 7 +- |
592 |
- .../ppb_x509_certificate_private_shared.cc | 2 + |
593 |
- 14 files changed, 127 insertions(+), 51 deletions(-) |
594 |
- |
595 |
-diff --git a/base/json/json_writer.cc b/base/json/json_writer.cc |
596 |
-index 376a459f9a46..cd020e7fa0c0 100644 |
597 |
---- a/base/json/json_writer.cc |
598 |
-+++ b/base/json/json_writer.cc |
599 |
-@@ -179,6 +179,11 @@ bool JSONWriter::BuildJSONString(const Value& node, size_t depth) { |
600 |
- // Successful only if we're allowed to omit it. |
601 |
- DLOG_IF(ERROR, !omit_binary_values_) << "Cannot serialize binary value."; |
602 |
- return omit_binary_values_; |
603 |
-+ |
604 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
605 |
-+ case Value::Type::DEAD: |
606 |
-+ CHECK(false); |
607 |
-+ return false; |
608 |
- } |
609 |
- |
610 |
- // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. |
611 |
-diff --git a/base/values.cc b/base/values.cc |
612 |
-index 0c002551b317..035aa2350cde 100644 |
613 |
---- a/base/values.cc |
614 |
-+++ b/base/values.cc |
615 |
-@@ -90,8 +90,6 @@ std::unique_ptr<Value> CopyWithoutEmptyChildren(const Value& node) { |
616 |
- |
617 |
- } // namespace |
618 |
- |
619 |
--constexpr uint16_t Value::kMagicIsAlive; |
620 |
-- |
621 |
- // static |
622 |
- std::unique_ptr<Value> Value::CreateWithCopiedBuffer(const char* buffer, |
623 |
- size_t size) { |
624 |
-@@ -112,9 +110,9 @@ Value::Value(Value&& that) noexcept { |
625 |
- InternalMoveConstructFrom(std::move(that)); |
626 |
- } |
627 |
- |
628 |
--Value::Value() noexcept : type_(Type::NONE), is_alive_(kMagicIsAlive) {} |
629 |
-+Value::Value() noexcept : type_(Type::NONE) {} |
630 |
- |
631 |
--Value::Value(Type type) : type_(type), is_alive_(kMagicIsAlive) { |
632 |
-+Value::Value(Type type) : type_(type) { |
633 |
- // Initialize with the default value. |
634 |
- switch (type_) { |
635 |
- case Type::NONE: |
636 |
-@@ -141,22 +139,26 @@ Value::Value(Type type) : type_(type), is_alive_(kMagicIsAlive) { |
637 |
- case Type::LIST: |
638 |
- new (&list_) ListStorage(); |
639 |
- return; |
640 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
641 |
-+ case Type::DEAD: |
642 |
-+ CHECK(false); |
643 |
-+ return; |
644 |
- } |
645 |
-+ |
646 |
-+ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. |
647 |
-+ CHECK(false); |
648 |
- } |
649 |
- |
650 |
- Value::Value(bool in_bool) |
651 |
- : bool_type_(Type::BOOLEAN), |
652 |
-- bool_is_alive_(kMagicIsAlive), |
653 |
- bool_value_(in_bool) {} |
654 |
- |
655 |
- Value::Value(int in_int) |
656 |
- : int_type_(Type::INTEGER), |
657 |
-- int_is_alive_(kMagicIsAlive), |
658 |
- int_value_(in_int) {} |
659 |
- |
660 |
- Value::Value(double in_double) |
661 |
- : double_type_(Type::DOUBLE), |
662 |
-- double_is_alive_(kMagicIsAlive), |
663 |
- double_value_(in_double) { |
664 |
- if (!std::isfinite(double_value_)) { |
665 |
- NOTREACHED() << "Non-finite (i.e. NaN or positive/negative infinity) " |
666 |
-@@ -171,7 +173,6 @@ Value::Value(StringPiece in_string) : Value(std::string(in_string)) {} |
667 |
- |
668 |
- Value::Value(std::string&& in_string) noexcept |
669 |
- : string_type_(Type::STRING), |
670 |
-- string_is_alive_(kMagicIsAlive), |
671 |
- string_value_(std::move(in_string)) { |
672 |
- DCHECK(IsStringUTF8(string_value_)); |
673 |
- } |
674 |
-@@ -182,21 +183,18 @@ Value::Value(StringPiece16 in_string16) : Value(UTF16ToUTF8(in_string16)) {} |
675 |
- |
676 |
- Value::Value(const std::vector<char>& in_blob) |
677 |
- : binary_type_(Type::BINARY), |
678 |
-- binary_is_alive_(kMagicIsAlive), |
679 |
- binary_value_(in_blob.begin(), in_blob.end()) {} |
680 |
- |
681 |
- Value::Value(base::span<const uint8_t> in_blob) |
682 |
- : binary_type_(Type::BINARY), |
683 |
-- binary_is_alive_(kMagicIsAlive), |
684 |
- binary_value_(in_blob.begin(), in_blob.end()) {} |
685 |
- |
686 |
- Value::Value(BlobStorage&& in_blob) noexcept |
687 |
- : binary_type_(Type::BINARY), |
688 |
-- binary_is_alive_(kMagicIsAlive), |
689 |
- binary_value_(std::move(in_blob)) {} |
690 |
- |
691 |
- Value::Value(const DictStorage& in_dict) |
692 |
-- : dict_type_(Type::DICTIONARY), dict_is_alive_(kMagicIsAlive), dict_() { |
693 |
-+ : dict_type_(Type::DICTIONARY), dict_() { |
694 |
- dict_.reserve(in_dict.size()); |
695 |
- for (const auto& it : in_dict) { |
696 |
- dict_.try_emplace(dict_.end(), it.first, |
697 |
-@@ -206,11 +204,9 @@ Value::Value(const DictStorage& in_dict) |
698 |
- |
699 |
- Value::Value(DictStorage&& in_dict) noexcept |
700 |
- : dict_type_(Type::DICTIONARY), |
701 |
-- dict_is_alive_(kMagicIsAlive), |
702 |
- dict_(std::move(in_dict)) {} |
703 |
- |
704 |
--Value::Value(const ListStorage& in_list) |
705 |
-- : list_type_(Type::LIST), list_is_alive_(kMagicIsAlive), list_() { |
706 |
-+Value::Value(const ListStorage& in_list) : list_type_(Type::LIST), list_() { |
707 |
- list_.reserve(in_list.size()); |
708 |
- for (const auto& val : in_list) |
709 |
- list_.emplace_back(val.Clone()); |
710 |
-@@ -218,7 +214,6 @@ Value::Value(const ListStorage& in_list) |
711 |
- |
712 |
- Value::Value(ListStorage&& in_list) noexcept |
713 |
- : list_type_(Type::LIST), |
714 |
-- list_is_alive_(kMagicIsAlive), |
715 |
- list_(std::move(in_list)) {} |
716 |
- |
717 |
- Value& Value::operator=(Value&& that) noexcept { |
718 |
-@@ -246,15 +241,21 @@ Value Value::Clone() const { |
719 |
- return Value(dict_); |
720 |
- case Type::LIST: |
721 |
- return Value(list_); |
722 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
723 |
-+ case Type::DEAD: |
724 |
-+ CHECK(false); |
725 |
-+ return Value(); |
726 |
- } |
727 |
- |
728 |
-- NOTREACHED(); |
729 |
-+ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. |
730 |
-+ CHECK(false); |
731 |
- return Value(); |
732 |
- } |
733 |
- |
734 |
- Value::~Value() { |
735 |
- InternalCleanup(); |
736 |
-- is_alive_ = 0; |
737 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
738 |
-+ type_ = Type::DEAD; |
739 |
- } |
740 |
- |
741 |
- // static |
742 |
-@@ -654,9 +655,14 @@ bool operator==(const Value& lhs, const Value& rhs) { |
743 |
- }); |
744 |
- case Value::Type::LIST: |
745 |
- return lhs.list_ == rhs.list_; |
746 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
747 |
-+ case Value::Type::DEAD: |
748 |
-+ CHECK(false); |
749 |
-+ return false; |
750 |
- } |
751 |
- |
752 |
-- NOTREACHED(); |
753 |
-+ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. |
754 |
-+ CHECK(false); |
755 |
- return false; |
756 |
- } |
757 |
- |
758 |
-@@ -693,9 +699,14 @@ bool operator<(const Value& lhs, const Value& rhs) { |
759 |
- }); |
760 |
- case Value::Type::LIST: |
761 |
- return lhs.list_ < rhs.list_; |
762 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
763 |
-+ case Value::Type::DEAD: |
764 |
-+ CHECK(false); |
765 |
-+ return false; |
766 |
- } |
767 |
- |
768 |
-- NOTREACHED(); |
769 |
-+ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. |
770 |
-+ CHECK(false); |
771 |
- return false; |
772 |
- } |
773 |
- |
774 |
-@@ -733,7 +744,6 @@ size_t Value::EstimateMemoryUsage() const { |
775 |
- |
776 |
- void Value::InternalMoveConstructFrom(Value&& that) { |
777 |
- type_ = that.type_; |
778 |
-- is_alive_ = that.is_alive_; |
779 |
- |
780 |
- switch (type_) { |
781 |
- case Type::NONE: |
782 |
-@@ -759,12 +769,17 @@ void Value::InternalMoveConstructFrom(Value&& that) { |
783 |
- case Type::LIST: |
784 |
- new (&list_) ListStorage(std::move(that.list_)); |
785 |
- return; |
786 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
787 |
-+ case Type::DEAD: |
788 |
-+ CHECK(false); |
789 |
-+ return; |
790 |
- } |
791 |
-+ |
792 |
-+ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. |
793 |
-+ CHECK(false); |
794 |
- } |
795 |
- |
796 |
- void Value::InternalCleanup() { |
797 |
-- CHECK_EQ(is_alive_, kMagicIsAlive); |
798 |
-- |
799 |
- switch (type_) { |
800 |
- case Type::NONE: |
801 |
- case Type::BOOLEAN: |
802 |
-@@ -785,7 +800,14 @@ void Value::InternalCleanup() { |
803 |
- case Type::LIST: |
804 |
- list_.~ListStorage(); |
805 |
- return; |
806 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
807 |
-+ case Type::DEAD: |
808 |
-+ CHECK(false); |
809 |
-+ return; |
810 |
- } |
811 |
-+ |
812 |
-+ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. |
813 |
-+ CHECK(false); |
814 |
- } |
815 |
- |
816 |
- ///////////////////// DictionaryValue //////////////////// |
817 |
-diff --git a/base/values.h b/base/values.h |
818 |
-index 429ef1dfdebd..e31cadd83102 100644 |
819 |
---- a/base/values.h |
820 |
-+++ b/base/values.h |
821 |
-@@ -92,7 +92,9 @@ class BASE_EXPORT Value { |
822 |
- STRING, |
823 |
- BINARY, |
824 |
- DICTIONARY, |
825 |
-- LIST |
826 |
-+ LIST, |
827 |
-+ // TODO(crbug.com/859477): Remove once root cause is found. |
828 |
-+ DEAD |
829 |
- // Note: Do not add more types. See the file-level comment above for why. |
830 |
- }; |
831 |
- |
832 |
-@@ -375,10 +377,6 @@ class BASE_EXPORT Value { |
833 |
- size_t EstimateMemoryUsage() const; |
834 |
- |
835 |
- protected: |
836 |
-- // Magic IsAlive signature to debug double frees. |
837 |
-- // TODO(crbug.com/859477): Remove once root cause is found. |
838 |
-- static constexpr uint16_t kMagicIsAlive = 0x2f19; |
839 |
-- |
840 |
- // Technical note: |
841 |
- // The naive way to implement a tagged union leads to wasted bytes |
842 |
- // in the object on CPUs like ARM ones, which impose an 8-byte alignment |
843 |
-@@ -408,8 +406,8 @@ class BASE_EXPORT Value { |
844 |
- // that |double_value_| below is always located at an offset that is a |
845 |
- // multiple of 8, relative to the start of the overall data structure. |
846 |
- // |
847 |
-- // Each struct must declare its own |type_| and |is_alive_| field, which |
848 |
-- // must have a different name, to appease the C++ compiler. |
849 |
-+ // Each struct must declare its own |type_| field, which must have a different |
850 |
-+ // name, to appease the C++ compiler. |
851 |
- // |
852 |
- // Using this technique sizeof(base::Value) == 16 on 32-bit ARM instead |
853 |
- // of 24, without losing any information. Results are unchanged for x86, |
854 |
-@@ -419,24 +417,17 @@ class BASE_EXPORT Value { |
855 |
- // TODO(crbug.com/646113): Make these private once DictionaryValue and |
856 |
- // ListValue are properly inlined. |
857 |
- Type type_ : 8; |
858 |
-- |
859 |
-- // IsAlive member to debug double frees. |
860 |
-- // TODO(crbug.com/859477): Remove once root cause is found. |
861 |
-- uint16_t is_alive_ = kMagicIsAlive; |
862 |
- }; |
863 |
- struct { |
864 |
- Type bool_type_ : 8; |
865 |
-- uint16_t bool_is_alive_; |
866 |
- bool bool_value_; |
867 |
- }; |
868 |
- struct { |
869 |
- Type int_type_ : 8; |
870 |
-- uint16_t int_is_alive_; |
871 |
- int int_value_; |
872 |
- }; |
873 |
- struct { |
874 |
- Type double_type_ : 8; |
875 |
-- uint16_t double_is_alive_; |
876 |
- // Subtle: On architectures that require it, the compiler will ensure |
877 |
- // that |double_value_|'s offset is a multiple of 8 (e.g. 32-bit ARM). |
878 |
- // See technical note above to understand why it is important. |
879 |
-@@ -444,22 +435,18 @@ class BASE_EXPORT Value { |
880 |
- }; |
881 |
- struct { |
882 |
- Type string_type_ : 8; |
883 |
-- uint16_t string_is_alive_; |
884 |
- std::string string_value_; |
885 |
- }; |
886 |
- struct { |
887 |
- Type binary_type_ : 8; |
888 |
-- uint16_t binary_is_alive_; |
889 |
- BlobStorage binary_value_; |
890 |
- }; |
891 |
- struct { |
892 |
- Type dict_type_ : 8; |
893 |
-- uint16_t dict_is_alive_; |
894 |
- DictStorage dict_; |
895 |
- }; |
896 |
- struct { |
897 |
- Type list_type_ : 8; |
898 |
-- uint16_t list_is_alive_; |
899 |
- ListStorage list_; |
900 |
- }; |
901 |
- }; |
902 |
-diff --git a/base/values_unittest.cc b/base/values_unittest.cc |
903 |
-index 0a641bcc7ef4..b23fd8332491 100644 |
904 |
---- a/base/values_unittest.cc |
905 |
-+++ b/base/values_unittest.cc |
906 |
-@@ -20,17 +20,20 @@ |
907 |
- #include "base/strings/string16.h" |
908 |
- #include "base/strings/string_piece.h" |
909 |
- #include "base/strings/utf_string_conversions.h" |
910 |
-+#include "build/build_config.h" |
911 |
- #include "testing/gmock/include/gmock/gmock.h" |
912 |
- #include "testing/gtest/include/gtest/gtest.h" |
913 |
- |
914 |
- namespace base { |
915 |
- |
916 |
-+// Test is currently incorrect on Windows x86. |
917 |
-+#if !defined(OS_WIN) || !defined(ARCH_CPU_X86) |
918 |
- TEST(ValuesTest, SizeOfValue) { |
919 |
- // Ensure that base::Value is as small as possible, i.e. that there is |
920 |
- // no wasted space after the inner value due to alignment constraints. |
921 |
-- // Distinguish between the 'header' that includes |type_| and |is_alive_| |
922 |
-- // and the inner value that follows it, which can be a bool, int, double, |
923 |
-- // string, blob, list or dict. |
924 |
-+ // Distinguish between the 'header' that includes |type_| and and the inner |
925 |
-+ // value that follows it, which can be a bool, int, double, string, blob, list |
926 |
-+ // or dict. |
927 |
- #define INNER_TYPES_LIST(X) \ |
928 |
- X(bool, bool_value_) \ |
929 |
- X(int, int_value_) \ |
930 |
-@@ -61,6 +64,7 @@ TEST(ValuesTest, SizeOfValue) { |
931 |
- LOG(INFO) << "max_inner_struct_limit=" << max_inner_struct_limit; |
932 |
- } |
933 |
- } |
934 |
-+#endif |
935 |
- |
936 |
- TEST(ValuesTest, TestNothrow) { |
937 |
- static_assert(std::is_nothrow_move_constructible<Value>::value, |
938 |
-diff --git a/chrome/browser/ui/cocoa/applescript/apple_event_util.mm b/chrome/browser/ui/cocoa/applescript/apple_event_util.mm |
939 |
-index 16d685607ced..25a59338ee73 100644 |
940 |
---- a/chrome/browser/ui/cocoa/applescript/apple_event_util.mm |
941 |
-+++ b/chrome/browser/ui/cocoa/applescript/apple_event_util.mm |
942 |
-@@ -96,6 +96,16 @@ NSAppleEventDescriptor* ValueToAppleEventDescriptor(const base::Value* value) { |
943 |
- } |
944 |
- break; |
945 |
- } |
946 |
-+ |
947 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
948 |
-+ case base::Value::Type::DEAD: |
949 |
-+ CHECK(false); |
950 |
-+ break; |
951 |
-+ |
952 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
953 |
-+ default: |
954 |
-+ CHECK(false); |
955 |
-+ break; |
956 |
- } |
957 |
- |
958 |
- return descriptor; |
959 |
-diff --git a/chromeos/network/onc/variable_expander.cc b/chromeos/network/onc/variable_expander.cc |
960 |
-index fd72752c2aa6..cd5bbb238eb3 100644 |
961 |
---- a/chromeos/network/onc/variable_expander.cc |
962 |
-+++ b/chromeos/network/onc/variable_expander.cc |
963 |
-@@ -145,6 +145,12 @@ bool VariableExpander::ExpandValue(base::Value* value) const { |
964 |
- // Nothing to do here. |
965 |
- break; |
966 |
- } |
967 |
-+ |
968 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
969 |
-+ case base::Value::Type::DEAD: { |
970 |
-+ CHECK(false); |
971 |
-+ break; |
972 |
-+ } |
973 |
- } |
974 |
- return no_error; |
975 |
- } |
976 |
-diff --git a/components/policy/core/browser/android/policy_converter.cc b/components/policy/core/browser/android/policy_converter.cc |
977 |
-index b711a64febc9..9d41ad0d1507 100644 |
978 |
---- a/components/policy/core/browser/android/policy_converter.cc |
979 |
-+++ b/components/policy/core/browser/android/policy_converter.cc |
980 |
-@@ -175,10 +175,17 @@ std::unique_ptr<base::Value> PolicyConverter::ConvertValueToSchema( |
981 |
- } |
982 |
- return value; |
983 |
- } |
984 |
-+ |
985 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
986 |
-+ case base::Value::Type::DEAD: { |
987 |
-+ CHECK(false); |
988 |
-+ return nullptr; |
989 |
-+ } |
990 |
- } |
991 |
- |
992 |
-- NOTREACHED(); |
993 |
-- return std::unique_ptr<base::Value>(); |
994 |
-+ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. |
995 |
-+ CHECK(false); |
996 |
-+ return nullptr; |
997 |
- } |
998 |
- |
999 |
- void PolicyConverter::SetPolicyValue(const std::string& key, |
1000 |
-diff --git a/components/policy/core/common/policy_loader_win_unittest.cc b/components/policy/core/common/policy_loader_win_unittest.cc |
1001 |
-index 311e7fb122fc..0377307c5e28 100644 |
1002 |
---- a/components/policy/core/common/policy_loader_win_unittest.cc |
1003 |
-+++ b/components/policy/core/common/policy_loader_win_unittest.cc |
1004 |
-@@ -133,8 +133,14 @@ bool InstallValue(const base::Value& value, |
1005 |
- |
1006 |
- case base::Value::Type::BINARY: |
1007 |
- return false; |
1008 |
-+ |
1009 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
1010 |
-+ case base::Value::Type::DEAD: |
1011 |
-+ CHECK(false); |
1012 |
-+ return false; |
1013 |
- } |
1014 |
-- NOTREACHED(); |
1015 |
-+ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. |
1016 |
-+ CHECK(false); |
1017 |
- return false; |
1018 |
- } |
1019 |
- |
1020 |
-diff --git a/components/policy/core/common/policy_test_utils.cc b/components/policy/core/common/policy_test_utils.cc |
1021 |
-index 5af98b47275c..919f004153ec 100644 |
1022 |
---- a/components/policy/core/common/policy_test_utils.cc |
1023 |
-+++ b/components/policy/core/common/policy_test_utils.cc |
1024 |
-@@ -137,6 +137,11 @@ CFPropertyListRef ValueToProperty(const base::Value& value) { |
1025 |
- // because there's no equivalent JSON type, and policy values can only |
1026 |
- // take valid JSON values. |
1027 |
- break; |
1028 |
-+ |
1029 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
1030 |
-+ case base::Value::Type::DEAD: |
1031 |
-+ CHECK(false); |
1032 |
-+ break; |
1033 |
- } |
1034 |
- |
1035 |
- return NULL; |
1036 |
-diff --git a/components/policy/core/common/registry_dict.cc b/components/policy/core/common/registry_dict.cc |
1037 |
-index f3ed372bdcb3..696ba7e04abe 100644 |
1038 |
---- a/components/policy/core/common/registry_dict.cc |
1039 |
-+++ b/components/policy/core/common/registry_dict.cc |
1040 |
-@@ -135,6 +135,10 @@ std::unique_ptr<base::Value> ConvertRegistryValue(const base::Value& value, |
1041 |
- case base::Value::Type::BINARY: |
1042 |
- // No conversion possible. |
1043 |
- break; |
1044 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
1045 |
-+ case base::Value::Type::DEAD: |
1046 |
-+ CHECK(false); |
1047 |
-+ return nullptr; |
1048 |
- } |
1049 |
- |
1050 |
- LOG(WARNING) << "Failed to convert " << value.type() << " to " |
1051 |
-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 |
1052 |
-index dabd66ba8c72..84fd5489a414 100644 |
1053 |
---- a/content/browser/android/java/gin_java_script_to_java_types_coercion.cc |
1054 |
-+++ b/content/browser/android/java/gin_java_script_to_java_types_coercion.cc |
1055 |
-@@ -722,8 +722,14 @@ jvalue CoerceJavaScriptValueToJavaValue(JNIEnv* env, |
1056 |
- case base::Value::Type::BINARY: |
1057 |
- return CoerceGinJavaBridgeValueToJavaValue( |
1058 |
- env, value, target_type, coerce_to_string, object_refs, error); |
1059 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
1060 |
-+ case base::Value::Type::DEAD: |
1061 |
-+ CHECK(false); |
1062 |
-+ return jvalue(); |
1063 |
- } |
1064 |
-- NOTREACHED(); |
1065 |
-+ |
1066 |
-+ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. |
1067 |
-+ CHECK(false); |
1068 |
- return jvalue(); |
1069 |
- } |
1070 |
- |
1071 |
-diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc |
1072 |
-index ec04c77c6c18..df6ec39bd663 100644 |
1073 |
---- a/ipc/ipc_message_utils.cc |
1074 |
-+++ b/ipc/ipc_message_utils.cc |
1075 |
-@@ -92,7 +92,7 @@ void WriteValue(base::Pickle* m, const base::Value* value, int recursion) { |
1076 |
- |
1077 |
- switch (value->type()) { |
1078 |
- case base::Value::Type::NONE: |
1079 |
-- break; |
1080 |
-+ break; |
1081 |
- case base::Value::Type::BOOLEAN: { |
1082 |
- bool val; |
1083 |
- result = value->GetAsBoolean(&val); |
1084 |
-@@ -147,6 +147,11 @@ void WriteValue(base::Pickle* m, const base::Value* value, int recursion) { |
1085 |
- } |
1086 |
- break; |
1087 |
- } |
1088 |
-+ |
1089 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
1090 |
-+ default: |
1091 |
-+ CHECK(false); |
1092 |
-+ break; |
1093 |
- } |
1094 |
- } |
1095 |
- |
1096 |
-@@ -260,7 +265,9 @@ bool ReadValue(const base::Pickle* m, |
1097 |
- break; |
1098 |
- } |
1099 |
- default: |
1100 |
-- return false; |
1101 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
1102 |
-+ CHECK(false); |
1103 |
-+ return false; |
1104 |
- } |
1105 |
- |
1106 |
- return true; |
1107 |
-diff --git a/mojo/public/cpp/base/values_mojom_traits.h b/mojo/public/cpp/base/values_mojom_traits.h |
1108 |
-index cdb9bbbd94df..66752b7c90d8 100644 |
1109 |
---- a/mojo/public/cpp/base/values_mojom_traits.h |
1110 |
-+++ b/mojo/public/cpp/base/values_mojom_traits.h |
1111 |
-@@ -86,8 +86,13 @@ struct COMPONENT_EXPORT(MOJO_BASE_SHARED_TRAITS) |
1112 |
- return mojo_base::mojom::ValueDataView::Tag::DICTIONARY_VALUE; |
1113 |
- case base::Value::Type::LIST: |
1114 |
- return mojo_base::mojom::ValueDataView::Tag::LIST_VALUE; |
1115 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
1116 |
-+ case base::Value::Type::DEAD: |
1117 |
-+ CHECK(false); |
1118 |
-+ return mojo_base::mojom::ValueDataView::Tag::NULL_VALUE; |
1119 |
- } |
1120 |
-- NOTREACHED(); |
1121 |
-+ // TODO(crbug.com/859477): Revert to NOTREACHED() after root cause is found. |
1122 |
-+ CHECK(false); |
1123 |
- return mojo_base::mojom::ValueDataView::Tag::NULL_VALUE; |
1124 |
- } |
1125 |
- |
1126 |
-diff --git a/ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc b/ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc |
1127 |
-index 6ffff36337e0..7f392d50f718 100644 |
1128 |
---- a/ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc |
1129 |
-+++ b/ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc |
1130 |
-@@ -73,6 +73,8 @@ PP_Var PPB_X509Certificate_Fields::GetFieldAsPPVar( |
1131 |
- } |
1132 |
- case base::Value::Type::DICTIONARY: |
1133 |
- case base::Value::Type::LIST: |
1134 |
-+ // TODO(crbug.com/859477): Remove after root cause is found. |
1135 |
-+ case base::Value::Type::DEAD: |
1136 |
- // Not handled. |
1137 |
- break; |
1138 |
- } |
1139 |
--- |
1140 |
-2.21.0 |
1141 |
- |