[cef][wam] Make the recipe work with official chromium release tarballs
[AGL/meta-agl-demo.git] / recipes-wam / cef / files / chromium / 0026-M118-fix-Add-deleted-constructors-operators.patch
1 From 19a3339965f79f8ae8ab650850461cbd0a782bff Mon Sep 17 00:00:00 2001
2 From: Roger Zanoni <rzanoni@igalia.com>
3 Date: Mon, 30 Oct 2023 15:28:20 -0300
4 Subject: [PATCH 26/33] [M118-fix] Add deleted constructors/operators
5
6 Apparently the rules for deleting the implicitly-defined move
7 constructor/operators is different in clang 14 and this causes build
8 issues where the constructors or operators are needed.
9
10 So we explicitly declare all the needed constructors defined as deleted
11 by the compiler.
12
13 Upstream-Status: Inappropriate, only affects older versions of clang
14 Signed-off-by: Roger Zanoni <rzanoni@igalia.com>
15 ---
16  .../profile_management_navigation_throttle.cc | 22 +++++++++++++
17  .../core/browser/profile_token_quality.cc     | 12 +++----
18  .../core/browser/profile_token_quality.h      | 15 +++++++++
19  .../public/common/download_save_item_data.h   |  5 +++
20  .../fenced_frame/fenced_frame_reporter.h      | 25 +++++++++++++++
21  .../header_direct_from_seller_signals.cc      |  4 ++-
22  .../webid/idp_network_request_manager.h       | 31 +++++++++++++++++++
23  .../renderer/platform/fonts/font_palette.h    |  1 +
24  .../gesture_detection/motion_event_generic.cc | 27 ++++++++++++++++
25  .../gesture_detection/motion_event_generic.h  |  6 ++--
26  10 files changed, 139 insertions(+), 9 deletions(-)
27
28 diff --git a/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc b/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc
29 index aecaaf76762ee..3b02142d3e722 100644
30 --- a/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc
31 +++ b/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc
32 @@ -5,6 +5,7 @@
33  #include "chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.h"
34  
35  #include <string>
36 +#include <utility>
37  
38  #include "base/command_line.h"
39  #include "base/containers/contains.h"
40 @@ -47,6 +48,27 @@ constexpr char kGoogleServiceLoginUrl[] =
41  // Utility struct used to store SAML attributes related to third-party profile
42  // management.
43  struct SAMLProfileAttributes {
44 +  SAMLProfileAttributes() {}
45 +  SAMLProfileAttributes(std::string n, std::string d, std::string t)
46 +    : name{n}, domain{d}, token{t} {}
47 +  SAMLProfileAttributes(const SAMLProfileAttributes& o)
48 +    : SAMLProfileAttributes(o.name,
49 +                            o.domain,
50 +                            o.token) {}
51 +  SAMLProfileAttributes(SAMLProfileAttributes&& o)
52 +    : name{std::move(o.name)}
53 +    , domain{std::move(o.domain)}
54 +    , token{std::move(o.token)} {}
55 +  SAMLProfileAttributes& operator=(const SAMLProfileAttributes& o) {
56 +    return *this = SAMLProfileAttributes(o);
57 +  }
58 +  SAMLProfileAttributes& operator=(SAMLProfileAttributes&& o) {
59 +    name = std::move(o.name);
60 +    domain = std::move(o.domain);
61 +    token = std::move(o.token);
62 +    return *this;
63 +  }
64 +
65    std::string name;
66    std::string domain;
67    std::string token;
68 diff --git a/components/autofill/core/browser/profile_token_quality.cc b/components/autofill/core/browser/profile_token_quality.cc
69 index ff5f175372f39..e1c18eccb84b3 100644
70 --- a/components/autofill/core/browser/profile_token_quality.cc
71 +++ b/components/autofill/core/browser/profile_token_quality.cc
72 @@ -241,10 +241,10 @@ bool ProfileTokenQuality::AddObservationsForFilledForm(
73      }
74      possible_observations.emplace_back(
75          stored_type,
76 -        Observation{.type = base::to_underlying(GetObservationTypeFromField(
77 +        Observation(base::to_underlying(GetObservationTypeFromField(
78                          field, form_data.fields[i].value, other_profiles,
79                          pdm.app_locale())),
80 -                    .form_hash = hash});
81 +                    hash));
82    }
83    return AddSubsetOfObservations(std::move(possible_observations)) > 0;
84  }
85 @@ -387,10 +387,10 @@ void ProfileTokenQuality::LoadSerializedObservationsForStoredType(
86    for (size_t i = 0; i + 1 < serialized_data.size(); i += 2) {
87      AddObservation(
88          type,
89 -        Observation{
90 -            .type = std::min(serialized_data[i],
91 -                             base::to_underlying(ObservationType::kMaxValue)),
92 -            .form_hash = FormSignatureHash(serialized_data[i + 1])});
93 +        Observation(
94 +            std::min(serialized_data[i],
95 +                     base::to_underlying(ObservationType::kMaxValue)),
96 +            FormSignatureHash(serialized_data[i + 1])));
97    }
98  }
99  
100 diff --git a/components/autofill/core/browser/profile_token_quality.h b/components/autofill/core/browser/profile_token_quality.h
101 index 9dc16a1f98a13..2f726f04ab8d3 100644
102 --- a/components/autofill/core/browser/profile_token_quality.h
103 +++ b/components/autofill/core/browser/profile_token_quality.h
104 @@ -211,6 +211,21 @@ class ProfileTokenQuality {
105      // For this reason, it is preferred to store the `ObservationType`s as their
106      // underlying type in the data model as well.
107      // Getters expose unknown values as `kUnknown`.
108 +    Observation(std::underlying_type_t<ObservationType> t,
109 +                FormSignatureHash h) : type{t}, form_hash{h} {}
110 +    Observation(const Observation &o)
111 +      : Observation(o.type, o.form_hash) {}
112 +    Observation(Observation &&o) : type{std::move(o.type)},
113 +                                   form_hash{std::move(o.form_hash)} {}
114 +    Observation& operator=(const Observation& o) {
115 +        return *this = Observation(o);
116 +    }
117 +    Observation& operator=(Observation&& o) noexcept {
118 +        type = std::move(o.type);
119 +        form_hash = std::move(o.form_hash);
120 +        return *this;
121 +    }
122 +
123      std::underlying_type_t<ObservationType> type;
124      FormSignatureHash form_hash = FormSignatureHash(0);
125    };
126 diff --git a/components/download/public/common/download_save_item_data.h b/components/download/public/common/download_save_item_data.h
127 index 754aec2f64f6d..d49c3cd545b06 100644
128 --- a/components/download/public/common/download_save_item_data.h
129 +++ b/components/download/public/common/download_save_item_data.h
130 @@ -20,6 +20,11 @@ class COMPONENTS_DOWNLOAD_EXPORT DownloadSaveItemData
131      : public base::SupportsUserData::Data {
132   public:
133    struct ItemInfo {
134 +    ItemInfo(base::FilePath f, GURL u, GURL r)
135 +      : file_path{f}
136 +      , url{u}
137 +      , referrer_url{r} {}
138 +
139      // The final path where this file of the package will be saved.
140      base::FilePath file_path;
141      // The url this file was downloaded from.
142 diff --git a/content/browser/fenced_frame/fenced_frame_reporter.h b/content/browser/fenced_frame/fenced_frame_reporter.h
143 index 19ebadf3e14f7..8d2ee62847ced 100644
144 --- a/content/browser/fenced_frame/fenced_frame_reporter.h
145 +++ b/content/browser/fenced_frame/fenced_frame_reporter.h
146 @@ -8,6 +8,7 @@
147  #include <map>
148  #include <set>
149  #include <string>
150 +#include <utility>
151  #include <vector>
152  
153  #include "base/containers/flat_map.h"
154 @@ -40,6 +41,21 @@ class RenderFrameHostImpl;
155  // `type` is the key for the `ReportingUrlMap`, and `data` is sent with the
156  // request as a POST.
157  struct DestinationEnumEvent {
158 +  DestinationEnumEvent(std::string t, std::string d)
159 +    : type{std::move(t)}
160 +    , data{std::move(d)} {}
161 +  DestinationEnumEvent(const DestinationEnumEvent& o)
162 +    : DestinationEnumEvent(o.type, o.data) {}
163 +  DestinationEnumEvent(DestinationEnumEvent&& o)
164 +    : type{std::move(o.type)}
165 +    , data{std::move(o.data)} {}
166 +  DestinationEnumEvent& operator=(const DestinationEnumEvent& o) {
167 +    return *this = DestinationEnumEvent(o);
168 +  }
169 +  DestinationEnumEvent& operator=(DestinationEnumEvent&& o) {
170 +    std::swap(type, o.type);
171 +    std::swap(data, o.data);
172 +  }
173    std::string type;
174    std::string data;
175  };
176 @@ -48,6 +64,15 @@ struct DestinationEnumEvent {
177  // `url` is the custom destination url, and the request is sent as a GET.
178  // Macros are substituted using the `ReportingMacros`.
179  struct DestinationURLEvent {
180 +  DestinationURLEvent(const GURL& u) : url{u} {}
181 +  DestinationURLEvent(const DestinationURLEvent& u) : url{u.url} {}
182 +  DestinationURLEvent(DestinationURLEvent&& u) : url{std::move(u.url)} {}
183 +  DestinationURLEvent& operator=(const DestinationURLEvent& o) {
184 +    return *this =DestinationURLEvent(o);
185 +  }
186 +  DestinationURLEvent& operator=(DestinationURLEvent&& o) {
187 +    std::swap(url, o.url);
188 +  }
189    GURL url;
190  };
191  
192 diff --git a/content/browser/interest_group/header_direct_from_seller_signals.cc b/content/browser/interest_group/header_direct_from_seller_signals.cc
193 index fe59d11edf449..facbec80a203a 100644
194 --- a/content/browser/interest_group/header_direct_from_seller_signals.cc
195 +++ b/content/browser/interest_group/header_direct_from_seller_signals.cc
196 @@ -16,6 +16,7 @@
197  #include "base/strings/stringprintf.h"
198  #include "base/values.h"
199  #include "services/data_decoder/public/cpp/data_decoder.h"
200 +#include "third_party/abseil-cpp/absl/types/optional.h"
201  #include "url/gurl.h"
202  #include "url/origin.h"
203  #include "url/url_constants.h"
204 @@ -187,7 +188,8 @@ void OnJsonDecoded(std::unique_ptr<const std::set<std::string>> responses,
205  
206  }  // namespace
207  
208 -HeaderDirectFromSellerSignals::HeaderDirectFromSellerSignals() = default;
209 +HeaderDirectFromSellerSignals::HeaderDirectFromSellerSignals() : seller_signals_{absl::nullopt}
210 +                                                               , auction_signals_{absl::nullopt} {}
211  
212  HeaderDirectFromSellerSignals::~HeaderDirectFromSellerSignals() = default;
213  
214 diff --git a/content/browser/webid/idp_network_request_manager.h b/content/browser/webid/idp_network_request_manager.h
215 index 6a652e0a22b44..307e0f4a68f48 100644
216 --- a/content/browser/webid/idp_network_request_manager.h
217 +++ b/content/browser/webid/idp_network_request_manager.h
218 @@ -75,6 +75,24 @@ class CONTENT_EXPORT IdpNetworkRequestManager {
219      kInvalidContentTypeError,
220    };
221    struct FetchStatus {
222 +    FetchStatus(ParseStatus p, int r)
223 +      : parse_status{p}
224 +      , response_code{r} {}
225 +    FetchStatus(const FetchStatus& o)
226 +      : FetchStatus(o.parse_status,
227 +                    o.response_code) {}
228 +    FetchStatus(FetchStatus&& o)
229 +      : parse_status{std::move(o.parse_status)}
230 +      , response_code{std::move(o.response_code)} {}
231 +    FetchStatus& operator=(const FetchStatus& o) {
232 +      return *this = FetchStatus(o);
233 +    }
234 +    FetchStatus& operator=(FetchStatus&& o) {
235 +      std::swap(parse_status, o.parse_status);
236 +      std::swap(response_code, o.response_code);
237 +      return *this;
238 +    }
239 +
240      ParseStatus parse_status;
241      // The HTTP response code, if one was received, otherwise the net error. It
242      // is possible to distinguish which it is since HTTP response codes are
243 @@ -117,6 +135,19 @@ class CONTENT_EXPORT IdpNetworkRequestManager {
244    };
245  
246    struct IdentityCredentialTokenError {
247 +    IdentityCredentialTokenError(int c, GURL u) : code{c}, url{u} {}
248 +    IdentityCredentialTokenError(const IdentityCredentialTokenError &o)
249 +      : IdentityCredentialTokenError(o.code, o.url) {}
250 +    IdentityCredentialTokenError(IdentityCredentialTokenError &&o)
251 +      : code{std::move(o.code)}, url{std::move(o.url)} {}
252 +    IdentityCredentialTokenError& operator=(const IdentityCredentialTokenError& o) {
253 +      return *this = IdentityCredentialTokenError(o);
254 +    }
255 +    IdentityCredentialTokenError& operator=(IdentityCredentialTokenError&& o) {
256 +      std::swap(code, o.code);
257 +      std::swap(url, o.url);
258 +      return *this;
259 +    }
260      int code;
261      GURL url;
262    };
263 diff --git a/third_party/blink/renderer/platform/fonts/font_palette.h b/third_party/blink/renderer/platform/fonts/font_palette.h
264 index 01dac9c908e9e..9a1a167acf213 100644
265 --- a/third_party/blink/renderer/platform/fonts/font_palette.h
266 +++ b/third_party/blink/renderer/platform/fonts/font_palette.h
267 @@ -60,6 +60,7 @@ class PLATFORM_EXPORT FontPalette : public RefCounted<FontPalette> {
268    };
269  
270    struct NonNormalizedPercentages {
271 +    NonNormalizedPercentages(double s, double e) : start{s}, end{e} {}
272      double start;
273      double end;
274      bool operator==(const NonNormalizedPercentages& other) const {
275 diff --git a/ui/events/gesture_detection/motion_event_generic.cc b/ui/events/gesture_detection/motion_event_generic.cc
276 index 77c5edaa17ee4..a312c6d4de0cf 100644
277 --- a/ui/events/gesture_detection/motion_event_generic.cc
278 +++ b/ui/events/gesture_detection/motion_event_generic.cc
279 @@ -348,6 +348,33 @@ MotionEventGeneric& MotionEventGeneric::operator=(
280    return *this;
281  }
282  
283 +MotionEventGeneric& MotionEventGeneric::operator=(
284 +    MotionEventGeneric&& other) {
285 +  action_ = std::move(other.action_);
286 +  event_time_ = std::move(other.event_time_);
287 +  unique_event_id_ = std::move(other.unique_event_id_);
288 +  action_index_ = std::move(other.action_index_);
289 +  button_state_ = std::move(other.button_state_);
290 +  flags_ = std::move(other.flags_);
291 +  pointers_ = std::move(other.pointers_);
292 +  const size_t history_size = std::move(other.GetHistorySize());
293 +  for (size_t h = 0; h < history_size; ++h)
294 +    PushHistoricalEvent(other.historical_events_[h]->Clone());
295 +}
296 +
297 +MotionEventGeneric::MotionEventGeneric(MotionEventGeneric&& other) {
298 +  action_ = std::move(other.action_);
299 +  event_time_ = std::move(other.event_time_);
300 +  unique_event_id_ = std::move(other.unique_event_id_);
301 +  action_index_ = std::move(other.action_index_);
302 +  button_state_ = std::move(other.button_state_);
303 +  flags_ = std::move(other.flags_);
304 +  pointers_ = std::move(other.pointers_);
305 +  const size_t history_size = std::move(other.GetHistorySize());
306 +  for (size_t h = 0; h < history_size; ++h)
307 +    PushHistoricalEvent(other.historical_events_[h]->Clone());
308 +}
309 +
310  void MotionEventGeneric::PopPointer() {
311    DCHECK_GT(pointers_.size(), 0U);
312    pointers_.pop_back();
313 diff --git a/ui/events/gesture_detection/motion_event_generic.h b/ui/events/gesture_detection/motion_event_generic.h
314 index e508335d47ae9..ed87c6254412c 100644
315 --- a/ui/events/gesture_detection/motion_event_generic.h
316 +++ b/ui/events/gesture_detection/motion_event_generic.h
317 @@ -55,6 +55,9 @@ class GESTURE_DETECTION_EXPORT MotionEventGeneric : public MotionEvent {
318                       base::TimeTicks event_time,
319                       const PointerProperties& pointer);
320    MotionEventGeneric(const MotionEventGeneric& other);
321 +  MotionEventGeneric(MotionEventGeneric&& other);
322 +  MotionEventGeneric& operator=(const MotionEventGeneric& other);
323 +  MotionEventGeneric& operator=(MotionEventGeneric&& other);
324  
325    ~MotionEventGeneric() override;
326  
327 @@ -124,8 +127,7 @@ class GESTURE_DETECTION_EXPORT MotionEventGeneric : public MotionEvent {
328   protected:
329    MotionEventGeneric();
330    MotionEventGeneric(const MotionEvent& event, bool with_history);
331 -  MotionEventGeneric& operator=(const MotionEventGeneric& other);
332 -
333 +  
334    void PopPointer();
335  
336   private:
337 -- 
338 2.42.1
339