summaryrefslogtreecommitdiffstats
path: root/chromium/build/patches/chromium_base_pickles.patch
blob: a3f1edfcb307cc6f3811988ba3c829e43bd5c5c1 (plain)
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
Change most uses of Pickle to base::Pickle

There should be no behavior change.

TBR=jschuh (IPC messages)

Review URL: https://codereview.chromium.org/1154283003

Cr-Commit-Position: refs/heads/master@{#332552}

#
# Limited patch for Slackware, only addressing native_backend_kwallet_x
#

diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.cc b/chrome/browser/password_manager/native_backend_kwallet_x.cc
index 85ac9c7..12536ed 100644
--- a/chrome/browser/password_manager/native_backend_kwallet_x.cc
+++ b/chrome/browser/password_manager/native_backend_kwallet_x.cc

@@ -67,8 +67,8 @@
 bool CheckSerializedValue(const uint8_t* byte_array,
                           size_t length,
                           const std::string& realm) {
-  const Pickle::Header* header =
-      reinterpret_cast<const Pickle::Header*>(byte_array);
+  const base::Pickle::Header* header =
+      reinterpret_cast<const base::Pickle::Header*>(byte_array);
   if (length < sizeof(*header) ||
       header->payload_size > length - sizeof(*header)) {
     LOG(WARNING) << "Invalid KWallet entry detected (realm: " << realm << ")";
@@ -79,7 +79,7 @@

 // Convenience function to read a GURL from a Pickle. Assumes the URL has
 // been written as a UTF-8 string. Returns true on success.
-bool ReadGURL(PickleIterator* iter, bool warn_only, GURL* url) {
+bool ReadGURL(base::PickleIterator* iter, bool warn_only, GURL* url) {
   std::string url_string;
   if (!iter->ReadString(&url_string)) {
     if (!warn_only)
@@ -113,12 +113,12 @@
 // as either size when reading old pickles that fail to deserialize using the
 // native size. Returns true on success.
 bool DeserializeValueSize(const std::string& signon_realm,
-                          const PickleIterator& init_iter,
+                          const base::PickleIterator& init_iter,
                           int version,
                           bool size_32,
                           bool warn_only,
                           ScopedVector<autofill::PasswordForm>* forms) {
-  PickleIterator iter = init_iter;
+  base::PickleIterator iter = init_iter;

   size_t count = 0;
   if (size_32) {
@@ -235,7 +235,7 @@

 // Serializes a list of PasswordForms to be stored in the wallet.
 void SerializeValue(const std::vector<autofill::PasswordForm*>& forms,
-                    Pickle* pickle) {
+                    base::Pickle* pickle) {
   pickle->WriteInt(kPickleVersion);
   pickle->WriteSizeT(forms.size());
   for (autofill::PasswordForm* form : forms) {
@@ -637,7 +637,7 @@
     }

     // Can't we all just agree on whether bytes are signed or not? Please?
-    Pickle pickle(reinterpret_cast<const char*>(bytes), length);
+    base::Pickle pickle(reinterpret_cast<const char*>(bytes), length);
     *forms = DeserializeValue(signon_realm, pickle);
   }

@@ -719,7 +719,7 @@
       continue;

     // Can't we all just agree on whether bytes are signed or not? Please?
-    Pickle pickle(reinterpret_cast<const char*>(bytes), length);
+    base::Pickle pickle(reinterpret_cast<const char*>(bytes), length);
     AppendSecondToFirst(forms, DeserializeValue(signon_realm, pickle));
   }
   return true;
@@ -756,7 +756,7 @@
     return ret == 0;
   }

-  Pickle value;
+  base::Pickle value;
   SerializeValue(forms, &value);

   dbus::MethodCall method_call(kKWalletInterface, "writeEntry");
@@ -856,7 +856,7 @@
       continue;

     // Can't we all just agree on whether bytes are signed or not? Please?
-    Pickle pickle(reinterpret_cast<const char*>(bytes), length);
+    base::Pickle pickle(reinterpret_cast<const char*>(bytes), length);
     ScopedVector<autofill::PasswordForm> all_forms =
         DeserializeValue(signon_realm, pickle);

@@ -888,8 +888,8 @@
 // static
 ScopedVector<autofill::PasswordForm> NativeBackendKWallet::DeserializeValue(
     const std::string& signon_realm,
-    const Pickle& pickle) {
-  PickleIterator iter(pickle);
+    const base::Pickle& pickle) {
+  base::PickleIterator iter(pickle);

   int version = -1;
   if (!iter.ReadInt(&version) ||

diff --git a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc
index 297a765..9c3a37c 100644
--- a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc
+++ b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc

@@ -605,7 +605,8 @@
     EXPECT_EQ(sorted_expected[i].first, entries[i]);
     TestKWallet::Blob value;
     EXPECT_TRUE(wallet_.readEntry(folder, entries[i], &value));
-    Pickle pickle(reinterpret_cast<const char*>(value.data()), value.size());
+    base::Pickle pickle(reinterpret_cast<const char*>(value.data()),
+                        value.size());
     ScopedVector<autofill::PasswordForm> forms =
         NativeBackendKWalletStub::DeserializeValue(entries[i], pickle);
     const std::vector<const PasswordForm*>& expect = sorted_expected[i].second;
@@ -930,14 +931,14 @@

 class NativeBackendKWalletPickleTest : public NativeBackendKWalletTestBase {
  protected:
-  void CreateVersion6Pickle(const PasswordForm& form, Pickle* pickle);
-  void CreateVersion5Pickle(const PasswordForm& form, Pickle* pickle);
-  void CreateVersion3Pickle(const PasswordForm& form, Pickle* pickle);
-  void CreateVersion2Pickle(const PasswordForm& form, Pickle* pickle);
-  void CreateVersion1Pickle(const PasswordForm& form, Pickle* pickle);
+  void CreateVersion6Pickle(const PasswordForm& form, base::Pickle* pickle);
+  void CreateVersion5Pickle(const PasswordForm& form, base::Pickle* pickle);
+  void CreateVersion3Pickle(const PasswordForm& form, base::Pickle* pickle);
+  void CreateVersion2Pickle(const PasswordForm& form, base::Pickle* pickle);
+  void CreateVersion1Pickle(const PasswordForm& form, base::Pickle* pickle);
   void CreateVersion0Pickle(bool size_32,
                             const PasswordForm& form,
-                            Pickle* pickle);
+                            base::Pickle* pickle);
   void CheckVersion6Pickle();
   void CheckVersion5Pickle();
   void CheckVersion3Pickle();
@@ -953,12 +954,12 @@
   void CreatePickle(bool size_32,
                     bool date_created_internal,
                     const PasswordForm& form,
-                    Pickle* pickle);
+                    base::Pickle* pickle);
 };

 void NativeBackendKWalletPickleTest::CreateVersion6Pickle(
     const PasswordForm& form,
-    Pickle* pickle) {
+    base::Pickle* pickle) {
   pickle->WriteInt(6);
   CreatePickle(false, true, form, pickle);
   pickle->WriteInt(form.type);
@@ -974,7 +975,7 @@

 void NativeBackendKWalletPickleTest::CreateVersion5Pickle(
     const PasswordForm& form,
-    Pickle* pickle) {
+    base::Pickle* pickle) {
   pickle->WriteInt(5);
   CreatePickle(false, true, form, pickle);
   pickle->WriteInt(form.type);
@@ -988,7 +989,8 @@
 }

 void NativeBackendKWalletPickleTest::CreateVersion3Pickle(
-    const PasswordForm& form, Pickle* pickle) {
+    const PasswordForm& form,
+    base::Pickle* pickle) {
   pickle->WriteInt(3);
   CreatePickle(false, false, form, pickle);
   pickle->WriteInt(form.type);
@@ -998,7 +1000,8 @@
 }

 void NativeBackendKWalletPickleTest::CreateVersion2Pickle(
-    const PasswordForm& form, Pickle* pickle) {
+    const PasswordForm& form,
+    base::Pickle* pickle) {
   pickle->WriteInt(2);
   CreatePickle(false, false, form, pickle);
   pickle->WriteInt(form.type);
@@ -1007,13 +1010,16 @@
 }

 void NativeBackendKWalletPickleTest::CreateVersion1Pickle(
-    const PasswordForm& form, Pickle* pickle) {
+    const PasswordForm& form,
+    base::Pickle* pickle) {
   pickle->WriteInt(1);
   CreatePickle(false, false, form, pickle);
 }

 void NativeBackendKWalletPickleTest::CreateVersion0Pickle(
-    bool size_32, const PasswordForm& form, Pickle* pickle) {
+    bool size_32,
+    const PasswordForm& form,
+    base::Pickle* pickle) {
   pickle->WriteInt(0);
   CreatePickle(size_32, false, form, pickle);
 }
@@ -1021,7 +1027,7 @@
 void NativeBackendKWalletPickleTest::CreatePickle(bool size_32,
                                                   bool date_created_internal,
                                                   const PasswordForm& form,
-                                                  Pickle* pickle) {
+                                                  base::Pickle* pickle) {
   if (size_32)
     pickle->WriteUInt32(1);  // Size of form list. 32 bits.
   else
@@ -1044,7 +1050,7 @@
 }

 void NativeBackendKWalletPickleTest::CheckVersion6Pickle() {
-  Pickle pickle;
+  base::Pickle pickle;
   PasswordForm form = form_google_;
   form.generation_upload_status = PasswordForm::NEGATIVE_SIGNAL_SENT;
   CreateVersion6Pickle(form, &pickle);
@@ -1059,7 +1065,7 @@
 }

 void NativeBackendKWalletPickleTest::CheckVersion5Pickle() {
-  Pickle pickle;
+  base::Pickle pickle;
   PasswordForm form = form_google_;
   CreateVersion5Pickle(form, &pickle);

@@ -1072,7 +1078,7 @@
 }

 void NativeBackendKWalletPickleTest::CheckVersion3Pickle() {
-  Pickle pickle;
+  base::Pickle pickle;
   PasswordForm form = form_google_;
   // Remove the fields which were not present in version #3.
   form.display_name.clear();
@@ -1090,7 +1096,7 @@
 }

 void NativeBackendKWalletPickleTest::CheckVersion2Pickle() {
-  Pickle pickle;
+  base::Pickle pickle;
   PasswordForm form = old_form_google_;
   form.times_used = form_google_.times_used;
   form.type = form_google_.type;
@@ -1107,7 +1113,7 @@

 // Make sure that we can still read version 1 pickles.
 void NativeBackendKWalletPickleTest::CheckVersion1Pickle() {
-  Pickle pickle;
+  base::Pickle pickle;
   PasswordForm form = form_google_;
   CreateVersion1Pickle(form, &pickle);

@@ -1123,7 +1129,7 @@

 void NativeBackendKWalletPickleTest::CheckVersion0Pickle(
     bool size_32, PasswordForm::Scheme scheme) {
-  Pickle pickle;
+  base::Pickle pickle;
   PasswordForm form = old_form_google_;
   form.scheme = scheme;
   CreateVersion0Pickle(size_32, form, &pickle);