summaryrefslogtreecommitdiff
path: root/www-client/chromium/files/chromium-76-gcc-noexcept.patch
blob: 2a7f4b35a7263991c01a856fa78edbf57958c4af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
From 84c91abab33966f928497c24db4a39f436d2dca8 Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jose.dapena@lge.com>
Date: Fri, 07 Jun 2019 09:50:11 +0000
Subject: [PATCH] Make SharedMemoryMapping move constructor noexcept

As LayerTreeHostImpl::UIResourceData move constructor is declared
noexcept with default implementation, the move constructor of its
members should also be noexcept. GCC will fail to build otherwise
for mismatching noexcept declaration.

We also set the move assignment operator.

Bug: 819294
Change-Id: Icd663da83b882e15f7d16780c9241972e09bc492
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1645297
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667064}
---

diff --git a/base/memory/shared_memory_mapping.cc b/base/memory/shared_memory_mapping.cc
index 2be2570..8426fa8 100644
--- a/base/memory/shared_memory_mapping.cc
+++ b/base/memory/shared_memory_mapping.cc
@@ -33,7 +33,7 @@
 
 SharedMemoryMapping::SharedMemoryMapping() = default;
 
-SharedMemoryMapping::SharedMemoryMapping(SharedMemoryMapping&& mapping)
+SharedMemoryMapping::SharedMemoryMapping(SharedMemoryMapping&& mapping) noexcept
     : memory_(mapping.memory_),
       size_(mapping.size_),
       mapped_size_(mapping.mapped_size_),
