summaryrefslogtreecommitdiff
path: root/libchrome_tools/patches/r680000-forward-compatibility-patch-part-1.patch
blob: 2f820e6832f5895450158a67ef6522425ffbd99c (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
From 9d210ed05abf5e527f1de0b30fff62a8a3ae548f Mon Sep 17 00:00:00 2001
From: hscham <hscham@chromium.org>
Date: Mon, 13 Apr 2020 10:36:11 +0900
Subject: [PATCH] libchrome: r680000 forward compatibility patch part 1

This CL includes:
- Add header files base/hash/{hash,md5,sha1}.h and
  base/system/sys_info.h from base/.
- Add macro PRFilePath.
- Add JSONReader::{Read,ReadAndReturnError,ReadToValue}Deprecated, alias
  of the corresponding method without the Deprecated suffix.
- Add empty class base::CheckedObserver.
- Add bool operators == and != for base::RepeatingCallback.
- ScopedClearLastError (up to r758621)

Change-Id: I6ba15f2938c02729e4fd51e5a4a52cb94e7c2a4e
---
 base/callback.h            |  8 ++++++++
 base/files/file_path.h     |  1 +
 base/hash/hash.h           |  8 ++++++++
 base/hash/md5.h            | 10 ++++++++++
 base/hash/sha1.h           | 10 ++++++++++
 base/json/json_reader.h    | 19 +++++++++++++++++++
 base/observer_list_types.h | 24 ++++++++++++++++++++++++
 base/system/sys_info.h     | 10 ++++++++++
 8 files changed, 90 insertions(+)
 create mode 100644 base/hash/hash.h
 create mode 100644 base/hash/md5.h
 create mode 100644 base/hash/sha1.h
 create mode 100644 base/observer_list_types.h
 create mode 100644 base/system/sys_info.h

diff --git a/base/callback.h b/base/callback.h
index bcda5af58..22a6f0e3e 100644
--- a/base/callback.h
+++ b/base/callback.h
@@ -123,6 +123,14 @@ class RepeatingCallback<R(Args...)> : public internal::CallbackBaseCopyable {
     return EqualsInternal(other);
   }
 
+  bool operator==(const RepeatingCallback& other) const {
+    return EqualsInternal(other);
+  }
+
+  bool operator!=(const RepeatingCallback& other) const {
+    return !operator==(other);
+  }
+
   R Run(Args... args) const & {
     PolymorphicInvoke f =
         reinterpret_cast<PolymorphicInvoke>(this->polymorphic_invoke());
diff --git a/base/files/file_path.h b/base/files/file_path.h
index 2dc15f9d0..36229979d 100644
--- a/base/files/file_path.h
+++ b/base/files/file_path.h
@@ -131,6 +131,7 @@
 #define PRIsFP "ls"
 #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
 #define PRIsFP "s"
+#define PRFilePath "s"
 #endif  // OS_WIN
 
 namespace base {
diff --git a/base/hash/hash.h b/base/hash/hash.h
new file mode 100644
index 000000000..b35a96fd3
--- /dev/null
+++ b/base/hash/hash.h
@@ -0,0 +1,8 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_HASH_HASH_H_
+#define BASE_HASH_HASH_H_
+#include "base/hash.h"
+#endif  // BASE_HASH_HASH_H_
diff --git a/base/hash/md5.h b/base/hash/md5.h
new file mode 100644
index 000000000..821649319
--- /dev/null
+++ b/base/hash/md5.h
@@ -0,0 +1,10 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_HASH_MD5_H_
+#define BASE_HASH_MD5_H_
+
+#include "base/md5.h"
+
+#endif  // BASE_HASH_MD5_H_
diff --git a/base/hash/sha1.h b/base/hash/sha1.h
new file mode 100644
index 000000000..7d3e18212
--- /dev/null
+++ b/base/hash/sha1.h
@@ -0,0 +1,10 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_HASH_SHA1_H_
+#define BASE_HASH_SHA1_H_
+
+#include "base/sha1.h"
+
+#endif  // BASE_HASH_SHA1_H_
diff --git a/base/json/json_reader.h b/base/json/json_reader.h
index 2c6bd3e47..05de907ce 100644
--- a/base/json/json_reader.h
+++ b/base/json/json_reader.h
@@ -98,6 +98,12 @@ class BASE_EXPORT JSONReader {
   static std::unique_ptr<Value> Read(StringPiece json,
                                      int options = JSON_PARSE_RFC,
                                      int max_depth = kStackMaxDepth);
+  inline static std::unique_ptr<Value> ReadDeprecated(
+      StringPiece json,
+      int options = JSON_PARSE_RFC,
+      int max_depth = kStackMaxDepth){
+    return Read(json, options, max_depth);
+  }
 
   // Reads and parses |json| like Read(). |error_code_out| and |error_msg_out|
   // are optional. If specified and nullptr is returned, they will be populated
@@ -110,6 +116,16 @@ class BASE_EXPORT JSONReader {
       std::string* error_msg_out,
       int* error_line_out = nullptr,
       int* error_column_out = nullptr);
+  inline static std::unique_ptr<Value> ReadAndReturnErrorDeprecated(
+      StringPiece json,
+      int options,  // JSONParserOptions
+      int* error_code_out,
+      std::string* error_msg_out,
+      int* error_line_out = nullptr,
+      int* error_column_out = nullptr){
+    return ReadAndReturnError(json, options, error_code_out, error_msg_out,
+                              error_line_out, error_column_out);
+  }
 
   // Converts a JSON parse error code into a human readable message.
   // Returns an empty string if error_code is JSON_NO_ERROR.
@@ -117,6 +133,9 @@ class BASE_EXPORT JSONReader {
 
   // Non-static version of Read() above.
   std::unique_ptr<Value> ReadToValue(StringPiece json);
+  inline std::unique_ptr<Value> ReadToValueDeprecated(StringPiece json) {
+    return JSONReader::ReadToValue(json);
+  }
 
   // Returns the error code if the last call to ReadToValue() failed.
   // Returns JSON_NO_ERROR otherwise.
diff --git a/base/observer_list_types.h b/base/observer_list_types.h
new file mode 100644
index 000000000..8f3889735
--- /dev/null
+++ b/base/observer_list_types.h
@@ -0,0 +1,24 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_OBSERVER_LIST_TYPES_H_
+#define BASE_OBSERVER_LIST_TYPES_H_
+
+#include "base/base_export.h"
+#include "base/macros.h"
+
+namespace base {
+class BASE_EXPORT CheckedObserver {
+ public:
+  CheckedObserver() {};
+
+ protected:
+  virtual ~CheckedObserver() = default;
+
+  DISALLOW_COPY_AND_ASSIGN(CheckedObserver);
+};
+
+}  // namespace base
+
+#endif  // BASE_OBSERVER_LIST_TYPES_H_
diff --git a/base/scoped_clear_last_error.h b/base/scoped_clear_last_error.h
new file mode 100644
index 0000000..066730d
--- /dev/null
+++ b/base/scoped_clear_last_error.h
@@ -0,0 +1,14 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_SCOPED_CLEAR_LAST_ERROR_H_
+#define BASE_SCOPED_CLEAR_LAST_ERROR_H_
+
+#include "base/scoped_clear_errno.h"
+
+namespace base {
+using ScopedClearLastError = base::ScopedClearErrno;
+}
+
+#endif  // BASE_SCOPED_CLEAR_LAST_ERROR_H_
diff --git a/base/system/sys_info.h b/base/system/sys_info.h
new file mode 100644
index 000000000..60676e0e1
--- /dev/null
+++ b/base/system/sys_info.h
@@ -0,0 +1,10 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_SYSTEM_SYS_INFO_H_
+#define BASE_SYSTEM_SYS_INFO_H_
+
+#include "base/sys_info.h"
+
+#endif  // BASE_SYSTEM_SYS_INFO_H_
-- 
2.26.1.301.g55bc3eb7cb9-goog