@@ -42,7 +42,7 @@
 }
 
 SharedMemoryMapping& SharedMemoryMapping::operator=(
-    SharedMemoryMapping&& mapping) {
+    SharedMemoryMapping&& mapping) noexcept {
   Unmap();
   memory_ = mapping.memory_;
   size_ = mapping.size_;
@@ -90,9 +90,9 @@
 
 ReadOnlySharedMemoryMapping::ReadOnlySharedMemoryMapping() = default;
 ReadOnlySharedMemoryMapping::ReadOnlySharedMemoryMapping(
-    ReadOnlySharedMemoryMapping&&) = default;
+    ReadOnlySharedMemoryMapping&&) noexcept = default;
 ReadOnlySharedMemoryMapping& ReadOnlySharedMemoryMapping::operator=(
-    ReadOnlySharedMemoryMapping&&) = default;
+    ReadOnlySharedMemoryMapping&&) noexcept = default;
 ReadOnlySharedMemoryMapping::ReadOnlySharedMemoryMapping(
     void* address,
     size_t size,
@@ -102,9 +102,9 @@
 
 WritableSharedMemoryMapping::WritableSharedMemoryMapping() = default;
 WritableSharedMemoryMapping::WritableSharedMemoryMapping(
-    WritableSharedMemoryMapping&&) = default;
+    WritableSharedMemoryMapping&&) noexcept = default;
 WritableSharedMemoryMapping& WritableSharedMemoryMapping::operator=(
-    WritableSharedMemoryMapping&&) = default;
+    WritableSharedMemoryMapping&&) noexcept = default;
 WritableSharedMemoryMapping::WritableSharedMemoryMapping(
     void* address,
     size_t size,
diff --git a/base/memory/shared_memory_mapping.h b/base/memory/shared_memory_mapping.h
index d9569af..2b8858e 100644
--- a/base/memory/shared_memory_mapping.h
+++ b/base/memory/shared_memory_mapping.h
@@ -32,8 +32,8 @@
   SharedMemoryMapping();
 
   // Move operations are allowed.
-  SharedMemoryMapping(SharedMemoryMapping&& mapping);
-  SharedMemoryMapping& operator=(SharedMemoryMapping&& mapping);
+  SharedMemoryMapping(SharedMemoryMapping&& mapping) noexcept;
+  SharedMemoryMapping& operator=(SharedMemoryMapping&& mapping) noexcept;
 
   // Unmaps the region if the mapping is valid.
   virtual ~SharedMemoryMapping();
@@ -93,8 +93,9 @@
   ReadOnlySharedMemoryMapping();
 
   // Move operations are allowed.
-  ReadOnlySharedMemoryMapping(ReadOnlySharedMemoryMapping&&);
-  ReadOnlySharedMemoryMapping& operator=(ReadOnlySharedMemoryMapping&&);
+  ReadOnlySharedMemoryMapping(ReadOnlySharedMemoryMapping&&) noexcept;
+  ReadOnlySharedMemoryMapping& operator=(
+      ReadOnlySharedMemoryMapping&&) noexcept;
 
   // Returns the base address of the mapping. This is read-only memory. This is
   // page-aligned. This is nullptr for invalid instances.
@@ -171,8 +172,9 @@
   WritableSharedMemoryMapping();
 
   // Move operations are allowed.
-  WritableSharedMemoryMapping(WritableSharedMemoryMapping&&);
-  WritableSharedMemoryMapping& operator=(WritableSharedMemoryMapping&&);
+  WritableSharedMemoryMapping(WritableSharedMemoryMapping&&) noexcept;
+  WritableSharedMemoryMapping& operator=(
+      WritableSharedMemoryMapping&&) noexcept;
 
   // Returns the base address of the mapping. This is writable memory. This is
   // page-aligned. This is nullptr for invalid instances.

From bdc24128b75008743d819e298557a53205706e7c Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jose.dapena@lge.com>
Date: Sun, 09 Jun 2019 11:22:25 +0000
Subject: [PATCH] GCC: fix noexcept from move constructor and assign operators of AccountInfo

AccountInfo declares them as noexcept and uses default implementation,
so all its members (including AccountId) should be noexcept. But AccountId
is not noexcept. To fix it we just need to make CoreAccountId move
operator/assign operator noexcept.

Bug: 819294
Change-Id: Ice38654ab7cf3b9eaa6f54aa36e1fec329264f98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1645296
Reviewed-by: Roger Tawa <rogerta@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
Cr-Commit-Position: refs/heads/master@{#667484}
---

diff --git a/google_apis/gaia/core_account_id.cc b/google_apis/gaia/core_account_id.cc
index d808082..12eefe3 100644
--- a/google_apis/gaia/core_account_id.cc
+++ b/google_apis/gaia/core_account_id.cc
@@ -6,8 +6,16 @@
 
 CoreAccountId::CoreAccountId() = default;
 
+CoreAccountId::CoreAccountId(const CoreAccountId&) = default;
+
+CoreAccountId::CoreAccountId(CoreAccountId&&) noexcept = default;
+
 CoreAccountId::~CoreAccountId() = default;
 
+CoreAccountId& CoreAccountId::operator=(const CoreAccountId&) = default;
+
+CoreAccountId& CoreAccountId::operator=(CoreAccountId&&) noexcept = default;
+
 CoreAccountId::CoreAccountId(const char* id) : id(id) {}
 
 CoreAccountId::CoreAccountId(std::string&& id) : id(std::move(id)) {}
diff --git a/google_apis/gaia/core_account_id.h b/google_apis/gaia/core_account_id.h
index 5ea602a..c2d1911 100644
--- a/google_apis/gaia/core_account_id.h
+++ b/google_apis/gaia/core_account_id.h
@@ -14,8 +14,13 @@
 // for design and tracking).
 struct CoreAccountId {
   CoreAccountId();
+  CoreAccountId(const CoreAccountId&);
+  CoreAccountId(CoreAccountId&&) noexcept;
   ~CoreAccountId();
 
+  CoreAccountId& operator=(const CoreAccountId&);
+  CoreAccountId& operator=(CoreAccountId&&) noexcept;
+
   // Those implicit constructor and conversion operator allow to
   // progressively migrate the code to use this struct. Removing
   // them is tracked by https://crbug.com/959161

From 9aae68736bc7eb7172d0d0c978ecb6d1f75c7b30 Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jose.dapena@lge.com>
Date: Tue, 11 Jun 2019 10:27:19 +0200
Subject: [PATCH] GCC: add noexcept move assignment in history::URLRow

In GCC, build is failing because history::QueryURLResult declares its move
assignment operator as noexcept using default implementation. That requires
its members to provide a move assignment operator that is noexcept too.

But URLRow was missing noexcept declaration in move assignment operator (even
though it was providing noexcept to its move constructor).

Bug: 819294
Change-Id: I726e3cf7a4a50c9206a5d0fba8a561d363483d4f
---

diff --git a/components/history/core/browser/url_row.cc b/components/history/core/browser/url_row.cc
index 44c22fd..aec0101 100644
--- a/components/history/core/browser/url_row.cc
+++ b/components/history/core/browser/url_row.cc
@@ -26,7 +26,7 @@
 }
 
 URLRow& URLRow::operator=(const URLRow& other) = default;
-URLRow& URLRow::operator=(URLRow&& other) = default;
+URLRow& URLRow::operator=(URLRow&& other) noexcept = default;
 
 void URLRow::Swap(URLRow* other) {
   std::swap(id_, other->id_);
diff --git a/components/history/core/browser/url_row.h b/components/history/core/browser/url_row.h
index 8f6f9cf..31a1ef8 100644
--- a/components/history/core/browser/url_row.h
+++ b/components/history/core/browser/url_row.h
@@ -35,7 +35,7 @@
 
   virtual ~URLRow();
   URLRow& operator=(const URLRow& other);
-  URLRow& operator=(URLRow&& other);
+  URLRow& operator=(URLRow&& other) noexcept;
 
   URLID id() const { return id_; }
 

From 41d954dec0669c9a85730c0bde7df7ba7a0ff43e Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jose.dapena@lge.com>
Date: Thu, 06 Jun 2019 15:30:49 +0000
Subject: [PATCH] Fix AutocompleteMatch move constructor/assign operator noexcept

For AutocompleteMatch to declare noexcept them, all the contained
properties need to be noexcept too. This is required at least
for SuggestionAnswer, because base::string16 will make default
calculated signature of the move operator noexcept(false).

To avoid this issue we explicitely declare them on SuggestionAnswer,
and its member classes TextField and ImageLine.

Bug: 819294
Change-Id: I8714f2c6352a3292bdebdc3aed9790270e49c580
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1554669
Reviewed-by: Kevin Bailey <krb@chromium.org>
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
Cr-Commit-Position: refs/heads/master@{#666714}
---

diff --git a/components/omnibox/browser/suggestion_answer.cc b/components/omnibox/browser/suggestion_answer.cc
index 151e55f..a0c9049 100644
--- a/components/omnibox/browser/suggestion_answer.cc
+++ b/components/omnibox/browser/suggestion_answer.cc
@@ -55,6 +55,12 @@
 
 SuggestionAnswer::TextField::TextField() = default;
 SuggestionAnswer::TextField::~TextField() = default;
+SuggestionAnswer::TextField::TextField(const TextField&) = default;
+SuggestionAnswer::TextField::TextField(TextField&&) noexcept = default;
+SuggestionAnswer::TextField& SuggestionAnswer::TextField::operator=(
+    const TextField&) = default;
+SuggestionAnswer::TextField& SuggestionAnswer::TextField::operator=(
+    TextField&&) noexcept = default;
 
 // static
 bool SuggestionAnswer::TextField::ParseTextField(const base::Value& field_json,
@@ -93,9 +99,12 @@
 SuggestionAnswer::ImageLine::ImageLine()
     : num_text_lines_(1) {}
 SuggestionAnswer::ImageLine::ImageLine(const ImageLine& line) = default;
+SuggestionAnswer::ImageLine::ImageLine(ImageLine&&) noexcept = default;
 
 SuggestionAnswer::ImageLine& SuggestionAnswer::ImageLine::operator=(
     const ImageLine& line) = default;
+SuggestionAnswer::ImageLine& SuggestionAnswer::ImageLine::operator=(
+    ImageLine&&) noexcept = default;
 
 SuggestionAnswer::ImageLine::~ImageLine() {}
 
@@ -251,9 +260,14 @@
 
 SuggestionAnswer::SuggestionAnswer(const SuggestionAnswer& answer) = default;
 
+SuggestionAnswer::SuggestionAnswer(SuggestionAnswer&&) noexcept = default;
+
 SuggestionAnswer& SuggestionAnswer::operator=(const SuggestionAnswer& answer) =
     default;
 
+SuggestionAnswer& SuggestionAnswer::operator=(SuggestionAnswer&&) noexcept =
+    default;
+
 SuggestionAnswer::~SuggestionAnswer() = default;
 
 // static
diff --git a/components/omnibox/browser/suggestion_answer.h b/components/omnibox/browser/suggestion_answer.h
index 31be937..2840ace 100644
--- a/components/omnibox/browser/suggestion_answer.h
+++ b/components/omnibox/browser/suggestion_answer.h
@@ -125,6 +125,10 @@
    public:
     TextField();
     ~TextField();
+    TextField(const TextField&);
+    TextField(TextField&&) noexcept;
+    TextField& operator=(const TextField&);
+    TextField& operator=(TextField&&) noexcept;
 
     // Parses |field_json| dictionary and populates |text_field| with the
     // contents.  If any of the required elements is missing, returns false and
@@ -162,7 +166,9 @@
    public:
     ImageLine();
     explicit ImageLine(const ImageLine& line);
+    ImageLine(ImageLine&&) noexcept;
     ImageLine& operator=(const ImageLine& line);
+    ImageLine& operator=(ImageLine&&) noexcept;
     ~ImageLine();
 
     // Parses dictionary |line_json| and populates |image_line| with the
@@ -213,7 +219,9 @@
 
   SuggestionAnswer();
   SuggestionAnswer(const SuggestionAnswer& answer);
+  SuggestionAnswer(SuggestionAnswer&&) noexcept;
   SuggestionAnswer& operator=(const SuggestionAnswer& answer);
+  SuggestionAnswer& operator=(SuggestionAnswer&&) noexcept;
   ~SuggestionAnswer();
 
   // Parses dictionary |answer_json| and fills a SuggestionAnswer containing the

From 9f99af41cae3cfff3bcdcc856c1539801c9b745b Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jose.dapena@lge.com>
Date: Fri, 07 Jun 2019 18:59:59 +0000
Subject: [PATCH] DisjoingRangeLockManager::Lock move constructor/assign operator cannot be noexcept

They depend on LockRequest, that depends on WeakPtr, none of them noexcept.

Bug: 819294
Change-Id: I04ec15901ca627358df727540597f21f135c129b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1646252
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
Cr-Commit-Position: refs/heads/master@{#667260}
---

diff --git a/content/browser/indexed_db/scopes/disjoint_range_lock_manager.cc b/content/browser/indexed_db/scopes/disjoint_range_lock_manager.cc
index 478a5c9..a18c6cd 100644
--- a/content/browser/indexed_db/scopes/disjoint_range_lock_manager.cc
+++ b/content/browser/indexed_db/scopes/disjoint_range_lock_manager.cc
@@ -19,14 +19,13 @@
     : requested_type(type),
       locks_holder(std::move(locks_holder)),
       acquired_callback(std::move(acquired_callback)) {}
-DisjointRangeLockManager::LockRequest::LockRequest(LockRequest&&) noexcept =
-    default;
+DisjointRangeLockManager::LockRequest::LockRequest(LockRequest&&) = default;
 DisjointRangeLockManager::LockRequest::~LockRequest() = default;
 DisjointRangeLockManager::Lock::Lock() = default;
-DisjointRangeLockManager::Lock::Lock(Lock&&) noexcept = default;
+DisjointRangeLockManager::Lock::Lock(Lock&&) = default;
 DisjointRangeLockManager::Lock::~Lock() = default;
 DisjointRangeLockManager::Lock& DisjointRangeLockManager::Lock::operator=(
-    DisjointRangeLockManager::Lock&&) noexcept = default;
+    DisjointRangeLockManager::Lock&&) = default;
 
 DisjointRangeLockManager::DisjointRangeLockManager(int level_count)
     : task_runner_(base::SequencedTaskRunnerHandle::Get()),